DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Isaac Boukris <iboukris@gmail.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v2] dumpcap: correctly disable promiscuous mode at exit
Date: Thu,  7 Mar 2024 14:37:59 -0800	[thread overview]
Message-ID: <20240307223851.5786-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20240227092326.340229-1-iboukris@gmail.com>

From: Isaac Boukris <iboukris@gmail.com>

If request to set promiscious mode failed at startup,
then it is not necessary to disable it when shutting down.

This should only be issue if with a buggy driver because if
driver does not support setting promiscious it would just
ignore request to disable it as well.

Fixes: 6026bfae07d4 ("app/dumpcap: support multiple interfaces")
Signed-off-by: Isaac Boukris <iboukris@gmail.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
v2 - add more to commit log, and simplify the logic

 app/dumpcap/main.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 76c747511444..11e470391edb 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -828,12 +828,9 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
 			if (rte_eth_promiscuous_get(intf->port) == 1) {
 				/* promiscuous already enabled */
 				intf->opts.promisc_mode = false;
-			} else {
-				ret = rte_eth_promiscuous_enable(intf->port);
-				if (ret != 0)
-					fprintf(stderr,
-						"port %u set promiscuous enable failed: %d\n",
-						intf->port, ret);
+			} else if (rte_eth_promiscuous_enable(intf->port) < 0) {
+				fprintf(stderr, "port %u:%s set promiscuous failed\n",
+					intf->port, intf->name);
 				intf->opts.promisc_mode = false;
 			}
 		}
-- 
2.43.0


  parent reply	other threads:[~2024-03-07 22:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-27  9:23 [PATCH] " Isaac Boukris
2024-02-27 18:07 ` Stephen Hemminger
2024-03-06 21:45   ` Thomas Monjalon
2024-03-07 22:37 ` Stephen Hemminger [this message]
2024-03-08  7:09   ` [PATCH v2] " Isaac Boukris
2024-03-18  3:04     ` 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=20240307223851.5786-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=iboukris@gmail.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).