From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B868D42D9C; Sat, 1 Jul 2023 04:16:17 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 40ECC40F16; Sat, 1 Jul 2023 04:16:17 +0200 (CEST) Received: from mail-yw1-f174.google.com (mail-yw1-f174.google.com [209.85.128.174]) by mails.dpdk.org (Postfix) with ESMTP id 0F2CA40A79 for ; Sat, 1 Jul 2023 04:16:15 +0200 (CEST) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-5776312eaddso11250277b3.3 for ; Fri, 30 Jun 2023 19:16:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688177775; x=1690769775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZFsqNPCtMoSfiNPoO5tmoxoMeO7aIW2IFCr9t+bPfxk=; b=PN7l6NeV7klilrLDy+e3fgcdIT4PZYoUxDn/8HvNKfduVN8RzV3oTTAdrpdqAd+pF/ wuDNzR+9M6lPLnOqmPDFiQ0KWHemgh6MwEtQBJRyZhC04OSGLLM/NvtXnuI264Qplgck i0BjkI+2UAHtjcrKI/ni1q/y/Yx8cSd5+08pZDK/NSDgYpuAgz3OGQNn7BcWSHjU3svf KlPdeggqeBP+0zMjR1mwzGj7uLq+FjOa9vL0RbPDcHuujSnmVjD1fIXPaLtmVAuHjmjc LqukOtz1AbMhuIRJRFF4iHJ08STJXxLPjAMZfvObPgq7YZ0sva9d5g3RuFMmzxgWeB0P Tbyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688177775; x=1690769775; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZFsqNPCtMoSfiNPoO5tmoxoMeO7aIW2IFCr9t+bPfxk=; b=Re1vAdrbyW5LTyUXLja6Dug6YQcsS29XTBbp0oc81iPYt5teIGFy7KKKZGsNWo2gJj zsEes+GE4aJqvcbaUrfgvH/C92fbU4gdMaImlC8JYrsUWtxJjZX7RAaj7TTH0Ug/KWR3 elF46tVaQxcGaeN0ERv+vPjTcuV1EphdcFzxXwbgKWbGe14COe1MAQ9mwDwXWBL4wGZh wOfd0M2VJ9wiu6/LNTeDmmHy8j7+YL//Dk7WZCbPNVqqaWbUzF5IfCZlGuq4pSVHkjBx LAsFQA51/pVsA6YdUQrOAHsOnMLEZny+7MQpP9c/uSP0oOXvC0GKj932u7wcD4VeYJLm TNdw== X-Gm-Message-State: ABy/qLYe3pmJIlFrwJU4EjOVd12W5FCG8eGe3eGRWLw7x55fn+FiLUON ZW09HY6KyRRuXxIlFxHHSSP24A== X-Google-Smtp-Source: APBJJlEGKFhtyaEK2tT4xxGnbP+M8mzjutuYN9XYuYkq/IJGAXEgVkSjBY/IOu2KizF5fi2SpYMGMw== X-Received: by 2002:a0d:e385:0:b0:576:b999:3d75 with SMTP id m127-20020a0de385000000b00576b9993d75mr4388884ywe.14.1688177775214; Fri, 30 Jun 2023 19:16:15 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id j1-20020aa78d01000000b00666a83bd544sm10457113pfe.23.2023.06.30.19.16.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jun 2023 19:16:14 -0700 (PDT) From: Stephen Hemminger To: usman.tanveer@emumba.com, reshma.pattan@intel.com Cc: dev@dpdk.org, Stephen Hemminger Subject: [PATCH v2] app/pdump: exit if no device specified Date: Fri, 30 Jun 2023 19:16:11 -0700 Message-Id: <20230701021611.8269-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20220302092614.5164-1-usman.tanveer@emumba.com> References: <20220302092614.5164-1-usman.tanveer@emumba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Signed-off-by: Stephen Hemminger --- 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