All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 3/3] app/dumpcap: check for failure to set promiscious
Date: Thu, 10 Feb 2022 15:09:06 -0800	[thread overview]
Message-ID: <20220210230906.833163-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20220210230906.833163-1-stephen@networkplumber.org>

If the rte_eth_promiscious_enable() fails, then log the error
and continue.

Coverity issue: 373662
Fixes: cbb44143be74 ("app/dumpcap: add new packet capture application")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/dumpcap/main.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index c5fe4403028a..21cb2810a48f 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -679,8 +679,13 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
 		flags |= RTE_PDUMP_FLAG_PCAPNG;
 
 	TAILQ_FOREACH(intf, &interfaces, next) {
-		if (promiscuous_mode)
-			rte_eth_promiscuous_enable(intf->port);
+		if (promiscuous_mode) {
+			ret = rte_eth_promiscuous_enable(intf->port);
+			if (ret != 0)
+				fprintf(stderr,
+					"port %u set promicious enable faile: %d\n",
+					intf->port, ret);
+		}
 
 		ret = rte_pdump_enable_bpf(intf->port, RTE_PDUMP_ALL_QUEUES,
 					   flags, snaplen,
-- 
2.34.1


  parent reply	other threads:[~2022-02-10 23:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-10 23:09 [PATCH 0/3] small fixes suggested by Coverity scan Stephen Hemminger
2022-02-10 23:09 ` [PATCH 1/3] pcapng: handle rte_ethlink_get failing Stephen Hemminger
2022-02-10 23:09 ` [PATCH 2/3] app/test_bpf: don't print eBPF program if NULL Stephen Hemminger
2022-02-11 11:02   ` Ananyev, Konstantin
2022-02-10 23:09 ` Stephen Hemminger [this message]
2022-03-08  8:20 ` [PATCH 0/3] small fixes suggested by Coverity scan 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=20220210230906.833163-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.