From: "Toke Høiland-Jørgensen" <toke@redhat.com>
To: Heng Qi <hengqi@linux.alibaba.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>,
Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Subject: Re: [PATCH net] veth: Avoid drop packets when xdp_redirect performs
Date: Thu, 29 Sep 2022 14:08:38 +0200 [thread overview]
Message-ID: <87o7uymlh5.fsf@toke.dk> (raw)
In-Reply-To: <c1831b89-c896-80c3-7258-01bcf2defcbc@linux.alibaba.com>
Heng Qi <hengqi@linux.alibaba.com> writes:
>>> As I said above in the real case, the user's concern is not why the performance
>>> of xdp becomes bad, but why the data packets are not received.
>> Well, that arguably tells the end-user there is something wrong in
>> their setup. On the flip side, having a functionally working setup with
>> horrible performances would likely lead the users (perhaps not yours,
>> surely others) in very wrong directions (from "XDP is slow" to "the
>> problem is in the application")...
>>
>>> The default number of veth queues is not num_possible_cpus(). When GRO is enabled
>>> by default, if there is only one veth queue, but multiple CPUs read and write at the
>>> same time, the efficiency of napi is actually very low due to the existence of
>>> production locks and races. On the contrary, the default veth_xmit() each cpu has
>>> its own unique queue, and this way of sending and receiving packets is also efficient.
>>>
>> This patch adds a bit of complexity and it looks completely avoidable
>> with some configuration - you could enable GRO and set the number of
>> queues to num_possible_cpus().
>>
>> I agree with Toke, you should explain the end-users that their
>> expecations are wrong, and guide them towards a better setup.
>>
>> Thanks!
>
> Well, one thing I want to know is that in the following scenario,
>
> NIC -> veth0----veth1
> | | |
> (XDP) (XDP) (no XDP)
>
> xdp_redirect is triggered,
> and NIC and veth0 are both mounted with the xdp program, then why our default behavior
> is to drop packets that should be sent to veth1 instead of when veth0 is mounted with xdp
> program, the napi ring of veth1 is opened by default at the same time? Why not make it like
> this, but we must configure a simple xdp program on veth1?
As I said in my initial reply, you don't actually need to load an XDP
program (anymore), it's enough to enable GRO through ethtool on both
peers. You can easily do this on setup if you know XDP is going to be
used in your environment.
-Toke
next prev parent reply other threads:[~2022-09-29 12:08 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-27 8:30 [PATCH net] veth: Avoid drop packets when xdp_redirect performs Heng Qi
2022-09-27 12:20 ` Toke Høiland-Jørgensen
2022-09-28 11:57 ` Heng Qi
2022-09-28 14:58 ` Toke Høiland-Jørgensen
2022-09-29 2:50 ` Heng Qi
2022-09-29 6:57 ` Paolo Abeni
2022-09-29 7:33 ` Heng Qi
2022-09-29 12:08 ` Toke Høiland-Jørgensen [this message]
2022-10-20 2:23 ` Heng Qi
2022-10-20 16:34 ` Toke Høiland-Jørgensen
2022-10-21 6:31 ` Heng Qi
2022-10-24 11:20 ` Heng Qi
2022-10-24 13:34 ` Toke Høiland-Jørgensen
2022-10-24 13:39 ` Heng Qi
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=87o7uymlh5.fsf@toke.dk \
--to=toke@redhat.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hengqi@linux.alibaba.com \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=xuanzhuo@linux.alibaba.com \
/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).