Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 30ba2ab9 authored by Jian Shen's avatar Jian Shen Committed by David S. Miller
Browse files

net: hns3: Disable VFs change rxvlan offload status



Rxvlan offload status can only be changed by PF. Initialize
the value of NETIF_F_HW_VLAN_CTAG_RX bit of hw_features for
VFS to false, make sure user can't be able to change it.

Signed-off-by: default avatarJian Shen <shenjian15@huawei.com>
Signed-off-by: default avatarPeng Li <lipeng321@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 391b5e93
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -1584,14 +1584,15 @@ static void hns3_set_default_feature(struct net_device *netdev)
		NETIF_F_GSO_UDP_TUNNEL_CSUM;
		NETIF_F_GSO_UDP_TUNNEL_CSUM;


	netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
	netdev->hw_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
		NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
		NETIF_F_HW_VLAN_CTAG_TX |
		NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO |
		NETIF_F_RXCSUM | NETIF_F_SG | NETIF_F_GSO |
		NETIF_F_GRO | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_GSO_GRE |
		NETIF_F_GRO | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_GSO_GRE |
		NETIF_F_GSO_GRE_CSUM | NETIF_F_GSO_UDP_TUNNEL |
		NETIF_F_GSO_GRE_CSUM | NETIF_F_GSO_UDP_TUNNEL |
		NETIF_F_GSO_UDP_TUNNEL_CSUM;
		NETIF_F_GSO_UDP_TUNNEL_CSUM;


	if (!(h->flags & HNAE3_SUPPORT_VF))
	if (!(h->flags & HNAE3_SUPPORT_VF))
		netdev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER;
		netdev->hw_features |=
			NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_VLAN_CTAG_RX;
}
}


static int hns3_alloc_buffer(struct hns3_enet_ring *ring,
static int hns3_alloc_buffer(struct hns3_enet_ring *ring,