[dpdk-dev] [PATCH] ethdev: avoid blocking telemetry callback for link status

Power, Ciara ciara.power at intel.com
Thu Jan 14 16:06:13 CET 2021


Hi Bruce,

>-----Original Message-----
>From: Richardson, Bruce <bruce.richardson at intel.com>
>Sent: Thursday 14 January 2021 12:18
>To: dev at dpdk.org
>Cc: Richardson, Bruce <bruce.richardson at intel.com>; stable at dpdk.org;
>Thomas Monjalon <thomas at monjalon.net>; Yigit, Ferruh
><ferruh.yigit at intel.com>; Andrew Rybchenko
><andrew.rybchenko at oktetlabs.ru>; Power, Ciara <ciara.power at intel.com>;
>Wiles, Keith <keith.wiles at intel.com>
>Subject: [PATCH] ethdev: avoid blocking telemetry callback for link status
>
>When querying the link status via telemetry interface, we don't want the
>client to have to wait for multiple seconds for a reply. Therefore use
>"rte_eth_link_get_nowait()" rather than "rte_eth_link_get()" in the telemetry
>callback.
>
>Cc: stable at dpdk.org
>Fixes: c190daedb9b1 ("ethdev: add telemetry callbacks")
>
>Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>
>---
> lib/librte_ethdev/rte_ethdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>index 17ddacc78..1f4545fe0 100644
>--- a/lib/librte_ethdev/rte_ethdev.c
>+++ b/lib/librte_ethdev/rte_ethdev.c
>@@ -5692,7 +5692,7 @@ eth_dev_handle_port_link_status(const char *cmd
>__rte_unused,
> 	if (!rte_eth_dev_is_valid_port(port_id))
> 		return -1;
>
>-	ret = rte_eth_link_get(port_id, &link);
>+	ret = rte_eth_link_get_nowait(port_id, &link);
> 	if (ret < 0)
> 		return -1;
>
>--
>2.27.0

This change looks good to me.

Acked-by: Ciara Power <ciara.power at intel.com>


More information about the dev mailing list