DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/ice: handle flow mark offload properly
@ 2019-11-05  7:04 Qi Zhang
  0 siblings, 0 replies; only message in thread
From: Qi Zhang @ 2019-11-05  7:04 UTC (permalink / raw)
  To: qiming.yang, xiaolong.ye; +Cc: dev, yahui.cao, beilei.xing, Qi Zhang

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-11-05  7:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05  7:04 [dpdk-dev] [PATCH] net/ice: handle flow mark offload properly Qi Zhang

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