[V2,1/2] app/testpmd: add tunnel types

Message ID 20210923084301.5139-1-elibr@nvidia.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [V2,1/2] app/testpmd: add tunnel types |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Eli Britstein Sept. 23, 2021, 8:43 a.m. UTC
  Current testpmd implementation supports VXLAN only for tunnel offload.
Add GRE, NVGRE and GENEVE for tunnel offload flow matches.

For example:
testpmd> flow tunnel create 0 type vxlan
port 0: flow tunnel #1 type vxlan
testpmd> flow tunnel create 0 type nvgre
port 0: flow tunnel #2 type nvgre
testpmd> flow tunnel create 0 type gre
port 0: flow tunnel #3 type gre
testpmd> flow tunnel create 0 type geneve
port 0: flow tunnel #4 type geneve

Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")
Cc: stable@dpdk.org

Signed-off-by: Eli Britstein <elibr@nvidia.com>
---
 app/test-pmd/config.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
  

Comments

Ferruh Yigit Oct. 14, 2021, 5:15 p.m. UTC | #1
On 9/23/2021 9:43 AM, Eli Britstein wrote:
> Current testpmd implementation supports VXLAN only for tunnel offload.
> Add GRE, NVGRE and GENEVE for tunnel offload flow matches.
> 
> For example:
> testpmd> flow tunnel create 0 type vxlan
> port 0: flow tunnel #1 type vxlan
> testpmd> flow tunnel create 0 type nvgre
> port 0: flow tunnel #2 type nvgre
> testpmd> flow tunnel create 0 type gre
> port 0: flow tunnel #3 type gre
> testpmd> flow tunnel create 0 type geneve
> port 0: flow tunnel #4 type geneve
> 
> Fixes: 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Eli Britstein <elibr@nvidia.com>

Hi Matan, Gregory,

Set looks good to me but can you please help reviewing it?

Thanks,
ferruh
  
Gregory Etelson Oct. 14, 2021, 6:29 p.m. UTC | #2
> Subject: [PATCH V2 1/2] app/testpmd: add
> tunnel types
> 
> Current testpmd implementation supports
> VXLAN only for tunnel offload.
> Add GRE, NVGRE and GENEVE for tunnel offload
> flow matches.
> 
> For example:
> testpmd> flow tunnel create 0 type vxlan
> port 0: flow tunnel #1 type vxlan
> testpmd> flow tunnel create 0 type nvgre
> port 0: flow tunnel #2 type nvgre
> testpmd> flow tunnel create 0 type gre
> port 0: flow tunnel #3 type gre
> testpmd> flow tunnel create 0 type geneve
> port 0: flow tunnel #4 type geneve
> 
> Fixes: 1b9f274623b8 ("app/testpmd: add
> commands for tunnel offload")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Eli Britstein <elibr@nvidia.com>

Reviewed-by: Gregory Etelson <getelson@nvidia.com> 

> ---
>  app/test-pmd/config.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-
> pmd/config.c
> index f5765b34f7..2bb9fc6784 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1210,6 +1210,15 @@
> port_flow_tunnel_type(struct rte_flow_tunnel
> *tunnel)
>  	case RTE_FLOW_ITEM_TYPE_VXLAN:
>  		type = "vxlan";
>  		break;
> +	case RTE_FLOW_ITEM_TYPE_GRE:
> +		type = "gre";
> +		break;
> +	case RTE_FLOW_ITEM_TYPE_NVGRE:
> +		type = "nvgre";
> +		break;
> +	case RTE_FLOW_ITEM_TYPE_GENEVE:
> +		type = "geneve";
> +		break;
>  	}
> 
>  	return type;
> @@ -1270,6 +1279,12 @@ void
> port_flow_tunnel_create(portid_t port_id, const
> struct tunnel_ops *ops)
> 
>  	if (!strcmp(ops->type, "vxlan"))
>  		type =
> RTE_FLOW_ITEM_TYPE_VXLAN;
> +	else if (!strcmp(ops->type, "gre"))
> +		type =
> RTE_FLOW_ITEM_TYPE_GRE;
> +	else if (!strcmp(ops->type, "nvgre"))
> +		type =
> RTE_FLOW_ITEM_TYPE_NVGRE;
> +	else if (!strcmp(ops->type, "geneve"))
> +		type =
> RTE_FLOW_ITEM_TYPE_GENEVE;
>  	else {
>  		fprintf(stderr, "cannot offload
> \"%s\" tunnel type\n",
>  			ops->type);
> --
> 2.28.0.2311.g225365fb51
  
Ferruh Yigit Oct. 19, 2021, 9:52 p.m. UTC | #3
On 10/14/2021 7:29 PM, Gregory Etelson wrote:
>> Subject: [PATCH V2 1/2] app/testpmd: add
>> tunnel types
>>
>> Current testpmd implementation supports
>> VXLAN only for tunnel offload.
>> Add GRE, NVGRE and GENEVE for tunnel offload
>> flow matches.
>>
>> For example:
>> testpmd> flow tunnel create 0 type vxlan
>> port 0: flow tunnel #1 type vxlan
>> testpmd> flow tunnel create 0 type nvgre
>> port 0: flow tunnel #2 type nvgre
>> testpmd> flow tunnel create 0 type gre
>> port 0: flow tunnel #3 type gre
>> testpmd> flow tunnel create 0 type geneve
>> port 0: flow tunnel #4 type geneve
>>
>> Fixes: 1b9f274623b8 ("app/testpmd: add
>> commands for tunnel offload")
>> Cc: stable@dpdk.org
>>
>> Signed-off-by: Eli Britstein <elibr@nvidia.com>
> 
> Reviewed-by: Gregory Etelson <getelson@nvidia.com>
> 

Series applied to dpdk-next-net/main, thanks.
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index f5765b34f7..2bb9fc6784 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1210,6 +1210,15 @@  port_flow_tunnel_type(struct rte_flow_tunnel *tunnel)
 	case RTE_FLOW_ITEM_TYPE_VXLAN:
 		type = "vxlan";
 		break;
+	case RTE_FLOW_ITEM_TYPE_GRE:
+		type = "gre";
+		break;
+	case RTE_FLOW_ITEM_TYPE_NVGRE:
+		type = "nvgre";
+		break;
+	case RTE_FLOW_ITEM_TYPE_GENEVE:
+		type = "geneve";
+		break;
 	}
 
 	return type;
@@ -1270,6 +1279,12 @@  void port_flow_tunnel_create(portid_t port_id, const struct tunnel_ops *ops)
 
 	if (!strcmp(ops->type, "vxlan"))
 		type = RTE_FLOW_ITEM_TYPE_VXLAN;
+	else if (!strcmp(ops->type, "gre"))
+		type = RTE_FLOW_ITEM_TYPE_GRE;
+	else if (!strcmp(ops->type, "nvgre"))
+		type = RTE_FLOW_ITEM_TYPE_NVGRE;
+	else if (!strcmp(ops->type, "geneve"))
+		type = RTE_FLOW_ITEM_TYPE_GENEVE;
 	else {
 		fprintf(stderr, "cannot offload \"%s\" tunnel type\n",
 			ops->type);