[dpdk-dev,2/5] librte_ether:extend data structures of MACVLAN filter
diff mbox

Message ID 1411442991-15386-3-git-send-email-jijiang.liu@intel.com
State Superseded, archived
Headers show

Commit Message

Jijiang Liu Sept. 23, 2014, 3:29 a.m. UTC
Add new data definations for MACVLAN filter enhancement in rte_eth_ctrl.h file.

Signed-off-by: Jijiang Liu <jijiang.liu@intel.com>
Acked-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Changchun Ouyang <changchun.ouyang@intel.com>
---
 lib/librte_ether/rte_eth_ctrl.h |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)

Patch
diff mbox

diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h
index 66745a6..0910376 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_RSS,
 	RTE_ETH_FILTER_FDIR,
+	RTE_ETH_FILTER_MACVLAN,
 	RTE_ETH_FILTER_MAX,
 };
 
@@ -72,6 +73,30 @@  enum rte_filter_op {
 	RTE_ETH_FILTER_OP_MAX,
 };
 
+/* *** MACVLAN FILTER *** */
+
+/* MAC/VLAN filter type */
+#define RTE_MAC_PERFECT_MATCH      0x0001
+#define RTE_MACVLAN_PERFECT_MATCH  0x0002
+#define RTE_MAC_HASH_MATCH         0x0004
+#define RTE_MACVLAN_HASH_MATCH     0x0008
+#define RTE_MACVLAN_TO_QUEUE       0x0010
+
+/* MACVLAN filter type mask */
+#define RTE_MACVLAN_FILTER_MASK    0x000F
+
+
+/**
+ * MAC filter structure
+ */
+struct rte_eth_mac_filter {
+	uint8_t  pf_vf_flag;  /**< 0 for PF;1 for VF */
+	uint16_t id;          /**< PF ID or VF ID */
+	uint16_t filter_type; /**< MAC/VLAN filter type */
+	uint16_t queue_id;    /**< to queue ID */
+	struct ether_addr mac_addr;
+};
+
 #ifdef __cplusplus
 }
 #endif