hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/samples/pktgen/pktgen_sample03_burst_single_flow.sh
....@@ -33,6 +33,14 @@
3333 [ -z "$BURST" ] && BURST=32
3434 [ -z "$CLONE_SKB" ] && CLONE_SKB="0" # No need for clones when bursting
3535 [ -z "$COUNT" ] && COUNT="0" # Zero means indefinitely
36
+if [ -n "$DEST_IP" ]; then
37
+ validate_addr${IP6} $DEST_IP
38
+ read -r DST_MIN DST_MAX <<< $(parse_addr${IP6} $DEST_IP)
39
+fi
40
+if [ -n "$DST_PORT" ]; then
41
+ read -r UDP_DST_MIN UDP_DST_MAX <<< $(parse_ports $DST_PORT)
42
+ validate_ports $UDP_DST_MIN $UDP_DST_MAX
43
+fi
3644
3745 # Base Config
3846 DELAY="0" # Zero means max speed
....@@ -58,7 +66,15 @@
5866
5967 # Destination
6068 pg_set $dev "dst_mac $DST_MAC"
61
- pg_set $dev "dst$IP6 $DEST_IP"
69
+ pg_set $dev "dst${IP6}_min $DST_MIN"
70
+ pg_set $dev "dst${IP6}_max $DST_MAX"
71
+
72
+ if [ -n "$DST_PORT" ]; then
73
+ # Single destination port or random port range
74
+ pg_set $dev "flag UDPDST_RND"
75
+ pg_set $dev "udp_dst_min $UDP_DST_MIN"
76
+ pg_set $dev "udp_dst_max $UDP_DST_MAX"
77
+ fi
6278
6379 # Setup burst, for easy testing -b 0 disable bursting
6480 # (internally in pktgen default and minimum burst=1)