Allow bigger number of packets to generate

Authored by olivier on May 19 2016, 8:54 AM.



On 10Giga or more faster link, usage of pkt-gen ask often to generate large number of packet.
But current packet counter (-n option) is a int and core dump if we ask more than 2^31 packets.
This proposal change int to uint32_t for this counter but should it be bigger like an uint64_t ?

Test Plan

Before: pkt-gen with option "-n 4000000000" generate a core dump
After: it's works.

Diff Detail

rS FreeBSD src repository
Lint OK
No Unit Test Coverage
Build Status
Buildable 4840
Build 4903: arc lint + arc unit
olivier updated this revision to Diff 16554.May 19 2016, 8:54 AM
olivier retitled this revision from to Allow bigger number of packets to generate.
olivier updated this object.
olivier edited the test plan for this revision. (Show Details)
olivier added reviewers: gnn, sbruno.
gnn edited edge metadata.May 19 2016, 3:31 PM

Push it out to 64 bits please.

sbruno requested changes to this revision.May 29 2016, 5:13 PM
sbruno edited edge metadata.

Please expand npackets to a 64bit type.

This revision now requires changes to proceed.May 29 2016, 5:13 PM
olivier updated this revision to Diff 19417.Aug 17 2016, 2:46 PM
olivier edited edge metadata.

Switched to uint64_t

gnn accepted this revision.Aug 17 2016, 2:51 PM
gnn edited edge metadata.

Is this still to be committed or is it abandoned?

Still to be commited. But I'm not a src commiter (just port under mentoring), then I was not sure that just one "accepted review" is enough for allowing me to commit it directly.

By the way, this patch was accepted upstream too (

Cool. I'll talk with gnn and figure out whom is going to commit it.

gnn added a comment.Sep 15 2016, 3:30 PM

I will test and commit this one.

sbruno accepted this revision.Sep 15 2016, 5:51 PM
sbruno edited edge metadata.


This revision is now accepted and ready to land.Sep 15 2016, 5:51 PM

gnn: You want to grab this and commit it?

gnn closed this revision.Jul 26 2017, 12:19 PM

This has already been committed upstream and is present in HEAD.