DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: fix disabling of promisc mode (keep allmulti state)
@ 2021-04-19 12:53 Siwar Zitouni
  2021-04-20 14:08 ` Zhang, Qi Z
  0 siblings, 1 reply; 2+ messages in thread
From: Siwar Zitouni @ 2021-04-19 12:53 UTC (permalink / raw)
  To: dev
  Cc: qiming.yang, qi.z.zhang, wenzhuo.lu, Siwar Zitouni, stable,
	Thibaut Collet

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 <thibaut.collet@6wind.com>
Signed-off-by: Siwar Zitouni <siwar.zitouni@6wind.com>
---
 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 84d173525..da9e85bd7 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) {
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-20 14:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-19 12:53 [dpdk-dev] [PATCH] net/ice: fix disabling of promisc mode (keep allmulti state) Siwar Zitouni
2021-04-20 14:08 ` Zhang, Qi Z

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).