Skip to content

Commit

Permalink
Fix TX errors for packets greater then 100 bytes and bump version.
Browse files Browse the repository at this point in the history
  • Loading branch information
KeithWiles committed Jul 6, 2024
1 parent bf32ae8 commit 1bd1384
Show file tree
Hide file tree
Showing 19 changed files with 461 additions and 70 deletions.
267 changes: 267 additions & 0 deletions 2-ports
Original file line number Diff line number Diff line change
@@ -0,0 +1,267 @@
#
# Pktgen 24.05.5
# Copyright(c) <2010-2024>, Intel Corporation. All rights reserved., Powered by DPDK 24.07.0-rc1

# Command line arguments: (DPDK args are defaults)
# ./usr/local/bin/pktgen -c fe -n 3 -m 512 --proc-type primary -- -v -T -P -G -m [2:3-4].0 -m [5:6-7].1 -f themes/black-yellow.theme -f cnet-fwd

#######################################################################
# Pktgen Configuration script information:
# Flags 00000814
# Number of ports: 2
# Number ports per page: 4
# Number descriptors: RX 1024 TX: 2048
# Promiscuous mode is Enabled


# Global configuration:
# geometry 121x55
disable mac_from_arp

######################### Port 0 ##################################
#
# Port: 0, Burst (Rx/Tx): 64/ 64, Rate:100%, Flags:00001000, TX Count:Forever
# Sequence count:0, Prime:1 VLAN ID:0001, Link: <UP-40000-FD>
#
# Set up the primary port information:
set 0 count 0
set 0 size 64
set 0 rate 100
set 0 rxburst 64
set 0 txburst 64
set 0 sport 1234
set 0 dport 5678
set 0 prime 1
set 0 type ipv4
set 0 proto tcp
set 0 dst ip 192.168.1.1
set 0 src ip 192.168.0.1/24
set 0 tcp flag clr all
set 0 tcp flag set ack
set 0 tcp seq 74616
set 0 tcp ack 74640
set 0 dst mac 3c:fd:fe:e4:34:c0
set 0 src mac 3c:fd:fe:e6:a5:70
set 0 vlan 1

set 0 pattern abc

set 0 jitter 50
disable 0 mpls
range 0 mpls entry 0x0
disable 0 qinq
set 0 qinqids 0 0
disable 0 gre
disable 0 gre_eth
disable 0 vxlan
set 0 vxlan 0x0 0 0
#
# Port flag values:
disable 0 icmp
disable 0 pcap
disable 0 range
disable 0 latency
disable 0 process
disable 0 capture
disable 0 vlan
#
# Range packet information:
range 0 src mac start 3c:fd:fe:e6:a5:70
range 0 src mac min 00:00:00:00:00:00
range 0 src mac max 00:00:00:00:00:00
range 0 src mac inc 00:00:00:00:00:00

range 0 dst mac start 3c:fd:fe:e4:34:c0
range 0 dst mac min 00:00:00:00:00:00
range 0 dst mac max 00:00:00:00:00:00
range 0 dst mac inc 00:00:00:00:00:00

range 0 src ip start 192.168.0.1
range 0 src ip min 192.168.0.1
range 0 src ip max 192.168.0.254
range 0 src ip inc 0.0.0.0

range 0 dst ip start 192.168.1.1
range 0 dst ip min 192.168.1.1
range 0 dst ip max 192.168.1.254
range 0 dst ip inc 0.0.0.1

range 0 proto tcp

range 0 src port start 1234
range 0 src port min 0
range 0 src port max 65535
range 0 src port inc 1

range 0 dst port start 5678
range 0 dst port min 0
range 0 dst port max 65535
range 0 dst port inc 1

range 0 tcp flag clr all
range 0 tcp flag set ack

range 0 tcp seq start 74616
range 0 tcp seq min 0
range 0 tcp seq max 536870911
range 0 tcp seq inc 0

range 0 tcp ack start 74640
range 0 tcp ack min 0
range 0 tcp ack max 536870911
range 0 tcp ack inc 0

range 0 ttl start 64
range 0 ttl min 0
range 0 ttl max 255
range 0 ttl inc 0

range 0 vlan start 1
range 0 vlan min 1
range 0 vlan max 4095
range 0 vlan inc 0

range 0 cos start 0
range 0 cos min 0
range 0 cos max 7
range 0 cos inc 0

range 0 tos start 0
range 0 tos min 0
range 0 tos max 255
range 0 tos inc 0
range 0 gre key 0

range 0 size start 64
range 0 size min 64
range 0 size max 1518
range 0 size inc 0

#
# Set up the sequence data for the port.
set 0 seq_cnt 0

######################### Port 1 ##################################
#
# Port: 1, Burst (Rx/Tx): 64/ 64, Rate:100%, Flags:00001000, TX Count:Forever
# Sequence count:0, Prime:1 VLAN ID:0001, Link: <UP-40000-FD>
#
# Set up the primary port information:
set 1 count 0
set 1 size 64
set 1 rate 100
set 1 rxburst 64
set 1 txburst 64
set 1 sport 1234
set 1 dport 5678
set 1 prime 1
set 1 type ipv4
set 1 proto tcp
set 1 dst ip 192.168.0.1
set 1 src ip 192.168.1.1/24
set 1 tcp flag clr all
set 1 tcp flag set ack
set 1 tcp seq 74616
set 1 tcp ack 74640
set 1 dst mac 3c:fd:fe:e4:34:c1
set 1 src mac 3c:fd:fe:e6:a5:71
set 1 vlan 1

set 1 pattern abc

set 1 jitter 50
disable 1 mpls
range 1 mpls entry 0x0
disable 1 qinq
set 1 qinqids 0 0
disable 1 gre
disable 1 gre_eth
disable 1 vxlan
set 1 vxlan 0x0 0 0
#
# Port flag values:
disable 1 icmp
disable 1 pcap
disable 1 range
disable 1 latency
disable 1 process
disable 1 capture
disable 1 vlan
#
# Range packet information:
range 1 src mac start 3c:fd:fe:e6:a5:71
range 1 src mac min 00:00:00:00:00:00
range 1 src mac max 00:00:00:00:00:00
range 1 src mac inc 00:00:00:00:00:00

range 1 dst mac start 3c:fd:fe:e4:34:c1
range 1 dst mac min 00:00:00:00:00:00
range 1 dst mac max 00:00:00:00:00:00
range 1 dst mac inc 00:00:00:00:00:00

range 1 src ip start 192.168.1.1
range 1 src ip min 192.168.1.1
range 1 src ip max 192.168.1.254
range 1 src ip inc 0.0.0.0

range 1 dst ip start 192.168.2.1
range 1 dst ip min 192.168.2.1
range 1 dst ip max 192.168.2.254
range 1 dst ip inc 0.0.0.1

range 1 proto tcp

range 1 src port start 1234
range 1 src port min 0
range 1 src port max 65535
range 1 src port inc 1

range 1 dst port start 5678
range 1 dst port min 0
range 1 dst port max 65535
range 1 dst port inc 1

range 1 tcp flag clr all
range 1 tcp flag set ack

range 1 tcp seq start 74616
range 1 tcp seq min 0
range 1 tcp seq max 536870911
range 1 tcp seq inc 0

range 1 tcp ack start 74640
range 1 tcp ack min 0
range 1 tcp ack max 536870911
range 1 tcp ack inc 0

range 1 ttl start 64
range 1 ttl min 0
range 1 ttl max 255
range 1 ttl inc 0

range 1 vlan start 1
range 1 vlan min 1
range 1 vlan max 4095
range 1 vlan inc 0

range 1 cos start 0
range 1 cos min 0
range 1 cos max 7
range 1 cos inc 0

range 1 tos start 0
range 1 tos min 0
range 1 tos max 255
range 1 tos inc 0
range 1 gre key 0

range 1 size start 64
range 1 size min 64
range 1 size max 1518
range 1 size inc 0

#
# Set up the sequence data for the port.
set 1 seq_cnt 0

################################ Done #################################
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
24.05.5
24.07.0
31 changes: 22 additions & 9 deletions app/cli-functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,21 +1145,28 @@ static struct cli_map dbg_map[] = {
{80, "dbg break"},
{90, "dbg memcpy"},
{91, "dbg memcpy %d %d"},
#ifdef TX_DEBUG
{100, "dbg %|enable|disable|on|off tx pcap %P"},
#endif
{-1, NULL}
};
// clang-format on

static const char *dbg_help[] = {
"",
"dbg tx_dbg|dbg - Enable tx debug output",
"dbg tx_rate <portlist> - Show packet rate for all ports",
"dbg mempool|dump <portlist> <type> - Dump out the mempool info for a given type",
" types - rx|tx",
"dbg memzone - List all of the current memzones",
"dbg memseg - List all of the current memsegs",
"dbg hexdump <addr> <len> - hex dump memory at given address",
"dbg break - break into the debugger",
"dbg memcpy [loop-cnt KBytes] - run a memcpy test",
"dbg tx_dbg|dbg - Enable tx debug output",
"dbg tx_rate <portlist> - Show packet rate for all ports",
"dbg mempool|dump <portlist> <type> - Dump out the mempool info for a given type",
" types - rx|tx",
"dbg memzone - List all of the current memzones",
"dbg memseg - List all of the current memsegs",
"dbg hexdump <addr> <len> - hex dump memory at given address",
"dbg break - break into the debugger",
"dbg memcpy [loop-cnt KBytes] - run a memcpy test",
#ifdef TX_DEBUG
"dbg enable|disable tx pcap <portlist> - Enable/disable writing pcap file for transmitted "
"packets",
#endif
CLI_HELP_PAUSE,
NULL};

Expand Down Expand Up @@ -1258,6 +1265,12 @@ dbg_cmd(int argc, char **argv)
rte_memcpy_perf(cnt, len, 0);
rte_memcpy_perf(cnt, len, 1);
break;
#ifdef TX_DEBUG
case 100: /* enable/disable TX packets written to PCAP file */
portlist_parse(argv[4], pktgen.nb_ports, &portlist);
foreach_port(portlist, pktgen_pcap_handler(pinfo, estate(argv[1])));
break;
#endif
default:
return cli_cmd_error("Debug invalid command", "Debug", argc, argv);
}
Expand Down
34 changes: 31 additions & 3 deletions app/pktgen-cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ pktgen_script_save(char *path)
if (pinfo->rnd_bitfields && pinfo->rnd_bitfields->active_specs) {
uint32_t active = pinfo->rnd_bitfields->active_specs;
bf_spec_t *bf;
fprintf(fd, "\n-- Rnd bitfeilds\n");
fprintf(fd, "\n-- Rnd bitfields\n");
for (j = 0; j < MAX_RND_BITFIELDS; j++) {
if ((active & (1 << j)) == 0)
continue;
Expand Down Expand Up @@ -751,7 +751,7 @@ pktgen_lua_save(char *path)
if (pinfo->rnd_bitfields && pinfo->rnd_bitfields->active_specs) {
uint32_t active = pinfo->rnd_bitfields->active_specs;
bf_spec_t *bf;
fprintf(fd, "\n-- Rnd bitfeilds\n");
fprintf(fd, "\n-- Rnd bitfields\n");
fflush(fd);
for (j = 0; j < MAX_RND_BITFIELDS; j++) {
if ((active & (1 << j)) == 0)
Expand Down Expand Up @@ -1431,7 +1431,7 @@ pktgen_stop_latency_sampler(port_info_t *pinfo)
/* Dump stats to file */
outfile = fopen(pinfo->latsamp_outfile, "w");
if (outfile == NULL)
pktgen_log_error("Cannot open the latcol outfile!");
pktgen_log_error("Cannot open the latency outfile!");
else {
pktgen_log_info("Writing to file %s", pinfo->latsamp_outfile);
fprintf(outfile, "Latency\n");
Expand Down Expand Up @@ -3819,3 +3819,31 @@ pktgen_quit(void)
{
cli_quit();
}

static void
_pcap_file_close(port_info_t *port)
{
pktgen_close_pcap_file(port->pcap_file);
port->pcap_file = NULL;
}

static void
_pcap_file_open(port_info_t *port, char *filename)
{
_pcap_file_close(port);

port->pcap_file = pktgen_create_pcap_file(filename);
}

void
pktgen_pcap_handler(port_info_t *pinfo, uint32_t state)
{
if (state == ENABLE_STATE) {
char filename[64];

snprintf(filename, sizeof(filename), "tx-%d.pcap", pinfo->pid);
_pcap_file_open(pinfo, filename);
} else if (state == DISABLE_STATE) {
_pcap_file_close(pinfo);
}
}
1 change: 1 addition & 0 deletions app/pktgen-cmds.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@
void debug_mempool_dump(port_info_t * pinfo, char *name);
void debug_set_port_dump(port_info_t * pinfo, uint32_t cnt);
void debug_tx_rate(port_info_t * pinfo);
void pktgen_pcap_handler(port_info_t * pinfo, uint32_t state);

#if defined(RTE_LIBRTE_PMD_BOND) || defined(RTE_NET_BOND)
void show_bonding_mode(port_info_t * pinfo);
Expand Down
Loading

0 comments on commit 1bd1384

Please sign in to comment.