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 0D6BBA0032; Fri, 18 Feb 2022 17:27:29 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 883BA40E28; Fri, 18 Feb 2022 17:27:28 +0100 (CET) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id C54574014E for ; Fri, 18 Feb 2022 17:27:26 +0100 (CET) Received: by mail-pg1-f178.google.com with SMTP id 195so8300974pgc.6 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=GBIGhSRm9GUfZJ0kQDjdGpQyTdv2wtRfq4G8RrTXDhna1MmYnzoc2FS7gTxkRXiOVU HObXA04xDizHY6HyPhUEdzG2xm1r6DIY2K8LcWdWaVL2DRK50Ez2vg94DK3DJdiz5bNv fMS7WjnF8iDhUADSMB1tvV2WP/73aOV3Gn7h14DTiTZNpRIrUWy9Lx/NHHIB7UaZJugz ShGV4W/xxkWJAIBVfSRVwC8odArD904GXAm4AX9FX7rX2gnbQXIkCG+R+dpLd46ZQrSn EXQz9wNRH7T+wzON0+H7q+4L/nfeWMu1907lYkfkCW0PbYNcL2Ml7UfZQLM5lBDNaY0Q LvuQ== X-Gm-Message-State: AOAM5339LdIiiB+Wvh/R7Qzrz6iRWGJFlYuh5vuGBy2H7g3xix/enAPR V3u0BXIMHxvN61zuXFipNha0sA== 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: 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 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.