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

yangxingui <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>

On 2026/7/23 6:22, Stephen Hemminger wrote:
> 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.

Haha, I think you're right. We have an internal test case for 
ultra-short packets to verify hardware capabilities, and this test case 
has been around for many years. We have maintained this private patch 
separately for many years. It's possible that other network cards might 
not have such a requirement.

Thanks.
Xingui
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.