- rxq->allmulti_flow = flow;
- DEBUG("%p: allmulticast mode enabled", (void *)rxq);
+ hash_rxq->allmulti_flow = flow;
+ DEBUG("%p: allmulticast mode enabled", (void *)hash_rxq);
+ return 0;
+}
+
+/**
+ * Enable allmulti mode in most hash RX queues.
+ * TCP queues are exempted to save resources.
+ *
+ * @param priv
+ * Private structure.
+ *
+ * @return
+ * 0 on success, errno value on failure.
+ */
+int
+priv_allmulticast_enable(struct priv *priv)
+{
+ unsigned int i;
+
+ if (!priv_allow_flow_type(priv, HASH_RXQ_FLOW_TYPE_ALLMULTI))
+ return 0;
+ for (i = 0; (i != priv->hash_rxqs_n); ++i) {
+ struct hash_rxq *hash_rxq = &(*priv->hash_rxqs)[i];
+ int ret;
+
+ /* allmulticast not relevant for TCP. */
+ if (hash_rxq->type == HASH_RXQ_TCPV4)
+ continue;
+ ret = hash_rxq_allmulticast_enable(hash_rxq);
+ if (!ret)
+ continue;
+ /* Failure, rollback. */
+ while (i != 0) {
+ hash_rxq = &(*priv->hash_rxqs)[--i];
+ hash_rxq_allmulticast_disable(hash_rxq);
+ }
+ return ret;
+ }