From: Linus Walleij <linus.walleij@linaro.org>
To: DENG Qingfang <dqfext@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Russell King <linux@armlinux.org.uk>,
netdev <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC net-next] net: dsa: rtl8366rb: support bridge offloading
Date: Mon, 1 Mar 2021 14:48:20 +0100 [thread overview]
Message-ID: <CACRpkdZykWgxM7Ge40gpMBaVUoa7WqJrOugrvSpm2Lc52hHC8w@mail.gmail.com> (raw)
In-Reply-To: <20210224061205.23270-1-dqfext@gmail.com>
On Wed, Feb 24, 2021 at 7:12 AM DENG Qingfang <dqfext@gmail.com> wrote:
> Use port isolation registers to configure bridge offloading.
> Remove the VLAN init, as we have proper CPU tag and bridge offloading
> support now.
>
> Signed-off-by: DENG Qingfang <dqfext@gmail.com>
> ---
> This is not tested, as I don't have a RTL8366RB board. And I think there
> is potential race condition in port_bridge_{join,leave}.
Compilation failed for me like this:
../drivers/net/dsa/rtl8366rb.c:1573:23: error: initialization of 'void
(*)(struct dsa_switch *, int, struct net_device *)' from incompatible
pointer type 'int (*)(struct dsa_switch *, int, struct net_device *)'
[-Werror=incompatible-pointer-types]
1573 | .port_bridge_leave = rtl8366rb_port_bridge_leave,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
../drivers/net/dsa/rtl8366rb.c:1573:23: note: (near initialization for
'rtl8366rb_switch_ops.port_bridge_leave')
I fixed it like this:
diff --git a/drivers/net/dsa/rtl8366rb.c b/drivers/net/dsa/rtl8366rb.c
index e7abf846350d..0719fadadc3d 100644
--- a/drivers/net/dsa/rtl8366rb.c
+++ b/drivers/net/dsa/rtl8366rb.c
@@ -1161,7 +1161,7 @@ rtl8366rb_port_bridge_join(struct dsa_switch
*ds, int port,
0, port_bitmap << 1);
}
-static int
+static void
rtl8366rb_port_bridge_leave(struct dsa_switch *ds, int port,
struct net_device *bridge)
{
@@ -1176,14 +1176,17 @@ rtl8366rb_port_bridge_leave(struct dsa_switch
*ds, int port,
continue;
ret = regmap_update_bits(smi->map, RTL8366RB_PORT_ISO(i),
BIT(port + 1), 0);
- if (ret)
- return ret;
+ if (ret) {
+ dev_err(smi->dev, "failed to leave port %d
from bridge\n",
+ port);
+ return;
+ }
port_bitmap |= BIT(i);
}
- return regmap_update_bits(smi->map, RTL8366RB_PORT_ISO(port),
- port_bitmap << 1, 0);
+ regmap_update_bits(smi->map, RTL8366RB_PORT_ISO(port),
+ port_bitmap << 1, 0);
}
After this it works like a charm.
> - ret = rtl8366_init_vlan(smi);
> - if (ret)
> - return ret;
I suppose we can delete that confused VLAN set-up after this.
> - ds->configure_vlan_while_not_filtering = false;
This is default true not IIUC so we should be good!
With my minor changes:
Tested-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
next prev parent reply other threads:[~2021-03-01 13:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-24 6:12 [RFC net-next] net: dsa: rtl8366rb: support bridge offloading DENG Qingfang
2021-03-01 13:48 ` Linus Walleij [this message]
2021-03-02 3:58 ` DENG Qingfang
2021-03-02 16:05 ` Linus Walleij
2021-03-02 16:11 ` Vladimir Oltean
2021-03-02 16:24 ` Linus Walleij
2021-03-01 13:55 ` Linus Walleij
2021-03-02 3:39 ` DENG Qingfang
2021-03-03 4:35 ` Florian Fainelli
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=CACRpkdZykWgxM7Ge40gpMBaVUoa7WqJrOugrvSpm2Lc52hHC8w@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.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;
as well as URLs for NNTP newsgroup(s).