patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [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

* Re: [dpdk-stable] [PATCH] net/ice: fix disabling of promisc mode (keep allmulti state)
  2021-04-19 12:53 [dpdk-stable] [PATCH] net/ice: fix disabling of promisc mode (keep allmulti state) Siwar Zitouni
@ 2021-04-20 14:08 ` Zhang, Qi Z
  0 siblings, 0 replies; 2+ messages in thread
From: Zhang, Qi Z @ 2021-04-20 14:08 UTC (permalink / raw)
  To: Siwar Zitouni, dev; +Cc: Yang, Qiming, Lu, Wenzhuo, stable, Thibaut Collet



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

^ 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-stable] [PATCH] net/ice: fix disabling of promisc mode (keep allmulti state) Siwar Zitouni
2021-04-20 14:08 ` Zhang, Qi Z

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git