net/hns3: support promiscuous and allmulticast mode for VF
authorChengchang Tang <tangchengchang@huawei.com>
Mon, 9 Mar 2020 09:32:42 +0000 (17:32 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 18 Mar 2020 09:21:42 +0000 (10:21 +0100)
commit40486d38496241711955fc752ff4a6db4c89da7f
treeafce05b3cd7c4e20ce6109024dc3e00c7196a410
parent4bf2c84bd88691bbb9cdc39a8bcf597537abfa80
net/hns3: support promiscuous and allmulticast mode for VF

Currently, we only support VF device is bound to vfio_pci or igb_uio and
then driven by DPDK driver when PF is driven by kernel mode hns3 ethdev
driver, VF is not supported when PF is driven by hns3 DPDK driver.

This patch adds promiscuous and allmulticast mode support for hns3 VF
PMD driver.
1) The promiscuous/allmulticast mode can be configured successfully only
   based on the trusted VF device. If based on the non trusted VF
   device, configuring promiscuous/allmulticast mode will fail. The hns3
   VF device can be configured as trusted device by hns3 PF kernel
   ethdev driver on the host by "ip link set <eth num> vf <vf id> turst
   on" command.
2) After the promiscuous mode is configured successfully, hns3 VF PMD
   driver can receive the ingress and outgoing traffic. In the words,
   all the ingress packets, all the packets sent from the PF and other
   VFs on the same physical port.
3) Note: Because of the hardware constraints, By default vlan filter is
   enabled and couldn't be turned off based on VF device, so vlan filter
   is still effective even in promiscuous mode. If upper applications
   don't call rte_eth_dev_vlan_filter API function to set vlan based on
   VF device, hns3 VF PMD driver will can't receive the packets with
   vlan tag in promiscuous mode.

Signed-off-by: Chengchang Tang <tangchengchang@huawei.com>
Signed-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>
doc/guides/nics/features/hns3_vf.ini
drivers/net/hns3/hns3_ethdev_vf.c
drivers/net/hns3/hns3_mbx.c
drivers/net/hns3/hns3_mbx.h