Skip to content

Commit

Permalink
app/testpmd: add tunnel types
Browse files Browse the repository at this point in the history
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: 1b9f274 ("app/testpmd: add commands for tunnel offload")
Cc: [email protected]

Signed-off-by: Eli Britstein <[email protected]>
Reviewed-by: Gregory Etelson <[email protected]>
  • Loading branch information
elibritstein authored and Ferruh Yigit committed Oct 19, 2021
1 parent 287ca31 commit ad6a8a2
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/test-pmd/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1249,6 +1249,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;
Expand Down Expand Up @@ -1309,6 +1318,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);
Expand Down

0 comments on commit ad6a8a2

Please sign in to comment.