From: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
To: hongbo.wang@nxp.com, xiaoliang.yang_1@nxp.com,
allan.nielsen@microchip.com, po.liu@nxp.com,
claudiu.manoil@nxp.com, alexandru.marginean@nxp.com,
vladimir.oltean@nxp.com, leoyang.li@nxp.com, mingkai.hu@nxp.com,
andrew@lunn.ch, f.fainelli@gmail.com, vivien.didelot@gmail.com,
davem@davemloft.net, jiri@resnulli.us, idosch@idosch.org,
kuba@kernel.org, vinicius.gomes@intel.com,
roopa@cumulusnetworks.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, horatiu.vultur@microchip.com,
alexandre.belloni@bootlin.com, UNGLinuxDriver@microchip.com,
linux-devel@linux.nxdi.nxp.com
Subject: Re: [PATCH 1/2] net: dsa: Add flag for 802.1AD when adding VLAN for dsa switch and port
Date: Mon, 20 Jul 2020 13:44:41 +0300 [thread overview]
Message-ID: <05b06d46-d705-7d06-b4dd-2bee90f75168@cumulusnetworks.com> (raw)
In-Reply-To: <20200720104119.19146-1-hongbo.wang@nxp.com>
On 20/07/2020 13:41, hongbo.wang@nxp.com wrote:
> From: "hongbo.wang" <hongbo.wang@nxp.com>
>
> the following command can be supported:
> ip link add link swp1 name swp1.100 type vlan protocol 802.1ad id 100
>
> Signed-off-by: hongbo.wang <hongbo.wang@nxp.com>
> ---
> include/uapi/linux/if_bridge.h | 1 +
> net/dsa/slave.c | 9 +++++++--
> 2 files changed, 8 insertions(+), 2 deletions(-)
>
This is not bridge related at all, please leave its flags out of it.
Nacked-by: Nikolay Aleksandrov <nikolay@cumulusnetworks.com>
> diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h
> index caa6914a3e53..ecd960aa65c7 100644
> --- a/include/uapi/linux/if_bridge.h
> +++ b/include/uapi/linux/if_bridge.h
> @@ -132,6 +132,7 @@ enum {
> #define BRIDGE_VLAN_INFO_RANGE_END (1<<4) /* VLAN is end of vlan range */
> #define BRIDGE_VLAN_INFO_BRENTRY (1<<5) /* Global bridge VLAN entry */
> #define BRIDGE_VLAN_INFO_ONLY_OPTS (1<<6) /* Skip create/delete/flags */
> +#define BRIDGE_VLAN_INFO_8021AD (1<<7) /* VLAN is 802.1AD protocol */
>
> struct bridge_vlan_info {
> __u16 flags;
> diff --git a/net/dsa/slave.c b/net/dsa/slave.c
> index 4c7f086a047b..376d7ac5f1e5 100644
> --- a/net/dsa/slave.c
> +++ b/net/dsa/slave.c
> @@ -1232,6 +1232,7 @@ static int dsa_slave_get_ts_info(struct net_device *dev,
> static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
> u16 vid)
> {
> + u16 flags = 0;
> struct dsa_port *dp = dsa_slave_to_port(dev);
> struct bridge_vlan_info info;
> int ret;
> @@ -1252,7 +1253,10 @@ static int dsa_slave_vlan_rx_add_vid(struct net_device *dev, __be16 proto,
> return -EBUSY;
> }
>
> - ret = dsa_port_vid_add(dp, vid, 0);
> + if (ntohs(proto) == ETH_P_8021AD)
> + flags |= BRIDGE_VLAN_INFO_8021AD;
> +
> + ret = dsa_port_vid_add(dp, vid, flags);
> if (ret)
> return ret;
>
> @@ -1744,7 +1748,8 @@ int dsa_slave_create(struct dsa_port *port)
>
> slave_dev->features = master->vlan_features | NETIF_F_HW_TC;
> if (ds->ops->port_vlan_add && ds->ops->port_vlan_del)
> - slave_dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
> + slave_dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
> + NETIF_F_HW_VLAN_STAG_FILTER;
> slave_dev->hw_features |= NETIF_F_HW_TC;
> slave_dev->features |= NETIF_F_LLTX;
> slave_dev->ethtool_ops = &dsa_slave_ethtool_ops;
>
next prev parent reply other threads:[~2020-07-20 10:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-20 10:41 [PATCH 1/2] net: dsa: Add flag for 802.1AD when adding VLAN for dsa switch and port hongbo.wang
2020-07-20 10:41 ` [PATCH 2/2] net: dsa: Set flag for 802.1AD when deleting vlan " hongbo.wang
2020-07-20 10:44 ` Nikolay Aleksandrov [this message]
2020-07-21 3:10 ` [EXT] Re: [PATCH 1/2] net: dsa: Add flag for 802.1AD when adding VLAN " Hongbo Wang
2020-07-21 4:57 ` Florian Fainelli
2020-07-21 6:01 ` [EXT] " Hongbo Wang
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=05b06d46-d705-7d06-b4dd-2bee90f75168@cumulusnetworks.com \
--to=nikolay@cumulusnetworks.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=alexandru.marginean@nxp.com \
--cc=allan.nielsen@microchip.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=hongbo.wang@nxp.com \
--cc=horatiu.vultur@microchip.com \
--cc=idosch@idosch.org \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=leoyang.li@nxp.com \
--cc=linux-devel@linux.nxdi.nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingkai.hu@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=po.liu@nxp.com \
--cc=roopa@cumulusnetworks.com \
--cc=vinicius.gomes@intel.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.com \
--cc=xiaoliang.yang_1@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).