mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Sascha Hauer <sha@pengutronix.de>,
	Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v2 2/6] net: dsa: enable promiscuous mode for switch master edev
Date: Fri, 4 Nov 2022 09:34:44 +0100	[thread overview]
Message-ID: <94bc24cc-2675-de3d-0b3c-541ab7a3fdac@pengutronix.de> (raw)
In-Reply-To: <20221104082653.GR3143@pengutronix.de>

Hello Oleksij,

On 04.11.22 09:26, Sascha Hauer wrote:
> On Thu, Nov 03, 2022 at 02:13:47PM +0100, Oleksij Rempel wrote:
>> Typical use case for DSA framework on barebox a port multiplexer. This
>> means, we mostly have different MAC addresses on each port. To make this
>> work, we need to enable promiscuous mode on the master Ethernet
>> controller.
>>
>> With this patch, promiscuous mode will be enabled automatically, as soon
>> as at least one switch port is enabled and this mode will be disabled
>> after all switch ports are disabled as well.
>>
>> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
>> ---
>>  drivers/net/dsa.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/dsa.c b/drivers/net/dsa.c
>> index 040ba897e2..14ef8f4c4f 100644
>> --- a/drivers/net/dsa.c
>> +++ b/drivers/net/dsa.c
>> @@ -129,6 +129,7 @@ static int dsa_port_start(struct eth_device *edev)
>>  				return ret;
>>  		}
>>  
>> +		eth_set_promiscuous_mode(ds->edev_master, true);
>>  		eth_open(ds->edev_master);
>>  	}
>>  
>> @@ -160,6 +161,7 @@ static void dsa_port_stop(struct eth_device *edev)
>>  			ops->port_disable(dpc, ds->cpu_port,
>>  					ds->cpu_port_fixed_phy);
>>  
>> +		eth_set_promiscuous_mode(ds->edev_master, false);

Can you change the name to eth_set_promisc[_mode] ?
This aligns it with the kernel IFF_PROMISC and it's easier to type
without looking up correct spelling ^^'.

> 
> Please check the error code. When eth_set_promiscuous_mode() is not
> implemented for the current ethernet device we should notice the user.
> 
> Sascha
> 

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




  reply	other threads:[~2022-11-04  8:36 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-03 13:13 [PATCH v2 1/6] net: add promiscuous mode configuration support Oleksij Rempel
2022-11-03 13:13 ` [PATCH v2 2/6] net: dsa: enable promiscuous mode for switch master edev Oleksij Rempel
2022-11-04  8:26   ` Sascha Hauer
2022-11-04  8:34     ` Ahmad Fatoum [this message]
2022-11-03 13:13 ` [PATCH v2 3/6] drivers: net: fec_imx: add promiscuous mode configuration support Oleksij Rempel
2022-11-04  8:29   ` Sascha Hauer
2022-11-04  8:52     ` Sascha Hauer
2022-11-03 13:13 ` [PATCH v2 4/6] net: dsa: fix of_device_ensure_probed*() for switch ports Oleksij Rempel
2022-11-03 13:13 ` [PATCH v2 5/6] ARM: boards: skov-imx6: convert all pr_ to dev_ prints Oleksij Rempel
2022-11-03 13:13 ` [PATCH v2 6/6] ARM: boards: skov-imx6: assigned separate MAC address to LAN2 Oleksij Rempel
2022-11-04  8:25 ` [PATCH v2 1/6] net: add promiscuous mode configuration support Sascha Hauer
2022-11-04  8:37 ` Ahmad Fatoum

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=94bc24cc-2675-de3d-0b3c-541ab7a3fdac@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=o.rempel@pengutronix.de \
    --cc=sha@pengutronix.de \
    /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