Skip to content

Commit

Permalink
app/testpmd: fix tunnel TSO configuration
Browse files Browse the repository at this point in the history
[ upstream commit e43dc93803c4623840472c6109ef05e26286ec2f ]

Currently, there are two conditions to set tunnel TSO, like "parse
tunnel" and "outer IP checksum".
If these conditions are not satisfied, testpmd should not change their
configuration, like tx_offloads on port and per queue, and no need to
request "reconfig device".

Fixes: 597f9fa ("app/testpmd: convert to new Tx offloads API")

Signed-off-by: Huisong Li <lihuisong@huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@amd.com>
  • Loading branch information
LiHuiSong1 authored and bluca committed Nov 15, 2023
1 parent d6dd9c8 commit 0325a1c
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions app/test-pmd/cmdline.c
Original file line number Diff line number Diff line change
Expand Up @@ -4999,12 +4999,6 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,
res->port_id);
return;
}
check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa);

ports[res->port_id].dev_conf.txmode.offloads |=
(all_tunnel_tso & dev_info.tx_offload_capa);
printf("TSO segment size for tunneled packets is %d\n",
ports[res->port_id].tunnel_tso_segsz);

/* Below conditions are needed to make it work:
* (1) tunnel TSO is supported by the NIC;
Expand All @@ -5017,14 +5011,23 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,
* is not necessary for IPv6 tunneled pkts because there's no
* checksum in IP header anymore.
*/

if (!ports[res->port_id].parse_tunnel)
printf("Warning: csum parse_tunnel must be set "
"so that tunneled packets are recognized\n");
if (!ports[res->port_id].parse_tunnel) {
fprintf(stderr,
"Error: csum parse_tunnel must be set so that tunneled packets are recognized\n");
return;
}
if (!(ports[res->port_id].dev_conf.txmode.offloads &
DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM))
printf("Warning: csum set outer-ip must be set to hw "
"if outer L3 is IPv4; not necessary for IPv6\n");
DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM)) {
fprintf(stderr,
"Error: csum set outer-ip must be set to hw if outer L3 is IPv4; not necessary for IPv6\n");
return;
}

check_tunnel_tso_nic_support(res->port_id, dev_info.tx_offload_capa);
ports[res->port_id].dev_conf.txmode.offloads |=
(all_tunnel_tso & dev_info.tx_offload_capa);
printf("TSO segment size for tunneled packets is %d\n",
ports[res->port_id].tunnel_tso_segsz);
}

cmd_config_queue_tx_offloads(&ports[res->port_id]);
Expand Down

0 comments on commit 0325a1c

Please sign in to comment.