This series contains improvements to the PCAP PMD including new
features, bug fixes, code cleanup, and a comprehensive test suite.
New features:
- VLAN tag insertion on Tx and stripping on Rx
- Nanosecond precision timestamps (when hardware/libpcap supports it)
- Accurate link state, speed, and duplex reporting in interface mode
- Advertise RTE_ETH_TX_OFFLOAD_MULTI_SEGS capability
Bug fixes:
- Fix multi-segment transmit to dynamically allocate instead of
silently truncating packets larger than 9K stack buffer
- Change Tx burst to always consume all packets; failed sends
increment error counter rather than leaving mbufs for retry
(pcap_sendpacket failures are not transient)
Code cleanup:
- Convert internal flags from int to bool
- Remove unnecessary casts of void* from rte_zmalloc
- Replace rte_malloc/rte_memcpy with libc equivalents in osdep code
- Include headers explicitly rather than relying on indirect includes
- Remove unnecessary volatile qualifier on statistics
- Reduce scope of file-level variables
Testing:
- Add comprehensive unit test suite covering basic operations,
timestamps, jumbo frames, VLAN handling, multi-queue, and more
v7:
- Drop MTU configuration patch; not necessary as underlying OS
commands (ip link, ifconfig) can be used directly
- Add patch to remove unnecessary volatile on queue statistics
- Add test_link_status to unit test suite
- Add Acked-by from Marat Khalili on patch 11
v6:
- Rebase to latest main
- Address review comments
Stephen Hemminger (13):
maintainers: update for pcap driver
doc: update features for PCAP PMD
net/pcap: include used headers
net/pcap: remove unnecessary casts
net/pcap: avoid using rte_malloc and rte_memcpy
net/pcap: improve multi-segment transmit handling
net/pcap: consolidate boolean flag handling
net/pcap: support VLAN insert and strip
net/pcap: add link state and speed for interface mode
net/pcap: support nanosecond timestamp precision
net/pcap: reduce scope of file-level variables
net/pcap: avoid use of volatile
test: add test for pcap PMD
MAINTAINERS | 1 +
app/test/meson.build | 2 +
app/test/test_pmd_pcap.c | 2334 ++++++++++++++++++++++++
doc/guides/nics/features/pcap.ini | 8 +
doc/guides/rel_notes/release_26_03.rst | 9 +
drivers/net/pcap/pcap_ethdev.c | 474 +++--
drivers/net/pcap/pcap_osdep.h | 23 +
drivers/net/pcap/pcap_osdep_freebsd.c | 288 ++-
drivers/net/pcap/pcap_osdep_linux.c | 118 +-
drivers/net/pcap/pcap_osdep_windows.c | 95 +-
10 files changed, 3180 insertions(+), 172 deletions(-)
create mode 100644 app/test/test_pmd_pcap.c
--
2.51.0