summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com>2017-03-31 15:36:33 +0200
committerThomas Monjalon <thomas@monjalon.net>2017-04-21 02:15:12 +0200
commit0469250961215809568153615fb2e0e9addfafed (patch)
treede45e9d25671c805195847e03afc1b2997408580
parentb58c9c3677718164e98dd2536add5f06f44134e9 (diff)
downloaddpdk-0469250961215809568153615fb2e0e9addfafed.zip
dpdk-0469250961215809568153615fb2e0e9addfafed.tar.gz
dpdk-0469250961215809568153615fb2e0e9addfafed.tar.xz
examples/ip_pipeline: avoid panic if link up/down not supported
Some PMDs (mostly VFs) do not provide link up/down functionality. Signed-off-by: Andriy Berestovskyy <andriy.berestovskyy@caviumnetworks.com> Acked-by: Cristian Dumitrescu <cristian.dumitrescu@intel.com>
-rw-r--r--examples/ip_pipeline/init.c6
1 files 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);