Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

netdevsim: add ipsec hw_features

Currently, netdevsim only sets dev->features, which makes the ESP features
fixed. For example:

# ethtool -k eni0np1 | grep esp
tx-esp-segmentation: on [fixed]
esp-hw-offload: on [fixed]
esp-tx-csum-hw-offload: on [fixed]

This patch adds the ESP features to hw_features, allowing them to be
changed manually. For example:

# ethtool -k eni0np1 | grep esp
tx-esp-segmentation: on
esp-hw-offload: on
esp-tx-csum-hw-offload: on

Suggested-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://patch.msgid.link/20251015083649.54744-1-liuhangbin@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Hangbin Liu and committed by
Jakub Kicinski
38c31c26 bd853a59

+1
+1
drivers/net/netdevsim/ipsec.c
··· 277 277 NETIF_F_GSO_ESP) 278 278 279 279 ns->netdev->features |= NSIM_ESP_FEATURES; 280 + ns->netdev->hw_features |= NSIM_ESP_FEATURES; 280 281 ns->netdev->hw_enc_features |= NSIM_ESP_FEATURES; 281 282 282 283 ns->ipsec.pfile = debugfs_create_file("ipsec", 0400,