[2/2] net/ice: fix promiscuous mode

Message ID 1555077139-244831-3-git-send-email-ying.a.wang@intel.com
State Superseded, archived
Delegated to: Qi Zhang
Headers show
Series
  • ice: code clean and promisc mode fix
Related show

Checks

Context Check Description
ci/Intel-compilation success Compilation OK
ci/checkpatch success coding style OK

Commit Message

Wang, Ying A April 12, 2019, 1:52 p.m.
When device promiscuous mode has already been enabled,
if user re-enables the promisc mode, he/she should be
prompted with "Promisc has already been enabled"
rather than "Failed to enable promisc".

Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
Cc: stable@dpdk.org

Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Rami Rosen April 15, 2019, 9:40 p.m. | #1
Wang Ying A ‏<ying.a.wang@intel.com>:

> When device promiscuous mode has already been enabled,
> if user re-enables the promisc mode, he/she should be
> prompted with "Promisc has already been enabled"
> rather than "Failed to enable promisc".
>
> Fixes: c945e4bf9063 ("net/ice: support promiscuous mode")
> Cc: stable@dpdk.org
>
> Signed-off-by: Wang Ying A <ying.a.wang@intel.com>
> ---
>

Reviewed-by: Rami Rosen <ramirose@gmail.com>

Patch

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 72831bb..cb82a6f 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -2759,7 +2759,9 @@  static int ice_macaddr_set(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);
 }