net/mlx4: rename alarm field
authorAdrien Mazarguil <adrien.mazarguil@6wind.com>
Fri, 1 Sep 2017 08:06:51 +0000 (10:06 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 6 Oct 2017 00:49:48 +0000 (02:49 +0200)
Make clear this field is related to interrupt handling.

Signed-off-by: Adrien Mazarguil <adrien.mazarguil@6wind.com>
drivers/net/mlx4/mlx4.c
drivers/net/mlx4/mlx4.h

index 21762cc..42606ed 100644 (file)
@@ -2720,10 +2720,10 @@ priv_dev_status_handler(struct priv *priv, struct rte_eth_dev *dev,
        mlx4_link_update(dev, 0);
        if (((link->link_speed == 0) && link->link_status) ||
            ((link->link_speed != 0) && !link->link_status)) {
-               if (!priv->pending_alarm) {
+               if (!priv->intr_alarm) {
                        /* Inconsistent status, check again later. */
-                       priv->pending_alarm = 1;
-                       rte_eal_alarm_set(MLX4_ALARM_TIMEOUT_US,
+                       priv->intr_alarm = 1;
+                       rte_eal_alarm_set(MLX4_INTR_ALARM_TIMEOUT,
                                          mlx4_dev_link_status_handler,
                                          dev);
                }
@@ -2747,8 +2747,8 @@ mlx4_dev_link_status_handler(void *arg)
        uint32_t events;
        int ret;
 
-       assert(priv->pending_alarm == 1);
-       priv->pending_alarm = 0;
+       assert(priv->intr_alarm == 1);
+       priv->intr_alarm = 0;
        ret = priv_dev_status_handler(priv, dev, &events);
        if (ret > 0 && events & (1 << RTE_ETH_EVENT_INTR_LSC))
                _rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_LSC,
@@ -2917,14 +2917,14 @@ priv_dev_link_interrupt_handler_uninstall(struct priv *priv,
                if (ret)
                        return ret;
        }
-       if (priv->pending_alarm)
+       if (priv->intr_alarm)
                if (rte_eal_alarm_cancel(mlx4_dev_link_status_handler,
                                         dev)) {
                        ERROR("rte_eal_alarm_cancel failed "
                              " (rte_errno: %s)", strerror(rte_errno));
                        return -rte_errno;
                }
-       priv->pending_alarm = 0;
+       priv->intr_alarm = 0;
        return 0;
 }
 
index ce827aa..47ea409 100644 (file)
@@ -63,8 +63,8 @@
 #define MLX4_PMD_TX_MP_CACHE 8
 #endif
 
-/* Alarm timeout. */
-#define MLX4_ALARM_TIMEOUT_US 100000
+/* Interrupt alarm timeout value in microseconds. */
+#define MLX4_INTR_ALARM_TIMEOUT 100000
 
 /* Port parameter. */
 #define MLX4_PMD_PORT_KVARG "port"
@@ -162,7 +162,7 @@ struct priv {
        uint8_t port; /* Physical port number. */
        unsigned int started:1; /* Device started, flows enabled. */
        unsigned int vf:1; /* This is a VF device. */
-       unsigned int pending_alarm:1; /* An alarm is pending. */
+       unsigned int intr_alarm:1; /* An interrupt alarm is scheduled. */
        unsigned int isolated:1; /* Toggle isolated mode. */
        /* RX/TX queues. */
        unsigned int rxqs_n; /* RX queues array size. */