DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: usman.tanveer@emumba.com, reshma.pattan@intel.com
Cc: dev@dpdk.org, Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH v2] app/pdump: exit if no device specified
Date: Fri, 30 Jun 2023 19:16:11 -0700	[thread overview]
Message-ID: <20230701021611.8269-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20220302092614.5164-1-usman.tanveer@emumba.com>

Simpler version of earlier patch which had a good idea, was just
implemented with more code than necessary.
If no device is specified don't start the capture loop.

Reported-by: usman.tanveer <usman.tanveer@emumba.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/pdump/main.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index c94606275b28..7a1c7bdf6011 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -915,6 +915,9 @@ dump_packets(void)
 	int i;
 	unsigned int lcore_id = 0;
 
+	if (num_tuples == 0)
+		rte_exit(EXIT_FAILURE, "No device specified for capture\n");
+
 	if (!multiple_core_capture) {
 		printf(" core (%u), capture for (%d) tuples\n",
 				rte_lcore_id(), num_tuples);
-- 
2.39.2


  parent reply	other threads:[~2023-07-01  2:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-02  9:26 [PATCH] app/pdump: close program if --pdump argument is missing usman.tanveer
2022-03-02 16:52 ` Stephen Hemminger
2022-03-31 12:59   ` Usman Tanveer
2023-07-01  2:16 ` Stephen Hemminger [this message]
2023-07-03  6:29   ` [PATCH v2] app/pdump: exit if no device specified fengchengwen
2023-07-06 10:45     ` 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=20230701021611.8269-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=reshma.pattan@intel.com \
    --cc=usman.tanveer@emumba.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).