net/ice: fix promiscuous mode
authorYing A Wang <ying.a.wang@intel.com>
Wed, 17 Apr 2019 01:47:52 +0000 (09:47 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 19 Apr 2019 12:51:54 +0000 (14:51 +0200)
When device promiscuous mode has already been enabled,
should not return error if user re-enable it.

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org
Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/ice_ethdev.c

index 5b26663..1f06a2c 100644 (file)
@@ -2775,7 +2775,9 @@ ice_promisc_enable(struct rte_eth_dev *dev)
                ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX;
 
        status = ice_set_vsi_promisc(hw, vsi->idx, pmask, 0);
-       if (status != ICE_SUCCESS)
+       if (status == ICE_ERR_ALREADY_EXISTS)
+               PMD_DRV_LOG(DEBUG, "Promisc mode has already been enabled");
+       else if (status != ICE_SUCCESS)
                PMD_DRV_LOG(ERR, "Failed to enable promisc, err=%d", status);
 }