[dpdk-dev,1/6] lib/librte_ether: modify the structures for fdir new modes
Commit Message
Define the new modes and modify the filter and mask
structure for the mac vlan and cloud modes.
Signed-off-by: Wenzhuo Lu <wenzhuo.lu@intel.com>
---
lib/librte_ether/rte_eth_ctrl.h | 68 ++++++++++++++++++++++++++++++-----------
1 file changed, 50 insertions(+), 18 deletions(-)
Comments
2015-09-25 14:05, Wenzhuo Lu:
> +enum rte_fdir_mode {
> + RTE_FDIR_MODE_NONE = 0, /**< Disable FDIR support. */
> + RTE_FDIR_MODE_SIGNATURE, /**< Enable FDIR signature filter mode. */
> + RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode for IP. */
> + RTE_FDIR_MODE_PERFECT_MAC_VLAN, /**< Enable FDIR filter mode - MAC VLAN. */
> + RTE_FDIR_MODE_PERFECT_CLOUD, /**< Enable FDIR filter mode - cloud. */
> +};
I know that some Intel NICs use the terminology "cloud" in their datasheet,
but it is meaningless.
[...]
> +/**
> + * A structure used to define the input for VxLAN NVGRE flow
> + */
> +struct rte_eth_cloud_flow {
> + enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match. */
> + uint32_t tni_vni; /**< TNI or VNI to match. */
Isn't it Intel-specific?
> + struct ether_addr mac_addr; /**< Mac address to match. */
> +};
So it is a tunnel, currently only VXLAN or NVGRE.
And this kind of tunnel can be used in a cloud datacenter, yes. Or elsewhere.
Please use the "tunnel" word.
Hi Thomas,
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, September 25, 2015 3:01 PM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/6] lib/librte_ether: modify the structures for
> fdir new modes
>
> 2015-09-25 14:05, Wenzhuo Lu:
> > +enum rte_fdir_mode {
> > + RTE_FDIR_MODE_NONE = 0, /**< Disable FDIR support. */
> > + RTE_FDIR_MODE_SIGNATURE, /**< Enable FDIR signature filter mode.
> */
> > + RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode for IP.
> */
> > + RTE_FDIR_MODE_PERFECT_MAC_VLAN, /**< Enable FDIR filter mode -
> MAC VLAN. */
> > + RTE_FDIR_MODE_PERFECT_CLOUD, /**< Enable FDIR filter mode -
> cloud. */
> > +};
>
> I know that some Intel NICs use the terminology "cloud" in their datasheet, but
> it is meaningless.
>
> [...]
> > +/**
> > + * A structure used to define the input for VxLAN NVGRE flow */
> > +struct rte_eth_cloud_flow {
> > + enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match.
> */
> > + uint32_t tni_vni; /**< TNI or VNI to match. */
>
> Isn't it Intel-specific?
I think only the word "cloud" is specific. It's for VxLAN and NVGRE packets.
>
> > + struct ether_addr mac_addr; /**< Mac address to match. */
> > +};
>
> So it is a tunnel, currently only VXLAN or NVGRE.
> And this kind of tunnel can be used in a cloud datacenter, yes. Or elsewhere.
>
> Please use the "tunnel" word.
Thanks for the comments. I'll sent a V2 to avoid using "cloud".
2015-09-25 08:14, Lu, Wenzhuo:
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > +/**
> > > + * A structure used to define the input for VxLAN NVGRE flow */
> > > +struct rte_eth_cloud_flow {
> > > + enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match.
> > */
> > > + uint32_t tni_vni; /**< TNI or VNI to match. */
> >
> > Isn't it Intel-specific?
>
> I think only the word "cloud" is specific. It's for VxLAN and NVGRE packets.
If someone else wants to use it for another kind of tunnel (neither VXLAN
neither NVGRE), identifier or tunnel_id would be more generic than tni_vni.
Hi Thomas,
> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> Sent: Friday, September 25, 2015 4:29 PM
> To: Lu, Wenzhuo
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [PATCH 1/6] lib/librte_ether: modify the structures for
> fdir new modes
>
> 2015-09-25 08:14, Lu, Wenzhuo:
> > From: Thomas Monjalon [mailto:thomas.monjalon@6wind.com]
> > > > +/**
> > > > + * A structure used to define the input for VxLAN NVGRE flow */
> > > > +struct rte_eth_cloud_flow {
> > > > + enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match.
> > > */
> > > > + uint32_t tni_vni; /**< TNI or VNI to match. */
> > >
> > > Isn't it Intel-specific?
> >
> > I think only the word "cloud" is specific. It's for VxLAN and NVGRE packets.
>
> If someone else wants to use it for another kind of tunnel (neither VXLAN
> neither NVGRE), identifier or tunnel_id would be more generic than tni_vni.
Yes, you're right. I'll change it in V2. Thanks.
@@ -248,6 +248,17 @@ enum rte_eth_tunnel_type {
};
/**
+ * Flow Director setting modes: none, signature or perfect.
+ */
+enum rte_fdir_mode {
+ RTE_FDIR_MODE_NONE = 0, /**< Disable FDIR support. */
+ RTE_FDIR_MODE_SIGNATURE, /**< Enable FDIR signature filter mode. */
+ RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode for IP. */
+ RTE_FDIR_MODE_PERFECT_MAC_VLAN, /**< Enable FDIR filter mode - MAC VLAN. */
+ RTE_FDIR_MODE_PERFECT_CLOUD, /**< Enable FDIR filter mode - cloud. */
+};
+
+/**
* filter type of tunneling packet
*/
#define ETH_TUNNEL_FILTER_OMAC 0x01 /**< filter by outer MAC addr */
@@ -377,18 +388,45 @@ struct rte_eth_sctpv6_flow {
};
/**
+ * A structure used to define the input for MAC VLAN flow
+ */
+struct rte_eth_mac_vlan_flow {
+ struct ether_addr mac_addr; /**< Mac address to match. */
+};
+
+/**
+ * Tunnel type for flow director.
+ */
+enum rte_eth_fdir_tunnel_type {
+ RTE_FDIR_TUNNEL_TYPE_NVGRE = 0,
+ RTE_FDIR_TUNNEL_TYPE_VXLAN,
+ RTE_FDIR_TUNNEL_TYPE_UNKNOWN,
+};
+
+/**
+ * A structure used to define the input for VxLAN NVGRE flow
+ */
+struct rte_eth_cloud_flow {
+ enum rte_eth_fdir_tunnel_type tunnel_type; /**< Tunnel type to match. */
+ uint32_t tni_vni; /**< TNI or VNI to match. */
+ struct ether_addr mac_addr; /**< Mac address to match. */
+};
+
+/**
* An union contains the inputs for all types of flow
*/
union rte_eth_fdir_flow {
- struct rte_eth_l2_flow l2_flow;
- struct rte_eth_udpv4_flow udp4_flow;
- struct rte_eth_tcpv4_flow tcp4_flow;
- struct rte_eth_sctpv4_flow sctp4_flow;
- struct rte_eth_ipv4_flow ip4_flow;
- struct rte_eth_udpv6_flow udp6_flow;
- struct rte_eth_tcpv6_flow tcp6_flow;
- struct rte_eth_sctpv6_flow sctp6_flow;
- struct rte_eth_ipv6_flow ipv6_flow;
+ struct rte_eth_l2_flow l2_flow;
+ struct rte_eth_udpv4_flow udp4_flow;
+ struct rte_eth_tcpv4_flow tcp4_flow;
+ struct rte_eth_sctpv4_flow sctp4_flow;
+ struct rte_eth_ipv4_flow ip4_flow;
+ struct rte_eth_udpv6_flow udp6_flow;
+ struct rte_eth_tcpv6_flow tcp6_flow;
+ struct rte_eth_sctpv6_flow sctp6_flow;
+ struct rte_eth_ipv6_flow ipv6_flow;
+ struct rte_eth_mac_vlan_flow mac_vlan_flow;
+ struct rte_eth_cloud_flow cloud_flow;
};
/**
@@ -465,6 +503,9 @@ struct rte_eth_fdir_masks {
struct rte_eth_ipv6_flow ipv6_mask;
uint16_t src_port_mask;
uint16_t dst_port_mask;
+ uint8_t mac_addr_mask; /** Per byte MAC address mask */
+ uint32_t tni_vni_mask; /** Per byte TNI or VNI mask */
+ uint8_t tunnel_type_mask;
};
/**
@@ -515,15 +556,6 @@ struct rte_eth_fdir_flex_conf {
/**< Flex mask configuration for each flow type */
};
-/**
- * Flow Director setting modes: none, signature or perfect.
- */
-enum rte_fdir_mode {
- RTE_FDIR_MODE_NONE = 0, /**< Disable FDIR support. */
- RTE_FDIR_MODE_SIGNATURE, /**< Enable FDIR signature filter mode. */
- RTE_FDIR_MODE_PERFECT, /**< Enable FDIR perfect filter mode. */
-};
-
#define UINT32_BIT (CHAR_BIT * sizeof(uint32_t))
#define RTE_FLOW_MASK_ARRAY_SIZE \
(RTE_ALIGN(RTE_ETH_FLOW_MAX, UINT32_BIT)/UINT32_BIT)