[dpdk-dev,v5,2/2] app/testpmd: testpmd support Tx generic tunnel offloads
Checks
Commit Message
"show port cap" and "csum parse tunnel" command support TX generic
tunnel offloads
Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
app/test-pmd/cmdline.c | 14 ++++++++++++--
app/test-pmd/config.c | 17 +++++++++++++++++
2 files changed, 29 insertions(+), 2 deletions(-)
Comments
Wrong patch, please ignore this one.
> -----Original Message-----
> From: Xueming Li <xuemingl@mellanox.com>
> Sent: Friday, April 20, 2018 9:07 PM
> To: Shahaf Shuler <shahafs@mellanox.com>; Nelio Laranjeiro <notifications@github.com>; Wenzhuo Lu
> <wenzhuo.lu@intel.com>; Jingjing Wu <jingjing.wu@intel.com>; Thomas Monjalon <thomas@monjalon.net>;
> Adrien Mazarguil <adrien.mazarguil@6wind.com>
> Cc: Xueming(Steven) Li <xuemingl@mellanox.com>; dev@dpdk.org
> Subject: [PATCH v5 2/2] 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@mellanox.com>
> ---
> app/test-pmd/cmdline.c | 14 ++++++++++++-- app/test-pmd/config.c | 17 +++++++++++++++++
> 2 files changed, 29 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index 512e3b55e..4ec3dab56 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -4157,6 +4157,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;
> }
>
> @@ -4184,13 +4190,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 dd051f5ca..f329a8810 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
> --
> 2.13.3
@@ -4157,6 +4157,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;
}
@@ -4184,13 +4190,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);
@@ -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