Skip to content

Commit

Permalink
fixup pktperf for new fgen changes
Browse files Browse the repository at this point in the history
Signed-off-by: Keith Wiles <keith.wiles@intel.com>
  • Loading branch information
KeithWiles committed Nov 6, 2024
1 parent 867e183 commit 2fd243b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/pktperf/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,14 +343,14 @@ parse_args(int argc, char **argv)
break;

case 'f': /* FGEN string */
if (fgen_load_strings(info->fgen, (const char **)&optarg, 1) < 0) {
if (fgen_load_strings(info->fgen, &optarg, 1) < 0) {
ERR_PRINT("Unable to load FGEN string '%s'\n", optarg);
usage(EXIT_FAILURE);
}
break;

case 'F': /* FGEN file */
if (fgen_load_file(info->fgen, optarg) < 0) {
if (fgen_load_files(info->fgen, &optarg, 1) < 0) {
ERR_PRINT("Unable to load FGEN file '%s'\n", optarg);
usage(EXIT_FAILURE);
}
Expand Down
15 changes: 15 additions & 0 deletions examples/pktperf/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,21 @@ port_setup(l2p_port_t *port)
ERR_RET("Port %u, Failed to disable Ptype parsing\n", pid);
DBG_PRINT("Port %u configured with %08x Ptypes\n", pid, RTE_PTYPE_UNKNOWN);

if (port->mtu_size < dev_info.min_mtu) {
INFO_PRINT("Increasing MTU from %u to %u", port->mtu_size, dev_info.min_mtu);
port->mtu_size = dev_info.min_mtu;
port->max_pkt_size = dev_info.min_mtu + RTE_ETHER_HDR_LEN;
}
if (port->mtu_size > dev_info.max_mtu) {
INFO_PRINT("Reducing MTU from %u to %u", port->mtu_size, dev_info.max_mtu);
port->mtu_size = dev_info.max_mtu;
port->max_pkt_size = dev_info.max_mtu + RTE_ETHER_HDR_LEN;
}

if ((ret = rte_eth_dev_set_mtu(pid, port->mtu_size)) < 0)
ERR_RET("Cannot set MTU %u on port %u, (%d)%s", port->mtu_size, pid, -ret,
rte_strerror(-ret));

DBG_PRINT("Port %u Rx/Tx queues %u/%u\n", pid, port->num_rx_qids, port->num_tx_qids);

/* Setup Rx/Tx Queues */
Expand Down

0 comments on commit 2fd243b

Please sign in to comment.