netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <jbrouer@redhat.com>
To: Alexander Lobakin <aleksander.lobakin@intel.com>,
	Jesper Dangaard Brouer <jbrouer@redhat.com>
Cc: brouer@redhat.com, "Alexei Starovoitov" <ast@kernel.org>,
	"Daniel Borkmann" <daniel@iogearbox.net>,
	"Andrii Nakryiko" <andrii@kernel.org>,
	"Martin KaFai Lau" <martin.lau@linux.dev>,
	"Maciej Fijalkowski" <maciej.fijalkowski@intel.com>,
	"Larysa Zaremba" <larysa.zaremba@intel.com>,
	"Toke Høiland-Jørgensen" <toke@redhat.com>,
	"Song Liu" <song@kernel.org>,
	"Jesper Dangaard Brouer" <hawk@kernel.org>,
	"John Fastabend" <john.fastabend@gmail.com>,
	"Menglong Dong" <imagedong@tencent.com>,
	"Mykola Lysenko" <mykolal@fb.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Eric Dumazet" <edumazet@google.com>,
	"Paolo Abeni" <pabeni@redhat.com>,
	bpf@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Freysteinn Alfredsson" <Freysteinn.Alfredsson@kau.se>
Subject: Re: [PATCH bpf-next v3 3/4] xdp: recycle Page Pool backed skbs built from XDP frames
Date: Thu, 16 Mar 2023 18:10:26 +0100	[thread overview]
Message-ID: <0377c85c-5d59-49e5-017f-212821849a18@redhat.com> (raw)
In-Reply-To: <85d803a2-a315-809a-5eff-13892aff5401@intel.com>


On 15/03/2023 15.58, Alexander Lobakin wrote:
> From: Jesper Dangaard Brouer <jbrouer@redhat.com>
> Date: Wed, 15 Mar 2023 15:55:44 +0100
> 
>> On 13/03/2023 22.55, Alexander Lobakin wrote:
[...]
>>>
>>> diff --git a/net/core/xdp.c b/net/core/xdp.c
>>> index 8c92fc553317..a2237cfca8e9 100644
>>> --- a/net/core/xdp.c
>>> +++ b/net/core/xdp.c
>>> @@ -658,8 +658,8 @@ struct sk_buff *__xdp_build_skb_from_frame(struct
>>> xdp_frame *xdpf,
>>>         * - RX ring dev queue index    (skb_record_rx_queue)
>>>         */
>>>    -    /* Until page_pool get SKB return path, release DMA here */
>>> -    xdp_release_frame(xdpf);
>>> +    if (xdpf->mem.type == MEM_TYPE_PAGE_POOL)
>>> +        skb_mark_for_recycle(skb);
>>
>> I hope this is safe ;-) ... Meaning hopefully drivers does the correct
>> thing when XDP_REDIRECT'ing page_pool pages.
> 
> Safe when it's done by the schoolbook. For now I'm observing only one
> syzbot issue with test_run due to that it assumes yet another bunch
> o'things I wouldn't rely on :D (separate subthread)
> 
>>
>> Looking for drivers doing weird refcnt tricks and XDP_REDIRECT'ing, I
>> noticed the driver aquantia/atlantic (in aq_get_rxpages_xdp), but I now
>> see this is not using page_pool, so it should be affected by this (but I
>> worry if atlantic driver have a potential race condition for its refcnt
>> scheme).
> 
> If we encounter some driver using Page Pool, but mangling refcounts on
> redirect, we'll fix it ;)
> 

Thanks for signing up for fixing these issues down-the-road :-)

For what is it worth, I've rebased to include this patchset on my
testlab.

For now, I've tested mlx5 with cpumap redirect and net stack processing,
everything seems to be working nicely. When disabling GRO/GRO, then the
cpumap get same and sometimes better TCP throughput performance,
even-though checksum have to be done in software. (Hopefully we can soon
close the missing HW checksum gap with XDP-hints).

--Jesper


  reply	other threads:[~2023-03-16 17:11 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-13 21:55 [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 1/4] selftests/bpf: robustify test_xdp_do_redirect with more payload magics Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 2/4] net: page_pool, skbuff: make skb_mark_for_recycle() always available Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 3/4] xdp: recycle Page Pool backed skbs built from XDP frames Alexander Lobakin
2023-03-15 14:55   ` Jesper Dangaard Brouer
2023-03-15 14:58     ` Alexander Lobakin
2023-03-16 17:10       ` Jesper Dangaard Brouer [this message]
2023-03-17 13:36         ` Alexander Lobakin
2023-03-13 21:55 ` [PATCH bpf-next v3 4/4] xdp: remove unused {__,}xdp_release_frame() Alexander Lobakin
2023-03-14 11:37   ` Yunsheng Lin
2023-03-14 12:27     ` Alexander Lobakin
2023-03-14 11:57 ` [PATCH bpf-next v3 0/4] xdp: recycle Page Pool backed skbs built from XDP frames Alexander Lobakin
2023-03-14 18:52   ` Alexei Starovoitov
2023-03-14 23:54     ` Alexei Starovoitov
2023-03-15  9:56       ` Alexander Lobakin
2023-03-15 10:54         ` Alexander Lobakin
2023-03-15 14:54           ` Ilya Leoshkevich
2023-03-15 18:00             ` Ilya Leoshkevich
2023-03-15 18:12               ` Alexander Lobakin
2023-03-15 18:26                 ` Ilya Leoshkevich
2023-03-16 13:22                   ` Alexander Lobakin
2023-03-15 16:55           ` Alexei Starovoitov
2023-03-14 22:30 ` patchwork-bot+netdevbpf
  -- strict thread matches above, loose matches on Subject: below --
2023-03-13 21:42 Alexander Lobakin
2023-03-13 21:42 ` [PATCH bpf-next v3 3/4] " Alexander Lobakin
2023-03-13 19:08 [PATCH bpf-next v3 0/4] " Alexander Lobakin
2023-03-13 19:08 ` [PATCH bpf-next v3 3/4] " Alexander Lobakin

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=0377c85c-5d59-49e5-017f-212821849a18@redhat.com \
    --to=jbrouer@redhat.com \
    --cc=Freysteinn.Alfredsson@kau.se \
    --cc=aleksander.lobakin@intel.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=imagedong@tencent.com \
    --cc=john.fastabend@gmail.com \
    --cc=kuba@kernel.org \
    --cc=larysa.zaremba@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.fijalkowski@intel.com \
    --cc=martin.lau@linux.dev \
    --cc=mykolal@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=song@kernel.org \
    --cc=toke@redhat.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).