DPDK patches and discussions
 help / color / mirror / Atom feed
From: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
To: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported
Date: Fri, 31 Mar 2017 15:36:33 +0200	[thread overview]
Message-ID: <1490967396-2240-2-git-send-email-Andriy.Berestovskyy@caviumnetworks.com> (raw)
In-Reply-To: <1490967396-2240-1-git-send-email-Andriy.Berestovskyy@caviumnetworks.com>

Some PMDs (mostly VFs) do not provide link up/down functionality.

Signed-off-by: Andriy Berestovskyy <Andriy.Berestovskyy@caviumnetworks.com>
---
 examples/ip_pipeline/init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/examples/ip_pipeline/init.c b/examples/ip_pipeline/init.c
index 1dc2a04..be148fc 100644
--- a/examples/ip_pipeline/init.c
+++ b/examples/ip_pipeline/init.c
@@ -717,7 +717,8 @@ app_link_up_internal(struct app_params *app, struct app_link_params *cp)
 
 	/* PMD link up */
 	status = rte_eth_dev_set_link_up(cp->pmd_id);
-	if (status < 0)
+	/* Do not panic if PMD does not provide link up functionality */
+	if (status < 0 && status != -ENOTSUP)
 		rte_panic("%s (%" PRIu32 "): PMD set link up error %"
 			PRId32 "\n", cp->name, cp->pmd_id, status);
 
@@ -733,7 +734,8 @@ app_link_down_internal(struct app_params *app, struct app_link_params *cp)
 
 	/* PMD link down */
 	status = rte_eth_dev_set_link_down(cp->pmd_id);
-	if (status < 0)
+	/* Do not panic if PMD does not provide link down functionality */
+	if (status < 0 && status != -ENOTSUP)
 		rte_panic("%s (%" PRIu32 "): PMD set link down error %"
 			PRId32 "\n", cp->name, cp->pmd_id, status);
 
-- 
2.7.4

  reply	other threads:[~2017-03-31 13:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 13:36 [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Andriy Berestovskyy
2017-03-31 13:36 ` Andriy Berestovskyy [this message]
2017-03-31 14:17   ` [dpdk-dev] [PATCH 2/5] examples/ip_pipeline: avoid panic if link up/down is not supported Dumitrescu, Cristian
2017-03-31 13:36 ` [dpdk-dev] [PATCH 3/5] port: use mbuf alloc bulk instead of mempool Andriy Berestovskyy
2017-03-31 14:18   ` Dumitrescu, Cristian
2017-03-31 13:36 ` [dpdk-dev] [PATCH 4/5] port: fix file descriptor reader Andriy Berestovskyy
2017-03-31 14:18   ` Dumitrescu, Cristian
2017-03-31 13:36 ` [dpdk-dev] [PATCH 5/5] port: minor typo Andriy Berestovskyy
2017-03-31 14:18   ` Dumitrescu, Cristian
2017-03-31 14:17 ` [dpdk-dev] [PATCH 1/5] examples/ip_pipeline: add support for more than 32 CPUs Dumitrescu, Cristian
2017-04-21  0:16   ` Thomas Monjalon

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=1490967396-2240-2-git-send-email-Andriy.Berestovskyy@caviumnetworks.com \
    --to=andriy.berestovskyy@caviumnetworks.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    /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).