[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230904133953.180f9b6b@wsk>
Date: Mon, 4 Sep 2023 13:39:53 +0200
From: Lukasz Majewski <lukma@...x.de>
To: Andrew Lunn <andrew@...n.ch>
Cc: Eric Dumazet <edumazet@...gle.com>, davem@...emloft.net, Paolo Abeni
<pabeni@...hat.com>, Woojung Huh <woojung.huh@...rochip.com>, Vladimir
Oltean <olteanv@...il.com>, Tristram.Ha@...rochip.com, Florian Fainelli
<f.fainelli@...il.com>, Jakub Kicinski <kuba@...nel.org>,
UNGLinuxDriver@...rochip.com, George McCollister
<george.mccollister@...il.com>, Oleksij Rempel <o.rempel@...gutronix.de>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 3/4] net: dsa: hsr: Enable in KSZ9477 switch HW HSR
offloading
Hi Andrew,
> > +int ksz9477_hsr_join(struct dsa_switch *ds, int port, struct
> > net_device *hsr,
> > + struct dsa_port *partner)
> > +{
> > + struct ksz_device *dev = ds->priv;
> > + struct net_device *slave;
> > + u8 i, data;
> > + int ret;
> > +
> > + /* Program which ports shall support HSR */
> > + dev->hsr_ports = BIT(port) | BIT(partner->index);
> > + ksz_write32(dev, REG_HSR_PORT_MAP__4, dev->hsr_ports);
> > +
> > + /* Enable discarding of received HSR frames */
> > + ksz_read8(dev, REG_HSR_ALU_CTRL_0__1, &data);
> > + data |= HSR_DUPLICATE_DISCARD;
> > + data &= ~HSR_NODE_UNICAST;
> > + ksz_write8(dev, REG_HSR_ALU_CTRL_0__1, data);
> > +
> > + /* Self MAC address filtering for HSR frames to avoid
> > + * traverse of the HSR ring more than once.
> > + *
> > + * The HSR port (i.e. hsr0) MAC address is used.
> > + */
> > + if (!is_valid_ether_addr(hsr->dev_addr)) {
> > + dev_err(dev->dev,
> > + "Set valid MAC address to %s for HSR
> > operation!",
> > + hsr->name);
> > + return -EINVAL;
> > + }
>
> This seems like something which should be done at a higher level, not
> per driver. Please check if there is an existing test, and if not, add
> one in the HSR core.
Yes, your are right. This is caught earlier in the net stack code.
Especially, I was afraid, that one can use:
local-mac-address = [00 00 00 00 00 00]
but in this case is caught as well.
I will remove this check. Thanks for pointing this out.
>
> Andrew
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma@...x.de
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists