[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <3ea8934e-c41f-4366-a0c4-1894ed4e3d7e@lunn.ch>
Date: Fri, 19 Jan 2024 15:12:04 +0100
From: Andrew Lunn <andrew@...n.ch>
To: MD Danish Anwar <danishanwar@...com>
Cc: Rob Herring <robh@...nel.org>, Dan Carpenter <dan.carpenter@...aro.org>,
Jan Kiszka <jan.kiszka@...mens.com>,
Vladimir Oltean <vladimir.oltean@....com>,
Wolfram Sang <wsa+renesas@...g-engineering.com>,
Arnd Bergmann <arnd@...db.de>,
Grygorii Strashko <grygorii.strashko@...com>,
Vignesh Raghavendra <vigneshr@...com>,
Roger Quadros <rogerq@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>,
"David S. Miller" <davem@...emloft.net>,
linux-arm-kernel@...ts.infradead.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, srk@...com, r-gunasekaran@...com
Subject: Re: [RFC PATCH v2 2/3] net: ti: icssg-switch: Add switchdev based
driver for ethernet switch support
> +static int prueth_switchdev_stp_state_set(struct prueth_emac *emac,
> + u8 state)
> +{
> + enum icssg_port_state_cmd emac_state;
> + int ret = 0;
> +
> + switch (state) {
> + case BR_STATE_FORWARDING:
> + emac_state = ICSSG_EMAC_PORT_FORWARD;
> + break;
> + case BR_STATE_DISABLED:
> + emac_state = ICSSG_EMAC_PORT_DISABLE;
> + break;
> + case BR_STATE_LEARNING:
> + case BR_STATE_LISTENING:
> + case BR_STATE_BLOCKING:
> + emac_state = ICSSG_EMAC_PORT_BLOCK;
> + break;
That is unusual. Does it still learn while in BLOCK? It might be you
need to flush the FDB for this port when it changes from BLOCKING to
LISTENING or LEARNING?
> +static void prueth_switchdev_event_work(struct work_struct *work)
> +{
> + struct prueth_switchdev_event_work *switchdev_work =
> + container_of(work, struct prueth_switchdev_event_work, work);
> + struct prueth_emac *emac = switchdev_work->emac;
> + struct switchdev_notifier_fdb_info *fdb;
> + int port_id = emac->port_id;
> + int ret;
> +
> + rtnl_lock();
> + switch (switchdev_work->event) {
> + case SWITCHDEV_FDB_ADD_TO_DEVICE:
> + fdb = &switchdev_work->fdb_info;
> +
> + netdev_dbg(emac->ndev, "prueth_fdb_add: MACID = %pM vid = %u flags = %u %u -- port %d\n",
> + fdb->addr, fdb->vid, fdb->added_by_user,
> + fdb->offloaded, port_id);
> +
> + if (!fdb->added_by_user)
> + break;
> + if (memcmp(emac->mac_addr, (u8 *)fdb->addr, ETH_ALEN) == 0)
> + break;
ether_addr_equal(). Please review all the code and use these helpers
when possible.
So you don't add an FDB for the interfaces own MAC address? Does the
switch know the interfaces MAC address?
Andrew
Powered by blists - more mailing lists