Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Andrew Lunn
On Wed, Jan 06, 2021 at 01:32:05PM +0100, Marek Behún wrote: > On Wed, 6 Jan 2021 12:56:08 +0100 > Marek Behún wrote: > > > I also to write a simple NAT masquerading program. I think XDP can > > increase NAT throughput to 2.5gbps as well. > > BTW currently if XDP modifies the packet, it has to m

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Sven Auhagen
On Wed, Jan 06, 2021 at 11:33:50AM +0100, Jesper Dangaard Brouer wrote: > On Tue, 5 Jan 2021 18:43:08 +0100 > Marek Behún wrote: > > > On Tue, 5 Jan 2021 18:24:37 +0100 > > Sven Auhagen wrote: > > > > > On Tue, Jan 05, 2021 at 06:19:21PM +0100, Marek Behún wrote: > > > > Currently mvpp2_xdp_s

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Vladimir Oltean
On Wed, Jan 06, 2021 at 12:56:08PM +0100, Marek Behún wrote: > 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 10

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Marek Behún
On Wed, 6 Jan 2021 13:32:05 +0100 Marek Behún wrote: > On Wed, 6 Jan 2021 12:56:08 +0100 > Marek Behún wrote: > > > I also to write a simple NAT masquerading program. I think XDP can > > increase NAT throughput to 2.5gbps as well. > > BTW currently if XDP modifies the packet, it has to modify

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Marek Behún
On Wed, 6 Jan 2021 12:56:08 +0100 Marek Behún wrote: > I also to write a simple NAT masquerading program. I think XDP can > increase NAT throughput to 2.5gbps as well. BTW currently if XDP modifies the packet, it has to modify the checksums accordingly. There is a helper for that even, bpf_csum_

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Marek Behún
On Tue, 5 Jan 2021 21:23:12 +0100 Andrew Lunn wrote: > > @@ -4913,8 +4914,8 @@ static int mvpp2_xdp_setup(struct mvpp2_port *port, > > struct netdev_bpf *bpf) > > bool running = netif_running(port->dev); > > bool reset = !prog != !port->xdp_prog; > > > > - if (port->dev->mtu > ETH_DA

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Marek Behún
On Tue, 5 Jan 2021 21:21:10 +0100 Andrew Lunn 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 wrote: > > > > > On Tue, Jan 05, 2021 at 06:19:21PM +0100, Marek Behún wrote: > > > > Currently mvpp2_xdp_setup won't al

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-06 Thread Jesper Dangaard Brouer
On Tue, 5 Jan 2021 18:43:08 +0100 Marek Behún wrote: > On Tue, 5 Jan 2021 18:24:37 +0100 > Sven Auhagen 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). > > > > >

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-05 Thread Andrew Lunn
> @@ -4913,8 +4914,8 @@ static int mvpp2_xdp_setup(struct mvpp2_port *port, > struct netdev_bpf *bpf) > bool running = netif_running(port->dev); > bool reset = !prog != !port->xdp_prog; > > - if (port->dev->mtu > ETH_DATA_LEN) { > - NL_SET_ERR_MSG_MOD(bpf->extack, "XD

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-05 Thread Andrew Lunn
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 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). > > >

Re: [PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-05 Thread Marek Behún
On Tue, 5 Jan 2021 18:24:37 +0100 Sven Auhagen 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_PK

[PATCH net-next] net: mvpp2: increase MTU limit when XDP enabled

2021-01-05 Thread Marek Behún
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_B