diff mbox series

net/ice: fix disabling of promisc mode (keep allmulti state)

Message ID 20210419125348.25109-1-siwar.zitouni@6wind.com (mailing list archive)
State Accepted
Delegated to: Qi Zhang
Headers show
Series net/ice: fix disabling of promisc mode (keep allmulti state) | expand

Checks

Context Check Description
ci/iol-abi-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation success Compilation OK
ci/travis-robot success travis build: passed
ci/checkpatch success coding style OK

Commit Message

Siwar Zitouni April 19, 2021, 12:53 p.m. UTC
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(-)

Comments

Zhang, Qi Z April 20, 2021, 2:08 p.m. UTC | #1
> -----Original Message-----
> From: Siwar Zitouni <siwar.zitouni@6wind.com>
> Sent: Monday, April 19, 2021 8:54 PM
> To: dev@dpdk.org
> Cc: Yang, Qiming <qiming.yang@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; Lu, Wenzhuo <wenzhuo.lu@intel.com>; Siwar Zitouni
> <siwar.zitouni@6wind.com>; stable@dpdk.org; Thibaut Collet
> <thibaut.collet@6wind.com>
> Subject: [PATCH] net/ice: fix disabling of promisc mode (keep allmulti state)
> 
> 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

Acked-by: Qi Zhang <qi.z.zhang@intel.com>

Applied to dpdk-next-net-intel.

Thanks
Qi
diff mbox series

Patch

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) {