Netdev List
 help / color / mirror / Atom feed
From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Cc: paul@pbarker.dev, andrew+netdev@lunn.ch, davem@davemloft.net,
	edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, upstream+netdev@sigma-star.at
Subject: Re: [PATCH] net: ravb: Honor the promsicuous mode state on device re-init
Date: Mon, 30 Nov 2026 16:55:06 +0100	[thread overview]
Message-ID: <20261130155506.GA3157946@ragnatech.se> (raw)
In-Reply-To: <20261130072856.16909-1-david.oberhollenzer@sigma-star.at>

Hi David,

Thanks for your patch.

On 2026-11-30 08:28:55 +0100, David Oberhollenzer wrote:
> When the device is initialized via ravb_emac_init, called from
> the ndo_open implementation, the ECMR register is initialized
> with a configuration that has the promiscuous mode bit cleared.
> 
> While this may be desireable for the default case, this device
> (re-)initialization is also performed e.g. when changing the MTU
> on a running device. An interface that has been set into
> promiscuous mode (e.g because it has previously been attached to a
> bridge), now silently drops out of promiscuous mode, but with the
> IFF_PROMISC flag still set (leaving the bridge to no longer forward
> frames correctly).
> 
> Make sure we honor the state of the IFF_PROMISC flag from the netdev
> when initializing the ECMR.
> 
> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
> ---
>  drivers/net/ethernet/renesas/ravb_main.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index 641ad4054df4..d57230492e04 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -533,6 +533,7 @@ static void ravb_emac_init_gbeth(struct net_device *ndev)
>  
>  	/* EMAC Mode: PAUSE prohibition; Duplex; TX; RX; CRC Pass Through */
>  	ravb_write(ndev, ECMR_ZPF | ((priv->duplex > 0) ? ECMR_DM : 0) |
> +			 (ndev->flags & IFF_PROMISC ? ECMR_PRM : 0) |
>  			 ECMR_TE | ECMR_RE | ECMR_RCPT |
>  			 ECMR_TXF | ECMR_RXF, ECMR);
>  
> @@ -569,6 +570,7 @@ static void ravb_emac_init_rcar(struct net_device *ndev)
>  	/* EMAC Mode: PAUSE prohibition; Duplex; RX Checksum; TX; RX */
>  	ravb_write(ndev, ECMR_ZPF | ECMR_DM |
>  		   (ndev->features & NETIF_F_RXCSUM ? ECMR_RCSC : 0) |
> +		   (ndev->flags & IFF_PROMISC ? ECMR_PRM : 0) |
>  		   ECMR_TE | ECMR_RE, ECMR);

I wonder if it would make more sens to add a call to ravb_set_rx_mode() 
in ravb_emac_init()?

It would align with how the promiscuous mode is preserved when resuming 
from suspend. If it's added there the direct call to ravb_set_rx_mode() 
could even be dropped from ravb_resume() as it already calls ravb_open() 
which in turn call ravb_emac_init().

That way we have a single point for this and don't need to spread code 
in the gbeth and rcar codepaths, something I'm slowly working to join 
back into one.

>  
>  	ravb_set_rate_rcar(ndev);
> -- 
> 2.51.0
> 

-- 
Kind Regards,
Niklas Söderlund

      parent reply	other threads:[~2026-11-30 15:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30  7:28 [PATCH] net: ravb: Honor the promsicuous mode state on device re-init David Oberhollenzer
2026-11-30  7:33 ` netdev-bot+sinfo
2026-11-30  7:55   ` David Oberhollenzer
2026-11-30 15:55 ` Niklas Söderlund [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130155506.GA3157946@ragnatech.se \
    --to=niklas.soderlund@ragnatech.se \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=david.oberhollenzer@sigma-star.at \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=paul@pbarker.dev \
    --cc=upstream+netdev@sigma-star.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox