DPDK patches and discussions
 help / color / mirror / Atom feed
From: Isaac Boukris <iboukris@gmail.com>
To: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Subject: A couple of patches for dumpcap
Date: Sat, 24 Feb 2024 19:28:19 +0200	[thread overview]
Message-ID: <CAC-fF8TDO-peNgbimYEQxJKT0BabJDDC0OOLt3ax0XS+QwOStg@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 42 bytes --]

Hi Stephen,

Please take a look.

Thanks!

[-- Attachment #2: dumpcap_fixes.patch --]
[-- Type: application/octet-stream, Size: 1620 bytes --]

From 3e32a62cb6ad1042d942a87fd9da813558c11532 Mon Sep 17 00:00:00 2001
From: Isaac Boukris <iboukris@gmail.com>
Date: Sat, 24 Feb 2024 15:00:44 +0200
Subject: [PATCH 1/2] dumpcap: disable promiscuous mode at exit

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
---
 app/dumpcap/main.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index d57db0589a..88cec43086 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -830,11 +830,12 @@ static void enable_pdump(struct rte_ring *r, struct rte_mempool *mp)
 				intf->opts.promisc_mode = false;
 			} else {
 				ret = rte_eth_promiscuous_enable(intf->port);
-				if (ret != 0)
+				if (ret != 0) {
 					fprintf(stderr,
 						"port %u set promiscuous enable failed: %d\n",
 						intf->port, ret);
-				intf->opts.promisc_mode = false;
+					intf->opts.promisc_mode = false;
+				}
 			}
 		}
 		++count;
-- 
2.39.3


From 7ba53acbb39e0dc701a80702ea0d4a7e2a37a5f2 Mon Sep 17 00:00:00 2001
From: Isaac Boukris <iboukris@gmail.com>
Date: Sat, 24 Feb 2024 18:49:01 +0200
Subject: [PATCH 2/2] dumpcap: set handler for SIGTERM as well

Signed-off-by: Isaac Boukris <iboukris@gmail.com>
---
 app/dumpcap/main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 88cec43086..95b1067387 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -966,6 +966,7 @@ int main(int argc, char **argv)
 	compile_filters();
 
 	signal(SIGINT, signal_handler);
+	signal(SIGTERM, signal_handler);
 	signal(SIGPIPE, SIG_IGN);
 
 	enable_primary_monitor();
-- 
2.39.3


             reply	other threads:[~2024-02-24 17:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-24 17:28 Isaac Boukris [this message]
2024-02-26  1:24 ` Stephen Hemminger

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=CAC-fF8TDO-peNgbimYEQxJKT0BabJDDC0OOLt3ax0XS+QwOStg@mail.gmail.com \
    --to=iboukris@gmail.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.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).