Commit Graph

14 Commits

Author SHA1 Message Date
Jesper Dangaard Brouer
1bb141e9e3 Extend xdp_hints_rx_time with xdp_rx_cpu
The latency or time-delay between XDP and AF_XDP depend highly
on whether the XDP and AF_XDP runs on same CPU or remote CPU.

Extend xdp_hints_rx_time, without worrying about the layout
as BTF will adjust, so we can determine case of same CPU or
remote CPU.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-19 14:33:58 +01:00
Jesper Dangaard Brouer
de646516c3 AF_XDP-interaction: Shared header for defining MAX_AF_SOCKS
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-12 12:46:11 +01:00
Jesper Dangaard Brouer
f46743a75f AF_XDP-interaction: Enable AF_XDP code that reply to ICMPV6_ECHO_REQUEST
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-04 15:54:21 +01:00
Jesper Dangaard Brouer
173cc762fd AF_XDP-interaction: Let netstack handle ARP and IPv6 NDP
NDP (Neighbor Discovery Protocol)

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-04 15:25:49 +01:00
Jesper Dangaard Brouer
556d6fd47b AF_XDP-interaction: Move refill of fill-queue to after RX processing
The root cause of the slowdown on the first packet with timestamps,
as primary related to refilling the fill-queue, which happend before
process_packet.

Primary cause, as first packet still see a slowdown of around 4 usec
while it was around 9 usec before.

In commit 5df5332f23 ("AF_XDP-interaction: config AF_XDP frame_headroom")
the fill-queue size was increase to be larger.  This caused the
first call to handle_receive_packets() to refill too many frames
into the fill-queue.

Patch split out refill into function restock_receive_fill_queue()
which is now called *after* process_packet step, but before
releasing RX packets via xsk_ring_cons__release(&xsk->rx).

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-04 13:49:20 +01:00
Jesper Dangaard Brouer
5245641946 AF_XDP-interaction: Improve comments explaning attributes
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-02 13:58:39 +01:00
Jesper Dangaard Brouer
c905867f29 AF_XDP-interaction: Make the two meta data types different sizes
On purpose to make it more difficult for userspace side.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-02 12:40:49 +01:00
Jesper Dangaard Brouer
555aec82a7 AF_XDP-interaction: Two meta data structs
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-11-02 10:46:11 +01:00
Jesper Dangaard Brouer
69c0f60008 AF_XDP-interaction: Make BPF-prog BTF aware
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-29 17:54:09 +02:00
Jesper Dangaard Brouer
54d51b06b4 AF_XDP-interaction: Have XDP-prog with something into meta area
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-28 18:45:41 +02:00
Jesper Dangaard Brouer
359cc27c72 AF_XDP-interaction: use bpf_xdp_adjust_meta
This only works in skb-mode, other modes fail the bpf_xdp_adjust_meta
call and result in XDP_ABORTED.  This only occurred on mlx5.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-28 17:42:23 +02:00
Jesper Dangaard Brouer
9e8218556c AF_XDP-interaction: Use new .maps section for BTF aware map definitions
In-practice only 'xdp_stats_map' definition gets associated BTF,
as it uses the proper '__type' construct.

The AF_XDP map BPF_MAP_TYPE_XSKMAP doesn't know about BTF yet.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-28 13:17:33 +02:00
Jesper Dangaard Brouer
0dc1b0eab5 AF_XDP-interaction: Started on newer .maps SEC usage but stopped
Something in fishy as it seems this BPF-object is not getting used.

Use old maps SEC defines until figuring out what is wrong,
but keep new dot-maps defines.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-26 17:00:48 +02:00
Eelco Chaudron
68743eb1d3 AF_XDP-interaction: Import AF_XDP example from XDP-tutorial
https://github.com/xdp-project/xdp-tutorial/blob/master/advanced03-AF_XDP/

Give Eelco Chaudron credit as code Author.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2021-10-15 18:23:42 +02:00