Re: [PATCH v3 net 5/8] eth: bnxt: fix kernel panic in the bnxt_get_queue_stats{rx | tx}

2025-03-09 Thread Somnath Kotur
On Sun, Mar 9, 2025 at 7:13 PM Taehee Yoo wrote: > > When qstats-get operation is executed, callbacks of netdev_stats_ops > are called. The bnxt_get_queue_stats{rx | tx} collect per-queue stats > from sw_stats in the rings. > But {rx | tx | cp}_ring are allocated when the interface is up. > So, th

Re: [PATCH v3 net 4/8] eth: bnxt: do not update checksum in bnxt_xdp_build_skb()

2025-03-09 Thread Somnath Kotur
On Sun, Mar 9, 2025 at 7:13 PM Taehee Yoo wrote: > > The bnxt_rx_pkt() updates ip_summed value at the end if checksum offload > is enabled. > When the XDP-MB program is attached and it returns XDP_PASS, the > bnxt_xdp_build_skb() is called to update skb_shared_info. > The main purpose of bnxt_xdp_

Re: [PATCH v3 net 2/8] eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc()

2025-03-09 Thread Taehee Yoo
On Mon, Mar 10, 2025 at 6:44 AM Mina Almasry wrote: > Hi Mina, Thanks a lot for the review! > On Sun, Mar 9, 2025 at 6:43 AM Taehee Yoo wrote: > > > > The bnxt_queue_mem_alloc() is called to allocate new queue memory when > > a queue is restarted. > > It internally accesses rx buffer descriptor

Re: [PATCH v3 net 7/8] net: devmem: do not WARN conditionally after netdev_rx_queue_restart()

2025-03-09 Thread Mina Almasry
On Sun, Mar 9, 2025 at 6:43 AM Taehee Yoo wrote: > > When devmem socket is closed, netdev_rx_queue_restart() is called to > reset queue by the net_devmem_unbind_dmabuf(). But callback may return > -ENETDOWN if the interface is down because queues are already freed > when the interface is down so q

Re: [PATCH v3 net 2/8] eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc()

2025-03-09 Thread Mina Almasry
On Sun, Mar 9, 2025 at 6:43 AM Taehee Yoo wrote: > > The bnxt_queue_mem_alloc() is called to allocate new queue memory when > a queue is restarted. > It internally accesses rx buffer descriptor corresponding to the index. > The rx buffer descriptor is allocated and set when the interface is up > a

[PATCH v3 net 5/8] eth: bnxt: fix kernel panic in the bnxt_get_queue_stats{rx | tx}

2025-03-09 Thread Taehee Yoo
When qstats-get operation is executed, callbacks of netdev_stats_ops are called. The bnxt_get_queue_stats{rx | tx} collect per-queue stats from sw_stats in the rings. But {rx | tx | cp}_ring are allocated when the interface is up. So, these rings are not allocated when the interface is down. The q

[PATCH v3 net 8/8] selftests: drv-net: add xdp cases for ping.py

2025-03-09 Thread Taehee Yoo
ping.py has 3 cases, test_v4, test_v6 and test_tcp. But these cases are not executed on the XDP environment. So, it adds XDP environment, existing tests(test_v4, test_v6, and test_tcp) are executed too on the below XDP environment. So, it adds XDP cases. 1. xdp-generic + single-buffer 2. xdp-generi

[PATCH v3 net 7/8] net: devmem: do not WARN conditionally after netdev_rx_queue_restart()

2025-03-09 Thread Taehee Yoo
When devmem socket is closed, netdev_rx_queue_restart() is called to reset queue by the net_devmem_unbind_dmabuf(). But callback may return -ENETDOWN if the interface is down because queues are already freed when the interface is down so queue reset is not needed. So, it should not warn if the retu

[PATCH v3 net 6/8] eth: bnxt: fix memory leak in queue reset

2025-03-09 Thread Taehee Yoo
When the queue is reset, the bnxt_alloc_one_tpa_info() is called to allocate tpa_info for the new queue. And then the old queue's tpa_info should be removed by the bnxt_free_one_tpa_info(), but it is not called. So memory leak occurs. It adds the bnxt_free_one_tpa_info() in the bnxt_queue_mem_free(

[PATCH v3 net 1/8] eth: bnxt: fix truesize for mb-xdp-pass case

2025-03-09 Thread Taehee Yoo
When mb-xdp is set and return is XDP_PASS, packet is converted from xdp_buff to sk_buff with xdp_update_skb_shared_info() in bnxt_xdp_build_skb(). bnxt_xdp_build_skb() passes incorrect truesize argument to xdp_update_skb_shared_info(). The truesize is calculated as BNXT_RX_PAGE_SIZE * sinfo->nr_fra

[PATCH v3 net 4/8] eth: bnxt: do not update checksum in bnxt_xdp_build_skb()

2025-03-09 Thread Taehee Yoo
The bnxt_rx_pkt() updates ip_summed value at the end if checksum offload is enabled. When the XDP-MB program is attached and it returns XDP_PASS, the bnxt_xdp_build_skb() is called to update skb_shared_info. The main purpose of bnxt_xdp_build_skb() is to update skb_shared_info, but it updates ip_su

[PATCH v3 net 0/8] eth: bnxt: fix several bugs in the bnxt module

2025-03-09 Thread Taehee Yoo
The first fixes setting incorrect skb->truesize. When xdp-mb prog returns XDP_PASS, skb is allocated and initialized. Currently, The truesize is calculated as BNXT_RX_PAGE_SIZE * sinfo->nr_frags, but sinfo->nr_frags is flushed by napi_build_skb(). So, it stores sinfo before calling napi_build_skb()

[PATCH v3 net 3/8] eth: bnxt: do not use BNXT_VNIC_NTUPLE unconditionally in queue restart logic

2025-03-09 Thread Taehee Yoo
When a queue is restarted, it sets MRU to 0 for stopping packet flow. MRU variable is a member of vnic_info[], the first vnic_info is default and the second is ntuple. Only when ntuple is enabled(ethtool -K eth0 ntuple on), vnic_info for ntuple is allocated in init logic. The bp->nr_vnics indicates

[PATCH v3 net 2/8] eth: bnxt: return fail if interface is down in bnxt_queue_mem_alloc()

2025-03-09 Thread Taehee Yoo
The bnxt_queue_mem_alloc() is called to allocate new queue memory when a queue is restarted. It internally accesses rx buffer descriptor corresponding to the index. The rx buffer descriptor is allocated and set when the interface is up and it's freed when the interface is down. So, if queue is rest