diff options
author | Simon Zhang <yuwei1.zhang@intel.com> | 2019-04-16 22:00:15 +0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-04-16 15:54:15 +0000 |
commit | 3cf215aab7237d44cf153b43d80a971be9300626 (patch) | |
tree | 0df16936745156e57c2c16ddfe4fd4d8104950cf /src/plugins/dpdk/device/flow.c | |
parent | 958170a45f35ad1f08c1af48990a6b0e63d6c1ee (diff) |
Add direct packets to specific flow action in dpdk flow
Change-Id: I48cd8052f9509efdf13f64ab279edb66a2d4a0a9
Signed-off-by: Simon Zhang <yuwei1.zhang@intel.com>
Diffstat (limited to 'src/plugins/dpdk/device/flow.c')
-rw-r--r-- | src/plugins/dpdk/device/flow.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/plugins/dpdk/device/flow.c b/src/plugins/dpdk/device/flow.c index 3f9553105f8..1b8b5906b1c 100644 --- a/src/plugins/dpdk/device/flow.c +++ b/src/plugins/dpdk/device/flow.c @@ -41,6 +41,7 @@ dpdk_flow_add (dpdk_device_t * xd, vnet_flow_t * f, dpdk_flow_entry_t * fe) struct rte_flow_item_udp udp[2] = { }; struct rte_flow_item_tcp tcp[2] = { }; struct rte_flow_action_mark mark = { 0 }; + struct rte_flow_action_queue queue = { 0 }; struct rte_flow_item *item, *items = 0; struct rte_flow_action *action, *actions = 0; @@ -201,10 +202,21 @@ dpdk_flow_add (dpdk_device_t * xd, vnet_flow_t * f, dpdk_flow_entry_t * fe) vec_add2 (actions, action, 1); action->type = RTE_FLOW_ACTION_TYPE_PASSTHRU; - vec_add2 (actions, action, 1); - mark.id = fe->mark; - action->type = RTE_FLOW_ACTION_TYPE_MARK; - action->conf = &mark; + if (f->actions & VNET_FLOW_ACTION_REDIRECT_TO_QUEUE) + { + vec_add2 (actions, action, 1); + queue.index = f->redirect_queue; + action->type = RTE_FLOW_ACTION_TYPE_QUEUE; + action->conf = &queue; + } + + if (f->actions & VNET_FLOW_ACTION_MARK) + { + vec_add2 (actions, action, 1); + mark.id = fe->mark; + action->type = RTE_FLOW_ACTION_TYPE_MARK; + action->conf = &mark; + } vec_add2 (actions, action, 1); action->type = RTE_FLOW_ACTION_TYPE_END; |