DPDK patches and discussions
 help / color / mirror / Atom feed
From: Qi Zhang <qi.z.zhang@intel.com>
To: qiming.yang@intel.com, xiaolong.ye@intel.com
Cc: dev@dpdk.org, yahui.cao@intel.com, beilei.xing@intel.com,
	Qi Zhang <qi.z.zhang@intel.com>
Subject: [dpdk-dev] [PATCH] net/ice: handle flow mark offload properly
Date: Tue,  5 Nov 2019 15:04:00 +0800	[thread overview]
Message-ID: <20191105070400.40511-1-qi.z.zhang@intel.com> (raw)

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(-)

diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c
index fbbc41ff0..83d3adab9 100644
--- a/drivers/net/ice/ice_fdir_filter.c
+++ b/drivers/net/ice/ice_fdir_filter.c
@@ -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;
diff --git a/drivers/net/ice/ice_rxtx_vec_common.h b/drivers/net/ice/ice_rxtx_vec_common.h
index 080ca4175..9d8918928 100644
--- a/drivers/net/ice/ice_rxtx_vec_common.h
+++ b/drivers/net/ice/ice_rxtx_vec_common.h
@@ -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];
-- 
2.13.6


                 reply	other threads:[~2019-11-05  7:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191105070400.40511-1-qi.z.zhang@intel.com \
    --to=qi.z.zhang@intel.com \
    --cc=beilei.xing@intel.com \
    --cc=dev@dpdk.org \
    --cc=qiming.yang@intel.com \
    --cc=xiaolong.ye@intel.com \
    --cc=yahui.cao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).