From 506964bf86b0b0a576d590e89c4494afceb86a94 Mon Sep 17 00:00:00 2001 From: Thomas Monjalon Date: Fri, 20 Jun 2014 15:13:58 +0200 Subject: [PATCH] ethdev: read link state interrupt without link update service It is now possible to read link status updated by interrupt without having manual link_update() service provided by the PMD. Indeed link_update() is useless in interrupt case. So check of this function pointer must be done in the interrupt case only. Signed-off-by: Thomas Monjalon Acked-by: Olivier Matz --- lib/librte_ether/rte_ethdev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 7256841a7c..a292b6e01c 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1100,11 +1100,11 @@ rte_eth_link_get(uint8_t port_id, struct rte_eth_link *eth_link) return; } dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_RET(*dev->dev_ops->link_update); if (dev->data->dev_conf.intr_conf.lsc != 0) rte_eth_dev_atomic_read_link_status(dev, eth_link); else { + FUNC_PTR_OR_RET(*dev->dev_ops->link_update); (*dev->dev_ops->link_update)(dev, 1); *eth_link = dev->data->dev_link; } @@ -1120,11 +1120,11 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link) return; } dev = &rte_eth_devices[port_id]; - FUNC_PTR_OR_RET(*dev->dev_ops->link_update); if (dev->data->dev_conf.intr_conf.lsc != 0) rte_eth_dev_atomic_read_link_status(dev, eth_link); else { + FUNC_PTR_OR_RET(*dev->dev_ops->link_update); (*dev->dev_ops->link_update)(dev, 0); *eth_link = dev->data->dev_link; } -- 2.20.1