Re: [PATCH net-next v4 8/8] bnxt_en: add support for device memory tcp
From: Taehee Yoo <ap420073@gmail.com>
Date: 2025-02-19 02:37:42
Also in:
linux-doc
On Wed, Feb 19, 2025 at 9:16 AM David Wei [off-list ref] wrote:
On 2024-11-01 11:24, Taehee Yoo wrote:quoted
On Fri, Nov 1, 2024 at 11:53 PM Mina Almasry [off-list ref] wrote:quoted
On Tue, Oct 22, 2024 at 9:25 AM Taehee Yoo [off-list ref] wrote:quoted
Currently, bnxt_en driver satisfies the requirements of Device memory TCP, which is tcp-data-split. So, it implements Device memory TCP for bnxt_en driver. From now on, the aggregation ring handles netmem_ref instead of page regardless of the on/off of netmem. So, for the aggregation ring, memory will be handled with the netmem page_pool API instead of generic page_pool API. If Devmem is enabled, netmem_ref is used as-is and if Devmem is not enabled, netmem_ref will be converted to page and that is used. Driver recognizes whether the devmem is set or unset based on the mp_params.mp_priv is not NULL. Only if devmem is set, it passes PP_FLAG_ALLOW_UNREADABLE_NETMEM.Looks like in the latest version, you pass PP_FLAG_ALLOW_UNREADABLE_NETMEM unconditionally, so this line is obsolete.Okay, I will remove this line.quoted
However, I think you should only pass PP_FLAG_ALLOW_UNREADABLE_NETMEM if hds_thresh==0 and tcp-data-split==1, because otherwise the driver is not configured well enough to handle unreadable netmem, right? I know that we added checks in the devmem binding to detect hds_thresh and tcp-data-split, but we should keep another layer of protection in the driver. The driver should not set PP_FLAG_ALLOW_UNREADABLE_NETMEM unless it's configured to be able to handle unreadable netmem.Okay, I agree, I will pass PP_FLAG_ALLOW_UNREADABLE_NETMEM only when hds_thresh==0 and tcp-data-split==1.quoted
quoted
Tested-by: Stanislav Fomichev <sdf@fomichev.me> Signed-off-by: Taehee Yoo <ap420073@gmail.com> --- v4: - Do not select NET_DEVMEM in Kconfig. - Pass PP_FLAG_ALLOW_UNREADABLE_NETMEM flag unconditionally. - Add __bnxt_rx_agg_pages_xdp(). - Use gfp flag in __bnxt_alloc_rx_netmem(). - Do not add *offset in the __bnxt_alloc_rx_netmem(). - Do not pass queue_idx to bnxt_alloc_rx_page_pool(). - Add Test tag from Stanislav. - Add page_pool_recycle_direct_netmem() helper. v3: - Patch added. drivers/net/ethernet/broadcom/bnxt/bnxt.c | 182 ++++++++++++++++------ drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 +- include/net/page_pool/helpers.h | 6 + 3 files changed, 142 insertions(+), 48 deletions(-)Hi Taehee, what is your plan with this patch? Are you still working on it? I noticed that you dropped it in later versions of this series. With io_uring zero copy Rx now merged I also need bnxt support, but I don't want to duplicate efforts. Please let me know, thanks!
Hi David, Sorry for the late! I'm still working on it. I implemented a working patch, but there are several bugs. So I'm thinking about how to deal with it. And then, I would like to send this patch after fixing bugs. Thanks a lot! Taehee Yoo