[dpdk-dev] [PATCH v2 4/4] app/testpmd: support tunnel offload API
Gregory Etelson
getelson at nvidia.com
Tue Sep 15 12:44:45 CEST 2020
::::snip::::
@@ -1520,6 +1574,75 @@ port_flow_create(portid_t port_id,
}
id = port->flow_list->id + 1;
}
+ if (tunnel_ops->enabled) {
+ int ret;
+ pft = port_flow_locate_tunnel(port, tunnel_ops->id);
+ if (!pft) {
+ printf("failed to locate port flow tunnel #%u\n",
+ tunnel_ops->id);
+ return -ENOENT;
+ }
+ if (tunnel_ops->actions) {
+ uint32_t num_actions;
+ const struct rte_flow_action *aptr;
+
+ ret = rte_flow_tunnel_decap_set(port_id, &pft->tunnel,
+ &pft->pmd_actions,
+ &pft->num_pmd_actions,
+ &error);
> Does tunnel_ops always indicate decap?
> Shouldn't there be a check for encap/decap? Or check for direction?
When tunnel offload API is enabled, application does not need to specify
decap in flow rules - that action is carried out internally by PMD.
If application activated the API, it's expected that it will call rte_flow_tunnel_decap_set()
and rte_flow_tunnel_math() and use results obtained by the functions to compile flow rule parameters.
tunnel_ops members specify 2 things
1 - tunnel offload API was activated
2 - what function, decap_set or match, should be activated and how to proceed with results
+ if (ret) {
+ port_flow_complain(&error);
+ return -EINVAL;
+ }
::::snip::::
More information about the dev
mailing list