From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
linux-kernel@vger.kernel.org (open list),
vladimir.oltean@nxp.com, olteanv@gmail.com
Subject: [PATCH net-next 2/4] net: dsa: b53: Set untag_bridge_pvid
Date: Thu, 1 Oct 2020 19:42:13 -0700 [thread overview]
Message-ID: <20201002024215.660240-3-f.fainelli@gmail.com> (raw)
In-Reply-To: <20201002024215.660240-1-f.fainelli@gmail.com>
Indicate to the DSA receive path that we need to untage the bridge PVID,
this allows us to remove the dsa_untag_bridge_pvid() calls from
net/dsa/tag_brcm.c.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/b53/b53_common.c | 1 +
net/dsa/tag_brcm.c | 15 ++-------------
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_common.c
index 73507cff3bc4..ce18ba0b74eb 100644
--- a/drivers/net/dsa/b53/b53_common.c
+++ b/drivers/net/dsa/b53/b53_common.c
@@ -2603,6 +2603,7 @@ struct b53_device *b53_switch_alloc(struct device *base,
dev->ops = ops;
ds->ops = &b53_switch_ops;
ds->configure_vlan_while_not_filtering = true;
+ ds->untag_bridge_pvid = true;
dev->vlan_enabled = ds->configure_vlan_while_not_filtering;
mutex_init(&dev->reg_mutex);
mutex_init(&dev->stats_mutex);
diff --git a/net/dsa/tag_brcm.c b/net/dsa/tag_brcm.c
index 69d6b8c597a9..ad72dff8d524 100644
--- a/net/dsa/tag_brcm.c
+++ b/net/dsa/tag_brcm.c
@@ -152,11 +152,6 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,
/* Remove Broadcom tag and update checksum */
skb_pull_rcsum(skb, BRCM_TAG_LEN);
- /* Set the MAC header to where it should point for
- * dsa_untag_bridge_pvid() to parse the correct VLAN header.
- */
- skb_set_mac_header(skb, -ETH_HLEN);
-
skb->offload_fwd_mark = 1;
return skb;
@@ -187,7 +182,7 @@ static struct sk_buff *brcm_tag_rcv(struct sk_buff *skb, struct net_device *dev,
nskb->data - ETH_HLEN - BRCM_TAG_LEN,
2 * ETH_ALEN);
- return dsa_untag_bridge_pvid(nskb);
+ return nskb;
}
static const struct dsa_device_ops brcm_netdev_ops = {
@@ -214,14 +209,8 @@ static struct sk_buff *brcm_tag_rcv_prepend(struct sk_buff *skb,
struct net_device *dev,
struct packet_type *pt)
{
- struct sk_buff *nskb;
-
/* tag is prepended to the packet */
- nskb = brcm_tag_rcv_ll(skb, dev, pt, ETH_HLEN);
- if (!nskb)
- return nskb;
-
- return dsa_untag_bridge_pvid(nskb);
+ return brcm_tag_rcv_ll(skb, dev, pt, ETH_HLEN);
}
static const struct dsa_device_ops brcm_prepend_netdev_ops = {
--
2.25.1
next prev parent reply other threads:[~2020-10-02 2:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-02 2:42 [PATCH net-next 0/4] net: dsa: Improve dsa_untag_bridge_pvid() Florian Fainelli
2020-10-02 2:42 ` [PATCH net-next 1/4] net: dsa: Call dsa_untag_bridge_pvid() from dsa_switch_rcv() Florian Fainelli
2020-10-02 8:39 ` Vladimir Oltean
2020-10-02 2:42 ` Florian Fainelli [this message]
2020-10-02 8:40 ` [PATCH net-next 2/4] net: dsa: b53: Set untag_bridge_pvid Vladimir Oltean
2020-10-02 2:42 ` [PATCH net-next 3/4] net: dsa: Obtain VLAN protocol from skb->protocol Florian Fainelli
2020-10-02 8:41 ` Vladimir Oltean
2020-10-02 2:42 ` [PATCH net-next 4/4] net: dsa: Utilize __vlan_find_dev_deep_rcu() Florian Fainelli
2020-10-02 8:42 ` Vladimir Oltean
2020-10-02 20:36 ` [PATCH net-next 0/4] net: dsa: Improve dsa_untag_bridge_pvid() David Miller
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=20201002024215.660240-3-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.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).