DPDK patches and discussions
 help / color / mirror / Atom feed
From: Jingjing Wu <jingjing.wu@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/5] ethdev: define ntuple filter type and its structure
Date: Thu, 15 Jan 2015 09:45:57 +0800	[thread overview]
Message-ID: <1421286361-11504-2-git-send-email-jingjing.wu@intel.com> (raw)
In-Reply-To: <1421286361-11504-1-git-send-email-jingjing.wu@intel.com>

This patch defines ntuple filter type RTE_ETH_FILTER_NTUPLE and its structure rte_eth_ntuple_filter.
It also corrects the typo TCP_UGR_FLAG to TCP_URG_FLAG

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_ether/rte_eth_ctrl.h | 50 +++++++++++++++++++++++++++++++++++++++++
 lib/librte_ether/rte_ethdev.h   |  2 ++
 2 files changed, 52 insertions(+)

diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 5d9c387..58d830d 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -53,6 +53,7 @@ enum rte_filter_type {
 	RTE_ETH_FILTER_NONE = 0,
 	RTE_ETH_FILTER_MACVLAN,
 	RTE_ETH_FILTER_ETHERTYPE,
+	RTE_ETH_FILTER_NTUPLE,
 	RTE_ETH_FILTER_TUNNEL,
 	RTE_ETH_FILTER_FDIR,
 	RTE_ETH_FILTER_MAX
@@ -117,6 +118,55 @@ struct rte_eth_ethertype_filter {
 };
 
 /**
+ * Define all structures for ntuple Filter type.
+ */
+
+#define RTE_NTUPLE_FLAGS_DST_IP    0x0001 /**< If set, dst_ip is part of ntuple */
+#define RTE_NTUPLE_FLAGS_SRC_IP    0x0002 /**< If set, src_ip is part of ntuple */
+#define RTE_NTUPLE_FLAGS_DST_PORT  0x0004 /**< If set, dst_port is part of ntuple */
+#define RTE_NTUPLE_FLAGS_SRC_PORT  0x0008 /**< If set, src_port is part of ntuple */
+#define RTE_NTUPLE_FLAGS_PROTO     0x0010 /**< If set, protocol is part of ntuple */
+#define RTE_NTUPLE_FLAGS_TCP_FLAG  0x0020 /**< If set, tcp flag is involved */
+
+#define RTE_5TUPLE_FLAGS ( \
+		RTE_NTUPLE_FLAGS_DST_IP | \
+		RTE_NTUPLE_FLAGS_SRC_IP | \
+		RTE_NTUPLE_FLAGS_DST_PORT | \
+		RTE_NTUPLE_FLAGS_SRC_PORT | \
+		RTE_NTUPLE_FLAGS_PROTO)
+
+#define RTE_2TUPLE_FLAGS ( \
+		RTE_NTUPLE_FLAGS_DST_PORT | \
+		RTE_NTUPLE_FLAGS_PROTO)
+
+
+/**
+ * A structure used to define the ntuple filter entry
+ * to support RTE_ETH_FILTER_NTUPLE with RTE_ETH_FILTER_ADD,
+ * RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations.
+ */
+struct rte_eth_ntuple_filter {
+	uint16_t flags;          /**< Flags from RTE_NTUPLE_FLAGS_* */
+	uint32_t dst_ip;         /**< Destination IP address in big endian. */
+	uint32_t dst_ip_mask;    /**< Mask of destination IP address. */
+	uint32_t src_ip;         /**< Source IP address in big endian. */
+	uint32_t src_ip_mask;    /**< Mask of destination IP address. */
+	uint16_t dst_port;       /**< Destination port in big endian. */
+	uint16_t dst_port_mask;  /**< Mask of destination port. */
+	uint16_t src_port;       /**< Source Port in big endian. */
+	uint16_t src_port_mask;  /**< Mask of source port. */
+	uint8_t proto;           /**< L4 protocol. */
+	uint8_t proto_mask;      /**< Mask of L4 protocol. */
+	/** tcp_flags only meaningful when the proto is TCP.
+	    The packet matched above ntuple fields and contain
+	    any set bit in tcp_flags will hit this filter. */
+	uint8_t tcp_flags;
+	uint16_t priority;       /**< seven levels (001b-111b), 111b is highest,
+				      used when more than one filter matches. */
+	uint16_t queue;          /**< Queue assigned to when match*/
+};
+
+/**
  * Tunneled type.
  */
 enum rte_eth_tunnel_type {
diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h
index ce0528f..551b28f 100644
--- a/lib/librte_ether/rte_ethdev.h
+++ b/lib/librte_ether/rte_ethdev.h
@@ -963,6 +963,8 @@ 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
-- 
1.9.3

  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 ` Jingjing Wu [this message]
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 ` [dpdk-dev] [PATCH 5/5] ethdev: remove old APIs and structures of 5tuple and 2tuple filters Jingjing Wu
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-2-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).