From: Andrew Lunn <andrew@lunn.ch>
To: Egil Hjelmeland <privat@egil-hjelmeland.no>
Cc: vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged
Date: Tue, 24 Oct 2017 18:33:34 +0200 [thread overview]
Message-ID: <20171024163334.GC12347@lunn.ch> (raw)
In-Reply-To: <20171024093515.6749-3-privat@egil-hjelmeland.no>
On Tue, Oct 24, 2017 at 11:35:15AM +0200, Egil Hjelmeland wrote:
> When CPU transmit directly to port using tag, the LAN9303 does not
> learn MAC addresses received on the CPU port into the ALR.
> ALR learning is performed only when transmitting using ALR lookup.
>
> Solution:
> If the two external ports are bridged and the packet is not STP BPDU,
> then use ALR lookup to allow ALR learning on CPU port.
> Otherwise transmit directly to port with STP state override.
>
> Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no>
> ---
> net/dsa/tag_lan9303.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
> index 57519597c6fc..174721293a34 100644
> --- a/net/dsa/tag_lan9303.c
> +++ b/net/dsa/tag_lan9303.c
> @@ -12,6 +12,7 @@
> *
> */
> #include <linux/etherdevice.h>
> +#include <linux/lan9303.h>
> #include <linux/list.h>
> #include <linux/slab.h>
>
> @@ -39,6 +40,23 @@
> */
>
> #define LAN9303_TAG_LEN 4
> +# define LAN9303_TAG_TX_USE_ALR BIT(3)
> +# define LAN9303_TAG_TX_STP_OVERRIDE BIT(4)
> +#define eth_stp_addr eth_reserved_addr_base
> +
> +/* Decide whether to transmit using ALR lookup, or transmit directly to
> + * port using tag. ALR learning is performed only when using ALR lookup.
> + * If the two external ports are bridged and the packet is not STP BPDU,
> + * then use ALR lookup to allow ALR learning on CPU port.
> + * Otherwise transmit directly to port with STP state override.
> + * See also: lan9303_separate_ports() and lan9303.pdf 6.4.10.1
> + */
> +static inline int lan9303_tx_use_arl(struct dsa_port *dp, u8 *dest_addr)
Hi Egil
There is no need for the inline. The compiler will do that anyway, for
a function like this.
Andrew
next prev parent reply other threads:[~2017-10-24 16:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-24 9:35 [PATCH net-next 0/2] net: dsa: lan9303: Learn addresses on CPU port when bridged Egil Hjelmeland
2017-10-24 9:35 ` [PATCH net-next 1/2] net: dsa: lan9303: Move struct lan9303 to include/linux/lan9303.h Egil Hjelmeland
2017-10-24 16:31 ` Andrew Lunn
2017-10-25 11:07 ` Egil Hjelmeland
2017-10-24 9:35 ` [PATCH net-next 2/2] net: dsa: lan9303: Learn addresses on CPU port when bridged Egil Hjelmeland
2017-10-24 16:33 ` Andrew Lunn [this message]
2017-10-25 10:27 ` Egil Hjelmeland
2017-10-24 17:18 ` Woojung.Huh
2017-10-25 10:54 ` Egil Hjelmeland
2017-10-25 15:48 ` Woojung.Huh
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=20171024163334.GC12347@lunn.ch \
--to=andrew@lunn.ch \
--cc=f.fainelli@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=privat@egil-hjelmeland.no \
--cc=vivien.didelot@savoirfairelinux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.