Skip to content

pktgen: Add IMIX mode

Nicholas Richardson lkml netdev 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 4 repliesSuperseded
  3. v13 patches 2 repliesSuperseded

Changes in v3 from the cover letter

* Move fill_imix_bins() out of #ifdef CONFIG_XFRM block.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3pktgen: Parse internet mix (imix) inputnet/core/pktgen.c+96 -00 replies
2/3pktgen: Add imix distribution binsnet/core/pktgen.c+40 -00 replies
3/3pktgen: Add output for imix resultsnet/core/pktgen.c+25 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCH v3 0/3] pktgen: Add IMIX mode

From: Nick Richardson <[email protected]>

Adds internet mix (IMIX) mode to pktgen. Internet mix is included in many user-space network perf testing tools. It allows for the user to specify a distribution of discrete packet sizes to be generated. This type of test is common among vendors when perf testing their devices.
[RFC link: https://datatracker.ietf.org/doc/html/rfc2544#section-9.1]

This allows users to get a
more complete picture of how their device will perform in the real-world.

This feature adds a command that allows users to specify an imix distribution in the following format:
imix_weights size_1,weight_1 size_2,weight_2 ... size_n,weight_n

The distribution of packets with size_i will be (weight_i / total_weights) where total_weights = weight_1 + weight_2 + ... + weight_n

For example:
imix_weights 40,7 576,4 1500,1

The pkt_size "40" will account for 7 / (7 + 4 + 1) = ~58% of the total packets sent.

This patch was tested with the following:
1. imix_weights = 40,7 576,4 1500,1
2. imix_weights = 0,7 576,4 1500,1
- Packet size of 0 is resized to the minimum, 42
3. imix_weights = 40,7 576,4 1500,1 count = 0
- Zero count.
- Runs until user stops pktgen.
Invalid Configurations
1. clone_skb = 200 imix_weights = 40,7 576,4 1500,1
- Returns error code -524 (-ENOTSUPP) when setting imix_weights
2. len(imix_weights) > MAX_IMIX_ENTRIES
- Returns -7 (-E2BIG)

This patch is split into three parts, each provide different aspects of required functionality:
1. Parse internet mix input.
2. Add IMIX Distribution representation.
3. Process and output IMIX results.

Changes in v2:
* Remove __ prefix outside of uAPI.
* Use seq_puts instead of seq_printf where necessary.
* Reorder variable declaration.
* Return -EINVAL instead of -ENOTSUPP when using IMIX with clone_skb > 0.

Changes in v3:
* Move fill_imix_bins() out of #ifdef CONFIG_XFRM block.

Nick Richardson (3):
pktgen: Parse internet mix (imix) input
pktgen: Add imix distribution bins
pktgen: Add output for imix results

 net/core/pktgen.c | 163 +++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 162 insertions(+), 1 deletion(-)
Signature · 1 line
2.32.0.605.g8dce9f2422-goog