From: Jakub Kicinski <kuba@kernel.org>
To: Taehee Yoo <ap420073@gmail.com>
Cc: davem@davemloft.net, pabeni@redhat.com, edumazet@google.com,
andrew+netdev@lunn.ch, horms@kernel.org,
michael.chan@broadcom.com, pavan.chebbi@broadcom.com,
ilias.apalodimas@linaro.org, dw@davidwei.uk,
netdev@vger.kernel.org, kuniyu@amazon.com, sdf@fomichev.me,
aleksander.lobakin@intel.com
Subject: Re: [RFC net-next 1/2] eth: bnxt: refactor buffer descriptor
Date: Mon, 31 Mar 2025 10:34:16 -0700 [thread overview]
Message-ID: <20250331103416.7b76c83c@kernel.org> (raw)
In-Reply-To: <20250331114729.594603-2-ap420073@gmail.com>
On Mon, 31 Mar 2025 11:47:28 +0000 Taehee Yoo wrote:
> There are two kinds of buffer descriptors in bnxt, struct
> bnxt_sw_rx_bd and struct bnxt_sw_rx_agg_bd.(+ struct bnxt_tpa_info).
> The bnxt_sw_rx_bd is the bd for ring buffer, the bnxt_sw_rx_agg_bd is
> the bd for the aggregation ring buffer. The purpose of these bd are the
> same, but the structure is a little bit different.
>
> struct bnxt_sw_rx_bd {
> void *data;
> u8 *data_ptr;
> dma_addr_t mapping;
> };
>
> struct bnxt_sw_rx_agg_bd {
> struct page *page;
> unsigned int offset;
> dma_addr_t mapping;
> }
>
> bnxt_sw_rx_bd->data would be either page pointer or page_address(page) +
> offset. Under page mode(xdp is set), data indicates page pointer,
> if not, it indicates virtual address.
> Before the recent head_pool work from Jakub, bnxt_sw_rx_bd->data was
> allocated by kmalloc().
> But after Jakub's work, bnxt_sw_rx_bd->data is allocated by page_pool.
> So, there is no reason to still keep handling virtual address anymore.
> The goal of this patch is to make bnxt_sw_rx_bd the same as
> the bnxt_sw_rx_agg_bd.
> By this change, we can easily use page_pool API like
> page_pool_dma_sync_for_{cpu | device}()
> Also, we can convert from page to the netmem very smoothly by this change.
LGTM, could you split this into two patches, tho?
One for the BD change and one for the syncing changes?
> - dma_sync_single_for_device(&pdev->dev, mapping, bp->rx_copybreak,
> - bp->rx_dir);
> -
> + page_pool_dma_sync_for_device(rxr->head_pool, page_to_netmem(page),
> + bp->rx_dma_offset, bp->rx_copybreak);
I think we should add a separate helper for this instead of extending
the existing page_pool_dma_sync_for_device(). Let's call it
page_pool_dma_sync_for_device_frag() ?
The use case here is that the driver recycles a frag directly, rather
than following the normal PP recycling path.
next prev parent reply other threads:[~2025-03-31 17:34 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-31 11:47 [RFC net-next 0/2]eth: bnxt: Implement rx-side device memory Taehee Yoo
2025-03-31 11:47 ` [RFC net-next 1/2] eth: bnxt: refactor buffer descriptor Taehee Yoo
2025-03-31 17:34 ` Jakub Kicinski [this message]
2025-04-01 6:48 ` Taehee Yoo
2025-04-01 5:39 ` Michael Chan
2025-04-01 7:17 ` Taehee Yoo
2025-04-01 15:22 ` David Wei
2025-04-01 15:20 ` David Wei
2025-03-31 11:47 ` [RFC net-next 2/2] eth: bnxt: add support rx side device memory TCP Taehee Yoo
2025-03-31 18:50 ` Jakub Kicinski
2025-04-02 12:09 ` Taehee Yoo
2025-04-02 12:46 ` Jakub Kicinski
2025-04-02 22:11 ` Mina Almasry
2025-04-02 22:45 ` Jakub Kicinski
2025-04-02 22:16 ` Mina Almasry
2025-04-03 1:55 ` Taehee Yoo
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=20250331103416.7b76c83c@kernel.org \
--to=kuba@kernel.org \
--cc=aleksander.lobakin@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=ap420073@gmail.com \
--cc=davem@davemloft.net \
--cc=dw@davidwei.uk \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=ilias.apalodimas@linaro.org \
--cc=kuniyu@amazon.com \
--cc=michael.chan@broadcom.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pavan.chebbi@broadcom.com \
--cc=sdf@fomichev.me \
/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).