All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zvi Effron <zeffron@riotgames.com>
To: Xdp <xdp-newbies@vger.kernel.org>
Subject: Dropped packets mapping IRQs for adjusted queue counts on i40e
Date: Fri, 30 Apr 2021 17:45:19 -0700	[thread overview]
Message-ID: <CAC1LvL1NHj6n+RNYRmja2YDhkcCwREuhjaBz_k255rU1jdO8Sw@mail.gmail.com> (raw)

Hi-ho, friends!

I'm trying to tune network queues so that there's one queue per core,
as recommended in many, many places. I've noticed that if I adjust the
number of queues from the default AND adjust the IRQ affinities, then
I get some percentage (varying from a small percent to 100%, seemingly
proportional to the number of reduced queues) of packets not making it
through.

For my setup, I have a single 36 core Skylake processor with two dual
port X710 NICs. All traffic coming in one one port of each NIC is
redirected out the other port (traffic arrives on all four ports). 34
cores are isolated for network processing. I adjust the combined
queues from the default of 36 down, and then map the IRQ associated
with each queue to one of the 34 isolated cores. Everything works fine
if I don't map the IRQs.

For a minimum repro case, I reduced my program (reproduced below) to a
blind redirector using a devmap (it doesn't even adjust MACs, which is
not a problem as my DUT is directly connected to a measurement device
in promiscuous mode) reproduced below. I use bpftool to load 4 copies
of the program and pin them, use bpftool to configure the egress
interface in the devmap, and then use ip link to attach the programs
to the interfaces.

I have played around with when I adjust the queue counts and IRQs
(before attaching XDP programs, after, XDP attachment in the middle,
etc.) and it doesn't seem to matter. But with any ordering, if I just
don't remap the IRQs, everything works fine, and if I remap, I lose
packets.

Has anyone encountered anything like this? Does anyone know what might
be causing it? How can I assign a single queue to a single core
without using the default number of queues and without losing packets?

Thanks!
--Zvi

#include <linux/bpf.h>

struct bpf_map_def {
    unsigned int type;
    unsigned int key_size;
    unsigned int value_size;
    unsigned int max_entries;
    unsigned int map_flags;
    struct bpf_map_def* inner_map;
};

struct bpf_map_def __attribute__((section("maps"), used)) device_map = {
    .type = BPF_MAP_TYPE_DEVMAP,
    .key_size = sizeof(__u32),
    .value_size = sizeof(__u32),
    .max_entries = 1,
};

static int (*bpf_redirect_map)(void *map, int key, int flags) = (void
*)BPF_FUNC_redirect_map;

__attribute__((section("xdp/test"), used))
int test(struct xdp_md *context) {
    __u32 key = 0;
    bpf_redirect_map(&device_map, key, 0);
    return XDP_REDIRECT;
}

             reply	other threads:[~2021-05-01  0:45 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-01  0:45 Zvi Effron [this message]
     [not found] ` <CADS2XXpjasmJKP__oHsrvv3EG8n-FjB6sqHwgQfh7QgeJ8GrrQ@mail.gmail.com>
2021-05-01 17:56   ` Dropped packets mapping IRQs for adjusted queue counts on i40e Zvi Effron
2021-05-02 20:16     ` T K Sourabh
2021-05-04 23:07       ` Zvi Effron
2021-05-05 18:55         ` Zvi Effron
2021-05-05 19:53           ` Zvi Effron
2021-05-05 19:55           ` David Ahern
2021-05-05 20:01           ` Jesse Brandeburg
2021-05-05 21:21             ` Maciej Fijalkowski
2021-05-05 21:21               ` [Intel-wired-lan] " Maciej Fijalkowski
2021-05-06 10:29               ` Toke Høiland-Jørgensen
2021-05-06 10:29                 ` [Intel-wired-lan] " Toke =?unknown-8bit?q?H=C3=B8iland-J=C3=B8rgensen?=
2021-05-09 15:50                 ` Maciej Fijalkowski
2021-05-09 15:50                   ` [Intel-wired-lan] " Maciej Fijalkowski
2021-05-10 11:22                   ` Toke Høiland-Jørgensen
2021-05-10 11:22                     ` [Intel-wired-lan] " Toke =?unknown-8bit?q?H=C3=B8iland-J=C3=B8rgensen?=
2021-05-10 15:01                     ` Jesper Dangaard Brouer
2021-05-10 15:01                       ` [Intel-wired-lan] " Jesper Dangaard Brouer

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=CAC1LvL1NHj6n+RNYRmja2YDhkcCwREuhjaBz_k255rU1jdO8Sw@mail.gmail.com \
    --to=zeffron@riotgames.com \
    --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.