From 07f02cdb0840fe54d4f6474112bc5486a7a45147 Mon Sep 17 00:00:00 2001 From: "jingjing.wu" Date: Thu, 13 Nov 2014 20:49:54 +0800 Subject: [PATCH] ethdev: add ethertype filter A new structure of ethertype filter is defined in rte_eth_ctrl.h for filter_ctrl api Signed-off-by: Jingjing Wu Acked-by: Jijiang Liu --- 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 7fa710362a..7088d8dc08 100644 --- a/lib/librte_ether/rte_eth_ctrl.h +++ b/lib/librte_ether/rte_eth_ctrl.h @@ -52,6 +52,7 @@ extern "C" { enum rte_filter_type { RTE_ETH_FILTER_NONE = 0, RTE_ETH_FILTER_MACVLAN, + RTE_ETH_FILTER_ETHERTYPE, RTE_ETH_FILTER_TUNNEL, RTE_ETH_FILTER_FDIR, RTE_ETH_FILTER_MAX @@ -96,6 +97,25 @@ struct rte_eth_mac_filter { struct ether_addr mac_addr; }; +/** + * 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*/ +}; + /** * Tunneled type. */ -- 2.20.1