[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20221117002433.dvswqnfo5djobpfp@skbuf>
Date: Thu, 17 Nov 2022 02:24:33 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: Maciej Fijalkowski <maciej.fijalkowski@...el.com>
Cc: Tony Nguyen <anthony.l.nguyen@...el.com>, davem@...emloft.net,
kuba@...nel.org, pabeni@...hat.com, edumazet@...gle.com,
netdev@...r.kernel.org, magnus.karlsson@...el.com, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com,
bpf@...r.kernel.org
Subject: Re: [PATCH net 0/2][pull request] Intel Wired LAN Driver Updates
2022-11-14 (i40e)
Hi Maciej,
On Thu, Nov 17, 2022 at 01:03:04AM +0100, Maciej Fijalkowski wrote:
> Hey Vladimir,
>
> have a look at xdp_convert_zc_to_xdp_frame() in net/core/xdp.c. For XDP_TX
> on ZC Rx side we basically create new xdp_frame backed by new page and
> copy the contents we had in ZC buffer. Then we give back the ZC buffer to
> XSK buff pool and new xdp_frame has to be DMA mapped to HW.
Ah, ok, I didn't notice the xdp_convert_zc_to_xdp_frame() call inside
xdp_convert_buff_to_frame(), it's quite well hidden...
So it's clear now from a correctness point of view, thanks for clarifying.
This could spark a separate discussion about whether there is any better
alternative to copying the RX buffer for XDP_TX and re-mapping to DMA
something that was already mapped. But I'm not interested in that, since
I believe who wrote the code probably thought about the high costs too.
Anyway, I believe that in the general case (meaning from the perspective
of the XSK API) it's perfectly fine to keep the RX buffer around for a
while, nobody forces you to copy the frame out of it for XDP_TX.
Powered by blists - more mailing lists