DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] net/memif: lifecycle fixes and unit test
@ 2026-10-15 14:39 Sriram Yagnaraman
  2026-10-15 14:39 ` [PATCH v2 1/8] net/memif: guard against empty Tx burst Sriram Yagnaraman
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Sriram Yagnaraman @ 2026-10-15 14:39 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Sriram Yagnaraman, Jakub Grajciar, stable

This series fixes a set of error-path and lifecycle bugs in the memif
PMD and adds a unit test for the driver.

The first seven patches are fixes:

 - guard eth_memif_tx() against an empty burst (nb_pkts == 0);
 - close file descriptor 0 instead of leaking it;
 - do not close the EAL-owned memseg fd in zero-copy mode;
 - free the MAC address allocated during probe on failure;
 - unwind a partially-created device on create failure;
 - disconnect on close so a stopped server's control channel is not
   leaked, and make memif_disconnect() safe on a never-started device;
 - fix eth_memif_tx_zc() returning 65535 on an invalid interrupt fd.

The last patch adds a memif PMD unit test (app/test, memif_pmd_autotest):
a server/client vdev pair over a loopback socket covering dev_info, link
state, stats, single-segment loopback (slow and fast path), multi-segment
loopback across a ring wrap, stop/start reconnect, empty Tx burst, and
close without stop.

Verified: memif_pmd_autotest passes 10/10; each commit builds with
-Dwerror=true; check-git-log and checkpatch are clean.

Thanks to Stephen Hemminger and the ai-code-review bot for the v1 review
that prompted all of the v2 changes below.

v2:
 - P1: correct Fixes tag (Tx fast path, not original driver); move the
   empty-burst check after the ring == NULL block.
 - P2: drop the memseg-fd change from this patch; split it out as a
   separate fix (new patch 3) that stops closing the EAL-owned fd
   rather than widening the check to ">= 0".
 - P3 (new): do not close the EAL-owned memseg fd in either
   memif_connect() or memif_free_regions().
 - P4 (MAC leak): document the secondary -1 -> -ENOMEM change.
 - P5 (unwind): add Fixes: multi-process support.
 - P6 (disconnect): rewrite the commit message to name the real
   trigger (server binds pmd->cc without a dev_started check).
 - New patch 7: fix eth_memif_tx_zc() bogus Tx count on invalid fd.
 - Test: add the file to MAINTAINERS; make close-without-stop actually
   connect a peer so the cc leak is exercised; return TEST_FAILED (not
   SKIPPED) on probe failure; add a default-bsize pair to cover the Tx
   fast path; set ring size via rsize and fix the stale comments; verify
   the full payload instead of the first byte.

Sriram Yagnaraman (8):
  net/memif: guard against empty Tx burst
  net/memif: close file descriptor zero
  net/memif: do not close EAL-owned memseg file descriptor
  net/memif: fix MAC address leak on probe failure
  net/memif: unwind partial device on create failure
  net/memif: disconnect on device close
  net/memif: fix bogus Tx count on invalid interrupt FD
  test/memif: add memif PMD unit test

 MAINTAINERS                       |   1 +
 app/test/meson.build              |   1 +
 app/test/test_pmd_memif.c         | 693 ++++++++++++++++++++++++++++++
 drivers/net/memif/memif_socket.c  |  14 +-
 drivers/net/memif/rte_eth_memif.c |  70 +--
 5 files changed, 750 insertions(+), 29 deletions(-)
 create mode 100644 app/test/test_pmd_memif.c

-- 
2.43.7


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2026-10-15 22:49 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-15 14:39 [PATCH v2 0/8] net/memif: lifecycle fixes and unit test Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 1/8] net/memif: guard against empty Tx burst Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 2/8] net/memif: close file descriptor zero Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 3/8] net/memif: do not close EAL-owned memseg file descriptor Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 4/8] net/memif: fix MAC address leak on probe failure Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 5/8] net/memif: unwind partial device on create failure Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 6/8] net/memif: disconnect on device close Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 7/8] net/memif: fix bogus Tx count on invalid interrupt FD Sriram Yagnaraman
2026-10-15 14:39 ` [PATCH v2 8/8] test/memif: add memif PMD unit test Sriram Yagnaraman
2026-10-15 19:51 ` [PATCH v2 0/8] net/memif: lifecycle fixes and " Stephen Hemminger
2026-10-15 22:49 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox