From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jingjing Wu Subject: [PATCH v3 1/2] ethdev: new structure of Ethertype Filter for filter_ctrl api Date: Thu, 13 Nov 2014 20:49:54 +0800 Message-ID: <1415882995-8697-2-git-send-email-jingjing.wu@intel.com> References: <1413965977-15165-1-git-send-email-jingjing.wu@intel.com> <1415882995-8697-1-git-send-email-jingjing.wu@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1415882995-8697-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" From: "jingjing.wu" A new structure of ethertype filter is defined in rte_eth_ctrl.h for filter_ctrl api Signed-off-by: jingjing.wu --- lib/librte_ether/rte_eth_ctrl.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/lib/librte_ether/rte_eth_ctrl.h b/lib/librte_ether/rte_eth_ctrl.h index 8dd384d..73bc296 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_TUNNEL, + RTE_ETH_FILTER_ETHERTYPE, RTE_ETH_FILTER_MAX }; @@ -155,6 +156,25 @@ struct rte_eth_tunnel_filter_conf { uint16_t queue_id; /** < queue number. */ }; +/** + * Define all structures for Ethertype Filter type. + */ + +#define RTE_ETHTYPE_FLAGS_MAC 0x0001 /**< If set, compare mac */ +#define RTE_ETHTYPE_FLAGS_DROP 0x0002 /**< If set, drop packet when match */ + +/** + * A structure used to define the ethertype filter entry + * to support RTE_ETH_FILTER_ETHERTYPE with RTE_ETH_FILTER_ADD, + * RTE_ETH_FILTER_DELETE and RTE_ETH_FILTER_GET operations. + */ +struct rte_eth_ethertype_filter { + struct ether_addr mac_addr; /**< Mac address to match. */ + uint16_t ether_type; /**< Ether type to match */ + uint16_t flags; /**< Flags from RTE_ETHTYPE_FLAGS_* */ + uint16_t queue; /**< Queue assigned to when match*/ +}; + #ifdef __cplusplus } #endif -- 1.8.1.4