[2/2] net/ice: fix promiscuous mode
Checks
Commit Message
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
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>
@@ -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);
}