On Sat, May 30, 2020 at 12:51 AM Lu Fengqi wrote:
>
> Hello,
>
> I encountered a reproducible NULL pointer dereference using the mainline
> kernel v5.7-rc7-44-g75caf310d16c(which also happened multiple times on
> 5.6.14). The machine is installed with archlinux, used as a kubernetes
> v1.18.3 node
Hi,
I am doing some XDP testing on a dual socket, combined 40 core machine
with ixgbe. I have found that with the default settings, depending on
which core a packet is received on, the xdp tx queue will hang with:
ixgbe :01:00.0 eno1: Detected Tx Unit Hang (XDP)
Tx Queue <38
Hi netdev,
I was using the new xdp support in virtio to test some idea that I have,
and am seeing the WARN_ON_ONCE in the end of this email when I add the
first xdp program. After this, the VM seems to operate just fine.
I know that y'all were testing with a particular qemu command line,
which I
p prog")
> Signed-off-by: Sabrina Dubroca
Reviewed-by: Brenden Blanco
> ---
> net/core/rtnetlink.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
> index 5aeb61aadd32..5b4c3ba507d0 100644
&g
On Wed, Nov 09, 2016 at 10:57:32AM +0100, Daniel Borkmann wrote:
> On 11/09/2016 10:45 AM, Zhiyi Sun wrote:
> >On Wed, Nov 09, 2016 at 10:05:31AM +0100, Daniel Borkmann wrote:
> >>On 11/09/2016 08:35 AM, Zhiyi Sun wrote:
> >>>There are rx_ring_num queues. Each queue will load xdp prog. So
> >>>bpf_
On Tue, Nov 01, 2016 at 01:36:26PM +0200, Tariq Toukan wrote:
> XDP statistics are reported in ethtool as follows:
> - xdp_drop: the number of packets dropped by xdp.
> - xdp_tx: the number of packets forwarded by xdp.
> - xdp_tx_full: the number of times an xdp forward failed
> due to a full
On Thu, Oct 27, 2016 at 06:07:02PM -0700, Alexei Starovoitov wrote:
> On Thu, Oct 27, 2016 at 05:52:04PM +0300, Tariq Toukan wrote:
> > Separately manage the two types of TX rings: regular ones, and XDP.
> > Upon an XDP set, do not borrow regular TX rings and convert them
> > into XDP ones, but all
u3 (48 % 9 == 3).
Resolve this discrepancy by shifting the irq for the xdp tx queues to
start again from 0, modulo rx_ring_num.
Fixes: 9ecc2d86171a ("net/mlx4_en: add xdp forwarding and data write support")
Reported-by: Jesper Dangaard Brouer
Signed-off-by: Brenden Blanco
---
drivers/n
On Sun, Sep 18, 2016 at 07:59:43PM -0400, Brenden Blanco wrote:
> On Fri, Sep 16, 2016 at 09:24:43PM +0200, Jesper Dangaard Brouer wrote:
> > On Fri, 16 Sep 2016 12:17:27 -0700
> > Brenden Blanco wrote:
> >
> > > On Fri, Sep 16, 2016 at 09:03:40PM +0200, Jesper Dan
On Fri, Sep 16, 2016 at 09:24:43PM +0200, Jesper Dangaard Brouer wrote:
> On Fri, 16 Sep 2016 12:17:27 -0700
> Brenden Blanco wrote:
>
> > On Fri, Sep 16, 2016 at 09:03:40PM +0200, Jesper Dangaard Brouer wrote:
> > > Hi Brenden,
> > >
> > > I've
u'll only save a handful of page_put's. The code to do so
wouldn't have been pretty.
Reviewed-by: Brenden Blanco
On Fri, Sep 16, 2016 at 09:03:40PM +0200, Jesper Dangaard Brouer wrote:
> Hi Brenden,
>
> I've discovered a bug with XDP_TX recycling of pages in the mlx4 driver.
>
> If I increase the number of RX and TX queues/channels via ethtool cmd:
> ethtool -L mlx4p1 rx 10 tx 10
>
> Then when running the
On Thu, Sep 15, 2016 at 08:14:02PM +0200, Jesper Dangaard Brouer wrote:
> Hi Brenden,
>
> I don't quite understand the semantics of the XDP userspace interface.
>
> We allow XDP programs to be (unconditionally) exchanged by another
> program, this avoids taking the link down+up and avoids realloc
icit mutex lock around rcu_assign instead of xchg loop.
Fixes: d576acf0a22 ("net/mlx4_en: add page recycle to prepare rx ring for tx
support")
Acked-by: Daniel Borkmann
Acked-by: Alexei Starovoitov
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 13 ++
On Mon, Aug 29, 2016 at 10:46:38AM -0700, Tom Herbert wrote:
[...]
> Brenden, tracking down how the structure is freed needed a few steps,
> please make sure the RCU requirements are well documented. Also, I'm
Really? It's just bpf_prog_put->call_rcu(__bpf_prog_put_rcu). I suppose
what's missing is
On Fri, Sep 02, 2016 at 01:59:40AM +0300, Saeed Mahameed wrote:
> On Wed, Aug 31, 2016 at 4:50 AM, Brenden Blanco wrote:
> > On Tue, Aug 30, 2016 at 12:35:58PM +0300, Saeed Mahameed wrote:
[...]
> >> Sorry folks I am with Tariq on this, you can't just add a single
> &g
On Thu, Sep 01, 2016 at 04:30:28PM -0700, Tom Herbert wrote:
[...]
> > Yep, but this is an unlikely condition and the critical code here is
> > much smaller and it is more clear that the rcu_read_lock here meant to
> > protect the ring->xdp_prog under this small xdp critical section in
> > comparis
On Tue, Aug 30, 2016 at 12:35:58PM +0300, Saeed Mahameed wrote:
> On Mon, Aug 29, 2016 at 8:46 PM, Tom Herbert wrote:
> > On Mon, Aug 29, 2016 at 8:55 AM, Brenden Blanco
> > wrote:
> >> On Mon, Aug 29, 2016 at 05:59:26PM +0300, Tariq Toukan wrote:
> >>>
On Mon, Aug 29, 2016 at 05:59:26PM +0300, Tariq Toukan wrote:
> Hi Brenden,
>
> The solution direction should be XDP specific that does not hurt the
> regular flow.
An rcu_read_lock is _already_ taken for _every_ packet. This is 1/64th of
that.
>
> On 26/08/2016 11:38 PM, Br
On Fri, Aug 26, 2016 at 01:38:08PM -0700, Brenden Blanco wrote:
> Depending on the preempt mode, the bpf_prog stored in xdp_prog may be
> freed despite the use of call_rcu inside bpf_prog_put. The situation is
> possible when running in PREEMPT_RCU=y mode, for instance, since the rcu
&
d for every packet
from netif_receive_skb_internal, so the napi poll call's rcu_read_lock
is easily amortized.
Fixes: d576acf0a22 ("net/mlx4_en: add page recycle to prepare rx ring for tx
support")
Acked-by: Daniel Borkmann
Acked-by: Alexei Starovoitov
Signed-off-by: Brenden Blan
On Wed, Aug 03, 2016 at 10:29:58AM -0700, Tom Herbert wrote:
> On Wed, Aug 3, 2016 at 10:11 AM, Alexei Starovoitov
> wrote:
> > On Wed, Aug 03, 2016 at 10:01:54AM -0700, Tom Herbert wrote:
> >> On Tue, Jul 19, 2016 at 12:16 PM, Brenden Blanco
> >> wrote:
[...]
&
For consistency, and in order to hint at the synchronous nature of the
xdp_prog field, use READ_ONCE in the destroy path of the ring. All
occurrences should now use either READ_ONCE or xchg.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 6 --
1 file changed
The naming choice of index is not terribly descriptive, and dropcnt is
in fact incorrect for xdp2. Pick better names for these: ipproto and
rxcnt.
Signed-off-by: Brenden Blanco
---
samples/bpf/xdp1_kern.c | 12 ++--
samples/bpf/xdp2_kern.c | 14 +++---
2 files changed, 13
The IFLA_XDP_ATTACHED nested attribute is meant for read-only, and while
do_setlink properly ignores it, it should be more paranoid and reject
commands that try to set it.
Signed-off-by: Brenden Blanco
---
net/core/rtnetlink.c | 4
1 file changed, 4 insertions(+)
diff --git a/net/core
This addresses several of the non-blocking comments left over from the
xdp patch set. See individual patches for details.
Brenden Blanco (3):
net/mlx4_en: use READ_ONCE when freeing xdp_prog
rtnl: protect do_setlink from IFLA_XDP_ATTACHED
bpf: make xdp sample variable names more meaningful
On Tue, Jul 19, 2016 at 03:05:37PM -0700, Alexei Starovoitov wrote:
> On Tue, Jul 19, 2016 at 12:16:57PM -0700, Brenden Blanco wrote:
> > Add a sample that rewrites and forwards packets out on the same
> > interface. Observed single core forwarding performance of ~10Mpps.
> >
On Wed, Jul 20, 2016 at 10:38:49AM +0200, Daniel Borkmann wrote:
> On 07/19/2016 09:16 PM, Brenden Blanco wrote:
> >Sets the bpf program represented by fd as an early filter in the rx path
> >of the netdev. The fd must have been created as BPF_PROG_TYPE_XDP.
> >Providing a
On Wed, Jul 20, 2016 at 11:07:57AM +0200, Daniel Borkmann wrote:
> On 07/19/2016 09:16 PM, Brenden Blanco wrote:
[...]
> >+if (ring->xdp_prog)
> >+bpf_prog_put(ring->xdp_prog);
>
> Would be good if you also make this a READ_ONCE() here. I believe this
bpf program")
Reported-by: kbuild test robot
Reported-by: Tariq Toukan
Signed-off-by: Brenden Blanco
---
include/linux/bpf.h | 4
1 file changed, 4 insertions(+)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 75a5ae6..36da074 100644
--- a/include/linux/bpf.h
+++ b/incl
On Wed, Jul 20, 2016 at 12:18:49PM +0300, Tariq Toukan wrote:
>
> On 20/07/2016 8:09 AM, David Miller wrote:
> >From: Brenden Blanco
> >Date: Tue, 19 Jul 2016 12:16:45 -0700
> >
> >>This patch set introduces new infrastructure for programmatically
> >>pr
Add a sample program that only drops packets at the BPF_PROG_TYPE_XDP_RX
hook of a link. With the drop-only program, observed single core rate is
~20Mpps.
Other tests were run, for instance without the dropcnt increment or
without reading from the packet header, the packet rate was mostly
unchange
that granularity through any ndo.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 60 ++
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 40 +++--
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 6 +++
3 files changed, 102
dma sync just before invoking prog
Check for explicit bpf return code rather than nonzero
Remove increment of rx_dropped
5/5: Use explicit bpf return code in example
Update commit log with higher pps numbers
Brenden Blanco (12):
bpf: add bpf_prog_add api for bulk prog refcnt
bpf:
A subsystem may need to store many copies of a bpf program, each
deserving its own reference. Rather than requiring the caller to loop
one by one (with possible mid-loop failure), add a bulk bpf_prog_add
api.
Signed-off-by: Brenden Blanco
---
include/linux/bpf.h | 1 +
kernel/bpf/syscall.c
XDP enabled drivers must transmit received packets back out on the same
port they were received on when a program returns this action.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/bpf.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux
] bpf_map_lookup_elem
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 38 +-
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 70 +++---
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 11 +++-
3 files changed, 109 insertions
whether the program is valid on the link or not.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/if_link.h | 12 +
net/core/rtnetlink.c | 64
2 files changed, 76 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi
XDP_ABORTED.
Signed-off-by: Brenden Blanco
---
include/linux/filter.h | 18 +++
include/uapi/linux/bpf.h | 20
kernel/bpf/verifier.c| 1 +
net/core/filter.c| 79
4 files changed, 118 insertions(+)
diff --git a/include
optionally updated
whenever recycle_ring is activated. By default the original free
function is always initialized.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 9 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 29 +
drivers/net/ethernet/mellanox
For forwarding to be effective, XDP programs should be allowed to
rewrite packet data.
This requires that the drivers supporting XDP must all map the packet
memory as TODEVICE or BIDIRECTIONAL before invoking the program.
Signed-off-by: Brenden Blanco
---
kernel/bpf/verifier.c | 17
Add one new netdev op for drivers implementing the BPF_PROG_TYPE_XDP
filter. The single op is used for both setup/query of the xdp program,
modelled after ndo_setup_tc.
Signed-off-by: Brenden Blanco
---
include/linux/netdevice.h | 34 ++
net/core/dev.c
In preparation for writing the tx descriptor from multiple functions,
create a helper for both normal and blueflame access.
Signed-off-by: Brenden Blanco
---
drivers/infiniband/hw/mlx4/qp.c| 11 +--
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 134
are likely occurring due to cache misses.
Signed-off-by: Brenden Blanco
---
samples/bpf/Makefile| 5 +++
samples/bpf/xdp2_kern.c | 114
2 files changed, 119 insertions(+)
create mode 100644 samples/bpf/xdp2_kern.c
diff --git a/samples/bpf
On Tue, Jul 19, 2016 at 04:33:28PM +0300, Tariq Toukan wrote:
[...]
> >So, I took Dave's suggestion to heart, and spent the last 2 days seeing
> >what was possible to implement with just xdp as the focus, rather than
> >an overall cleanup which Tariq will be looking at.
> >
> >Unfortunately, this t
On Mon, Jul 18, 2016 at 01:39:02PM +0200, Tom Herbert wrote:
> On Mon, Jul 18, 2016 at 11:10 AM, Thomas Graf wrote:
> > On 07/15/16 at 10:49am, Tom Herbert wrote:
[...]
> >> To me, an XDP program is just another attribute of an RX queue, it's
> >> really not special!. We already have a very good i
On Mon, Jul 18, 2016 at 09:38:28AM -0700, Brenden Blanco wrote:
> On Mon, Jul 18, 2016 at 04:39:38PM +0300, Tariq Toukan wrote:
> > After applying the patchset, I get no ping between two VLAN
> > interfaces (w/o activating any BPF program).
> > I'm debugging it, and will
On Mon, Jul 18, 2016 at 04:39:38PM +0300, Tariq Toukan wrote:
> After applying the patchset, I get no ping between two VLAN
> interfaces (w/o activating any BPF program).
> I'm debugging it, and will update once I find the bug.
>
> Brenden, please check if you can repro the issue.
I was able to re
are likely occurring due to cache misses.
Signed-off-by: Brenden Blanco
---
samples/bpf/Makefile| 5 +++
samples/bpf/xdp2_kern.c | 114
2 files changed, 119 insertions(+)
create mode 100644 samples/bpf/xdp2_kern.c
diff --git a/samples/bpf
For forwarding to be effective, XDP programs should be allowed to
rewrite packet data.
This requires that the drivers supporting XDP must all map the packet
memory as TODEVICE or BIDIRECTIONAL before invoking the program.
Signed-off-by: Brenden Blanco
---
kernel/bpf/verifier.c | 17
optionally updated
whenever recycle_ring is activated. By default the original free
function is always initialized.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 9 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 34 ++
drivers/net/ethernet
] bpf_map_lookup_elem
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 35 +++--
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 70 +++---
drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | 11 +++-
3 files changed, 104 insertions
whether the program is valid on the link or not.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/if_link.h | 12 +
net/core/rtnetlink.c | 64
2 files changed, 76 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi
Add a sample program that only drops packets at the BPF_PROG_TYPE_XDP_RX
hook of a link. With the drop-only program, observed single core rate is
~20Mpps.
Other tests were run, for instance without the dropcnt increment or
without reading from the packet header, the packet rate was mostly
unchange
XDP enabled drivers must transmit received packets back out on the same
port they were received on when a program returns this action.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/bpf.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux
In preparation for writing the tx descriptor from multiple functions,
create a helper for both normal and blueflame access.
Signed-off-by: Brenden Blanco
---
drivers/infiniband/hw/mlx4/qp.c| 11 +--
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 127
allocating an skb.
Therefore, disallow MTU settings that would produce a multi-fragment
packet that XDP programs would fail to access. Future enhancements could
be done to increase the allowable MTU.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 51
Add one new netdev op for drivers implementing the BPF_PROG_TYPE_XDP
filter. The single op is used for both setup/query of the xdp program,
modelled after ndo_setup_tc.
Signed-off-by: Brenden Blanco
---
include/linux/netdevice.h | 34 ++
net/core/dev.c
t;num_frags > 1
Rename pseudo_skb to bpf_phys_dev_md
Implement ndo_bpf_get
Add dma sync just before invoking prog
Check for explicit bpf return code rather than nonzero
Remove increment of rx_dropped
5/5: Use explicit bpf return code in example
Update commit log with highe
XDP_ABORTED.
Signed-off-by: Brenden Blanco
---
include/linux/filter.h | 18 +++
include/uapi/linux/bpf.h | 20
kernel/bpf/verifier.c| 1 +
net/core/filter.c| 79
4 files changed, 118 insertions(+)
diff --git a/include
On Wed, Jul 13, 2016 at 08:40:59AM -0700, Brenden Blanco wrote:
> On Wed, Jul 13, 2016 at 10:17:26AM +0300, Tariq Toukan wrote:
> >
> > On 13/07/2016 3:54 AM, Brenden Blanco wrote:
> > >On Tue, Jul 12, 2016 at 02:18:32PM -0700, David Miller wrote:
> > >>From:
On Wed, Jul 13, 2016 at 06:25:28PM +0300, Saeed Mahameed wrote:
> On Tue, Jul 12, 2016 at 12:29 AM, Brenden Blanco wrote:
> > A user will now be able to loop packets back out of the same port using
> > a bpf program attached to xdp hook. Updates to the packet contents from
> &g
On Wed, Jul 13, 2016 at 10:17:26AM +0300, Tariq Toukan wrote:
>
> On 13/07/2016 3:54 AM, Brenden Blanco wrote:
> >On Tue, Jul 12, 2016 at 02:18:32PM -0700, David Miller wrote:
> >>From: Brenden Blanco
> >>Date: Tue, 12 Jul 2016 00:51:29 -0700
> >&
On Wed, Jul 13, 2016 at 11:27:23AM +, David Laight wrote:
> From: Brenden Blanco
> > Sent: 12 July 2016 08:51
> > Add support for the BPF_PROG_TYPE_XDP hook in mlx4 driver.
> >
> > In tc/socket bpf programs, helpers linearize skb fragments as needed
> > wh
On Tue, Jul 12, 2016 at 02:18:32PM -0700, David Miller wrote:
> From: Brenden Blanco
> Date: Tue, 12 Jul 2016 00:51:29 -0700
>
> > + mlx4_en_free_resources(priv);
> > +
> > old_prog = xchg(&priv->prog, prog);
> > if (old_pro
On Mon, Jul 11, 2016 at 11:17:00PM -0700, David Miller wrote:
> From: Brenden Blanco
> Date: Mon, 11 Jul 2016 14:29:51 -0700
>
> > + if (priv->num_frags > 1)
> > + return -EOPNOTSUPP;
>
> I hate to be the user who has to debug why his XDP program w
whether the program is valid on the link or not.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/if_link.h | 12 +
net/core/rtnetlink.c | 64
2 files changed, 76 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi
For forwarding to be effective, XDP programs should be allowed to
rewrite packet data.
This requires that the drivers supporting XDP must all map the packet
memory as TODEVICE or BIDIRECTIONAL before invoking the program.
Signed-off-by: Brenden Blanco
---
kernel/bpf/verifier.c | 17
allocating an skb.
Therefore, disallow MTU settings that would produce a multi-fragment
packet that XDP programs would fail to access. Future enhancements could
be done to increase the allowable MTU.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 51
XDP_ABORTED.
Signed-off-by: Brenden Blanco
---
include/linux/filter.h | 18 +++
include/uapi/linux/bpf.h | 20
kernel/bpf/verifier.c| 1 +
net/core/filter.c| 79
4 files changed, 118 insertions(+)
diff --git a/include
tx completion, this dedicated tx ring recycles pages without
unmapping directly back to the original rx ring. In steady state tx/drop
workload, effectively 0 page allocs/frees will occur.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 15 ++-
drivers/net
are likely occurring due to cache misses.
Signed-off-by: Brenden Blanco
---
samples/bpf/Makefile| 5 +++
samples/bpf/xdp2_kern.c | 114
2 files changed, 119 insertions(+)
create mode 100644 samples/bpf/xdp2_kern.c
diff --git a/samples/bpf
XDP enabled drivers must transmit received packets back out on the same
port they were received on when a program returns this action.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/bpf.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux
In preparation for writing the tx descriptor from multiple functions,
create a helper for both normal and blueflame access.
Signed-off-by: Brenden Blanco
---
drivers/infiniband/hw/mlx4/qp.c| 11 +--
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 127
Add a sample program that only drops packets at the BPF_PROG_TYPE_XDP_RX
hook of a link. With the drop-only program, observed single core rate is
~20Mpps.
Other tests were run, for instance without the dropcnt increment or
without reading from the packet header, the packet rate was mostly
unchange
] bpf_map_lookup_elem
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 46 +++--
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 69 ++---
drivers/net/ethernet/mellanox
Add one new netdev op for drivers implementing the BPF_PROG_TYPE_XDP
filter. The single op is used for both setup/query of the xdp program,
modelled after ndo_setup_tc.
Signed-off-by: Brenden Blanco
---
include/linux/netdevice.h | 34 ++
net/core/dev.c
le
Update commit log with higher pps numbers
Brenden Blanco (11):
bpf: add XDP prog type for early driver filter
net: add ndo to setup/query xdp prog in adapter rx
rtnl: add option for setting link xdp prog
net/mlx4_en: add support for fast rx drop bpf program
Add sample for adding simp
On Mon, Jul 11, 2016 at 11:12:24PM -0700, David Miller wrote:
> From: Brenden Blanco
> Date: Mon, 11 Jul 2016 14:29:49 -0700
>
> > + if (fd >= 0) {
> > + prog = bpf_prog_get_type(fd, BPF_PROG_TYPE_XDP);
> > + if (IS_ERR(prog))
> > +
On Mon, Jul 11, 2016 at 11:02:54PM -0700, David Miller wrote:
> From: Brenden Blanco
> Date: Mon, 11 Jul 2016 14:29:48 -0700
>
> > + WARN_ONCE(1, "\n"
> > +"*\n"
> > +
On Tue, Jul 12, 2016 at 12:53:34AM +0300, Or Gerlitz wrote:
> On Tue, Jul 12, 2016 at 12:29 AM, Brenden Blanco wrote:
>
> > v7:
> [...]
> > TODOs:
> > Add ethtool per-ring stats for aborted, default cases, maybe even drop
> > and tx as well.
>
> ple
On Mon, Jul 11, 2016 at 02:48:17PM +0300, Saeed Mahameed wrote:
[...]
>
> yes, we need something like:
>
> +static inline void
> +mlx4_en_sync_dma(struct mlx4_en_priv *priv,
> +struct mlx4_en_rx_desc *rx_desc,
> +int length)
> +{
> + dma_addr_t dma;
> +
> +
Add one new netdev op for drivers implementing the BPF_PROG_TYPE_XDP
filter. The single op is used for both setup/query of the xdp program,
modelled after ndo_setup_tc.
Signed-off-by: Brenden Blanco
---
include/linux/netdevice.h | 32
net/core/dev.c
whether the program is valid on the link or not.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/if_link.h | 12 +
net/core/rtnetlink.c | 64
2 files changed, 76 insertions(+)
diff --git a/include/uapi/linux/if_link.h b/include/uapi
allocating an skb.
Therefore, disallow MTU settings that would produce a multi-fragment
packet that XDP programs would fail to access. Future enhancements could
be done to increase the allowable MTU.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 49
] bpf_map_lookup_elem
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 2 +-
drivers/net/ethernet/mellanox/mlx4/en_netdev.c | 46 +++--
drivers/net/ethernet/mellanox/mlx4/en_rx.c | 69 ++---
drivers/net/ethernet/mellanox
For forwarding to be effective, XDP programs should be allowed to
rewrite packet data.
This requires that the drivers supporting XDP must all map the packet
memory as TODEVICE or BIDIRECTIONAL before invoking the program.
Signed-off-by: Brenden Blanco
---
kernel/bpf/verifier.c | 17
XDP enabled drivers must transmit received packets back out on the same
port they were received on when a program returns this action.
Signed-off-by: Brenden Blanco
---
include/uapi/linux/bpf.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux
are likely occurring due to cache misses.
Signed-off-by: Brenden Blanco
---
samples/bpf/Makefile| 5 +++
samples/bpf/xdp2_kern.c | 114
2 files changed, 119 insertions(+)
create mode 100644 samples/bpf/xdp2_kern.c
diff --git a/samples/bpf
In preparation for writing the tx descriptor from multiple functions,
create a helper for both normal and blueflame access.
Signed-off-by: Brenden Blanco
---
drivers/infiniband/hw/mlx4/qp.c| 11 +--
drivers/net/ethernet/mellanox/mlx4/en_tx.c | 127
5/5: Use explicit bpf return code in example
Update commit log with higher pps numbers
Brenden Blanco (11):
bpf: add XDP prog type for early driver filter
net: add ndo to setup/query xdp prog in adapter rx
rtnl: add option for setting link xdp prog
net/mlx4_en: add support for fast rx
Add a sample program that only drops packets at the BPF_PROG_TYPE_XDP_RX
hook of a link. With the drop-only program, observed single core rate is
~20Mpps.
Other tests were run, for instance without the dropcnt increment or
without reading from the packet header, the packet rate was mostly
unchange
tx completion, this dedicated tx ring recycles pages without
unmapping directly back to the original rx ring. In steady state tx/drop
workload, effectively 0 page allocs/frees will occur.
Signed-off-by: Brenden Blanco
---
drivers/net/ethernet/mellanox/mlx4/en_ethtool.c | 15 ++-
drivers/net
XDP_ABORTED.
Signed-off-by: Brenden Blanco
---
include/linux/filter.h | 18 ++
include/uapi/linux/bpf.h | 20 +++
kernel/bpf/verifier.c| 1 +
net/core/filter.c| 91
4 files changed, 130 insertions(+)
diff --git a/include/linux
On Sun, Jul 10, 2016 at 03:56:02PM -0500, Tom Herbert wrote:
> On Thu, Jul 7, 2016 at 9:15 PM, Brenden Blanco wrote:
> > Add a new bpf prog type that is intended to run in early stages of the
> > packet rx path. Only minimal packet metadata will be available, hence a
> > new
On Mon, Jul 11, 2016 at 01:09:22PM +0200, Jesper Dangaard Brouer wrote:
[...]
> This patch is based on top of Brenden's patch 11/12, and is mean to
> replace patch 12/12.
>
> Prefetching is very important for XDP, especially when using a CPU
> without DDIO (here i7-4790K CPU @ 4.00GHz).
>
> Progr
On Sun, Jul 10, 2016 at 03:37:31PM +0200, Jesper Dangaard Brouer wrote:
> On Sat, 9 Jul 2016 08:47:52 -0500
> Tom Herbert wrote:
>
> > On Sat, Jul 9, 2016 at 3:14 AM, Jesper Dangaard Brouer
> > wrote:
> > > On Thu, 7 Jul 2016 19:15:13 -0700
> > > Brenden
On Sun, Jul 10, 2016 at 06:25:40PM +0300, Tariq Toukan wrote:
>
> On 09/07/2016 10:58 PM, Saeed Mahameed wrote:
> >On Fri, Jul 8, 2016 at 5:15 AM, Brenden Blanco wrote:
> >>+ /* A bpf program gets first chance to drop the packet. It
> >>may
> &g
On Sat, Jul 09, 2016 at 05:07:36PM +0300, Or Gerlitz wrote:
> On Fri, Jul 8, 2016 at 5:15 AM, Brenden Blanco wrote:
> > Add support for the BPF_PROG_TYPE_XDP hook in mlx4 driver.
> >
> > In tc/socket bpf programs, helpers linearize skb fragments as needed
> > when th
On Fri, Jul 08, 2016 at 08:56:45AM +0200, Eric Dumazet wrote:
> On Thu, 2016-07-07 at 21:16 -0700, Alexei Starovoitov wrote:
>
> > I've tried this style of prefetching in the past for normal stack
> > and it didn't help at all.
>
> This is very nice, but my experience showed opposite numbers.
> S
1 - 100 of 147 matches
Mail list logo