From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f53.google.com (mail-wm0-f53.google.com [74.125.82.53]) by dpdk.org (Postfix) with ESMTP id 4B581B6D for ; Mon, 28 Nov 2016 12:13:09 +0100 (CET) Received: by mail-wm0-f53.google.com with SMTP id g23so202006185wme.1 for ; Mon, 28 Nov 2016 03:13:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:user-agent:in-reply-to :references:mime-version:content-transfer-encoding; bh=4iV2Ckac+Ms7auoKHiGOALzAup8zw2z7zwvdpFqXu5Y=; b=pOh4m+CESvlKIJg0uA2jjmK3n89wnAN9j2dyhm2+aZplVsx95bYPAdJ/mia1fOw0hN kqgqp4P9NWEQei9akzhjEOUGXQqZrLrfhEPr5YLRY5DfyAsJvDaNH9WPrRYG+xZuHymr dlxknzJlgUhNCect+4UJbZv9+KL/vPkwhrDvPzB3AUqxZ4uupTJApq1Y3rQlWEotX1BM hhECHn0ItF30Sa6oQBI52HYLiftOOVOyKFDVVBx5PeSSmJyTeDtl3rbGJvRCBHAdGTeM 5BHjqL/2uYVmion3WhQLkXETDUgn7KxlO8Y548wSvyb7KAeikne3mJL1VEh0x9CIr1/N fcyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:user-agent :in-reply-to:references:mime-version:content-transfer-encoding; bh=4iV2Ckac+Ms7auoKHiGOALzAup8zw2z7zwvdpFqXu5Y=; b=iE6M7BF0ipxoxa1yb3c3KN76I8pENYeo5rRFDId1FBVWCyZfRTmgE9p55RO2mJphDd ci2BLgwhT1RmnjjZqyfz1/GJ/3GYeXkTArMQnjWP0YDI1PDitTW5F0L6ivPqGUXVOaux 4ERurGzEElmAWq4omKfGmtksOs2VhoPYXDbCygx3HYDys6AvXYBN1YSBuPunDfm8nJOQ xOP7+J3JsTmXBbo8dcePTWGQE/ygr3woDTU5hR1FY4SPmfQqnYv4rzVvufHOiak/y4ZX /RPJkV1BviNWyNM0MiGDG+tBZ1xQ3V4L6q2TWx9L1OM7iK4nU9qqIICFPeoRUWAnUW4A KMKQ== X-Gm-Message-State: AKaTC037FmGBagTpjF6sf5TWX+6xlJ/nrAgIqWJpySMQ2PBW44GTIIRJFjygfZtKvN2MfXM/ X-Received: by 10.28.12.84 with SMTP id 81mr19036379wmm.51.1480331589705; Mon, 28 Nov 2016 03:13:09 -0800 (PST) Received: from xps13.localnet (184.203.134.77.rev.sfr.net. [77.134.203.184]) by smtp.gmail.com with ESMTPSA id r138sm28363356wme.9.2016.11.28.03.13.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 28 Nov 2016 03:13:08 -0800 (PST) From: Thomas Monjalon To: Olivier Matz , dev@dpdk.org Cc: Alejandro Lucero , Bert van Leeuwen Date: Mon, 28 Nov 2016 12:13:08 +0100 Message-ID: <7874818.0HvcekTQN4@xps13> User-Agent: KMail/4.14.10 (Linux/4.5.4-1-ARCH; KDE/4.14.11; x86_64; ; ) In-Reply-To: <1480006746.31853.14.camel@6wind.com> References: <1479722378-23959-1-git-send-email-alejandro.lucero@netronome.com> <1480006746.31853.14.camel@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] ethdev: check number of queues less than RTE_ETHDEV_QUEUE_STAT_CNTRS X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 Nov 2016 11:13:10 -0000 2016-11-24 17:59, Olivier Matz: > Hi, > > On Mon, 2016-11-21 at 09:59 +0000, Alejandro Lucero wrote: > > From: Bert van Leeuwen > > > > Arrays inside rte_eth_stats have size=RTE_ETHDEV_QUEUE_STAT_CNTRS. > > Some devices report more queues than that and this code blindly uses > > the reported number of queues by the device to fill those arrays up. > > This patch fixes the problem using MIN between the reported number of > > queues and RTE_ETHDEV_QUEUE_STAT_CNTRS. > > > > Signed-off-by: Alejandro Lucero > > > > Reviewed-by: Olivier Matz > > > As a next step, I'm wondering if it would be possible to remove > this limitation. We could replace the tables in struct rte_eth_stats > by a pointer to an array allocated dynamically at pmd setup. Yes that's definitely the right way to handle these statistics. > It would break the API, so it should be announced first. I'm thinking > of something like: > > struct rte_eth_generic_stats { > uint64_t ipackets; > uint64_t opackets; > uint64_t ibytes; > uint64_t obytes; > uint64_t imissed; > uint64_t ierrors; > uint64_t oerrors; > uint64_t rx_nombuf > }; > > struct rte_eth_stats { > struct rte_eth_generic_stats port_stats; > struct rte_eth_generic_stats *queue_stats; > }; > > The queue_stats array would always be indexed by queue_id. > The xstats would continue to report the generic stats per-port and > per-queue. > > About the mapping API, either we keep it as-is, or it could > become a driver-specific API. Yes I agree to remove the queue statistics mapping which is very specific. I will send a patch with a deprecation notice to move the mapping API to a driver-specific API. Any objection?