ether_addr_copy((struct ether_addr *)&cld_filter->inner_mac,
(struct ether_addr *)&tunnel_filter->input.inner_mac);
tunnel_filter->input.inner_vlan = cld_filter->inner_vlan;
+ if ((rte_le_to_cpu_16(cld_filter->flags) &
+ I40E_AQC_ADD_CLOUD_FLAGS_IPV6) ==
+ I40E_AQC_ADD_CLOUD_FLAGS_IPV6)
+ tunnel_filter->input.ip_type = I40E_TUNNEL_IPTYPE_IPV6;
+ else
+ tunnel_filter->input.ip_type = I40E_TUNNEL_IPTYPE_IPV4;
tunnel_filter->input.flags = cld_filter->flags;
tunnel_filter->input.tenant_id = cld_filter->tenant_id;
tunnel_filter->queue = cld_filter->queue_number;
/* Tunnel filter number HW supports */
#define I40E_MAX_TUNNEL_FILTER_NUM 400
+enum i40e_tunnel_iptype {
+ I40E_TUNNEL_IPTYPE_IPV4,
+ I40E_TUNNEL_IPTYPE_IPV6,
+};
+
/* Tunnel filter struct */
struct i40e_tunnel_filter_input {
uint8_t outer_mac[6]; /* Outer mac address to match */
uint8_t inner_mac[6]; /* Inner mac address to match */
uint16_t inner_vlan; /* Inner vlan address to match */
+ enum i40e_tunnel_iptype ip_type;
uint16_t flags; /* Filter type flag */
uint32_t tenant_id; /* Tenant id to match */
};
}
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
+ filter->ip_type = RTE_TUNNEL_IPTYPE_IPV4;
+ /* IPv4 is used to describe protocol,
+ * spec amd mask should be NULL.
+ */
+ if (item->spec || item->mask) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Invalid IPv4 item");
+ return -rte_errno;
+ }
+ break;
case RTE_FLOW_ITEM_TYPE_IPV6:
+ filter->ip_type = RTE_TUNNEL_IPTYPE_IPV6;
+ /* IPv6 is used to describe protocol,
+ * spec amd mask should be NULL.
+ */
+ if (item->spec || item->mask) {
+ rte_flow_error_set(error, EINVAL,
+ RTE_FLOW_ERROR_TYPE_ITEM,
+ item,
+ "Invalid IPv6 item");
+ return -rte_errno;
+ }
+ break;
case RTE_FLOW_ITEM_TYPE_UDP:
- /* IPv4/IPv6/UDP are used to describe protocol,
+ /* UDP is used to describe protocol,
* spec amd mask should be NULL.
*/
if (item->spec || item->mask) {
rte_flow_error_set(error, EINVAL,
RTE_FLOW_ERROR_TYPE_ITEM,
item,
- "Invalid IPv4 item");
+ "Invalid UDP item");
return -rte_errno;
}
break;