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

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

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Eli Britstein Sept. 13, 2021, 2:25 p.m. UTC
  Current testpmd implementation supports VXLAN only for tunnel offload.
Add GRE, NVGRE and GENEVE for tunnel offload flow matches.

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

Comments

Ferruh Yigit Sept. 20, 2021, 3:57 p.m. UTC | #1
On 9/13/2021 3:25 PM, Eli Britstein wrote:
> Current testpmd implementation supports VXLAN only for tunnel offload.
> Add GRE, NVGRE and GENEVE for tunnel offload flow matches.
> 

Hi Eli,

I assume tunnel types are added, but forgot to add the flow tunnel support for
them, so this patch is fixing it. If so can you please add the fixes commits?

Also it may help to give a sample of the enabled commands in the commit log, to
record.

Thanks,
ferruh

> Signed-off-by: Eli Britstein <elibr@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 31d8ba1b91..fba388da5c 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -1212,6 +1212,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;
> @@ -1272,6 +1281,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);
>
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 31d8ba1b91..fba388da5c 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -1212,6 +1212,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;
@@ -1272,6 +1281,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);