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 C7F5542DC0; Mon, 3 Jul 2023 08:29:27 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4294E40EF0; Mon, 3 Jul 2023 08:29:27 +0200 (CEST) Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by mails.dpdk.org (Postfix) with ESMTP id 4269E40156 for ; Mon, 3 Jul 2023 08:29:25 +0200 (CEST) Received: from dggpeml100024.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Qvbbt27gzz1HBL3; Mon, 3 Jul 2023 14:28:58 +0800 (CST) Received: from [10.67.100.224] (10.67.100.224) by dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 3 Jul 2023 14:29:20 +0800 Subject: Re: [PATCH v2] app/pdump: exit if no device specified To: Stephen Hemminger , , CC: References: <20220302092614.5164-1-usman.tanveer@emumba.com> <20230701021611.8269-1-stephen@networkplumber.org> From: fengchengwen Message-ID: Date: Mon, 3 Jul 2023 14:29:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <20230701021611.8269-1-stephen@networkplumber.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.100.224] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpeml100024.china.huawei.com (7.185.36.115) X-CFilter-Loop: Reflected 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 Acked-by: Chengwen Feng On 2023/7/1 10:16, Stephen Hemminger wrote: > 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); >