xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Gaul, Maximilian" <maximilian.gaul@hm.edu>
To: Xdp <xdp-newbies@vger.kernel.org>
Subject: Intel 10G 2P X520 Adapter doesn't receive anything with AF XDP
Date: Thu, 4 Jun 2020 19:25:23 +0000	[thread overview]
Message-ID: <7ec53b8f30524ffba36bb264c6d023fc@hm.edu> (raw)

Sorry to ask another question but I don't get this working.

I have this AF_XDP test program which creates an ordinary SOCK_RAW socket and adds a multicast address to it via IP_ADD_MEMBERSHIP.
Then it loads a BPF program and launches an AF_XDP socket which then processes packets of that multicast.

This works fine on my Mellanox ConnectX5 card, but it doesn't work on my Intel 10G 2P X520 (Kernel 5.6.0 and driver ixgbe 5.1.0-k).
I have an array map in the BPF program which counts the amount of packets received on each RX-Queue:

		SEC("xdp_sock") int xdp_sock_prog(struct xdp_md *ctx) {

			const void *data = (void*)(unsigned long)ctx->data;
			const void *data_end = (void*)(unsigned long)ctx->data_end;
			const int rx_queue_idx = ctx->rx_queue_index;

			const struct ethhdr *eth = (struct ethhdr*)(data);

			unsigned long *idx_counter = bpf_map_lookup_elem(&rx_queue_pckt_counter_map, &rx_queue_idx);
			if(idx_counter != NULL) {
				*idx_counter += 1;
			}

I can then look at this map via bpftool. What I found is that almost no packets are received: only like 4 packets on RX-Queues 1, 2, 3, 4 which I assume are random pings in the network or something but nothing significant (the multicast stream would have a packet rate of 270k pps).

The strange thing now is that everything works fine if I just use that generic Linux socket to receive the packets (without any XDP / AF_XDP / BPF involved).

Any ideas why that is?

Best regards

Max

             reply	other threads:[~2020-06-04 19:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 19:25 Gaul, Maximilian [this message]
2020-06-04 20:06 ` AW: Intel 10G 2P X520 Adapter doesn't receive anything with AF XDP Gaul, Maximilian

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=7ec53b8f30524ffba36bb264c6d023fc@hm.edu \
    --to=maximilian.gaul@hm.edu \
    --cc=xdp-newbies@vger.kernel.org \
    /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).