linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] net: stmmac: remove the limitation of adding vlan in promisc mode
@ 2023-04-03  8:17 Clark Wang
  2023-04-03  8:41 ` [Linux-stm32] " Ahmad Fatoum
  0 siblings, 1 reply; 4+ messages in thread
From: Clark Wang @ 2023-04-03  8:17 UTC (permalink / raw)
  To: peppe.cavallaro, alexandre.torgue, joabreu, davem, edumazet, kuba,
	pabeni, mcoquelin.stm32
  Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel

When using brctl to add eqos to a bridge, it will frist set eqos to
promisc mode and then set a VLAN for this bridge with a filer VID value
of 1.

These two error returns limit the use of brctl, resulting in the
inability of the bridge to be enabled on eqos. So remove them.

Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
---
 drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
index 8c7a0b7c9952..64bbe15a699e 100644
--- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
+++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
@@ -472,12 +472,6 @@ static int dwmac4_add_hw_vlan_rx_fltr(struct net_device *dev,
 	if (vid > 4095)
 		return -EINVAL;
 
-	if (hw->promisc) {
-		netdev_err(dev,
-			   "Adding VLAN in promisc mode not supported\n");
-		return -EPERM;
-	}
-
 	/* Single Rx VLAN Filter */
 	if (hw->num_vlan == 1) {
 		/* For single VLAN filter, VID 0 means VLAN promiscuous */
@@ -527,12 +521,6 @@ static int dwmac4_del_hw_vlan_rx_fltr(struct net_device *dev,
 {
 	int i, ret = 0;
 
-	if (hw->promisc) {
-		netdev_err(dev,
-			   "Deleting VLAN in promisc mode not supported\n");
-		return -EPERM;
-	}
-
 	/* Single Rx VLAN Filter */
 	if (hw->num_vlan == 1) {
 		if ((hw->vlan_filter[0] & GMAC_VLAN_TAG_VID) == vid) {
-- 
2.34.1


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

* Re: [Linux-stm32] [PATCH] net: stmmac: remove the limitation of adding vlan in promisc mode
  2023-04-03  8:17 [PATCH] net: stmmac: remove the limitation of adding vlan in promisc mode Clark Wang
@ 2023-04-03  8:41 ` Ahmad Fatoum
  2023-04-03  8:43   ` Clark Wang
  0 siblings, 1 reply; 4+ messages in thread
From: Ahmad Fatoum @ 2023-04-03  8:41 UTC (permalink / raw)
  To: Clark Wang, peppe.cavallaro, alexandre.torgue, joabreu, davem,
	edumazet, kuba, pabeni, mcoquelin.stm32
  Cc: netdev, linux-stm32, linux-arm-kernel, linux-kernel

Hello Clark,

On 03.04.23 10:17, Clark Wang wrote:
> When using brctl to add eqos to a bridge, it will frist set eqos to
> promisc mode and then set a VLAN for this bridge with a filer VID value
> of 1.
> 
> These two error returns limit the use of brctl, resulting in the
> inability of the bridge to be enabled on eqos. So remove them.
> 
> Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>

Please add a suitable Fixes: tag pointing at the commit introducing
the regression.

Thanks,
Ahmad

> ---
>  drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 12 ------------
>  1 file changed, 12 deletions(-)
> 
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> index 8c7a0b7c9952..64bbe15a699e 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> @@ -472,12 +472,6 @@ static int dwmac4_add_hw_vlan_rx_fltr(struct net_device *dev,
>  	if (vid > 4095)
>  		return -EINVAL;
>  
> -	if (hw->promisc) {
> -		netdev_err(dev,
> -			   "Adding VLAN in promisc mode not supported\n");
> -		return -EPERM;
> -	}
> -
>  	/* Single Rx VLAN Filter */
>  	if (hw->num_vlan == 1) {
>  		/* For single VLAN filter, VID 0 means VLAN promiscuous */
> @@ -527,12 +521,6 @@ static int dwmac4_del_hw_vlan_rx_fltr(struct net_device *dev,
>  {
>  	int i, ret = 0;
>  
> -	if (hw->promisc) {
> -		netdev_err(dev,
> -			   "Deleting VLAN in promisc mode not supported\n");
> -		return -EPERM;
> -	}
> -
>  	/* Single Rx VLAN Filter */
>  	if (hw->num_vlan == 1) {
>  		if ((hw->vlan_filter[0] & GMAC_VLAN_TAG_VID) == vid) {

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


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

* RE: [Linux-stm32] [PATCH] net: stmmac: remove the limitation of adding vlan in promisc mode
  2023-04-03  8:41 ` [Linux-stm32] " Ahmad Fatoum
@ 2023-04-03  8:43   ` Clark Wang
  2023-04-03 10:40     ` Vladimir Oltean
  0 siblings, 1 reply; 4+ messages in thread
From: Clark Wang @ 2023-04-03  8:43 UTC (permalink / raw)
  To: Ahmad Fatoum, peppe.cavallaro@st.com,
	alexandre.torgue@foss.st.com, joabreu@synopsys.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com
  Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

Hi Ahmad,

> -----Original Message-----
> From: Ahmad Fatoum <a.fatoum@pengutronix.de>
> Sent: 2023年4月3日 16:42
> To: Clark Wang <xiaoning.wang@nxp.com>; peppe.cavallaro@st.com;
> alexandre.torgue@foss.st.com; joabreu@synopsys.com;
> davem@davemloft.net; edumazet@google.com; kuba@kernel.org;
> pabeni@redhat.com; mcoquelin.stm32@gmail.com
> Cc: netdev@vger.kernel.org; linux-stm32@st-md-mailman.stormreply.com;
> linux-arm-kernel@lists.infradead.org; linux-kernel@vger.kernel.org
> Subject: Re: [Linux-stm32] [PATCH] net: stmmac: remove the limitation of
> adding vlan in promisc mode
> 
> Hello Clark,
> 
> On 03.04.23 10:17, Clark Wang wrote:
> > When using brctl to add eqos to a bridge, it will frist set eqos to
> > promisc mode and then set a VLAN for this bridge with a filer VID
> > value of 1.
> >
> > These two error returns limit the use of brctl, resulting in the
> > inability of the bridge to be enabled on eqos. So remove them.
> >
> > Signed-off-by: Clark Wang <xiaoning.wang@nxp.com>
> 
> Please add a suitable Fixes: tag pointing at the commit introducing the
> regression.


Thanks. I will add it in V2.

Best Regards,
Clark Wang
> 
> Thanks,
> Ahmad
> 
> > ---
> >  drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 12 ------------
> >  1 file changed, 12 deletions(-)
> >
> > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> > b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> > index 8c7a0b7c9952..64bbe15a699e 100644
> > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c
> > @@ -472,12 +472,6 @@ static int dwmac4_add_hw_vlan_rx_fltr(struct
> net_device *dev,
> >  	if (vid > 4095)
> >  		return -EINVAL;
> >
> > -	if (hw->promisc) {
> > -		netdev_err(dev,
> > -			   "Adding VLAN in promisc mode not supported\n");
> > -		return -EPERM;
> > -	}
> > -
> >  	/* Single Rx VLAN Filter */
> >  	if (hw->num_vlan == 1) {
> >  		/* For single VLAN filter, VID 0 means VLAN promiscuous */ @@
> > -527,12 +521,6 @@ static int dwmac4_del_hw_vlan_rx_fltr(struct
> > net_device *dev,  {
> >  	int i, ret = 0;
> >
> > -	if (hw->promisc) {
> > -		netdev_err(dev,
> > -			   "Deleting VLAN in promisc mode not supported\n");
> > -		return -EPERM;
> > -	}
> > -
> >  	/* Single Rx VLAN Filter */
> >  	if (hw->num_vlan == 1) {
> >  		if ((hw->vlan_filter[0] & GMAC_VLAN_TAG_VID) == vid) {
> 
> --
> Pengutronix e.K.                           |
> |
> Steuerwalder Str. 21                       |
> https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.pe
> ngutronix.de%2F&data=05%7C01%7Cxiaoning.wang%40nxp.com%7C3fccb853
> 586d4904486908db341f4882%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%
> 7C0%7C638161081182421273%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4w
> LjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C
> %7C%7C&sdata=UoMfM69d4Y5OI7ant5UNlNCl81tls45On6hsZQeZZH8%3D&r
> eserved=0  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0
> |
> Amtsgericht Hildesheim, HRA 2686           | Fax:
> +49-5121-206917-5555 |


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

* Re: [Linux-stm32] [PATCH] net: stmmac: remove the limitation of adding vlan in promisc mode
  2023-04-03  8:43   ` Clark Wang
@ 2023-04-03 10:40     ` Vladimir Oltean
  0 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2023-04-03 10:40 UTC (permalink / raw)
  To: Clark Wang
  Cc: Ahmad Fatoum, peppe.cavallaro@st.com,
	alexandre.torgue@foss.st.com, joabreu@synopsys.com,
	davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, mcoquelin.stm32@gmail.com,
	netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org

Hi Clark,

On Mon, Apr 03, 2023 at 08:43:54AM +0000, Clark Wang wrote:
> Thanks. I will add it in V2.

Please always check the latest state of net.git/main before submitting
patches. In this case, you seem to have missed the existence of commit
a7602e7332b9 ("net: stmmac: don't reject VLANs when IFF_PROMISC is set").

Please also check Documentation/process/maintainer-netdev.rst for next
time, especially the part where it says to designate the patch as
"[PATCH net]" (it also says to add a Fixes tag as Ahmad already pointed out).

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

end of thread, other threads:[~2023-04-03 10:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-04-03  8:17 [PATCH] net: stmmac: remove the limitation of adding vlan in promisc mode Clark Wang
2023-04-03  8:41 ` [Linux-stm32] " Ahmad Fatoum
2023-04-03  8:43   ` Clark Wang
2023-04-03 10:40     ` Vladimir Oltean

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