diff options
author | Xue Chaojing <xuechaojing@huawei.com> | 2019-06-29 05:26:27 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-06-29 20:28:23 +0300 |
commit | aebd17b7685499156b8bc976c66a12396f76d0a7 (patch) | |
tree | 5ebc95df6340ebc61317b9d94ee40a4fc387983f /drivers/net/ethernet/huawei/hinic/hinic_main.c | |
parent | 0a7960c7922228ca975ca4c5595e5539fc8f8b79 (diff) | |
download | linux-aebd17b7685499156b8bc976c66a12396f76d0a7.tar.xz |
hinic: add vlan offload support
This patch adds vlan offload support for the HINIC driver.
Signed-off-by: Xue Chaojing <xuechaojing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/huawei/hinic/hinic_main.c')
-rw-r--r-- | drivers/net/ethernet/huawei/hinic/hinic_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/ethernet/huawei/hinic/hinic_main.c b/drivers/net/ethernet/huawei/hinic/hinic_main.c index ceb0e247f52d..2411ad270c98 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_main.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_main.c @@ -836,14 +836,14 @@ static const struct net_device_ops hinic_netdev_ops = { .ndo_get_stats64 = hinic_get_stats64, .ndo_fix_features = hinic_fix_features, .ndo_set_features = hinic_set_features, - }; static void netdev_features_init(struct net_device *netdev) { netdev->hw_features = NETIF_F_SG | NETIF_F_HIGHDMA | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | NETIF_F_TSO | NETIF_F_TSO6 | - NETIF_F_RXCSUM | NETIF_F_LRO; + NETIF_F_RXCSUM | NETIF_F_LRO | + NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX; netdev->vlan_features = netdev->hw_features; @@ -923,6 +923,11 @@ static int set_features(struct hinic_dev *nic_dev, HINIC_LRO_MAX_WQE_NUM_DEFAULT); } + if (changed & NETIF_F_HW_VLAN_CTAG_RX) + err = hinic_set_rx_vlan_offload(nic_dev, + !!(features & + NETIF_F_HW_VLAN_CTAG_RX)); + return err; } |