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 6EB35A0032 for ; Fri, 18 Feb 2022 17:27:28 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F77440141; Fri, 18 Feb 2022 17:27:28 +0100 (CET) Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) by mails.dpdk.org (Postfix) with ESMTP id C43AD40141 for ; Fri, 18 Feb 2022 17:27:26 +0100 (CET) Received: by mail-pg1-f170.google.com with SMTP id d16so8300202pgd.9 for ; Fri, 18 Feb 2022 08:27:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bNJUGgpaDK1F0grpN19DBzD/uzpWSuZ+Iwc412IFXwA=; b=uiLG8OgYN66xtcXHKs/gp8BaSK0VO9mzsbxYwP5ud49llvsnYNe8Tl8gtoIaEVzgVA 2hBoT5fBq3+ojK/x6p5pg/u89ZlkKosFcRjj5iD1Y3BYflVRCOBH1jjbQTy0sHWIrI8W S2ywMZONoacqAbnRtuoDRu09pxEeZEn6KZm4DD07GMX0zPatI6IzEr//7INx0wiRN3I3 z96dN2SiydfuZAsWIMimSJF9tTc8BmJNKq2PLFkharyxgyhqS2KogYpSAUuh9vCJr3k6 1MnuCprNEz7ELyZqXC/J0tzhZ8EKEEZE/BGzsQ7ZtFn4Rpa0dDcXx27vQN6eSAUT3Gj/ oN3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bNJUGgpaDK1F0grpN19DBzD/uzpWSuZ+Iwc412IFXwA=; b=UxByqz+Y274zEi6FI0SsLOWiY4Etpw5fQLA5+m051MqPrni710beF1z20bVLxNgcjq vX33p3XN5DLuisBgnoho6tN1g23Ph/1w7QCU6YEXlaUB2ziELfgs59WLloVaoVkUSf16 4e8L/9REc2goJD49Tld8410KkbfXDrzVcZFbpqnNi5hQn5cr+rjmfbD+ubGLcLQGkuwF +loYtu5MbMbFhxQ0gZ0jbhkxjwqOmtPUEN09rUdIPen+qJnUPAXm0BybxSyXNdOfFom6 QujwdNMalsAf2/6GryULyyS4uSal3fjS8LJcoatljKnTcQAjVDN2si+W1aTu1zTVuZo9 yrXw== X-Gm-Message-State: AOAM5316dR1j0In5BaHBPMmhNCu+43OJwfYwhcZldrYOrHFbpFm0o2Rh MI82cTp5Z0CMvnQA3Rx5/Ehu4A== X-Google-Smtp-Source: ABdhPJyZDcfb+nn1TYIrhoaW+TnI5U4dN1hsPnrdP9fSvGCJMtvURpNrBTOIvwIsD71aebs1naO+Pg== X-Received: by 2002:a63:2b48:0:b0:365:2766:7e5f with SMTP id r69-20020a632b48000000b0036527667e5fmr7080250pgr.613.1645201645881; Fri, 18 Feb 2022 08:27:25 -0800 (PST) Received: from hermes.local (204-195-112-199.wavecable.com. [204.195.112.199]) by smtp.gmail.com with ESMTPSA id lk8sm5549131pjb.47.2022.02.18.08.27.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Feb 2022 08:27:25 -0800 (PST) Date: Fri, 18 Feb 2022 08:27:23 -0800 From: Stephen Hemminger To: Reshma Pattan Cc: dev@dpdk.org, ferruh.yigit@intel.com, vipin.varghese@intel.com, stable@dpdk.org Subject: Re: [PATCH] app/pdump: check lcore is not the maximum core Message-ID: <20220218082723.051106b5@hermes.local> In-Reply-To: <20220218151841.116135-1-reshma.pattan@intel.com> References: <20220218151841.116135-1-reshma.pattan@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org On Fri, 18 Feb 2022 15:18:41 +0000 Reshma Pattan wrote: > lcore_id = rte_get_next_lcore(lcore_id, 1, 0); > + if (lcore_id == RTE_MAX_LCORE) { > + printf("Invalid core %u for the packet capture!\n", lcore_id); > + return; > + } Since nothing useful can be done, maybe rte_exit()? Or at least print to stderr and return error status. Also, if you write same code in two places, it should be a function.