From: Simon Horman <simon.horman@corigine.com>
To: Pawel Dembicki <paweldembicki@gmail.com>
Cc: netdev@vger.kernel.org, linus.walleij@linaro.org,
Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 3/6] net: dsa: vsc73xx: Add dsa tagging based on 8021q
Date: Thu, 22 Jun 2023 09:41:42 +0200 [thread overview]
Message-ID: <ZJP7NnKntKPx40S+@corigine.com> (raw)
In-Reply-To: <20230621191302.1405623-3-paweldembicki@gmail.com>
On Wed, Jun 21, 2023 at 09:12:59PM +0200, Pawel Dembicki wrote:
> This patch is simple implementation of 8021q tagging in vsc73xx driver.
> At this moment devices with DSA_TAG_PROTO_NONE are useless. VSC73XX
> family doesn't provide any tag support for external ethernet ports.
>
> The only way is vlan-based tagging. It require constant hardware vlan
> filtering. VSC73XX family support provider bridging but QinQ only without
> fully implemented 802.1AD. It allow only doubled 0x8100 TPID.
>
> In simple port mode QinQ is enabled to preserve forwarding vlan tagged
> frames.
>
> Tag driver introduce most simple funcionality required for proper taging
> support.
>
> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Hi Pawel,
a few minor nits to consider if you end up respining this series.
> diff --git a/drivers/net/dsa/Kconfig b/drivers/net/dsa/Kconfig
> index 3ed5391bb18d..4cf0166fef7b 100644
> --- a/drivers/net/dsa/Kconfig
> +++ b/drivers/net/dsa/Kconfig
> @@ -125,7 +125,7 @@ config NET_DSA_SMSC_LAN9303_MDIO
>
> config NET_DSA_VITESSE_VSC73XX
> tristate
> - select NET_DSA_TAG_NONE
> + select NET_DSA_TAG_VSC73XX
> select FIXED_PHY
> select VITESSE_PHY
> select GPIOLIB
> diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c
...
> +static int vsc73xx_vlan_set_pvid(struct dsa_switch *ds, int port, u16 vid,
> + bool port_vlan)
> +{
> + struct vsc73xx *vsc = ds->priv;
> + struct dsa_port *dsa_port = dsa_to_port(ds, port);
> + u16 vlan_no;
> + u32 val;
nit: Please use reverse xmas tree - longest line to shortest,
for local variable declarations in new Networking code.
Also, once space is enough after '='.
...
> diff --git a/net/dsa/tag_vsc73xx_8021q.c b/net/dsa/tag_vsc73xx_8021q.c
> new file mode 100644
> index 000000000000..3d83dfecde31
> --- /dev/null
> +++ b/net/dsa/tag_vsc73xx_8021q.c
> @@ -0,0 +1,87 @@
> +// SPDX-License-Identifier: GPL-2.0 OR MIT
> +/* Copyright (C) 2022 Pawel Dembicki <paweldembicki@gmail.com>
> + * Based on tag_sja1105.c:
> + * Copyright (c) 2019, Vladimir Oltean <olteanv@gmail.com>
> + */
> +#include <linux/dsa/8021q.h>
> +
> +#include "tag.h"
> +#include "tag_8021q.h"
> +
> +#define VSC73XX_8021Q_NAME "vsc73xx-8021q"
> +
> +static struct sk_buff *vsc73xx_xmit(struct sk_buff *skb,
> + struct net_device *netdev)
> +{
> + struct dsa_port *dp = dsa_slave_to_port(netdev);
> + u16 queue_mapping = skb_get_queue_mapping(skb);
> + u8 pcp = netdev_txq_to_tc(netdev, queue_mapping);
> + u16 tx_vid = dsa_tag_8021q_standalone_vid(dp);
> + struct net_device *br = dsa_port_bridge_dev_get(dp);
nit: reverse xmas tree here too.
...
next prev parent reply other threads:[~2023-06-22 7:41 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 19:12 [PATCH net-next 1/6] net: dsa: vsc73xx: convert to PHYLINK Pawel Dembicki
2023-06-21 19:12 ` [PATCH net-next 2/6] net: dsa: vsc73xx: add port_stp_state_set function Pawel Dembicki
2023-06-21 19:33 ` Andrew Lunn
2023-06-21 20:38 ` Paweł Dembicki
2023-06-22 13:01 ` Andrew Lunn
2023-06-22 13:06 ` Vladimir Oltean
2023-06-21 21:27 ` Linus Walleij
2023-06-25 11:21 ` Vladimir Oltean
2023-06-25 11:47 ` Paweł Dembicki
2023-06-21 21:28 ` Linus Walleij
2023-06-22 17:24 ` Jakub Kicinski
2023-06-21 19:12 ` [PATCH net-next 3/6] net: dsa: vsc73xx: Add dsa tagging based on 8021q Pawel Dembicki
2023-06-21 21:32 ` Linus Walleij
2023-06-22 7:41 ` Simon Horman [this message]
2023-06-21 19:13 ` [PATCH net-next 4/6] net: dsa: vsc73xx: Add bridge support Pawel Dembicki
2023-06-21 21:33 ` Linus Walleij
2023-06-21 19:13 ` [PATCH net-next 5/6] net: dsa: vsc73xx: Add vlan filtering Pawel Dembicki
2023-06-21 21:34 ` Linus Walleij
2023-06-21 19:13 ` [PATCH net-next 6/6] net: dsa: vsc73xx: fix MTU configuration Pawel Dembicki
2023-06-21 21:35 ` Linus Walleij
2023-06-22 7:35 ` Simon Horman
2023-06-21 21:21 ` [PATCH net-next 1/6] net: dsa: vsc73xx: convert to PHYLINK Linus Walleij
2023-06-22 7:34 ` Simon Horman
2023-06-22 11:55 ` Russell King (Oracle)
2023-06-24 4:02 ` Paweł Dembicki
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=ZJP7NnKntKPx40S+@corigine.com \
--to=simon.horman@corigine.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=paweldembicki@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