[dpdk-dev,v4,19/21] ethdev: define structures for configuring flex masks

Message ID 1413939687-11177-20-git-send-email-jingjing.wu@intel.com (mailing list archive)
State Changes Requested, archived
Headers

Commit Message

Jingjing Wu Oct. 22, 2014, 1:01 a.m. UTC
  define structures for configuring flexible masks

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
---
 lib/librte_ether/rte_eth_ctrl.h | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
  

Patch

diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index ca21313..3b336e4 100644
--- a/lib/librte_ether/rte_eth_ctrl.h
+++ b/lib/librte_ether/rte_eth_ctrl.h
@@ -120,7 +120,28 @@  struct rte_eth_flex_payload_cfg {
 	struct rte_eth_field_vector field[0];
 };
 
+/**
+ * A structure defined to specify each word's bit mask
+ */
+struct rte_eth_flex_mask {
+	uint8_t offset;      /**< word offset in flexible payload */
+	uint16_t bitmask;    /**< bit mask for word defined by offset */
+};
+
+/**
+ * A structure used to configure FDIR masks for flexible payload
+ * for each flow type
+ */
+struct rte_eth_fdir_flex_masks {
+	enum rte_eth_flow_type flow_type;  /**< flow type */
+	uint8_t words_mask;  /**< bit i enables word i of 8 words flexible payload */
+	uint8_t nb_field;    /**< the number of following fields */
+	struct rte_eth_flex_mask field[0];
+};
+
 #define RTE_ETH_FDIR_CFG_FLX      0x0001
+#define RTE_ETH_FDIR_CFG_MASK     0x0002
+#define RTE_ETH_FDIR_CFG_FLX_MASK 0x0003
 /**
  * A structure used to config FDIR filter global set
  * to support RTE_ETH_FILTER_FDIR with RTE_ETH_FILTER_SET operation.
@@ -130,6 +151,8 @@  struct rte_eth_fdir_cfg {
 	/**
 	 * A pointer to structure for the configuration e.g.
 	 * struct rte_eth_flex_payload_cfg for FDIR_CFG_FLX
+	 * struct rte_fdir_masks for FDIR_MASK
+	 * struct rte_eth_fdir_flex_masks for FDIR_FLX_MASK
 	*/
 	void *cfg;
 };