From fa1d598844a73765cf26676ce3d219589ba57114 Mon Sep 17 00:00:00 2001 From: Siwar Zitouni Date: Mon, 19 Apr 2021 14:53:48 +0200 Subject: [PATCH] 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 --- drivers/net/ice/ice_ethdev.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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) {