[PATCH v3] app/testpmd: support runt and ultra-small frames in txonly

Stephen Hemminger stephen at networkplumber.org
Thu Jul 23 00:22:56 CEST 2026


On Mon, 6 Jul 2026 21:20:50 +0800
Xingui Yang <yangxingui at huawei.com> 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 <yangxingui at huawei.com>
> Suggested-by: Stephen Hemminger <stephen at networkplumber.org>
> ---
 
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.


More information about the dev mailing list