DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 5/5] ethdev: remove old APIs and structures of 5tuple and 2tuple filters
Date: Thu, 15 Jan 2015 09:46:01 +0800	[thread overview]
Message-ID: <1421286361-11504-6-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1421286361-11504-1-git-send-email-jingjing.wu@intel.com>

Following structures are removed:
 - rte_2tuple_filter
 - rte_5tuple_filter
Following APIs are removed:
 - rte_eth_dev_add_2tuple_filter
 - rte_eth_dev_remove_2tuple_filter
 - rte_eth_dev_get_2tuple_filter
 - rte_eth_dev_add_5tuple_filter
 - rte_eth_dev_remove_5tuple_filter
 - rte_eth_dev_get_5tuple_filter
It also move macros TCP_*_FLAG to rte_eth_ctrl.h, and removes the macro
TCP_UGR_FLAG which is duplicated with TCP_URG_FLAG.

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_ether/rte_eth_ctrl.h |   7 ++
 lib/librte_ether/rte_ethdev.c   | 116 ------------------------
 lib/librte_ether/rte_ethdev.h   | 195 ----------------------------------------
 3 files changed, 7 insertions(+), 311 deletions(-)

diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 58d830d..ab8e9a9 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -139,6 +139,13 @@ struct rte_eth_ethertype_filter {
 		RTE_NTUPLE_FLAGS_DST_PORT | \
 		RTE_NTUPLE_FLAGS_PROTO)
 
+#define TCP_URG_FLAG 0x20
+#define TCP_ACK_FLAG 0x10
+#define TCP_PSH_FLAG 0x08
+#define TCP_RST_FLAG 0x04
+#define TCP_SYN_FLAG 0x02
+#define TCP_FIN_FLAG 0x01
+#define TCP_FLAG_ALL 0x3F
 
 /**
  * A structure used to define the ntuple filter entry
diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index 95f2ceb..22d76c8 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -3072,122 +3072,6 @@ rte_eth_dev_get_ethertype_filter(uint8_t port_id, uint16_t index,
 }
 
 int
-rte_eth_dev_add_2tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_2tuple_filter *filter, uint16_t rx_queue)
-{
-	struct rte_eth_dev *dev;
-
-	if (port_id >= nb_ports) {
-		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return -ENODEV;
-	}
-	if (filter->protocol != IPPROTO_TCP &&
-		filter->tcp_flags != 0){
-		PMD_DEBUG_TRACE("tcp flags is 0x%x, but the protocol value"
-			" is not TCP\n",
-			filter->tcp_flags);
-		return -EINVAL;
-	}
-
-	dev = &rte_eth_devices[port_id];
-	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->add_2tuple_filter, -ENOTSUP);
-	return (*dev->dev_ops->add_2tuple_filter)(dev, index, filter, rx_queue);
-}
-
-int
-rte_eth_dev_remove_2tuple_filter(uint8_t port_id, uint16_t index)
-{
-	struct rte_eth_dev *dev;
-
-	if (port_id >= nb_ports) {
-		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return -ENODEV;
-	}
-
-	dev = &rte_eth_devices[port_id];
-	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->remove_2tuple_filter, -ENOTSUP);
-	return (*dev->dev_ops->remove_2tuple_filter)(dev, index);
-}
-
-int
-rte_eth_dev_get_2tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_2tuple_filter *filter, uint16_t *rx_queue)
-{
-	struct rte_eth_dev *dev;
-
-	if (filter == NULL || rx_queue == NULL)
-		return -EINVAL;
-
-	if (port_id >= nb_ports) {
-		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return -ENODEV;
-	}
-
-	dev = &rte_eth_devices[port_id];
-	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_2tuple_filter, -ENOTSUP);
-	return (*dev->dev_ops->get_2tuple_filter)(dev, index, filter, rx_queue);
-}
-
-int
-rte_eth_dev_add_5tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_5tuple_filter *filter, uint16_t rx_queue)
-{
-	struct rte_eth_dev *dev;
-
-	if (port_id >= nb_ports) {
-		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return -ENODEV;
-	}
-
-	if (filter->protocol != IPPROTO_TCP &&
-		filter->tcp_flags != 0){
-		PMD_DEBUG_TRACE("tcp flags is 0x%x, but the protocol value"
-			" is not TCP\n",
-			filter->tcp_flags);
-		return -EINVAL;
-	}
-
-	dev = &rte_eth_devices[port_id];
-	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->add_5tuple_filter, -ENOTSUP);
-	return (*dev->dev_ops->add_5tuple_filter)(dev, index, filter, rx_queue);
-}
-
-int
-rte_eth_dev_remove_5tuple_filter(uint8_t port_id, uint16_t index)
-{
-	struct rte_eth_dev *dev;
-
-	if (port_id >= nb_ports) {
-		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return -ENODEV;
-	}
-
-	dev = &rte_eth_devices[port_id];
-	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->remove_5tuple_filter, -ENOTSUP);
-	return (*dev->dev_ops->remove_5tuple_filter)(dev, index);
-}
-
-int
-rte_eth_dev_get_5tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_5tuple_filter *filter, uint16_t *rx_queue)
-{
-	struct rte_eth_dev *dev;
-
-	if (filter == NULL || rx_queue == NULL)
-		return -EINVAL;
-
-	if (port_id >= nb_ports) {
-		PMD_DEBUG_TRACE("Invalid port_id=%d\n", port_id);
-		return -ENODEV;
-	}
-
-	dev = &rte_eth_devices[port_id];
-	FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_5tuple_filter, -ENOTSUP);
-	return (*dev->dev_ops->get_5tuple_filter)(dev, index, filter,
-						rx_queue);
-}
-
-int
 rte_eth_dev_add_flex_filter(uint8_t port_id, uint16_t index,
 			struct rte_flex_filter *filter, uint16_t rx_queue)
 {
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index 551b28f..f6adeaa 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -963,16 +963,6 @@ struct rte_eth_dev_callback;
 /** @internal Structure to keep track of registered callbacks */
 TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
 
-
-#define TCP_URG_FLAG 0x20
-#define TCP_UGR_FLAG 0x20
-#define TCP_ACK_FLAG 0x10
-#define TCP_PSH_FLAG 0x08
-#define TCP_RST_FLAG 0x04
-#define TCP_SYN_FLAG 0x02
-#define TCP_FIN_FLAG 0x01
-#define TCP_FLAG_ALL 0x3F
-
 /**
  *  A structure used to define an ethertype filter.
  */
@@ -991,18 +981,6 @@ struct rte_syn_filter {
 };
 
 /**
- *  A structure used to define a 2tuple filter.
- */
-struct rte_2tuple_filter {
-	uint16_t dst_port;        /**< big endian. */
-	uint8_t protocol;
-	uint8_t tcp_flags;
-	uint16_t priority;        /**< used when more than one filter matches. */
-	uint8_t dst_port_mask:1,  /**< if mask is 1b, means not compare. */
-		protocol_mask:1;
-};
-
-/**
  *  A structure used to define a flex filter.
  */
 struct rte_flex_filter {
@@ -1013,25 +991,6 @@ struct rte_flex_filter {
 	uint8_t priority;
 };
 
-/**
- *  A structure used to define a 5tuple filter.
- */
-struct rte_5tuple_filter {
-	uint32_t dst_ip;         /**< destination IP address in big endian. */
-	uint32_t src_ip;         /**< source IP address in big endian. */
-	uint16_t dst_port;       /**< destination port in big endian. */
-	uint16_t src_port;       /**< source Port big endian. */
-	uint8_t protocol;        /**< l4 protocol. */
-	uint8_t tcp_flags;       /**< tcp flags. */
-	uint16_t priority;       /**< seven evels (001b-111b), 111b is highest,
-				      used when more than one filter matches. */
-	uint8_t dst_ip_mask:1,   /**< if mask is 1b, do not compare dst ip. */
-		src_ip_mask:1,   /**< if mask is 1b, do not compare src ip. */
-		dst_port_mask:1, /**< if mask is 1b, do not compare dst port. */
-		src_port_mask:1, /**< if mask is 1b, do not compare src port. */
-		protocol_mask:1; /**< if mask is 1b, do not compare protocol. */
-};
-
 /*
  * Definitions of all functions exported by an Ethernet driver through the
  * the generic structure of type *eth_dev_ops* supplied in the *rte_eth_dev*
@@ -1388,34 +1347,6 @@ typedef int (*eth_get_ethertype_filter_t)(struct rte_eth_dev *dev,
 			uint16_t *rx_queue);
 /**< @internal Get an ethertype filter rule on an Ethernet device */
 
-typedef int (*eth_add_2tuple_filter_t)(struct rte_eth_dev *dev,
-			uint16_t index, struct rte_2tuple_filter *filter,
-			uint16_t rx_queue);
-/**< @internal Setup a new 2tuple filter rule on an Ethernet device */
-
-typedef int (*eth_remove_2tuple_filter_t)(struct rte_eth_dev *dev,
-			uint16_t index);
-/**< @internal Remove a 2tuple filter rule on an Ethernet device */
-
-typedef int (*eth_get_2tuple_filter_t)(struct rte_eth_dev *dev,
-			uint16_t index, struct rte_2tuple_filter *filter,
-			uint16_t *rx_queue);
-/**< @internal Get a 2tuple filter rule on an Ethernet device */
-
-typedef int (*eth_add_5tuple_filter_t)(struct rte_eth_dev *dev,
-			uint16_t index, struct rte_5tuple_filter *filter,
-			uint16_t rx_queue);
-/**< @internal Setup a new 5tuple filter rule on an Ethernet device */
-
-typedef int (*eth_remove_5tuple_filter_t)(struct rte_eth_dev *dev,
-			uint16_t index);
-/**< @internal Remove a 5tuple filter rule on an Ethernet device */
-
-typedef int (*eth_get_5tuple_filter_t)(struct rte_eth_dev *dev,
-			uint16_t index, struct rte_5tuple_filter *filter,
-			uint16_t *rx_queue);
-/**< @internal Get a 5tuple filter rule on an Ethernet device */
-
 typedef int (*eth_add_flex_filter_t)(struct rte_eth_dev *dev,
 			uint16_t index, struct rte_flex_filter *filter,
 			uint16_t rx_queue);
@@ -1537,12 +1468,6 @@ struct eth_dev_ops {
 	eth_add_ethertype_filter_t     add_ethertype_filter;    /**< add ethertype filter. */
 	eth_remove_ethertype_filter_t  remove_ethertype_filter; /**< remove ethertype filter. */
 	eth_get_ethertype_filter_t     get_ethertype_filter;    /**< get ethertype filter. */
-	eth_add_2tuple_filter_t        add_2tuple_filter;    /**< add 2tuple filter. */
-	eth_remove_2tuple_filter_t     remove_2tuple_filter; /**< remove 2tuple filter. */
-	eth_get_2tuple_filter_t        get_2tuple_filter;    /**< get 2tuple filter. */
-	eth_add_5tuple_filter_t        add_5tuple_filter;    /**< add 5tuple filter. */
-	eth_remove_5tuple_filter_t     remove_5tuple_filter; /**< remove 5tuple filter. */
-	eth_get_5tuple_filter_t        get_5tuple_filter;    /**< get 5tuple filter. */
 	eth_add_flex_filter_t          add_flex_filter;      /**< add flex filter. */
 	eth_remove_flex_filter_t       remove_flex_filter;   /**< remove flex filter. */
 	eth_get_flex_filter_t          get_flex_filter;      /**< get flex filter. */
@@ -3538,126 +3463,6 @@ int rte_eth_dev_get_ethertype_filter(uint8_t port_id, uint16_t index,
 			struct rte_ethertype_filter *filter, uint16_t *rx_queue);
 
 /**
- * Add a new 2tuple filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param index
- *   The identifier of 2tuple filter.
- * @param filter
- *   The pointer to the structure describing the 2tuple filter rule.
- *   The *rte_2tuple_filter* structure includes the values of the different
- *   fields to match: protocol, dst_port and
- *   tcp_flags if the protocol is tcp type.
- * @param rx_queue
- *   The index of the RX queue where to store RX packets matching the added
- *   2tuple filter.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support 2tuple filter.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if the filter information is not correct.
- */
-int rte_eth_dev_add_2tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_2tuple_filter *filter, uint16_t rx_queue);
-
-/**
- * remove a 2tuple filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param index
- *   The identifier of 2tuple filter.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support 2tuple filter.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if the filter information is not correct.
- */
-int rte_eth_dev_remove_2tuple_filter(uint8_t port_id, uint16_t index);
-
-/**
- * Get an 2tuple filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param index
- *   The identifier of 2tuple filter.
- * @param filter
- *   A pointer to a structure of type *rte_2tuple_filter* to be filled with
- *   the information of the 2tuple filter.
- * @param rx_queue
- *   A pointer to get the queue index.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support 2tuple filter.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if the filter information is not correct.
- *   - (-ENOENT) if no enabled filter in this index.
- */
-int rte_eth_dev_get_2tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_2tuple_filter *filter, uint16_t *rx_queue);
-
-/**
- * Add a new 5tuple filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param index
- *   The identifier of 5tuple filter.
- * @param filter
- *   The pointer to the structure describing the 5tuple filter rule.
- *   The *rte_5tuple_filter* structure includes the values of the different
- *   fields to match: dst src IP, dst src port, protocol and relative masks
- * @param rx_queue
- *   The index of the RX queue where to store RX packets matching the added
- *   5tuple filter.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support 5tuple filter.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if the filter information is not correct.
- */
-int rte_eth_dev_add_5tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_5tuple_filter *filter, uint16_t rx_queue);
-
-/**
- * remove a 5tuple filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param index
- *   The identifier of 5tuple filter.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support 5tuple filter.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if the filter information is not correct.
- */
-int rte_eth_dev_remove_5tuple_filter(uint8_t port_id, uint16_t index);
-
-/**
- * Get an 5tuple filter rule on an Ethernet device.
- *
- * @param port_id
- *   The port identifier of the Ethernet device.
- * @param index
- *   The identifier of 5tuple filter.
- * @param filter
- *   A pointer to a structure of type *rte_5tuple_filter* to be filled with
- *   the information of the 5tuple filter.
- * @param rx_queue
- *   A pointer to get the queue index.
- * @return
- *   - (0) if successful.
- *   - (-ENOTSUP) if hardware doesn't support 5tuple filter.
- *   - (-ENODEV) if *port_id* invalid.
- *   - (-EINVAL) if the filter information is not correct.
- */
-int rte_eth_dev_get_5tuple_filter(uint8_t port_id, uint16_t index,
-			struct rte_5tuple_filter *filter, uint16_t *rx_queue);
-
-/**
  * Add a new flex filter rule on an Ethernet device.
  *
  * @param port_id
-- 
1.9.3

  parent reply	other threads:[~2015-01-15  1:46 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-15  1:45 [dpdk-dev] [PATCH 0/5] new ntuple filter replaces 2tuple and 5tuple filters Jingjing Wu
2015-01-15  1:45 ` [dpdk-dev] [PATCH 1/5] ethdev: define ntuple filter type and its structure Jingjing Wu
2015-01-15  1:45 ` [dpdk-dev] [PATCH 2/5] ixgbe: ntuple filter functions replace old ones for 5tuple filter Jingjing Wu
2015-01-15  1:45 ` [dpdk-dev] [PATCH 3/5] e1000: ntuple filter functions replace old ones for 2tuple and " Jingjing Wu
2015-01-15  1:46 ` [dpdk-dev] [PATCH 4/5] testpmd: new commands for ntuple filter Jingjing Wu
2015-01-15  1:46 ` Jingjing Wu [this message]
2015-01-21 12:18 ` [dpdk-dev] [PATCH 0/5] new ntuple filter replaces 2tuple and 5tuple filters De Lara Guarch, Pablo
2015-01-22  0:28   ` Wu, Jingjing
2015-01-22  7:38 ` [dpdk-dev] [PATCH v2 0/6] " Jingjing Wu
2015-01-22  7:38   ` [dpdk-dev] [PATCH v2 1/6] ethdev: define ntuple filter type and its structure Jingjing Wu
2015-01-22  7:38   ` [dpdk-dev] [PATCH v2 2/6] ixgbe: ntuple filter functions replace old ones for 5tuple filter Jingjing Wu
2015-01-22  7:38   ` [dpdk-dev] [PATCH v2 3/6] e1000: ntuple filter functions replace old ones for 2tuple and " Jingjing Wu
2015-01-22  7:38   ` [dpdk-dev] [PATCH v2 4/6] testpmd: new commands for ntuple filter Jingjing Wu
2015-01-22  7:38   ` [dpdk-dev] [PATCH v2 5/6] ethdev: remove old APIs and structures of 5tuple and 2tuple filters Jingjing Wu
2015-01-22  7:38   ` [dpdk-dev] [PATCH v2 6/6] doc: commands changed in testpmd_funcs for 2tuple amd 5tuple filter Jingjing Wu
2015-01-28 14:28   ` [dpdk-dev] [PATCH v2 0/6] new ntuple filter replaces 2tuple and 5tuple filters De Lara Guarch, Pablo
2015-01-30  8:22     ` Wu, Jingjing
2015-02-10  4:48   ` [dpdk-dev] [PATCH v3 " Jingjing Wu
2015-02-10  4:48     ` [dpdk-dev] [PATCH v3 1/6] ethdev: define ntuple filter type and its structure Jingjing Wu
2015-02-10  4:48     ` [dpdk-dev] [PATCH v3 2/6] ixgbe: ntuple filter functions replace old ones for 5tuple filter Jingjing Wu
2015-02-10  4:48     ` [dpdk-dev] [PATCH v3 3/6] e1000: ntuple filter functions replace old ones for 2tuple and " Jingjing Wu
2015-02-10  4:48     ` [dpdk-dev] [PATCH v3 4/6] testpmd: new commands for ntuple filter Jingjing Wu
2015-02-10  4:48     ` [dpdk-dev] [PATCH v3 5/6] ethdev: remove old APIs and structures of 5tuple and 2tuple filters Jingjing Wu
2015-02-10  4:48     ` [dpdk-dev] [PATCH v3 6/6] doc: commands changed in testpmd_funcs for 2tuple amd 5tuple filter Jingjing Wu
2015-02-13  2:59     ` [dpdk-dev] [PATCH v3 0/6] new ntuple filter replaces 2tuple and 5tuple filters Xu, HuilongX
2015-02-20 17:29     ` De Lara Guarch, Pablo
2015-02-22  3:10       ` Thomas Monjalon

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=1421286361-11504-6-git-send-email-jingjing.wu@intel.com \
    --to=jingjing.wu@intel.com \
    --cc=dev@dpdk.org \
    /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).