priv_dev_interrupt_handler_uninstall(priv, dev);
priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_ALLMULTI);
priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_PROMISC);
+ priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_BROADCAST);
+ priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_IPV6MULTI);
priv_mac_addrs_disable(priv);
priv_destroy_hash_rxqs(priv);
/* Prevent crashes when queues are still in use. */
mac.addr_bytes[0], mac.addr_bytes[1],
mac.addr_bytes[2], mac.addr_bytes[3],
mac.addr_bytes[4], mac.addr_bytes[5]);
- /* Register MAC and broadcast addresses. */
+ /* Register MAC address. */
claim_zero(priv_mac_addr_add(priv, 0,
(const uint8_t (*)[ETHER_ADDR_LEN])
mac.addr_bytes));
- claim_zero(priv_mac_addr_add(priv, (RTE_DIM(priv->mac) - 1),
- &(const uint8_t [ETHER_ADDR_LEN])
- { "\xff\xff\xff\xff\xff\xff" }));
#ifndef NDEBUG
{
char ifname[IF_NAMESIZE];
#define MLX5_MAX_VLAN_IDS 128
/* Maximum number of special flows. */
-#define MLX5_MAX_SPECIAL_FLOWS 2
+#define MLX5_MAX_SPECIAL_FLOWS 4
/* Request send completion once in every 64 sends, might be less. */
#define MLX5_PMD_TX_PER_COMP_REQ 64
max = 65535;
info->max_rx_queues = max;
info->max_tx_queues = max;
- /* Last array entry is reserved for broadcast. */
- info->max_mac_addrs = (RTE_DIM(priv->mac) - 1);
+ info->max_mac_addrs = RTE_DIM(priv->mac);
info->rx_offload_capa =
(priv->hw_csum ?
(DEV_RX_OFFLOAD_IPV4_CKSUM |
priv_lock(priv);
DEBUG("%p: removing MAC address from index %" PRIu32,
(void *)dev, index);
- /* Last array entry is reserved for broadcast. */
- if (index >= (RTE_DIM(priv->mac) - 1))
+ if (index >= RTE_DIM(priv->mac))
goto end;
priv_mac_addr_del(priv, index);
end:
priv_lock(priv);
DEBUG("%p: adding MAC address at index %" PRIu32,
(void *)dev, index);
- /* Last array entry is reserved for broadcast. */
- if (index >= (RTE_DIM(priv->mac) - 1))
+ if (index >= RTE_DIM(priv->mac))
goto end;
priv_mac_addr_add(priv, index,
(const uint8_t (*)[ETHER_ADDR_LEN])
1 << HASH_RXQ_ETH |
0,
},
+ [HASH_RXQ_FLOW_TYPE_BROADCAST] = {
+ .dst_mac_val = "\xff\xff\xff\xff\xff\xff",
+ .dst_mac_mask = "\xff\xff\xff\xff\xff\xff",
+ .hash_types =
+ 1 << HASH_RXQ_UDPV4 |
+ 1 << HASH_RXQ_IPV4 |
+#ifdef HAVE_FLOW_SPEC_IPV6
+ 1 << HASH_RXQ_UDPV6 |
+ 1 << HASH_RXQ_IPV6 |
+#endif /* HAVE_FLOW_SPEC_IPV6 */
+ 1 << HASH_RXQ_ETH |
+ 0,
+ },
+#ifdef HAVE_FLOW_SPEC_IPV6
+ [HASH_RXQ_FLOW_TYPE_IPV6MULTI] = {
+ .dst_mac_val = "\x33\x33\x00\x00\x00\x00",
+ .dst_mac_mask = "\xff\xff\x00\x00\x00\x00",
+ .hash_types =
+ 1 << HASH_RXQ_UDPV6 |
+ 1 << HASH_RXQ_IPV6 |
+ 1 << HASH_RXQ_ETH |
+ 0,
+ },
+#endif /* HAVE_FLOW_SPEC_IPV6 */
};
/**
return !!priv->promisc_req;
case HASH_RXQ_FLOW_TYPE_ALLMULTI:
return !!priv->allmulti_req;
+ case HASH_RXQ_FLOW_TYPE_BROADCAST:
+#ifdef HAVE_FLOW_SPEC_IPV6
+ case HASH_RXQ_FLOW_TYPE_IPV6MULTI:
+#endif /* HAVE_FLOW_SPEC_IPV6 */
+ /* If allmulti is enabled, broadcast and ipv6multi
+ * are unnecessary. */
+ return !priv->allmulti_req;
case HASH_RXQ_FLOW_TYPE_MAC:
return 1;
+ default:
+ /* Unsupported flow type is not allowed. */
+ return 0;
}
return 0;
}
enum hash_rxq_flow_type {
HASH_RXQ_FLOW_TYPE_PROMISC,
HASH_RXQ_FLOW_TYPE_ALLMULTI,
+ HASH_RXQ_FLOW_TYPE_BROADCAST,
+ HASH_RXQ_FLOW_TYPE_IPV6MULTI,
HASH_RXQ_FLOW_TYPE_MAC,
};
return "promiscuous";
case HASH_RXQ_FLOW_TYPE_ALLMULTI:
return "allmulticast";
+ case HASH_RXQ_FLOW_TYPE_BROADCAST:
+ return "broadcast";
+ case HASH_RXQ_FLOW_TYPE_IPV6MULTI:
+ return "IPv6 multicast";
case HASH_RXQ_FLOW_TYPE_MAC:
return "MAC";
}
" %s",
(void *)priv, strerror(err));
/* Rollback. */
+ priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_IPV6MULTI);
+ priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_BROADCAST);
priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_ALLMULTI);
priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_PROMISC);
priv_mac_addrs_disable(priv);
return;
}
DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev);
+ priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_IPV6MULTI);
+ priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_BROADCAST);
priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_ALLMULTI);
priv_special_flow_disable(priv, HASH_RXQ_FLOW_TYPE_PROMISC);
priv_mac_addrs_disable(priv);