Skip to content

net/ntnic: fix virt queue data in BSS

Serhii Iliushyk dpdk-dev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3net/ntnic: remove unused unmanaged virt queue setup opsdrivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c drivers/net/ntnic/ntnic_mod_reg.h+0 -320 replies
2/3net/ntnic: check virt queue hardware setup resultdrivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c+88 -700 replies
3/3net/ntnic: fix virt queue data in BSSdrivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c drivers/net/ntnic/ntnic_ethdev.c+173 -850 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH v1 0/3] net/ntnic: fix virt queue data in BSS

This series addresses the bug report "ntnic: virt queue data in BSS" (Bugzilla ID: 1975). The report lists five problems with keeping the virt queue state in static arrays; each is addressed as follows.

- BSS memory is slower than hugepages because of TLB overhead, which can cause performance loss in the hot path.
The per-queue state, and the copy of the packet buffer descriptors indexed on every burst, are now allocated from the EAL heap.

- Hard coding the size wastes space.
The 128-entry Rx and Tx arrays are gone; one object is allocated per configured queue and freed when the queue is released.

- Data in BSS is not visible to a secondary process.
The state now lives in EAL memory. The PMD still does not support primary/secondary operation, but this no longer stands in the way.

- NUMA aware allocation was not possible.
Both allocations are made with rte_zmalloc_socket() on the NUMA node of the adapter, next to the rings and buffers they describe.

- Cache alignment.
The queue object is cache line aligned and no longer shares a line with a neighboring queue.

Patch 1 drops two never-called setup ops so that only the managed setup and release paths own the queue state. Patch 2 makes a failed hardware setup visible to the caller, which patch 3 relies on to free the queue object on failure. Patch 3 is the fix itself; it also fixes a leak of the descriptor copy on queue re-setup and an ignored allocation failure that led to a NULL dereference in the burst functions.

Serhii Iliushyk (3):
net/ntnic: remove unused unmanaged virt queue setup ops net/ntnic: check virt queue hardware setup result net/ntnic: fix virt queue data in BSS

 drivers/net/ntnic/dbsconfig/ntnic_dbsconfig.c | 334 +++++++++++-------
 drivers/net/ntnic/ntnic_ethdev.c              |  52 ++-
 drivers/net/ntnic/ntnic_mod_reg.h             |  30 --
 3 files changed, 245 insertions(+), 171 deletions(-)
Signature · 1 line
2.45.0