All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gaul, Maximilian" <maximilian.gaul@hm.edu>
To: Xdp <xdp-newbies@vger.kernel.org>
Subject: Is there a problem with UDP-packets of size 371 bytes and less?
Date: Fri, 20 Mar 2020 17:54:17 +0000	[thread overview]
Message-ID: <f9c9f8d39ddf4f6ba915b3e6e087c63c@hm.edu> (raw)

This question is related to: https://marc.info/?l=xdp-newbies&m=158462735008364&w=2

Is there a known (or maybe unknown) bug regarding the size of packets in the AF-XDP socket framework (+ libbpf)?

I am experiencing a strange packet loss for my application:

IPv4/UDP/RTP packet stream with all packets being the same size (1442 bytes): no packet loss
IPv4/UDP/RTP packet stream where pretty much all packets are the same size (1492 bytes) except a special "marker" packet (only 357 bytes but they are also IPv4/UDP-packets): all marker packets get lost
I added a bpf_printk statement in my XDP-Kernelprogram for further validation:

const int len = bpf_ntohs(iph->tot_len);
if(len < 400) {
    bpf_printk("FOUND PACKET LEN < 400: %d.\n", len);
}

This output is never observed via *cat /sys/kernel/debug/tracing/trace_pipe*. So these small RTP-marker packets aren't even received by my kernel filter - no wonder why I don't receive them in userspace.

ethtool -S <if> shows me this number: rx_256_to_511_bytes_phy. This number is increasing in a similar rate as marker-packets should come in (about 30/s). So this means that my NIC does receive the packets (and so does a generic Linux socket), but my XDP-program doesn't - why?

I made further testing with *nping* which is able to generate packets with arbitrary sizes:

nping --udp -p <port> --dest-ip <ip> --data-length 372 -c 50000000 --rate 250 -N

Packets of size *372 bytes* are received but anything less is not received (ordinary linux socket does receive those packets as I said though).

The only idea that came to my mind was UMEM chunk size alignment related (option *XDP_UMEM_UNALIGNED_CHUNK_FLAG* with *MAP_HUGETLB*) - but this didn't change anything (I also don't know if changing UMEM-settings changes anything on the XDP-Kernelside).

Any idea what could be the cause of this problem?

                 reply	other threads:[~2020-03-20 17:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=f9c9f8d39ddf4f6ba915b3e6e087c63c@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.