On Mon, 6 Jul 2026 21:20:50 +0800 Xingui Yang <[email protected]> wrote:
> Allow set txpkts to accept packet lengths as small as one byte, > enabling generation of runt frames and ultra-small packets for > testing NIC padding logic and undersized frame handling. > > The txonly engine handles three ranges: normal (>= 42 bytes) with > full Ethernet/IPv4/UDP headers, runt (14-41 bytes) with truncated > headers, and ultra-small (< 14 bytes) filled with a repeating > pattern. Checksum offloads are disabled when headers are incomplete. > > Minimum length validation in set_tx_pkt_segments() is relaxed from > 42 to 1 byte. Random split and multi-flow still require the full > header stack in the first segment, as enforced by tx_only_begin(). > > Signed-off-by: Xingui Yang <[email protected]> > Suggested-by: Stephen Hemminger <[email protected]> > --- I would suggest that if NIC ever gets a packet < ethernet header it is an application bug, and driver should drop it as an transmit error. Or crash with an assert failed. There is no guarantee that this will ever work. Therefore can not see why testpmd needs to do this. For packets with Ethernet header plus a few more bytes, it makes sense to allow. There are always control level protocols that are very short.

