DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andrew Rybchenko <arybchenko@solarflare.com>
To: Jakub Grajciar <jgrajcia@cisco.com>
Cc: <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH 06/18] net/memif: check status of getting link info
Date: Tue, 10 Sep 2019 09:25:46 +0100	[thread overview]
Message-ID: <1568103959-25572-7-git-send-email-arybchenko@solarflare.com> (raw)
In-Reply-To: <1568103959-25572-1-git-send-email-arybchenko@solarflare.com>

The return value of rte_eth_link_get() was changed from void to int.
Update the usage of the function according to the new return type.

Just log error if something goes wrong.

Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 drivers/net/memif/rte_eth_memif.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/net/memif/rte_eth_memif.c b/drivers/net/memif/rte_eth_memif.c
index af260f7a8..a347e27bd 100644
--- a/drivers/net/memif/rte_eth_memif.c
+++ b/drivers/net/memif/rte_eth_memif.c
@@ -266,7 +266,10 @@ eth_memif_rx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 		return 0;
 	if (unlikely(ring == NULL)) {
 		/* Secondary process will attempt to request regions. */
-		rte_eth_link_get(mq->in_port, &link);
+		ret = rte_eth_link_get(mq->in_port, &link);
+		if (ret < 0)
+			MIF_LOG(ERR, "Failed to get port %u link info: %s",
+				mq->in_port, rte_strerror(-ret));
 		return 0;
 	}
 
@@ -392,8 +395,13 @@ eth_memif_tx(void *queue, struct rte_mbuf **bufs, uint16_t nb_pkts)
 	if (unlikely((pmd->flags & ETH_MEMIF_FLAG_CONNECTED) == 0))
 		return 0;
 	if (unlikely(ring == NULL)) {
+		int ret;
+
 		/* Secondary process will attempt to request regions. */
-		rte_eth_link_get(mq->in_port, &link);
+		ret = rte_eth_link_get(mq->in_port, &link);
+		if (ret < 0)
+			MIF_LOG(ERR, "Failed to get port %u link info: %s",
+				mq->in_port, rte_strerror(-ret));
 		return 0;
 	}
 
-- 
2.17.1


  parent reply	other threads:[~2019-09-10  8:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-10  8:25 [dpdk-dev] [PATCH 00/18] ethdev: change link status get functions return value to int Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 01/18] net/bonding: fix link speed update in broadcast mode Andrew Rybchenko
2019-09-10 23:01   ` Chas Williams
2019-09-10  8:25 ` [dpdk-dev] [PATCH 02/18] ethdev: change link status get functions return value to int Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 03/18] app/testpmd: check status of getting link info Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 04/18] net/bonding: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 05/18] net/ixgbe: " Andrew Rybchenko
2019-09-10  8:25 ` Andrew Rybchenko [this message]
2019-09-10  8:25 ` [dpdk-dev] [PATCH 07/18] app/proc-info: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 08/18] app/test: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 09/18] app/pipeline: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 10/18] examples: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 11/18] examples/bbdev_app: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 12/18] examples/ip_pipeline: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 13/18] examples/ethtool: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 14/18] examples/flow_filtering: " Andrew Rybchenko
2019-09-12  5:16   ` Ori Kam
2019-09-10  8:25 ` [dpdk-dev] [PATCH 15/18] examples/link_status_interrupt: check status of getting link Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 16/18] examples/distributor: check status of getting link info Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 17/18] examples/qos_sched: " Andrew Rybchenko
2019-09-10  8:25 ` [dpdk-dev] [PATCH 18/18] examples/kni: " Andrew Rybchenko
2019-09-24 12:38 ` [dpdk-dev] [PATCH 00/18] ethdev: change link status get functions return value to int Ferruh Yigit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1568103959-25572-7-git-send-email-arybchenko@solarflare.com \
    --to=arybchenko@solarflare.com \
    --cc=dev@dpdk.org \
    --cc=jgrajcia@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).