net/ice: handle flow mark offload properly
Checks
Commit Message
1. Do not select vector path if DEV_RX_OFFLOAD_FLOW_MARK is required.
2. return error when a rte_flow rule require software mark action while
DEV_RX_OFFLOAD_FLOW_MARK is not configured.
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
This patch depends on patchset:
http://patchwork.dpdk.org/project/dpdk/list/?series=7076
drivers/net/ice/ice_fdir_filter.c | 8 +++++++-
drivers/net/ice/ice_rxtx_vec_common.h | 6 +++++-
2 files changed, 12 insertions(+), 2 deletions(-)
@@ -1254,6 +1254,7 @@ ice_fdir_parse_action(struct ice_adapter *ad,
struct rte_flow_error *error,
struct ice_fdir_filter_conf *filter)
{
+ struct rte_eth_rxmode *rxmode = &ad->eth_dev->data->dev_conf.rxmode;
struct ice_pf *pf = &ad->pf;
const struct rte_flow_action_queue *act_q;
const struct rte_flow_action_mark *mark_spec = NULL;
@@ -1305,8 +1306,13 @@ ice_fdir_parse_action(struct ice_adapter *ad,
return ret;
break;
case RTE_FLOW_ACTION_TYPE_MARK:
+ if (!(rxmode->offloads & DEV_RX_OFFLOAD_FLOW_MARK)) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ACTION, actions,
+ "DEV_RX_OFFLOAD_FLOW_MARK is not enabled");
+ return -rte_errno;
+ }
mark_num++;
-
mark_spec = actions->conf;
filter->input.fltr_id = mark_spec->id;
break;
@@ -266,8 +266,12 @@ ice_tx_vec_queue_default(struct ice_tx_queue *txq)
static inline int
ice_rx_vec_dev_check_default(struct rte_eth_dev *dev)
{
- int i;
+ struct rte_eth_rxmode *rxmode = &dev->data->dev_conf.rxmode;
struct ice_rx_queue *rxq;
+ int i;
+
+ if (rxmode->offloads & DEV_RX_OFFLOAD_FLOW_MARK)
+ return -1;
for (i = 0; i < dev->data->nb_rx_queues; i++) {
rxq = dev->data->rx_queues[i];