/* Initialization data for special flows. */
static const struct special_flow_init special_flow_init[] = {
- [HASH_RXQ_FLOW_TYPE_ALLMULTI] = {
- .dst_mac_val = "\x01\x00\x00\x00\x00\x00",
- .dst_mac_mask = "\x01\x00\x00\x00\x00\x00",
- .hash_types =
- 1 << HASH_RXQ_UDPV4 |
- 1 << HASH_RXQ_IPV4 |
- 1 << HASH_RXQ_UDPV6 |
- 1 << HASH_RXQ_IPV6 |
- 1 << HASH_RXQ_ETH |
- 0,
- .per_vlan = 0,
- },
[HASH_RXQ_FLOW_TYPE_BROADCAST] = {
.dst_mac_val = "\xff\xff\xff\xff\xff\xff",
.dst_mac_mask = "\xff\xff\xff\xff\xff\xff",
if (priv->isolated)
return 0;
- for (flow_type = HASH_RXQ_FLOW_TYPE_ALLMULTI;
+ for (flow_type = HASH_RXQ_FLOW_TYPE_BROADCAST;
flow_type != HASH_RXQ_FLOW_TYPE_MAC;
++flow_type) {
int ret;
{
enum hash_rxq_flow_type flow_type;
- for (flow_type = HASH_RXQ_FLOW_TYPE_ALLMULTI;
+ for (flow_type = HASH_RXQ_FLOW_TYPE_BROADCAST;
flow_type != HASH_RXQ_FLOW_TYPE_MAC;
++flow_type)
priv_special_flow_disable(priv, flow_type);
void
mlx5_allmulticast_enable(struct rte_eth_dev *dev)
{
- struct priv *priv = dev->data->dev_private;
- int ret;
+ struct rte_flow_item_eth eth = {
+ .dst.addr_bytes = "\x01\x00\x00\x00\x00\x00",
+ .src.addr_bytes = "\x01\x00\x00\x00\x00\x00",
+ .type = 0,
+ };
if (mlx5_is_secondary())
return;
-
- priv_lock(priv);
- priv->allmulti_req = 1;
- ret = priv_rehash_flows(priv);
- if (ret)
- ERROR("error while enabling allmulticast mode: %s",
- strerror(ret));
- priv_unlock(priv);
+ dev->data->all_multicast = 1;
+ if (dev->data->dev_started)
+ claim_zero(mlx5_ctrl_flow(dev, ð, ð, 1));
}
/**
void
mlx5_allmulticast_disable(struct rte_eth_dev *dev)
{
- struct priv *priv = dev->data->dev_private;
- int ret;
+ struct rte_flow_item_eth eth = {
+ .dst.addr_bytes = "\x01\x00\x00\x00\x00\x00",
+ .src.addr_bytes = "\x01\x00\x00\x00\x00\x00",
+ .type = 0,
+ };
if (mlx5_is_secondary())
return;
-
- priv_lock(priv);
- priv->allmulti_req = 0;
- ret = priv_rehash_flows(priv);
- if (ret)
- ERROR("error while disabling allmulticast mode: %s",
- strerror(ret));
- priv_unlock(priv);
+ dev->data->all_multicast = 0;
+ if (dev->data->dev_started)
+ claim_zero(mlx5_ctrl_flow(dev, ð, ð, 0));
}
int
priv_allow_flow_type(struct priv *priv, enum hash_rxq_flow_type type)
{
+ (void)priv;
switch (type) {
- case HASH_RXQ_FLOW_TYPE_ALLMULTI:
- return !!priv->allmulti_req;
case HASH_RXQ_FLOW_TYPE_BROADCAST:
case HASH_RXQ_FLOW_TYPE_IPV6MULTI:
- /* If allmulti is enabled, broadcast and ipv6multi
- * are unnecessary. */
- return !priv->allmulti_req;
case HASH_RXQ_FLOW_TYPE_MAC:
return 1;
+ return 1;
default:
/* Unsupported flow type is not allowed. */
return 0;
};
enum hash_rxq_flow_type {
- HASH_RXQ_FLOW_TYPE_ALLMULTI,
HASH_RXQ_FLOW_TYPE_BROADCAST,
HASH_RXQ_FLOW_TYPE_IPV6MULTI,
HASH_RXQ_FLOW_TYPE_MAC,
hash_rxq_flow_type_str(enum hash_rxq_flow_type flow_type)
{
switch (flow_type) {
- case HASH_RXQ_FLOW_TYPE_ALLMULTI:
- return "allmulticast";
case HASH_RXQ_FLOW_TYPE_BROADCAST:
return "broadcast";
case HASH_RXQ_FLOW_TYPE_IPV6MULTI: