From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jingjing Wu Subject: [PATCH v2 1/3] ethdev: define ctrl_pkt filter type and its structure Date: Wed, 22 Oct 2014 16:19:35 +0800 Message-ID: <1413965977-15165-2-git-send-email-jingjing.wu@intel.com> References: <1411628369-29532-1-git-send-email-jingjing.wu@intel.com> <1413965977-15165-1-git-send-email-jingjing.wu@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1413965977-15165-1-git-send-email-jingjing.wu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" define new filter type and its structure - RTE_ETH_FILTER_CTRL_PKT - struct rte_ctrl_pkt_filter Signed-off-by: Jingjing Wu --- lib/librte_ether/rte_eth_ctrl.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index df21ac6..8d3dba9 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -51,6 +51,7 @@ extern "C" { */ enum rte_filter_type { RTE_ETH_FILTER_NONE = 0, + RTE_ETH_FILTER_CTRL_PKT, RTE_ETH_FILTER_MAX }; @@ -71,6 +72,29 @@ enum rte_filter_op { RTE_ETH_FILTER_OP_MAX }; +/** + * Define all structures for Control Packet Filter type corresponding with specific operations. + */ + +#define RTE_CONTROL_PACKET_FLAGS_IGNORE_MAC 0x0001 +#define RTE_CONTROL_PACKET_FLAGS_DROP 0x0002 +#define RTE_CONTROL_PACKET_FLAGS_TO_QUEUE 0x0004 +#define RTE_CONTROL_PACKET_FLAGS_TX 0x0008 +#define RTE_CONTROL_PACKET_FLAGS_RX 0x0000 + +/** + * A structure used to define the control packet filter entry + * to support RTE_ETH_FILTER_CTRL_PKT with RTE_ETH_FILTER_ADD + * and RTE_ETH_FILTER_DELETE operations. + */ +struct rte_ctrl_pkt_filter { + struct ether_addr mac_addr; /**< mac address to match. */ + uint16_t ether_type; /**< ether type to match */ + uint16_t flags; /**< options for filter's behavior*/ + uint16_t dest_id; /**< destination vsi id or pool id*/ + uint16_t queue; /**< queue assign to if TO QUEUE flag is set */ +}; + #ifdef __cplusplus } #endif -- 1.8.1.4