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 D2BECA00BE; Fri, 1 Nov 2019 21:13:22 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 455541E889; Fri, 1 Nov 2019 21:13:17 +0100 (CET) Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by dpdk.org (Postfix) with ESMTP id 6F16F1E874 for ; Fri, 1 Nov 2019 21:13:15 +0100 (CET) Received: by mail-pg1-f195.google.com with SMTP id e10so7119856pgd.11 for ; Fri, 01 Nov 2019 13:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Ns0orEptOo9h3M8NLsvTPZrd4Ml1Mzguv5a6kzmryQc=; b=cVqTZrHtX7Oo7PhZTQfWGICYhEzqP0IFB67GX5sllQ+RNZ2ptCpQfOcOFx/xIwGyZg 9Z6ZedKJ/RkRUYMQQacdkeXXa26R6WEOdNLlhqpIUFNo/KvIKN2DCFSrhszBeyw4V9J1 c9jvVrxPz+b++Yh7FLr49eGg7SI0Dh7TH/VjRe53BB0SwJcEO+OzAbGHP/Azwe6zsHzj cqsh9FE+RvXboxnzkY/zbrbV3KEjvAJUe/rTxNZdNbkd6OOn7QVtEeyIWl64m9G+/Sz7 r0cHx13egGdL2g9Haaa55LzJZRLA15RUZ1+XXUce22Z7fbgkzA+Ax+lXMFGj9vCd1llU fm4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ns0orEptOo9h3M8NLsvTPZrd4Ml1Mzguv5a6kzmryQc=; b=kgASgj2j1bUQGSITtBScsJekhv0YBJesh6GtS1WfUcNHx89AFOPYqzMvyCynUthnel meIJNZH+qorPggzPy7EWm26t4t7D0gr+VkMi+dlmTUxYTU7vt84Yrb2ytPqHA0KT+skC yYtzE73fUKnwOysfDlo/4ceULDBn+L+SlsJ3ryTc8CvjOIayYgVgMyQtkPrck7mAOmXh 8K+qDHPp1lbuKxWamC7wqHTCucHFEMOJBgzn+68rxE02gPZGqezZ1Wp6vzjWiTqcKOPx 3zRAPHLbMpLcncZgRyrLh1xhWocGRRprZnAavoVB50ipPixuh1T24D4+aFNWEJr04kS5 2xLg== X-Gm-Message-State: APjAAAXUCsdzwSJQh3zHtT1jBbDh3Y+OPApl2dUn+6zPis/wqw9WKQ4A VQTRyWIUQXIHuzYMLOnl7rtY/wHhkpqFYA== X-Google-Smtp-Source: APXvYqwQqHSsqwzffVZlUoMMdsulxTrDcayBuY2lfbF2po+bCRojK3zb+7prquv2BaqXT0QF1aBnCw== X-Received: by 2002:a17:90a:a384:: with SMTP id x4mr18175954pjp.116.1572639194138; Fri, 01 Nov 2019 13:13:14 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x9sm9744588pje.27.2019.11.01.13.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Nov 2019 13:13:12 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Date: Fri, 1 Nov 2019 13:12:55 -0700 Message-Id: <20191101201255.4853-2-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191101201255.4853-1-stephen@networkplumber.org> References: <20191101201255.4853-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 1/2] app/testpmd: block xstats for hidden 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" All the other testpmd commands block access to devices that are owned. Looks like xstat got overlooked. Fixes: bfd5051b43b5 ("app/testpmd: new command to get extended statistics") Signed-off-by: Stephen Hemminger --- app/test-pmd/config.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c index efe2812a85ef..ad926d573b81 100644 --- a/app/test-pmd/config.c +++ b/app/test-pmd/config.c @@ -238,6 +238,10 @@ nic_xstats_display(portid_t port_id) int cnt_xstats, idx_xstat; struct rte_eth_xstat_name *xstats_names; + if (port_id_is_invalid(port_id, ENABLED_WARN)) { + print_valid_ports(); + return; + } printf("###### NIC extended statistics for port %-2d\n", port_id); if (!rte_eth_dev_is_valid_port(port_id)) { printf("Error: Invalid port number %i\n", port_id); @@ -295,6 +299,10 @@ nic_xstats_clear(portid_t port_id) { int ret; + if (port_id_is_invalid(port_id, ENABLED_WARN)) { + print_valid_ports(); + return; + } ret = rte_eth_xstats_reset(port_id); if (ret != 0) { printf("%s: Error: failed to reset xstats (port %u): %s", -- 2.20.1