]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
netdevsim: add ipsec hw_features
authorHangbin Liu <liuhangbin@gmail.com>
Wed, 15 Oct 2025 08:36:49 +0000 (08:36 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 16 Oct 2025 22:44:32 +0000 (15:44 -0700)
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>
drivers/net/netdevsim/ipsec.c

index 47cdee5577d461008c884e2428e914be81569a95..36a1be4923d61f421438545709b2df9dd1bb2410 100644 (file)
@@ -277,6 +277,7 @@ void nsim_ipsec_init(struct netdevsim *ns)
                                 NETIF_F_GSO_ESP)
 
        ns->netdev->features |= NSIM_ESP_FEATURES;
+       ns->netdev->hw_features |= NSIM_ESP_FEATURES;
        ns->netdev->hw_enc_features |= NSIM_ESP_FEATURES;
 
        ns->ipsec.pfile = debugfs_create_file("ipsec", 0400,