Skip to contentSkip to conversation

app/testpmd: add tunnel types

PATCH Superseded Eli Britstein 4 participants 10 messages Sep 13, 2021 – Oct 19, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 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.

---
 app/test-pmd/config.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
app/test-pmd/config.c +15 -0
index 31d8ba1b91..fba388da5c 100644
@@ -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);
Signature · 1 line
2.28.0.2311.g225365fb51
#1 lore raw

PATCH 2/2 net/mlx5: add support for more tunnel types

Accept RTE_FLOW_ITEM_TYPE_GRE, RTE_FLOW_ITEM_TYPE_NVGRE and RTE_FLOW_ITEM_TYPE_GENEVE as valid tunnel types.

---
 drivers/net/mlx5/mlx5_flow.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/mlx5/mlx5_flow.c +3 -0
index 4762fa0f5f..a2810c4be3 100644
@@ -9099,6 +9099,9 @@ mlx5_flow_tunnel_validate(struct rte_eth_dev *dev,
 		err_msg = "unsupported tunnel type";
 		goto out;
 	case RTE_FLOW_ITEM_TYPE_VXLAN:
+	case RTE_FLOW_ITEM_TYPE_GRE:
+	case RTE_FLOW_ITEM_TYPE_NVGRE:
+	case RTE_FLOW_ITEM_TYPE_GENEVE:
 		break;
 	}
 
Signature · 1 line
2.28.0.2311.g225365fb51
Acked-by on v1 2/2
#2 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/mlx5: add support for more tunnel types

Quoted 9 lines

-----Original Message-----
From: Eli Britstein <[email protected]>
Sent: Monday, September 13, 2021 17:26
To: [email protected]
Cc: [email protected]; Matan Azrad <[email protected]>; Shahaf Shuler <[email protected]>; Slava Ovsiienko <[email protected]>; Gregory Etelson <[email protected]>; Eli Britstein <[email protected]>
Subject: [PATCH 2/2] net/mlx5: add support for more tunnel types

Quoted 4 lines

Accept RTE_FLOW_ITEM_TYPE_GRE, RTE_FLOW_ITEM_TYPE_NVGRE and RTE_FLOW_ITEM_TYPE_GENEVE as valid tunnel types.

#3 lore raw
In reply to Eli Britstein
Quoted 3 lines · Eli Britstein

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

Quoted 39 lines
---
 app/test-pmd/config.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
app/test-pmd/config.c +15 -0
index 31d8ba1b91..fba388da5c 100644
@@ -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);
#4 lore raw

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")
---
 app/test-pmd/config.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
app/test-pmd/config.c +15 -0
index f5765b34f7..2bb9fc6784 100644
@@ -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);
Signature · 1 line
2.28.0.2311.g225365fb51
#5 lore raw

PATCH v2 2/2 net/mlx5: add support for more tunnel types

Accept RTE_FLOW_ITEM_TYPE_GRE, RTE_FLOW_ITEM_TYPE_NVGRE and RTE_FLOW_ITEM_TYPE_GENEVE as valid tunnel types.

Fixes 4ec6360de37d ("net/mlx5: implement tunnel offload")
---
 drivers/net/mlx5/mlx5_flow.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/mlx5/mlx5_flow.c +3 -0
index c914a7120c..6a03fc52d7 100644
@@ -9123,6 +9123,9 @@ mlx5_flow_tunnel_validate(struct rte_eth_dev *dev,
 		err_msg = "unsupported tunnel type";
 		goto out;
 	case RTE_FLOW_ITEM_TYPE_VXLAN:
+	case RTE_FLOW_ITEM_TYPE_GRE:
+	case RTE_FLOW_ITEM_TYPE_NVGRE:
+	case RTE_FLOW_ITEM_TYPE_GENEVE:
 		break;
 	}
 
Signature · 1 line
2.28.0.2311.g225365fb51
Acked-by Viacheslav Ovsiienko on v2 2/2
#6 lore raw

Re: [dpdk-dev] [PATCH V2 2/2] net/mlx5: add support for more tunnel types

Quoted 7 lines · Eli Britstein

Accept RTE_FLOW_ITEM_TYPE_GRE, RTE_FLOW_ITEM_TYPE_NVGRE and RTE_FLOW_ITEM_TYPE_GENEVE as valid tunnel types.

Fixes 4ec6360de37d ("net/mlx5: implement tunnel offload")

Moving ack form first version of the set for record:

#7 lore raw
In reply to Eli Britstein
Quoted 13 lines · Eli Britstein

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

Quoted 4 lines
Fixes 1b9f274623b8 ("app/testpmd: add commands for tunnel offload")

Hi Matan, Gregory,

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

Thanks,
ferruh

Reviewed-by on v2 1/2
#8 lore raw
In reply to Eli Britstein
Quoted 18 lines

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

Quoted 5 lines
Fixes 1b9f274623b8 ("app/testpmd: add

commands for tunnel offload")
Cc: [email protected]

Quoted 49 lines
---
 app/test-pmd/config.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
app/test- renamed from app/test-pmd/config.c +0 -0

pmd/config.c
index f5765b34f7..2bb9fc6784 100644

app/test-pmd/config.c +0 -0
@@ -1210,6 +1210,15 @@

port_flow_tunnel_type(struct rte_flow_tunnel *tunnel)

app/test-pmd/config.c +9 -0
 	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)

app/test-pmd/config.c +0 -0
 	if (!strcmp(ops->type, "vxlan"))
 		type =

RTE_FLOW_ITEM_TYPE_VXLAN;

app/test-pmd/config.c +2 -0
+	else if (!strcmp(ops->type, "gre"))
+		type =

RTE_FLOW_ITEM_TYPE_GRE;

app/test-pmd/config.c +2 -0
+	else if (!strcmp(ops->type, "nvgre"))
+		type =

RTE_FLOW_ITEM_TYPE_NVGRE;

app/test-pmd/config.c +2 -0
+	else if (!strcmp(ops->type, "geneve"))
+		type =

RTE_FLOW_ITEM_TYPE_GENEVE;

app/test-pmd/config.c +0 -0
 	else {
 		fprintf(stderr, "cannot offload

\"%s\" tunnel type\n",
ops->type);
--
2.28.0.2311.g225365fb51

#9 lore raw
Quoted 18 lines · Gregory Etelson
Quoted 18 lines

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

Quoted 8 lines
Quoted 5 lines
Fixes 1b9f274623b8 ("app/testpmd: add

commands for tunnel offload")
Cc: [email protected]

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