net/mlx: fix build with icc
authorFerruh Yigit <ferruh.yigit@intel.com>
Tue, 14 Jun 2016 16:17:24 +0000 (17:17 +0100)
committerBruce Richardson <bruce.richardson@intel.com>
Tue, 28 Jun 2016 09:49:09 +0000 (11:49 +0200)
Compilation errors:
mlx4:
  drivers/net/mlx4/mlx4.c(5409): error #188:
  enumerated type mixed with another type
          priv->intr_handle.type = 0;
                                 ^
mlx5:
  drivers/net/mlx5/mlx5_rxq.c(282): error #188:
  enumerated type mixed with another type
        enum hash_rxq_type type = 0;
                                  ^
and more same type of error.
Fix these by assigning enum values rather than integer values to the enum
variables

Fixes: c4da6caa426d ("mlx4: handle link status interrupts")
Fixes: 198a3c339a8f ("mlx5: handle link status interrupts")
Fixes: 0d2186743d62 ("mlx5: manage all special flow types at once")
Fixes: 612ad38209f7 ("mlx5: fix hash Rx queue type in RSS mode")
Fixes: 083c2dd31776 ("mlx5: refactor special flows handling")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx4/mlx4.c
drivers/net/mlx5/mlx5_ethdev.c
drivers/net/mlx5/mlx5_rxmode.c
drivers/net/mlx5/mlx5_rxq.c

index 6228688..f8ed42b 100644 (file)
@@ -5408,7 +5408,7 @@ priv_dev_interrupt_handler_uninstall(struct priv *priv, struct rte_eth_dev *dev)
                rte_eal_alarm_cancel(mlx4_dev_link_status_handler, dev);
        priv->pending_alarm = 0;
        priv->intr_handle.fd = 0;
-       priv->intr_handle.type = 0;
+       priv->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
 }
 
 /**
index 72f0826..0e7ed01 100644 (file)
@@ -1114,7 +1114,7 @@ priv_dev_interrupt_handler_uninstall(struct priv *priv, struct rte_eth_dev *dev)
                rte_eal_alarm_cancel(mlx5_dev_link_status_handler, dev);
        priv->pending_alarm = 0;
        priv->intr_handle.fd = 0;
-       priv->intr_handle.type = 0;
+       priv->intr_handle.type = RTE_INTR_HANDLE_UNKNOWN;
 }
 
 /**
index 51e2aca..8b58555 100644 (file)
@@ -347,7 +347,9 @@ priv_special_flow_enable_all(struct priv *priv)
 {
        enum hash_rxq_flow_type flow_type;
 
-       for (flow_type = 0; flow_type != HASH_RXQ_FLOW_TYPE_MAC; ++flow_type) {
+       for (flow_type = HASH_RXQ_FLOW_TYPE_PROMISC;
+                       flow_type != HASH_RXQ_FLOW_TYPE_MAC;
+                       ++flow_type) {
                int ret;
 
                ret = priv_special_flow_enable(priv, flow_type);
@@ -372,7 +374,9 @@ priv_special_flow_disable_all(struct priv *priv)
 {
        enum hash_rxq_flow_type flow_type;
 
-       for (flow_type = 0; flow_type != HASH_RXQ_FLOW_TYPE_MAC; ++flow_type)
+       for (flow_type = HASH_RXQ_FLOW_TYPE_PROMISC;
+                       flow_type != HASH_RXQ_FLOW_TYPE_MAC;
+                       ++flow_type)
                priv_special_flow_disable(priv, flow_type);
 }
 
index 908fd0f..29c137c 100644 (file)
@@ -269,7 +269,7 @@ priv_flow_attr(struct priv *priv, struct ibv_exp_flow_attr *flow_attr,
 static enum hash_rxq_type
 hash_rxq_type_from_pos(const struct ind_table_init *table, unsigned int pos)
 {
-       enum hash_rxq_type type = 0;
+       enum hash_rxq_type type = HASH_RXQ_TCPV4;
 
        assert(pos < table->hash_types_n);
        do {
@@ -609,9 +609,11 @@ priv_allow_flow_type(struct priv *priv, enum hash_rxq_flow_type type)
 int
 priv_rehash_flows(struct priv *priv)
 {
-       unsigned int i;
+       enum hash_rxq_flow_type i;
 
-       for (i = 0; (i != RTE_DIM((*priv->hash_rxqs)[0].special_flow)); ++i)
+       for (i = HASH_RXQ_FLOW_TYPE_PROMISC;
+                       i != RTE_DIM((*priv->hash_rxqs)[0].special_flow);
+                       ++i)
                if (!priv_allow_flow_type(priv, i)) {
                        priv_special_flow_disable(priv, i);
                } else {