All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lorenzo Bianconi <lorenzo@kernel.org>
To: Alexander Duyck <alexander.duyck@gmail.com>
Cc: Jesper Dangaard Brouer <jbrouer@redhat.com>,
	brouer@redhat.com, Yunsheng Lin <linyunsheng@huawei.com>,
	davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jesper Dangaard Brouer <hawk@kernel.org>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Eric Dumazet <edumazet@google.com>,
	Maryam Tahhan <mtahhan@redhat.com>, bpf <bpf@vger.kernel.org>
Subject: Re: [PATCH net-next v3 3/4] page_pool: introduce page_pool_alloc() API
Date: Tue, 20 Jun 2023 23:16:59 +0200	[thread overview]
Message-ID: <ZJIXSyjxPf7FQQKo@lore-rh-laptop> (raw)
In-Reply-To: <CAKgT0UfFVFa4zT2DnPZEGaHp0uh5V1u1aGymgdL4Vu8Q1VV8hQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1955 bytes --]

[...]

> > I did some experiments using page_frag_cache/page_frag_alloc() instead of
> > page_pools in a simple environment I used to test XDP for veth driver.
> > In particular, I allocate a new buffer in veth_convert_skb_to_xdp_buff() from
> > the page_frag_cache in order to copy the full skb in the new one, actually
> > "linearizing" the packet (since we know the original skb length).
> > I run an iperf TCP connection over a veth pair where the
> > remote device runs the xdp_rxq_info sample (available in the kernel source
> > tree, with action XDP_PASS):
> >
> > TCP clietn -- v0 === v1 (xdp_rxq_info) -- TCP server
> >
> > net-next (page_pool):
> > - MTU 1500B: ~  7.5 Gbps
> > - MTU 8000B: ~ 15.3 Gbps
> >
> > net-next + page_frag_alloc:
> > - MTU 1500B: ~  8.4 Gbps
> > - MTU 8000B: ~ 14.7 Gbps
> >
> > It seems there is no a clear "win" situation here (at least in this environment
> > and we this simple approach). Moreover:
> 
> For the 1500B packets it is a win, but for 8000B it looks like there
> is a regression. Any idea what is causing it?

nope, I have not looked into it yet.

> 
> > - can the linearization introduce any issue whenever we perform XDP_REDIRECT
> >   into a destination device?
> 
> It shouldn't. If it does it would probably point to an issue w/ the
> destination driver rather than an issue with the code doing this.

ack, fine.

> 
> > - can the page_frag_cache introduce more memory fragmentation (IIRC we were
> >   experiencing this issue in mt76 before switching to page_pools).
> 
> I think it largely depends on where the packets are ending up. I know
> this is the approach we are using for sockets, see
> skb_page_frag_refill(). If nothing else, if you took a similar
> approach to it you might be able to bypass the need for the
> page_frag_cache itself, although you would likely still end up
> allocating similar structures.

ack.

Regards,
Lorenzo

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2023-06-20 21:17 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 13:17 [PATCH net-next v3 0/4] introduce page_pool_alloc() API Yunsheng Lin
2023-06-09 13:17 ` Yunsheng Lin
2023-06-09 13:17 ` [PATCH net-next v3 1/4] page_pool: frag API support for 32-bit arch with 64-bit DMA Yunsheng Lin
2023-06-09 15:02   ` Jesper Dangaard Brouer
2023-06-10 13:13     ` Yunsheng Lin
2023-06-11 10:47       ` Jesper Dangaard Brouer
2023-06-09 13:17 ` [PATCH net-next v3 2/4] page_pool: unify frag_count handling in page_pool_is_last_frag() Yunsheng Lin
2023-06-09 13:17 ` [PATCH net-next v3 3/4] page_pool: introduce page_pool_alloc() API Yunsheng Lin
2023-06-13 14:36   ` Alexander Duyck
2023-06-14  3:51     ` Yunsheng Lin
2023-06-14 14:18       ` Alexander Duyck
2023-06-15  6:39         ` Yunsheng Lin
2023-06-15 14:45           ` Alexander Duyck
2023-06-15 16:19             ` Jesper Dangaard Brouer
2023-06-16 11:57               ` Yunsheng Lin
2023-06-16 16:31                 ` Jesper Dangaard Brouer
2023-06-16 17:34                   ` Alexander Duyck
2023-06-16 18:41                     ` Jesper Dangaard Brouer
2023-06-16 18:47                       ` Jakub Kicinski
2023-06-16 19:50                       ` Alexander Duyck
2023-06-18 15:05                         ` Lorenzo Bianconi
2023-06-20 16:19                           ` Alexander Duyck
2023-06-20 21:16                             ` Lorenzo Bianconi [this message]
2023-06-21 11:55                               ` Jesper Dangaard Brouer
2023-06-24 14:44                                 ` Yunsheng Lin
2023-06-17 12:47                     ` Yunsheng Lin
2023-06-16 11:47             ` Yunsheng Lin
2023-06-16 14:46               ` Alexander Duyck
2023-06-17 11:41                 ` Yunsheng Lin
2023-06-20 15:39                   ` Alexander Duyck
2023-06-24 15:39                     ` Yunsheng Lin
2023-06-09 13:17 ` [PATCH net-next v3 4/4] page_pool: remove PP_FLAG_PAGE_FRAG flag Yunsheng Lin
2023-06-09 13:17   ` Yunsheng Lin

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=ZJIXSyjxPf7FQQKo@lore-rh-laptop \
    --to=lorenzo@kernel.org \
    --cc=alexander.duyck@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jbrouer@redhat.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linyunsheng@huawei.com \
    --cc=mtahhan@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@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 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.