This series makes several improvements to the null PMD driver and
adds comprehensive unit tests.

The series:
1) Cleans up the info_get callback by removing redundant argument
   checks and using proper constants. Also sets min_rx_bufsize to
   the configured packet_size, enabling the ethdev layer to reject
   undersized mbuf pools.

2) Adds proper validation for numeric devargs (packet_size,
   packet_copy, no_rx) using a common helper function that rejects
   empty strings, trailing non-numeric characters, and out-of-range
   values.

3) Removes redundant argument validation in dev_ops callbacks that
   is already performed by the ethdev layer.

4) Adds VLAN insert and strip offload support. The driver advertises
   RX VLAN strip and TX VLAN insert capabilities. When VLAN strip is
   enabled, received mbufs are marked with the appropriate flags and
   a dummy vlan_tci. The vlan_offload_set dev_op is implemented for
   runtime toggling via rte_eth_dev_set_vlan_offload().

5) Extends the packet burst generator to support larger packets
   by widening parameter types from uint8_t to uint16_t.

6) Adds a comprehensive unit test for the null PMD covering RX/TX,
   statistics, custom packet sizes, copy mode, no-RX mode, link
   status, device info, RSS, RETA, VLAN strip, VLAN insert, and
   multi-threaded TX.

Patches 1, 2, and 3 are marked for stable backport as they fix issues
where invalid mbufs could be generated or invalid arguments silently
accepted.

v11:
  - Add VLAN insert and strip offload support to the driver
  - Rebase to main

v10:
  - Fix mbuf leak in eth_null_copy_tx

v9:
  - Consolidated argument validation into a single patch with
    common helper function get_unsigned_arg()
  - Merged pool vs packet size check into the cleanup patch
  - Removed redundant argument validation in a separate patch
  - Reordered patches to put fixes before tests

Stephen Hemminger (7):
  net/null: fix missing mbuf leakage in the copy transmit
  net/null: cleanup info response
  net/null: validate the numeric devargs
  net/null: remove redundant argument validation
  test: support larger packet sizes in burst generator
  test: add a test for null PMD
  net/null: add VLAN insert and strip offload support

 app/test/meson.build              |   1 +
 app/test/packet_burst_generator.c |  34 +-
 app/test/packet_burst_generator.h |   4 +-
 app/test/test_pmd_null.c          | 947 ++++++++++++++++++++++++++++++
 drivers/net/null/rte_eth_null.c   | 156 ++---
 5 files changed, 1050 insertions(+), 92 deletions(-)
 create mode 100644 app/test/test_pmd_null.c

-- 
2.51.0

Reply via email to