From: "Marek Behún" <kabel@kernel.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Sven Auhagen <sven.auhagen@voleatech.de>,
netdev@vger.kernel.org, davem@davemloft.net,
Jakub Kicinski <kuba@kernel.org>,
Matteo Croce <mcroce@microsoft.com>,
Lorenzo Bianconi <lorenzo@kernel.org>
Subject: Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled
Date: Wed, 6 Jan 2021 12:56:08 +0100 [thread overview]
Message-ID: <20210106125608.5f6fab6f@kernel.org> (raw)
In-Reply-To: <X/TKNlir5Cyimjn3@lunn.ch>
On Tue, 5 Jan 2021 21:21:10 +0100
Andrew Lunn <andrew@lunn.ch> wrote:
> On Tue, Jan 05, 2021 at 06:43:08PM +0100, Marek Behún wrote:
> > On Tue, 5 Jan 2021 18:24:37 +0100
> > Sven Auhagen <sven.auhagen@voleatech.de> wrote:
> >
> > > On Tue, Jan 05, 2021 at 06:19:21PM +0100, Marek Behún wrote:
> > > > Currently mvpp2_xdp_setup won't allow attaching XDP program if
> > > > mtu > ETH_DATA_LEN (1500).
> > > >
> > > > The mvpp2_change_mtu on the other hand checks whether
> > > > MVPP2_RX_PKT_SIZE(mtu) > MVPP2_BM_LONG_PKT_SIZE.
> > > >
> > > > These two checks are semantically different.
> > > >
> > > > Moreover this limit can be increased to MVPP2_MAX_RX_BUF_SIZE, since in
> > > > mvpp2_rx we have
> > > > xdp.data = data + MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM;
> > > > xdp.frame_sz = PAGE_SIZE;
> > > >
> > > > Change the checks to check whether
> > > > mtu > MVPP2_MAX_RX_BUF_SIZE
> > >
> > > Hello Marek,
> > >
> > > in general, XDP is based on the model, that packets are not bigger than 1500.
> > > I am not sure if that has changed, I don't believe Jumbo Frames are upstreamed yet.
> > > You are correct that the MVPP2 driver can handle bigger packets without a problem but
> > > if you do XDP redirect that won't work with other drivers and your packets will disappear.
> >
> > At least 1508 is required when I want to use XDP with a Marvell DSA
> > switch: the DSA header is 4 or 8 bytes long there.
> >
> > The DSA driver increases MTU on CPU switch interface by this length
> > (on my switches to 1504).
> >
> > So without this I cannot use XDP with mvpp2 with a Marvell switch with
> > default settings, which I think is not OK.
>
> Hi Marek
>
> You are running XDP programs on the master interface? So you still
> have the DSA tag? What sort of programs are you running? I guess DOS
> protection could work, once the program understands the DSA tag. To
> forward the frame out another interface you would have to remove the
> tag. Or i suppose you could modify the tag and send it back to the
> switch? Does XDP support that sort of hairpin operation?
>
> Andrew
Andrew,
I am using bpf_fib_lookup to route the packets between switch
interfaces.
Here's the program for Marvell CN9130 CRB
https://blackhole.sk/~kabel/src/xdp_mvswitch_route.c
(This is just to experiment with XDP, so please excuse code quality.)
I found out that on Turris MOX I am able to route 2.5gbps (at MTU 1500)
with XDP. But when not using XDP, when the packets go via kernel's
stack, MOX is able to route less than 1gbps (cca 800mbps, at MTU
1500, and the CPU is at 100%).
I also to write a simple NAT masquerading program. I think XDP can
increase NAT throughput to 2.5gbps as well.
> Or i suppose you could modify the tag and send it back to the
> switch? Does XDP support that sort of hairpin operation?
You can modify the packet, prepend it with another headers (up to 256
bytes in some drivers, in mvpp2 only 224), append trailers... Look at
my program above, I am popping vlan tag, for example.
Marek
next prev parent reply other threads:[~2021-01-06 11:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-05 17:19 [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled Marek Behún
2021-01-05 17:24 ` Sven Auhagen
2021-01-05 17:43 ` Marek Behún
2021-01-05 20:21 ` Andrew Lunn
2021-01-06 11:56 ` Marek Behún [this message]
2021-01-06 12:32 ` Marek Behún
2021-01-06 12:33 ` Marek Behún
2021-01-06 18:34 ` Andrew Lunn
2021-01-06 13:13 ` Vladimir Oltean
2021-01-06 10:33 ` Jesper Dangaard Brouer
2021-01-06 11:28 ` Sven Auhagen
2021-01-05 20:23 ` Andrew Lunn
2021-01-06 12:11 ` Marek Behún
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=20210106125608.5f6fab6f@kernel.org \
--to=kabel@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=lorenzo@kernel.org \
--cc=mcroce@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=sven.auhagen@voleatech.de \
/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).