From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 054ECA0526; Tue, 21 Jul 2020 19:05:33 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 445001BFD1; Tue, 21 Jul 2020 19:05:32 +0200 (CEST) Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by dpdk.org (Postfix) with ESMTP id 5F46EE07 for ; Tue, 21 Jul 2020 19:05:31 +0200 (CEST) Received: by mail-pl1-f193.google.com with SMTP id x9so10537168plr.2 for ; Tue, 21 Jul 2020 10:05:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4dx+jaNH8R4UAcsWzHjKCDzK+hv8uHsDSzCIoeSdR2k=; b=Zu8uxI60drdRQW7hwROZwKh76ZcYwPQIXnTO10lMJBUvxtNwRwNGKkoRdpmZ4ULiV9 XcRh9P+YXjXIruFiaYXRdv8mqekgLcxhbL5VcydjmvB084c57jdPnuAnx56qfVNL41Gi fZvz1JJgJocfC6Y/cCu6ltFpIAYcbh9zofB/R5oMJsXap7peaB0Th/tnbXM+zojo+fF9 hxI5vydUvUoYDSNK8V6LbS+ckVtuAxlSrWcBE0XqZLM3tnRvxuFVWISbzXj70xhfqw32 PGnkvyr9NTHe5PtN6zmYiD4V4VJJdA/Euwv54Co7jEVk/4W+OLKDq/3xQAOGzSmmMJHJ ofmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=4dx+jaNH8R4UAcsWzHjKCDzK+hv8uHsDSzCIoeSdR2k=; b=E6ggId2mxw45U8IsXsHGhIzBH0Zq8AKiwJTVOWzjJaL2tDCxt/HGQoGKOvGZpov5OZ RG7gmKI+d5K7ZchOcdC04nm7FRlYrelj8jVbzqLJDldguE+iVG2Uh/fMx+AkQ0pxdVTA IIN5FZla6qSkMazbXHChjlWIWSO0jIq2cT3hp/pzUj4VkT9f3epVSz59wu3qO7kmla+m cemtQUfhiUrUoDiMafWlFG71Pww4eSIGga795jX4XAVVqV4IknObuT4zbilc5RYkWugd rs+LcOBtvIYev11avxS49ltqt2kNjsqLipbKT2ZCMr8kB3FvAuWFJj8YiCSlHGzKpK3A xrpw== X-Gm-Message-State: AOAM531+3SVvSaOGJQOl3AsNjJmeJiha0loaQfnV1FD+3GkDtFiAgUoC X00Q6zP+CiyB2s3fLbkhYSs4hBnKCvHWSw== X-Google-Smtp-Source: ABdhPJwIiM7YWGlE5ZOba/jFfd1JMB3DxipC2VpRuBMJiW7MVnVlB3a/wIFME+iu87FZlY3LK2yZsg== X-Received: by 2002:a17:90a:20e9:: with SMTP id f96mr5881685pjg.13.1595351130573; Tue, 21 Jul 2020 10:05:30 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id b13sm4016154pjl.7.2020.07.21.10.05.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 10:05:30 -0700 (PDT) Date: Tue, 21 Jul 2020 10:05:21 -0700 From: Stephen Hemminger To: Thomas Monjalon Cc: maryam.tahhan@intel.com, reshma.pattan@intel.com, hemant.agrawal@nxp.com, dev@dpdk.org Message-ID: <20200721100521.62c556e7@hermes.lan> In-Reply-To: <9275553.NR17kIY6SJ@thomas> References: <20200506193741.24117-1-stephen@networkplumber.org> <20200715212228.28010-1-stephen@networkplumber.org> <20200715212228.28010-7-stephen@networkplumber.org> <9275553.NR17kIY6SJ@thomas> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH v3 6/7] app/proc-info: provide way to request info on owned ports X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Fri, 17 Jul 2020 17:01:00 +0200 Thomas Monjalon wrote: > 15/07/2020 23:22, Stephen Hemminger: > > --- a/app/proc-info/Makefile > > +++ b/app/proc-info/Makefile > > +CFLAGS += -DALLOW_EXPERIMENTAL_API > > not needed in app/ > > > +CFLAGS += -O3 > > CFLAGS += $(WERROR_FLAGS) > > +CFLAGS += -Wno-deprecated-declarations > > Which deprecated function is used? > We must not use deprecated functions. Fixing. > > > + /* If no port mask was specified, one will be provided */ > > Would be nice to help the user by printing a port mask > of owned and unowned ports. Not needed, since each display already has the port # > > > + if (enabled_port_mask == 0) { > > + RTE_ETH_FOREACH_DEV(i) { > > + enabled_port_mask |= 1u << i; > > } > > } > > > > + for (port_mask = enabled_port_mask; port_mask != 0; > > + port_mask &= ~(1u << i)) { > > Please would be good to help drunk or sleepy readers with few comments. ok? > > > + /* ffs() first bit is 1 not 0 */ > > + i = ffs(port_mask) - 1; > > + > > + if (i >= RTE_MAX_ETHPORTS) > > + break; > > This check is already done in rte_eth_dev_is_valid_port(). Want to stop early if port is out of range, but continue if hits a port that is owned. > > > + > > + if (!rte_eth_dev_is_valid_port(i)) > > + continue; > > >