Thread (11 messages) 11 messages, 2 authors, 2026-01-09
STALE178d
Revisions (22)
  1. v02 [diff vs current]
  2. v03 [diff vs current]
  3. v04 [diff vs current]
  4. v05 [diff vs current]
  5. v06 [diff vs current]
  6. v07 [diff vs current]
  7. v08 [diff vs current]
  8. v09 [diff vs current]
  9. v10 current
  10. v11 [diff vs current]
  11. v02 [diff vs current]
  12. v03 [diff vs current]
  13. v01 [diff vs current]
  14. v02 [diff vs current]
  15. v03 [diff vs current]
  16. v04 [diff vs current]
  17. v05 [diff vs current]
  18. v06 [diff vs current]
  19. v07 [diff vs current]
  20. v08 [diff vs current]
  21. v09 [diff vs current]
  22. v10 [diff vs current]

[PATCH net-next v10 5/9] hinic3: Add .ndo_features_check

From: Fan Gong <gongfan1@huawei.com>
Date: 2026-01-09 04:10:24
Also in: linux-doc, lkml
Subsystem: huawei 3rd gen ethernet driver, networking drivers, the rest · Maintainers: Fan Gong, Andrew Lunn, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

As we cannot solve packets with multiple stacked vlan, so we use
.ndo_features_check to check for these packets and return a smaller
feature without offload features.

Co-developed-by: Zhu Yikai <redacted>
Signed-off-by: Zhu Yikai <redacted>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
---
 .../net/ethernet/huawei/hinic3/hinic3_netdev_ops.c  | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c b/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c
index 2e1ca9571e7c..87ada13b8f96 100644
--- a/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c
+++ b/drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c
@@ -2,7 +2,9 @@
 // Copyright (c) Huawei Technologies Co., Ltd. 2025. All rights reserved.
 
 #include <linux/etherdevice.h>
+#include <linux/if_vlan.h>
 #include <linux/netdevice.h>
+#include <net/vxlan.h>
 
 #include "hinic3_hwif.h"
 #include "hinic3_nic_cfg.h"
@@ -624,6 +626,16 @@ static netdev_features_t hinic3_fix_features(struct net_device *netdev,
 	return features_tmp;
 }
 
+static netdev_features_t hinic3_features_check(struct sk_buff *skb,
+					       struct net_device *dev,
+					       netdev_features_t features)
+{
+	features = vlan_features_check(skb, features);
+	features = vxlan_features_check(skb, features);
+
+	return features;
+}
+
 int hinic3_set_hw_features(struct net_device *netdev)
 {
 	netdev_features_t wanted, curr;
@@ -756,6 +768,7 @@ static const struct net_device_ops hinic3_netdev_ops = {
 	.ndo_stop             = hinic3_close,
 	.ndo_set_features     = hinic3_ndo_set_features,
 	.ndo_fix_features     = hinic3_fix_features,
+	.ndo_features_check   = hinic3_features_check,
 	.ndo_change_mtu       = hinic3_change_mtu,
 	.ndo_set_mac_address  = hinic3_set_mac_addr,
 	.ndo_tx_timeout       = hinic3_tx_timeout,
-- 
2.43.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help