[ovs-dev] [PATCH 5/7] netdev-dpdk: retry with queue action
Darrell Ball
dball at vmware.com
Tue Aug 29 08:15:56 UTC 2017
On 8/22/17, 11:24 PM, "Yuanhan Liu" <yliu at fridaylinux.org> wrote:
From: Finn Christensen <fc at napatech.com>
AFAIK, both Mellanox and Intel's NIC do not support a pure MARK action.
They both require to use it together with some other actions, like QUEUE.
To workaround it, retry with a queue action when first try failed.
Moreover, some Intel's NIC (say XL710) needs the QUEUE action set before
the MARK action.
Signed-off-by: Finn Christensen <fc at napatech.com>
Signed-off-by: Yuanhan Liu <yliu at fridaylinux.org>
---
lib/netdev-dpdk.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 8089da8..230d506 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -3629,9 +3629,29 @@ netdev_dpdk_add_rte_flow_offload(struct netdev *netdev,
}
ADD_FLOW_ACTION(RTE_FLOW_ACTION_TYPE_END, NULL);
+ int tried = 0;
bool ?
+ struct rte_flow_action_queue queue;
+again:
Maybe replace with loop semantics ?
flow = rte_flow_create(dev->port_id, &flow_attr, patterns.items,
actions.actions, &error);
- if (!flow) {
+ if (!flow && !tried && actions_len) {
+ /*
+ * create flow failed, try again with QUEUE ACTION
+ * FIXME: to not fix with queue id.
Could we add commit comments here and elaborate a bit if possible ?
+ */
+ queue.index = 0;
+
+ /* re-build the action */
+ actions.cnt = 0;
+ ADD_FLOW_ACTION(RTE_FLOW_ACTION_TYPE_QUEUE, &queue);
+ ADD_FLOW_ACTION(RTE_FLOW_ACTION_TYPE_MARK, &mark);
+ ADD_FLOW_ACTION(RTE_FLOW_ACTION_TYPE_END, NULL);
+
+ VLOG_INFO("rte flow create failed, try again with adding QUEUE action\n");
+ tried = 1;
+
+ goto again;
+ } else if (!flow) {
VLOG_ERR("rte flow creat error: %u : message : %s\n",
error.type, error.message);
goto err;
--
2.7.4
More information about the dev
mailing list