ethdev: add ethertype filter
authorjingjing.wu <jingjing.wu@intel.com>
Thu, 13 Nov 2014 12:49:54 +0000 (20:49 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Wed, 26 Nov 2014 22:24:43 +0000 (23:24 +0100)
A new structure of ethertype filter is defined in rte_eth_ctrl.h
for filter_ctrl api

Signed-off-by: Jingjing Wu <jingjing.wu@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
lib/librte_ether/rte_eth_ctrl.h

index 7fa7103..7088d8d 100644 (file)
@@ -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.
  */