xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Intel 10G 2P X520 Adapter doesn't receive anything with AF XDP
@ 2020-06-04 19:25 Gaul, Maximilian
  2020-06-04 20:06 ` AW: " Gaul, Maximilian
  0 siblings, 1 reply; 2+ messages in thread
From: Gaul, Maximilian @ 2020-06-04 19:25 UTC (permalink / raw)
  To: Xdp

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* AW: Intel 10G 2P X520 Adapter doesn't receive anything with AF XDP
  2020-06-04 19:25 Intel 10G 2P X520 Adapter doesn't receive anything with AF XDP Gaul, Maximilian
@ 2020-06-04 20:06 ` Gaul, Maximilian
  0 siblings, 0 replies; 2+ messages in thread
From: Gaul, Maximilian @ 2020-06-04 20:06 UTC (permalink / raw)
  To: Xdp

> Best regards
> 
> Max

A small update. I disabled the ethtool ntuple rule which steers the multicast packets to a specific RX-Queue and let the program run for 2 minutes.
After 2 minutes or so I looked at the BPF map again and saw this:

		$ sudo bpftool map dump id 41
		key: 00 00 00 00  value: eb 00 00 00 00 00 00 00
		key: 01 00 00 00  value: 6b 00 00 00 00 00 00 00
		key: 02 00 00 00  value: 18 00 00 00 00 00 00 00
		key: 03 00 00 00  value: 01 00 00 00 00 00 00 00
		key: 04 00 00 00  value: 17 00 00 00 00 00 00 00
		key: 05 00 00 00  value: 3a 00 00 00 00 00 00 00
		key: 06 00 00 00  value: 65 00 00 00 00 00 00 00
		key: 07 00 00 00  value: 3c 7a 89 01 00 00 00 00
		key: 08 00 00 00  value: 02 00 00 00 00 00 00 00
		key: 09 00 00 00  value: 12 00 00 00 00 00 00 00
		key: 0a 00 00 00  value: 55 00 00 00 00 00 00 00
		key: 0b 00 00 00  value: 14 00 00 00 00 00 00 00
		key: 0c 00 00 00  value: 2c 00 00 00 00 00 00 00
		key: 0d 00 00 00  value: 00 00 00 00 00 00 00 00
		key: 0e 00 00 00  value: 1b 00 00 00 00 00 00 00

As you can see, the multicast stream is probably landing on RX-Queue 7 (unfortunately my XSK-Program is waiting for packets on RX-Queue 0) but somehow delayed for 1 or 2 minutes.

In case I enable ntuple via

                 ethtool -K eth5 ntuple on

and add the ethtool ntuple rule back, wait for 2 minutes again, I get this:

		$ sudo bpftool map dump id 46
		key: 00 00 00 00  value: 6f 16 00 00 00 00 00 00
		key: 01 00 00 00  value: 43 00 00 00 00 00 00 00
		key: 02 00 00 00  value: 0d 00 00 00 00 00 00 00
		key: 03 00 00 00  value: 00 00 00 00 00 00 00 00
		key: 04 00 00 00  value: 0e 00 00 00 00 00 00 00
		key: 05 00 00 00  value: 24 00 00 00 00 00 00 00
		key: 06 00 00 00  value: 34 00 00 00 00 00 00 00
		key: 07 00 00 00  value: 7d 05 00 00 00 00 00 00
		key: 08 00 00 00  value: 01 00 00 00 00 00 00 00
		key: 09 00 00 00  value: 0a 00 00 00 00 00 00 00
		key: 0a 00 00 00  value: 30 00 00 00 00 00 00 00
		key: 0b 00 00 00  value: 0e 00 00 00 00 00 00 00
		key: 0c 00 00 00  value: 1b 00 00 00 00 00 00 00
		key: 0d 00 00 00  value: 00 00 00 00 00 00 00 00
		key: 0e 00 00 00  value: 0a 00 00 00 00 00 00 00

As you can see, no indicator for a multicast stream with lots of packets :(

Something is wrong here...

    

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-04 20:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-04 19:25 Intel 10G 2P X520 Adapter doesn't receive anything with AF XDP Gaul, Maximilian
2020-06-04 20:06 ` AW: " Gaul, Maximilian

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).