diff options
| author | Fan Gong <gongfan1@huawei.com> | 2026-01-14 11:38:24 +0300 |
|---|---|---|
| committer | Paolo Abeni <pabeni@redhat.com> | 2026-01-20 12:34:31 +0300 |
| commit | 2467a0466028f23c9ee173ddd160ef766a838e8d (patch) | |
| tree | cb88b549e2f9a8183a4a84c1ac2a26ed165342c3 | |
| parent | 721df7639c83f008dc15669268be315f2a205c34 (diff) | |
| download | linux-2467a0466028f23c9ee173ddd160ef766a838e8d.tar.xz | |
hinic3: Add .ndo_features_check
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 <zhuyikai1@h-partners.com>
Signed-off-by: Zhu Yikai <zhuyikai1@h-partners.com>
Signed-off-by: Fan Gong <gongfan1@huawei.com>
Link: https://patch.msgid.link/3879b20b7ffa20106a3f8f56dbf2d5eb389f260a.1768375903.git.zhuyikai1@h-partners.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
| -rw-r--r-- | drivers/net/ethernet/huawei/hinic3/hinic3_netdev_ops.c | 13 |
1 files changed, 13 insertions, 0 deletions
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, |
