DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Jeff Guo <jia.guo@intel.com>, Haiyue Wang <haiyue.wang@intel.com>,
	"Thomas Monjalon" <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 05/14] ethdev: move flexible filter type to e1000 driver
Date: Sun, 18 Oct 2020 15:09:02 +0100
Message-ID: <1603030152-13451-6-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1603030152-13451-1-git-send-email-arybchenko@solarflare.com>

net/e1000 driver is the only user of the struct rte_eth_flex_filter
and helper defines.  Move it to the driver and use igb_ prefix
instead of rte_eth_.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/e1000/e1000_ethdev.h | 22 +++++++++++++++++--
 drivers/net/e1000/igb_ethdev.c   |  2 +-
 drivers/net/e1000/igb_flow.c     | 36 ++++++++++++++++----------------
 lib/librte_ethdev/rte_eth_ctrl.h | 19 -----------------
 4 files changed, 39 insertions(+), 40 deletions(-)

diff --git a/drivers/net/e1000/e1000_ethdev.h b/drivers/net/e1000/e1000_ethdev.h
index 1e41ae9de1..4755a5f333 100644
--- a/drivers/net/e1000/e1000_ethdev.h
+++ b/drivers/net/e1000/e1000_ethdev.h
@@ -331,10 +331,28 @@ struct igb_eth_syn_filter_ele {
 	struct rte_eth_syn_filter filter_info;
 };
 
+#define IGB_FLEX_FILTER_MAXLEN	128	/**< bytes to use in flex filter. */
+#define IGB_FLEX_FILTER_MASK_SIZE	\
+	(RTE_ALIGN(IGB_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)
+					/**< mask bytes in flex filter. */
+
+/**
+ * A structure used to define the flex filter entry
+ * to support RTE_ETH_FILTER_FLEXIBLE data representation.
+ */
+struct igb_flex_filter {
+	uint16_t len;
+	uint8_t bytes[IGB_FLEX_FILTER_MAXLEN]; /**< flex bytes in big endian. */
+	uint8_t mask[IGB_FLEX_FILTER_MASK_SIZE];
+		/**< if mask bit is 1b, do not compare corresponding byte. */
+	uint8_t priority;
+	uint16_t queue;       /**< Queue assigned to when match. */
+};
+
 /* flex filter list structure */
 struct igb_flex_filter_ele {
 	TAILQ_ENTRY(igb_flex_filter_ele) entries;
-	struct rte_eth_flex_filter filter_info;
+	struct igb_flex_filter filter_info;
 };
 
 /* rss filter  list structure */
@@ -515,7 +533,7 @@ int eth_igb_syn_filter_set(struct rte_eth_dev *dev,
 			struct rte_eth_syn_filter *filter,
 			bool add);
 int eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
-			struct rte_eth_flex_filter *filter,
+			struct igb_flex_filter *filter,
 			bool add);
 int igb_rss_conf_init(struct rte_eth_dev *dev,
 		      struct igb_rte_flow_rss_conf *out,
diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c
index 7f99b76e48..db67bcb7f9 100644
--- a/drivers/net/e1000/igb_ethdev.c
+++ b/drivers/net/e1000/igb_ethdev.c
@@ -4050,7 +4050,7 @@ igb_remove_flex_filter(struct rte_eth_dev *dev,
 
 int
 eth_igb_add_del_flex_filter(struct rte_eth_dev *dev,
-			struct rte_eth_flex_filter *filter,
+			struct igb_flex_filter *filter,
 			bool add)
 {
 	struct e1000_filter_info *filter_info =
diff --git a/drivers/net/e1000/igb_flow.c b/drivers/net/e1000/igb_flow.c
index 43fef889b5..ccb184df95 100644
--- a/drivers/net/e1000/igb_flow.c
+++ b/drivers/net/e1000/igb_flow.c
@@ -1041,7 +1041,7 @@ static int
 cons_parse_flex_filter(const struct rte_flow_attr *attr,
 				const struct rte_flow_item pattern[],
 				const struct rte_flow_action actions[],
-				struct rte_eth_flex_filter *filter,
+				struct igb_flex_filter *filter,
 				struct rte_flow_error *error)
 {
 	const struct rte_flow_item *item;
@@ -1102,7 +1102,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 
 	if (!raw_mask->length ||
 	    !raw_mask->relative) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ITEM,
 				item, "Not supported by flex filter");
@@ -1116,7 +1116,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 
 	for (j = 0; j < raw_spec->length; j++) {
 		if (raw_mask->pattern[j] != 0xFF) {
-			memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+			memset(filter, 0, sizeof(struct igb_flex_filter));
 			rte_flow_error_set(error, EINVAL,
 					RTE_FLOW_ERROR_TYPE_ITEM,
 					item, "Not supported by flex filter");
@@ -1140,8 +1140,8 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 	}
 
 	if ((raw_spec->length + offset + total_offset) >
-			RTE_FLEX_FILTER_MAXLEN) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+			IGB_FLEX_FILTER_MAXLEN) {
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ITEM,
 				item, "Not supported by flex filter");
@@ -1204,7 +1204,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 	/* check if the first not void action is QUEUE. */
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	if (act->type != RTE_FLOW_ACTION_TYPE_QUEUE) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
 				act, "Not supported action.");
@@ -1218,7 +1218,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 	index++;
 	NEXT_ITEM_OF_ACTION(act, actions, index);
 	if (act->type != RTE_FLOW_ACTION_TYPE_END) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 				RTE_FLOW_ERROR_TYPE_ACTION,
 				act, "Not supported action.");
@@ -1228,7 +1228,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 	/* parse attr */
 	/* must be input direction */
 	if (!attr->ingress) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ATTR_INGRESS,
 			attr, "Only support ingress.");
@@ -1237,7 +1237,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 
 	/* not supported */
 	if (attr->egress) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ATTR_EGRESS,
 			attr, "Not support egress.");
@@ -1246,7 +1246,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 
 	/* not supported */
 	if (attr->transfer) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ATTR_TRANSFER,
 			attr, "No support for transfer.");
@@ -1254,7 +1254,7 @@ cons_parse_flex_filter(const struct rte_flow_attr *attr,
 	}
 
 	if (attr->priority > 0xFFFF) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 				   RTE_FLOW_ERROR_TYPE_ATTR_PRIORITY,
 				   attr, "Error priority.");
@@ -1271,7 +1271,7 @@ igb_parse_flex_filter(struct rte_eth_dev *dev,
 				 const struct rte_flow_attr *attr,
 			     const struct rte_flow_item pattern[],
 			     const struct rte_flow_action actions[],
-			     struct rte_eth_flex_filter *filter,
+			     struct igb_flex_filter *filter,
 			     struct rte_flow_error *error)
 {
 	struct e1000_hw *hw = E1000_DEV_PRIVATE_TO_HW(dev->data->dev_private);
@@ -1283,7 +1283,7 @@ igb_parse_flex_filter(struct rte_eth_dev *dev,
 					actions, filter, error);
 
 	if (filter->queue >= IGB_MAX_RX_QUEUE_NUM) {
-		memset(filter, 0, sizeof(struct rte_eth_flex_filter));
+		memset(filter, 0, sizeof(struct igb_flex_filter));
 		rte_flow_error_set(error, EINVAL,
 			RTE_FLOW_ERROR_TYPE_ITEM,
 			NULL, "queue number not supported by flex filter");
@@ -1444,7 +1444,7 @@ igb_flow_create(struct rte_eth_dev *dev,
 	struct rte_eth_ntuple_filter ntuple_filter;
 	struct rte_eth_ethertype_filter ethertype_filter;
 	struct rte_eth_syn_filter syn_filter;
-	struct rte_eth_flex_filter flex_filter;
+	struct igb_flex_filter flex_filter;
 	struct igb_rte_flow_rss_conf rss_conf;
 	struct rte_flow *flow = NULL;
 	struct igb_ntuple_filter_ele *ntuple_filter_ptr;
@@ -1549,7 +1549,7 @@ igb_flow_create(struct rte_eth_dev *dev,
 		goto out;
 	}
 
-	memset(&flex_filter, 0, sizeof(struct rte_eth_flex_filter));
+	memset(&flex_filter, 0, sizeof(struct igb_flex_filter));
 	ret = igb_parse_flex_filter(dev, attr, pattern,
 					actions, &flex_filter, error);
 	if (!ret) {
@@ -1564,7 +1564,7 @@ igb_flow_create(struct rte_eth_dev *dev,
 
 			rte_memcpy(&flex_filter_ptr->filter_info,
 				&flex_filter,
-				sizeof(struct rte_eth_flex_filter));
+				sizeof(struct igb_flex_filter));
 			TAILQ_INSERT_TAIL(&igb_filter_flex_list,
 				flex_filter_ptr, entries);
 			flow->rule = flex_filter_ptr;
@@ -1621,7 +1621,7 @@ igb_flow_validate(__rte_unused struct rte_eth_dev *dev,
 	struct rte_eth_ntuple_filter ntuple_filter;
 	struct rte_eth_ethertype_filter ethertype_filter;
 	struct rte_eth_syn_filter syn_filter;
-	struct rte_eth_flex_filter flex_filter;
+	struct igb_flex_filter flex_filter;
 	struct igb_rte_flow_rss_conf rss_conf;
 	int ret;
 
@@ -1643,7 +1643,7 @@ igb_flow_validate(__rte_unused struct rte_eth_dev *dev,
 	if (!ret)
 		return 0;
 
-	memset(&flex_filter, 0, sizeof(struct rte_eth_flex_filter));
+	memset(&flex_filter, 0, sizeof(struct igb_flex_filter));
 	ret = igb_parse_flex_filter(dev, attr, pattern,
 				actions, &flex_filter, error);
 	if (!ret)
diff --git a/lib/librte_ethdev/rte_eth_ctrl.h b/lib/librte_ethdev/rte_eth_ctrl.h
index 5690f8111a..c5e33bec31 100644
--- a/lib/librte_ethdev/rte_eth_ctrl.h
+++ b/lib/librte_ethdev/rte_eth_ctrl.h
@@ -56,25 +56,6 @@ enum rte_filter_op {
 	RTE_ETH_FILTER_OP_MAX
 };
 
-#define RTE_FLEX_FILTER_MAXLEN	128	/**< bytes to use in flex filter. */
-#define RTE_FLEX_FILTER_MASK_SIZE	\
-	(RTE_ALIGN(RTE_FLEX_FILTER_MAXLEN, CHAR_BIT) / CHAR_BIT)
-					/**< mask bytes in flex filter. */
-
-/**
- *  A structure used to define the flex filter entry
- *  to support RTE_ETH_FILTER_FLEXIBLE with RTE_ETH_FILTER_ADD,
- *  RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations.
- */
-struct rte_eth_flex_filter {
-	uint16_t len;
-	uint8_t bytes[RTE_FLEX_FILTER_MAXLEN];  /**< flex bytes in big endian.*/
-	uint8_t mask[RTE_FLEX_FILTER_MASK_SIZE];    /**< if mask bit is 1b, do
-					not compare corresponding byte. */
-	uint8_t priority;
-	uint16_t queue;       /**< Queue assigned to when match. */
-};
-
 /**
  * A structure used to define the TCP syn filter entry
  * to support RTE_ETH_FILTER_SYN with RTE_ETH_FILTER_ADD,
-- 
2.17.1


  parent reply	other threads:[~2020-10-18 14:11 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-18 14:08 [dpdk-dev] [PATCH 00/14] ethdev: remove legacy filter API Andrew Rybchenko
2020-10-18 14:08 ` [dpdk-dev] [PATCH 01/14] ethdev: remove legacy MACVLAN filter type support Andrew Rybchenko
2020-10-20 11:07   ` David Marchand
2020-10-21 16:34     ` Andrew Rybchenko
2020-10-21  3:31   ` Guo, Jia
2020-10-21 16:05     ` Andrew Rybchenko
2020-10-22  1:59       ` Guo, Jia
2020-10-18 14:08 ` [dpdk-dev] [PATCH 02/14] ethdev: move MAC filter type to i40e driver Andrew Rybchenko
2020-10-21  4:01   ` Guo, Jia
2020-10-21 16:09     ` Andrew Rybchenko
2020-10-22  2:58       ` Guo, Jia
2020-10-22  7:19         ` Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 03/14] ethdev: remove legacy EtherType filter type support Andrew Rybchenko
2020-10-18 22:13   ` Ajit Khaparde
2020-10-19  6:40   ` Wang, Haiyue
     [not found]   ` <BYAPR11MB3493BE2EB0D5B91DDDCD99758C1C0@BYAPR11MB3493.namprd11.prod.outlook.com>
2020-10-21  5:38     ` Guo, Jia
2020-10-21 16:12       ` Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 04/14] ethdev: remove legacy flexible " Andrew Rybchenko
2020-10-19  6:29   ` Wang, Haiyue
2020-10-18 14:09 ` Andrew Rybchenko [this message]
2020-10-19  6:20   ` [dpdk-dev] [PATCH 05/14] ethdev: move flexible filter type to e1000 driver Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 06/14] ethdev: remove legacy SYN filter type support Andrew Rybchenko
2020-10-19  6:45   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 07/14] ethdev: remove legacy N-tuple " Andrew Rybchenko
2020-10-18 22:13   ` Ajit Khaparde
2020-10-19  6:47   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 08/14] ethdev: remove legacy TUNNEL " Andrew Rybchenko
2020-10-18 22:14   ` Ajit Khaparde
2020-10-19  8:01   ` Li, Xiaoyun
2020-10-18 14:09 ` [dpdk-dev] [PATCH 09/14] ethdev: remove legacy HASH " Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 10/14] ethdev: remove legacy L2_TUNNEL " Andrew Rybchenko
2020-10-19  6:42   ` Wang, Haiyue
2020-10-18 14:09 ` [dpdk-dev] [PATCH 11/14] ethdev: remove legacy global filter configuration support Andrew Rybchenko
2020-10-21  5:42   ` Guo, Jia
2020-10-18 14:09 ` [dpdk-dev] [PATCH 12/14] ethdev: remove legacy FDIR filter type support Andrew Rybchenko
2020-10-18 22:15   ` Ajit Khaparde
2020-10-19  6:53   ` Wang, Haiyue
2020-10-21  5:45   ` Guo, Jia
2020-10-21 16:17     ` Andrew Rybchenko
2020-10-22  2:45       ` Guo, Jia
2020-10-18 14:09 ` [dpdk-dev] [PATCH 13/14] app/testpmd: remove flow_director_flex_mask command Andrew Rybchenko
2020-10-20 10:53   ` David Marchand
2020-10-22  9:01     ` Andrew Rybchenko
2020-10-18 14:09 ` [dpdk-dev] [PATCH 14/14] ethdev: remove legacy filter API functions Andrew Rybchenko
2020-10-20 10:47   ` David Marchand
2020-10-20 14:52   ` Ferruh Yigit
2020-10-22  9:12     ` Andrew Rybchenko
2020-10-22  9:33       ` Ferruh Yigit
2020-10-22  9:42 ` [dpdk-dev] [PATCH v2 00/14] ethdev: remove legacy filter API Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 01/14] ethdev: remove legacy MACVLAN filter type support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 02/14] ethdev: move MAC filter type to i40e driver Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 03/14] ethdev: remove legacy EtherType filter type support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 04/14] ethdev: remove legacy flexible " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 05/14] ethdev: move flexible filter type to e1000 driver Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 06/14] ethdev: remove legacy SYN filter type support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 07/14] ethdev: remove legacy N-tuple " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 08/14] ethdev: remove legacy TUNNEL " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 09/14] ethdev: remove legacy HASH " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 10/14] ethdev: remove legacy L2_TUNNEL " Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 11/14] ethdev: remove legacy global filter configuration support Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 12/14] ethdev: remove legacy FDIR filter type support Andrew Rybchenko
2020-10-23  3:32     ` Hyong Youb Kim (hyonkim)
2020-10-23  6:41       ` Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 13/14] app/testpmd: remove command to set FDIR flexible filter mask Andrew Rybchenko
2020-10-22  9:42   ` [dpdk-dev] [PATCH v2 14/14] ethdev: remove legacy filter API functions Andrew Rybchenko
2020-10-23 16:03   ` [dpdk-dev] [PATCH v2 00/14] ethdev: remove legacy filter API Ferruh Yigit
2020-10-29 21:36     ` Ferruh Yigit

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=1603030152-13451-6-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haiyue.wang@intel.com \
    --cc=jia.guo@intel.com \
    --cc=thomas@monjalon.net \
    /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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ https://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git