[dpdk-dev] [PATCH v4 2/4] app/testpmd: testpmd support Tx generic tunnel offloads
Iremonger, Bernard
bernard.iremonger at intel.com
Tue Apr 17 16:24:52 CEST 2018
Hi Lu,
> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Xueming Li
> Sent: Sunday, April 8, 2018 1:33 PM
> To: Lu, Wenzhuo <wenzhuo.lu at intel.com>; Wu, Jingjing
> <jingjing.wu at intel.com>; Thomas Monjalon <thomas at monjalon.net>;
> Yongseok Koh <yskoh at mellanox.com>; Olivier MATZ
> <olivier.matz at 6wind.com>; Shahaf Shuler <shahafs at mellanox.com>
> Cc: Xueming Li <xuemingl at mellanox.com>; Yigit, Ferruh
> <ferruh.yigit at intel.com>; dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v4 2/4] app/testpmd: testpmd support Tx generic
> tunnel offloads
>
> "show port cap" and "csum parse tunnel" command support TX generic tunnel
> offloads
>
> Signed-off-by: Xueming Li <xuemingl at mellanox.com>
> ---
> app/test-pmd/cmdline.c | 14 ++++++++++++--
> app/test-pmd/config.c | 17 +++++++++++++++++
> app/test-pmd/csumonly.c | 3 ++-
> 3 files changed, 31 insertions(+), 3 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index
> 40b31ad7e..a81112220 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -4013,6 +4013,12 @@ check_tunnel_tso_nic_support(portid_t port_id)
> if (!(dev_info.tx_offload_capa &
> DEV_TX_OFFLOAD_GENEVE_TNL_TSO))
> printf("Warning: GENEVE TUNNEL TSO not supported therefore
> "
> "not enabled for port %d\n", port_id);
> + if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IP_TNL_TSO))
> + printf("Warning: IP TUNNEL TSO not supported therefore "
> + "not enabled for port %d\n", port_id);
> + if (!(dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TNL_TSO))
> + printf("Warning: UDP TUNNEL TSO not supported therefore "
> + "not enabled for port %d\n", port_id);
> return dev_info;
> }
>
> @@ -4040,13 +4046,17 @@ cmd_tunnel_tso_set_parsed(void *parsed_result,
> ~(DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
> DEV_TX_OFFLOAD_GRE_TNL_TSO |
> DEV_TX_OFFLOAD_IPIP_TNL_TSO |
> - DEV_TX_OFFLOAD_GENEVE_TNL_TSO);
> + DEV_TX_OFFLOAD_GENEVE_TNL_TSO |
> + DEV_TX_OFFLOAD_IP_TNL_TSO |
> + DEV_TX_OFFLOAD_UDP_TNL_TSO);
> printf("TSO for tunneled packets is disabled\n");
> } else {
> uint64_t tso_offloads = (DEV_TX_OFFLOAD_VXLAN_TNL_TSO |
> DEV_TX_OFFLOAD_GRE_TNL_TSO |
> DEV_TX_OFFLOAD_IPIP_TNL_TSO |
> -
> DEV_TX_OFFLOAD_GENEVE_TNL_TSO);
> + DEV_TX_OFFLOAD_GENEVE_TNL_TSO
> |
> + DEV_TX_OFFLOAD_IP_TNL_TSO |
> + DEV_TX_OFFLOAD_UDP_TNL_TSO);
>
> ports[res->port_id].dev_conf.txmode.offloads |=
> (tso_offloads & dev_info.tx_offload_capa); diff --git
> a/app/test-pmd/config.c b/app/test-pmd/config.c index 4bb255c62..481d2b62d
> 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -722,6 +722,23 @@ port_offload_cap_display(portid_t port_id)
> printf("off\n");
> }
>
> + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IP_TNL_TSO) {
> + printf("IP tunnel TSO: ");
> + if (ports[port_id].dev_conf.txmode.offloads &
> + DEV_TX_OFFLOAD_IP_TNL_TSO)
> + printf("on\n");
> + else
> + printf("off\n");
> + }
> +
> + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TNL_TSO) {
> + printf("UDP tunnel TSO: ");
> + if (ports[port_id].dev_conf.txmode.offloads &
> + DEV_TX_OFFLOAD_UDP_TNL_TSO)
> + printf("on\n");
> + else
> + printf("off\n");
> + }
> }
>
> int
> diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c index
> 5f5ab64aa..7b2309372 100644
> --- a/app/test-pmd/csumonly.c
> +++ b/app/test-pmd/csumonly.c
> @@ -693,7 +693,8 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
> info.l3_len);
> parse_vxlan(udp_hdr, &info, m->packet_type);
> if (info.is_tunnel)
> - tx_ol_flags |=
> PKT_TX_TUNNEL_VXLAN;
> + tx_ol_flags |=
> (PKT_TX_TUNNEL_VXLAN |
> + PKT_TX_OUTER_UDP);
> } else if (info.l4_proto == IPPROTO_GRE) {
> struct simple_gre_hdr *gre_hdr;
>
> --
> 2.13.3
This patch fails to compile on latest master branch.
/root/dpdk_sforge_2/app/test-pmd/csumonly.c: In function 'pkt_burst_checksum_forward':
/root/dpdk_sforge_2/app/test-pmd/csumonly.c:700:8: error: 'PKT_TX_OUTER_UDP' undeclared (first use in this function)
PKT_TX_OUTER_UDP);
^
/root/dpdk_sforge_2/app/test-pmd/csumonly.c:700:8: note: each undeclared identifier is reported only once for each function it appears in
make[5]: *** [csumonly.o] Error 1
make[4]: *** [test-pmd] Error 2
make[3]: *** [app] Error 2
make[2]: *** [all] Error 2
make[1]: *** [pre_install] Error 2
make: *** [install] Error 2
Regards,
Bernard.
More information about the dev
mailing list