From: Adrien Mazarguil Date: Fri, 1 Sep 2017 08:06:51 +0000 (+0200) Subject: net/mlx4: rename alarm field X-Git-Tag: spdx-start~2020 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=7446202428f5116ec57c1f12095f2f6b4996b2b5;p=dpdk.git net/mlx4: rename alarm field Make clear this field is related to interrupt handling. Signed-off-by: Adrien Mazarguil --- diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 21762ccfbe..42606edca0 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -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; } diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h index ce827aa584..47ea409951 100644 --- a/drivers/net/mlx4/mlx4.h +++ b/drivers/net/mlx4/mlx4.h @@ -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. */