When programming GENEVE and VXLAN switch rules, there are some instances
where both VLAN tagged packets plus non-VLAN tagged packets are needed
to match the rule.
In order to perform this action in one rule, the switch code needs
to setup the packet flag mask to ignore the VLAN packet flag. This
will allow the rule to match both VLAN and non-VLAN packets.
Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
ICE_NON_TUN = 0,
ICE_SW_TUN_AND_NON_TUN,
ICE_SW_TUN_VXLAN_GPE,
ICE_NON_TUN = 0,
ICE_SW_TUN_AND_NON_TUN,
ICE_SW_TUN_VXLAN_GPE,
- ICE_SW_TUN_GENEVE,
- ICE_SW_TUN_VXLAN,
+ ICE_SW_TUN_GENEVE, /* GENEVE matches only non-VLAN pkts */
+ ICE_SW_TUN_GENEVE_VLAN, /* GENEVE matches both VLAN and non-VLAN pkts */
+ ICE_SW_TUN_VXLAN, /* VXLAN matches only non-VLAN pkts */
+ ICE_SW_TUN_VXLAN_VLAN, /* VXLAN matches both VLAN and non-VLAN pkts */
ICE_SW_TUN_NVGRE,
ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN
* and GENEVE
ICE_SW_TUN_NVGRE,
ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN
* and GENEVE
#define ICE_TUN_FLAG_MDID 21
#define ICE_TUN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_TUN_FLAG_MDID)
#define ICE_TUN_FLAG_MASK 0xFF
#define ICE_TUN_FLAG_MDID 21
#define ICE_TUN_FLAG_MDID_OFF (ICE_MDID_SIZE * ICE_TUN_FLAG_MDID)
#define ICE_TUN_FLAG_MASK 0xFF
+#define ICE_TUN_FLAG_VLAN_MASK 0x01
#define ICE_TUN_FLAG_FV_IND 2
#define ICE_PROTOCOL_MAX_ENTRIES 16
#define ICE_TUN_FLAG_FV_IND 2
#define ICE_PROTOCOL_MAX_ENTRIES 16
* ice_add_sw_recipe - function to call AQ calls to create switch recipe
* @hw: pointer to hardware structure
* @rm: recipe management list entry
* ice_add_sw_recipe - function to call AQ calls to create switch recipe
* @hw: pointer to hardware structure
* @rm: recipe management list entry
- * @match_tun: if field vector index for tunnel needs to be programmed
- * @profiles: bitmap of profiles that will be assocated.
+ * @match_tun_mask: tunnel mask that needs to be programmed
+ * @profiles: bitmap of profiles that will be associated.
*/
static enum ice_status
ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
*/
static enum ice_status
ice_add_sw_recipe(struct ice_hw *hw, struct ice_sw_recipe *rm,
- bool match_tun, ice_bitmap_t *profiles)
+ u16 match_tun_mask, ice_bitmap_t *profiles)
{
ice_declare_bitmap(result_idx_bm, ICE_MAX_FV_WORDS);
struct ice_aqc_recipe_data_elem *tmp;
{
ice_declare_bitmap(result_idx_bm, ICE_MAX_FV_WORDS);
struct ice_aqc_recipe_data_elem *tmp;
/* To differentiate among different UDP tunnels, a meta data ID
* flag is used.
*/
/* To differentiate among different UDP tunnels, a meta data ID
* flag is used.
*/
buf[recps].content.lkup_indx[i] = ICE_TUN_FLAG_FV_IND;
buf[recps].content.mask[i] =
buf[recps].content.lkup_indx[i] = ICE_TUN_FLAG_FV_IND;
buf[recps].content.mask[i] =
- CPU_TO_LE16(ICE_TUN_FLAG_MASK);
+ CPU_TO_LE16(match_tun_mask);
{
switch (tun_type) {
case ICE_SW_TUN_VXLAN_GPE:
{
switch (tun_type) {
case ICE_SW_TUN_VXLAN_GPE:
+ case ICE_SW_TUN_GENEVE:
+ case ICE_SW_TUN_VXLAN:
case ICE_SW_TUN_NVGRE:
case ICE_SW_TUN_UDP:
case ICE_ALL_TUNNELS:
*mask = ICE_TUN_FLAG_MASK;
return true;
case ICE_SW_TUN_NVGRE:
case ICE_SW_TUN_UDP:
case ICE_ALL_TUNNELS:
*mask = ICE_TUN_FLAG_MASK;
return true;
+ case ICE_SW_TUN_GENEVE_VLAN:
+ case ICE_SW_TUN_VXLAN_VLAN:
+ *mask = ICE_TUN_FLAG_MASK & ~ICE_TUN_FLAG_VLAN_MASK;
+ return true;
+
default:
*mask = 0;
return false;
default:
*mask = 0;
return false;
break;
case ICE_SW_TUN_VXLAN_GPE:
case ICE_SW_TUN_GENEVE:
break;
case ICE_SW_TUN_VXLAN_GPE:
case ICE_SW_TUN_GENEVE:
+ case ICE_SW_TUN_GENEVE_VLAN:
+ case ICE_SW_TUN_VXLAN_VLAN:
case ICE_SW_TUN_UDP:
case ICE_SW_TUN_GTP:
prof_type = ICE_PROF_TUN_UDP;
case ICE_SW_TUN_UDP:
case ICE_SW_TUN_GTP:
prof_type = ICE_PROF_TUN_UDP;
struct ice_sw_fv_list_entry *tmp;
enum ice_status status = ICE_SUCCESS;
struct ice_sw_recipe *rm;
struct ice_sw_fv_list_entry *tmp;
enum ice_status status = ICE_SUCCESS;
struct ice_sw_recipe *rm;
- bool match_tun = false;
+ u16 match_tun_mask = 0;
* differentiate different tunnel types. A separate recipe needs to be
* used for the metadata.
*/
* differentiate different tunnel types. A separate recipe needs to be
* used for the metadata.
*/
- if (ice_tun_type_match_word(rinfo->tun_type, &mask) &&
+ if (ice_tun_type_match_word(rinfo->tun_type, &mask) &&
/* set the recipe priority if specified */
rm->priority = (u8)rinfo->priority;
/* set the recipe priority if specified */
rm->priority = (u8)rinfo->priority;
rm->tun_type = rinfo->tun_type;
/* Recipe we need does not exist, add a recipe */
rm->tun_type = rinfo->tun_type;
/* Recipe we need does not exist, add a recipe */
- status = ice_add_sw_recipe(hw, rm, match_tun, profiles);
+ status = ice_add_sw_recipe(hw, rm, match_tun_mask, profiles);
if (status)
goto err_unroll;
if (status)
goto err_unroll;
*offsets = dummy_udp_gtp_packet_offsets;
return;
}
*offsets = dummy_udp_gtp_packet_offsets;
return;
}
if (tun_type == ICE_SW_TUN_PPPOE && ipv6) {
*pkt = dummy_pppoe_ipv6_packet;
*pkt_len = sizeof(dummy_pppoe_ipv6_packet);
if (tun_type == ICE_SW_TUN_PPPOE && ipv6) {
*pkt = dummy_pppoe_ipv6_packet;
*pkt_len = sizeof(dummy_pppoe_ipv6_packet);
}
if (tun_type == ICE_SW_TUN_VXLAN || tun_type == ICE_SW_TUN_GENEVE ||
}
if (tun_type == ICE_SW_TUN_VXLAN || tun_type == ICE_SW_TUN_GENEVE ||
- tun_type == ICE_SW_TUN_VXLAN_GPE || tun_type == ICE_SW_TUN_UDP) {
+ tun_type == ICE_SW_TUN_VXLAN_GPE || tun_type == ICE_SW_TUN_UDP ||
+ tun_type == ICE_SW_TUN_GENEVE_VLAN ||
+ tun_type == ICE_SW_TUN_VXLAN_VLAN) {
if (tcp) {
*pkt = dummy_udp_tun_tcp_packet;
*pkt_len = sizeof(dummy_udp_tun_tcp_packet);
if (tcp) {
*pkt = dummy_udp_tun_tcp_packet;
*pkt_len = sizeof(dummy_udp_tun_tcp_packet);
case ICE_SW_TUN_AND_NON_TUN:
case ICE_SW_TUN_VXLAN_GPE:
case ICE_SW_TUN_VXLAN:
case ICE_SW_TUN_AND_NON_TUN:
case ICE_SW_TUN_VXLAN_GPE:
case ICE_SW_TUN_VXLAN:
+ case ICE_SW_TUN_VXLAN_VLAN:
case ICE_SW_TUN_UDP:
if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, &open_port))
return ICE_ERR_CFG;
break;
case ICE_SW_TUN_GENEVE:
case ICE_SW_TUN_UDP:
if (!ice_get_open_tunnel_port(hw, TNL_VXLAN, &open_port))
return ICE_ERR_CFG;
break;
case ICE_SW_TUN_GENEVE:
+ case ICE_SW_TUN_GENEVE_VLAN:
if (!ice_get_open_tunnel_port(hw, TNL_GENEVE, &open_port))
return ICE_ERR_CFG;
break;
if (!ice_get_open_tunnel_port(hw, TNL_GENEVE, &open_port))
return ICE_ERR_CFG;
break;
cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI_LIST))
return ICE_ERR_NOT_IMPL;
cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI_LIST))
return ICE_ERR_NOT_IMPL;
- /* Workaround fix for unexpected rule deletion by kernel PF
- * during VF reset.
- */
- if (new_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI &&
- cur_fltr->sw_act.fltr_act == ICE_FWD_TO_VSI)
- return ICE_ERR_NOT_IMPL;
-
if (m_entry->vsi_count < 2 && !m_entry->vsi_list_info) {
/* Only one entry existed in the mapping and it was not already
* a part of a VSI list. So, create a VSI list with the old and
if (m_entry->vsi_count < 2 && !m_entry->vsi_list_info) {
/* Only one entry existed in the mapping and it was not already
* a part of a VSI list. So, create a VSI list with the old and