net/bnxt: fix usage of VMDq flags
authorAjit Khaparde <ajit.khaparde@broadcom.com>
Thu, 28 Sep 2017 21:43:29 +0000 (16:43 -0500)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:49 +0000 (02:49 +0200)
Map ETH_VMDQ_ACCEPT_HASH_UC to the promiscuous bit.
Also, set ALLMULTI and MCAST when MCAST is set to ensure multicast traffic
is received regardless of the VF driver list.

Fixes: 4cfe399f6550 ("net/bnxt: support to set VF rxmode")
Cc: stable@dpdk.org
Signed-off-by: Stephen Hurd <stephen.hurd@broadcom.com>
Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
drivers/net/bnxt/rte_pmd_bnxt.c

index c343d90..0bf5db5 100644 (file)
@@ -409,20 +409,19 @@ int rte_pmd_bnxt_set_vf_rxmode(uint8_t port, uint16_t vf,
        if (vf >= bp->pdev->max_vfs)
                return -EINVAL;
 
-       if (rx_mask & (ETH_VMDQ_ACCEPT_UNTAG | ETH_VMDQ_ACCEPT_HASH_MC)) {
+       if (rx_mask & ETH_VMDQ_ACCEPT_UNTAG) {
                RTE_LOG(ERR, PMD, "Currently cannot toggle this setting\n");
                return -ENOTSUP;
        }
 
-       if (rx_mask & ETH_VMDQ_ACCEPT_HASH_UC && !on) {
-               RTE_LOG(ERR, PMD, "Currently cannot disable UC Rx\n");
-               return -ENOTSUP;
-       }
+       /* Is this really the correct mapping?  VFd seems to think it is. */
+       if (rx_mask & ETH_VMDQ_ACCEPT_HASH_UC)
+               flag |= BNXT_VNIC_INFO_PROMISC;
 
        if (rx_mask & ETH_VMDQ_ACCEPT_BROADCAST)
                flag |= BNXT_VNIC_INFO_BCAST;
        if (rx_mask & ETH_VMDQ_ACCEPT_MULTICAST)
-               flag |= BNXT_VNIC_INFO_ALLMULTI;
+               flag |= BNXT_VNIC_INFO_ALLMULTI | BNXT_VNIC_INFO_MCAST;
 
        if (on)
                bp->pf.vf_info[vf].l2_rx_mask |= flag;