From: Vladimir Oltean <olteanv@gmail.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Luiz Angelo Daros de Luca <luizluca@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net v2] net: dsa: tag_rtl4_a: Bump min packet size
Date: Thu, 2 Nov 2023 12:04:53 +0200 [thread overview]
Message-ID: <20231102100453.dwnaxbdzf3j3ifrv@skbuf> (raw)
In-Reply-To: <CACRpkdaoBo0S0RgLhacObd3pbjtWAfr6s3oizQAHqdB76gaG5A@mail.gmail.com>
On Wed, Nov 01, 2023 at 09:26:50PM +0100, Linus Walleij wrote:
> > [ 3.967086] realtek-smi switch: set MAC: 42:E4:F5:XX:XX:XX
>
> Unrelated: I have seen other DSA switches "inherit" the MAC of the
> conduit interface (BRCM). I wonder if we could do that too instead
> of this random MAC number. Usually the conduit interface has a
> properly configured MAC.
We need to know what is the MAC address from the RTL8366RB_SMAR
registers used for.
What you know about is that DSA user interfaces have their own MAC
address for packet termination (send/receive to/from the CPU). MAC
addresses for switch ports are an abstract concept, of course (switches
normally just forward packets, nothing is addressed *to* them), and so,
these addresses are not programmed per se to hardware unless the
prerequisites of dsa_switch_supports_uc_filtering() are implemented.
If they are, the MAC addresses of user ports are programmed as host FDB
entries (FDB entries towards the CPU port).
The rule for establishing the MAC address of each user port is as
follows: if of_get_mac_address() finds something valid for that port's
OF node - provided by the bootloader - ("address", "mac-address",
"local-mac-address", a nvmem provider etc), then that value is used.
Otherwise, the MAC address is inherited from the conduit interface.
Some switches also have a global MAC address register (used for all
ports) of their own, but it is switch-specific what this does. We look
at the functionality it offers when deciding what to program it to,
since it's of course not possible to sync a single hardware register to
the value of the MAC addresses of multiple user ports.
For KSZ switches - see ksz_switch_macaddr_get() - the global MAC address
register is used for HSR self-address filtering and for Wake on LAN.
We sync the value of this hardware register with the MAC address of the
first user port on which these optional features are enabled. Then, we
allow these optional features only on the other user ports which have
the same MAC address as the original one which enabled that feature.
On KSZ, the same switch MAC address is also used as MAC SA in generated
pause frames, but to our knowledge, that MAC address could be any
address (even 00:00:00:00:00:00), so we don't really care too much about
that and we let it fall to whatever value it may.
next prev parent reply other threads:[~2023-11-02 10:05 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 9:26 [PATCH net v2] net: dsa: tag_rtl4_a: Bump min packet size Linus Walleij
2023-10-30 14:16 ` Vladimir Oltean
2023-10-30 14:37 ` Linus Walleij
2023-10-30 15:23 ` Vladimir Oltean
2023-10-30 15:30 ` Vladimir Oltean
2023-10-31 21:22 ` Linus Walleij
2023-11-02 10:48 ` Vladimir Oltean
2023-10-30 21:50 ` Linus Walleij
2023-10-30 22:20 ` Vladimir Oltean
2023-10-30 22:57 ` Linus Walleij
2023-10-30 23:09 ` Vladimir Oltean
2023-10-30 23:11 ` Linus Walleij
2023-10-31 0:37 ` Andrew Lunn
2023-10-31 3:37 ` Florian Fainelli
2023-10-31 14:06 ` Linus Walleij
2023-10-31 16:23 ` Florian Fainelli
2023-10-30 23:33 ` Vladimir Oltean
2023-10-31 14:16 ` Linus Walleij
2023-10-31 16:34 ` Vladimir Oltean
2023-10-31 19:02 ` Linus Walleij
2023-11-02 12:32 ` Vladimir Oltean
2023-10-31 19:18 ` Luiz Angelo Daros de Luca
2023-10-31 19:27 ` Linus Walleij
2023-11-01 12:35 ` Luiz Angelo Daros de Luca
2023-11-01 20:26 ` Linus Walleij
2023-11-02 10:04 ` Vladimir Oltean [this message]
2023-11-02 10:45 ` Vladimir Oltean
2023-11-03 17:05 ` Luiz Angelo Daros de Luca
2023-12-30 5:19 ` Luiz Angelo Daros de Luca
2023-12-30 12:28 ` Linus Walleij
2023-12-30 23:56 ` Luiz Angelo Daros de Luca
2023-11-02 10:31 ` Vladimir Oltean
2023-11-03 17:13 ` Luiz Angelo Daros de Luca
2023-10-31 22:44 ` Linus Walleij
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=20231102100453.dwnaxbdzf3j3ifrv@skbuf \
--to=olteanv@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luizluca@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/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