diff options
author | Eyal Bari <ebari@cisco.com> | 2018-05-16 11:30:23 +0300 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2018-05-21 19:16:37 +0000 |
commit | bd81bdf226c1dc03baaf05f17cf68fbb17bc5dd7 (patch) | |
tree | 2ca4ff0abb81fd144af40c30cc037a9055dfbc3a /src/plugins/dpdk/device/flow.c | |
parent | a52e1668c9976bd5cdd20d02b668df41ea41f16f (diff) |
dpdk:enable flow director perfect mode
when flows are enabled on the device
Change-Id: I971764988d5a9e7078468f627205b3fa60736263
Signed-off-by: Eyal Bari <ebari@cisco.com>
Diffstat (limited to 'src/plugins/dpdk/device/flow.c')
-rw-r--r-- | src/plugins/dpdk/device/flow.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/plugins/dpdk/device/flow.c b/src/plugins/dpdk/device/flow.c index af0c4b6e6bf..5080a9c83bc 100644 --- a/src/plugins/dpdk/device/flow.c +++ b/src/plugins/dpdk/device/flow.c @@ -178,7 +178,8 @@ dpdk_flow_ops_fn (vnet_main_t * vnm, vnet_flow_dev_op_t op, u32 dev_instance, memset (fe, 0, sizeof (*fe)); pool_put (xd->flow_entries, fe); - return 0; + + goto disable_rx_offload; } if (op != VNET_FLOW_DEV_OP_ADD_FLOW) @@ -208,6 +209,12 @@ dpdk_flow_ops_fn (vnet_main_t * vnm, vnet_flow_dev_op_t op, u32 dev_instance, else fe->mark = 0; + if ((xd->flags & DPDK_DEVICE_FLAG_RX_FLOW_OFFLOAD) == 0) + { + xd->flags |= DPDK_DEVICE_FLAG_RX_FLOW_OFFLOAD; + dpdk_device_setup (xd); + } + switch (flow->type) { case VNET_FLOW_TYPE_IP4_N_TUPLE: @@ -242,6 +249,14 @@ done: pool_put (xd->flow_lookup_entries, fle); } } +disable_rx_offload: + if ((xd->flags & DPDK_DEVICE_FLAG_RX_FLOW_OFFLOAD) != 0 + && pool_elts (xd->flow_entries) == 0) + { + xd->flags &= ~DPDK_DEVICE_FLAG_RX_FLOW_OFFLOAD; + dpdk_device_setup (xd); + } + return rv; } |