From: Siwar Zitouni Date: Mon, 19 Apr 2021 12:53:48 +0000 (+0200) Subject: net/ice: fix disabling promiscuous mode X-Git-Url: http://git.droids-corp.org/?p=dpdk.git;a=commitdiff_plain;h=fa1d598844a73765cf26676ce3d219589ba57114 net/ice: fix disabling promiscuous mode When promiscuous mode is disabled, allmulticast is also disabled, even if it was previously enabled. Add a test in ice_promisc_disable() to check if allmulticast should be kept enabled. Fixes: c945e4bf9063 ("net/ice: support promiscuous mode") Cc: stable@dpdk.org Signed-off-by: Thibaut Collet Signed-off-by: Siwar Zitouni Acked-by: Qi Zhang --- diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 84d1735255..da9e85bd7c 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -4526,8 +4526,11 @@ ice_promisc_disable(struct rte_eth_dev *dev) uint8_t pmask; int ret = 0; - pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX | - ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; + if (dev->data->all_multicast == 1) + pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX; + else + pmask = ICE_PROMISC_UCAST_RX | ICE_PROMISC_UCAST_TX | + ICE_PROMISC_MCAST_RX | ICE_PROMISC_MCAST_TX; status = ice_clear_vsi_promisc(hw, vsi->idx, pmask, 0); if (status != ICE_SUCCESS) {