From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
Cc: Jakub Kicinski <kuba@kernel.org>,
Marcin Wojtas <marcin.s.wojtas@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v0] net: mvpp2: Add parser configuration for DSA tags
Date: Thu, 10 Oct 2024 16:17:11 +0200 [thread overview]
Message-ID: <20241010161711.114370ed@fedora.home> (raw)
In-Reply-To: <20241010015104.1888628-1-aryan.srivastava@alliedtelesis.co.nz>
Hello,
On Thu, 10 Oct 2024 14:51:04 +1300
Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz> wrote:
> Allow the header parser to consider DSA and EDSA tagging. Currently the
> parser is always configured to use the MH tag, but this results in poor
> traffic distribution across queues and sub-optimal performance (in the
> case where DSA or EDSA tags are in the header).
>
> Add mechanism to check for tag type in use and then configure the
> parser correctly for this tag. This results in proper traffic
> distribution and hash calculation.
>
> Signed-off-by: Aryan Srivastava <aryan.srivastava@alliedtelesis.co.nz>
[...]
> static int mvpp2_open(struct net_device *dev)
> {
> struct mvpp2_port *port = netdev_priv(dev);
> @@ -4801,7 +4832,11 @@ static int mvpp2_open(struct net_device *dev)
> netdev_err(dev, "mvpp2_prs_mac_da_accept own addr failed\n");
> return err;
> }
> - err = mvpp2_prs_tag_mode_set(port->priv, port->id, MVPP2_TAG_TYPE_MH);
> +
> + if (netdev_uses_dsa(dev))
> + err = mvpp2_prs_tag_mode_set(port->priv, port->id, mvpp2_get_tag(dev));
> + else
> + err = mvpp2_prs_tag_mode_set(port->priv, port->id, MVPP2_TAG_TYPE_MH);
This could unfortunately break VLAN filtering. If you look at the code
for mvpp2_prs_vid_entry_add() and mvpp2_prs_vid_enable_filtering(), the
value of the tag type set in MVPP2_MH_REG is used to compute the offset
at which the VLAN tag will be located.
It might be possible that users would :
- Enable vlan filtering with :
ethtool -K ethX rx-vlan-filter on
- Add vlan interfaces with :
ip link add link ethX name ethX.Y type vlan id Y
- Set the interface up
ip link set ethX up => triggers a change in the DSA header size register
In that situation, the offset for the VLAN interface ethX.Y's header
will be incorrect, if the DSA tag type gets updated at .open() time.
So I think a solution would be to replace the read from the
MVPP2_MH_REG in the vlan filtering functions with a call your
newly-introduced mvpp2_get_tag, making sure that we use the correct tag
length for these parser entries as well.
Thanks,
Maxime
next prev parent reply other threads:[~2024-10-10 14:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-10 1:51 [PATCH net-next v0] net: mvpp2: Add parser configuration for DSA tags Aryan Srivastava
2024-10-10 14:17 ` Maxime Chevallier [this message]
2025-01-20 23:32 ` Aryan Srivastava
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=20241010161711.114370ed@fedora.home \
--to=maxime.chevallier@bootlin.com \
--cc=aryan.srivastava@alliedtelesis.co.nz \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=marcin.s.wojtas@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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