From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f182.google.com (mail-pd0-f182.google.com [209.85.192.182]) by dpdk.org (Postfix) with ESMTP id BB09858E4 for ; Fri, 13 Mar 2015 00:06:31 +0100 (CET) Received: by pdno5 with SMTP id o5so23833577pdn.1 for ; Thu, 12 Mar 2015 16:06:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=GYlsjm92D9rjNaQkvsw/TjngCY7BaJPlUN9lUfFNtog=; b=X1Bl+GjfU2LhQoCgZHAgJkn9pLS703MW0Tki1UPDPfx/YfnvMhChg3TNzGltitAMdL o3Sbh6Nhdt1f1bQhWL8HMl1OaYZ5ymfinYkx/yzJErAH1cFy7p38cTIwlYE0izcL7lgZ MQDZSkb1B3JSKMfyqpcaXxA5YUfhdxw2csDGxV+7OtGpEhHRDNPw4bCuvefaK5aHruD4 mJ3UulCS4lN8fpdnQvK4wwSYMXJhuVehHwQNDXBjV9CfE81Ob7mGICB13RuiRrxyWT5w cwh1A/rOP5Ncq0Ei7gVwDKGmEzmrDlyPLRN11hCDTIllovDEGLYDL1pRVD46T6iuUEFm sWlg== X-Gm-Message-State: ALoCoQlXgwUAuKm25N9ADVeWC8WSWqbdinDOkfuGkRFR8rwtLkmn1hvmME9+W3npeUbjPSmwaA/t X-Received: by 10.70.51.131 with SMTP id k3mr94194778pdo.155.1426201591023; Thu, 12 Mar 2015 16:06:31 -0700 (PDT) Received: from urahara (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id bh15sm240872pdb.21.2015.03.12.16.06.30 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Mar 2015 16:06:30 -0700 (PDT) Date: Thu, 12 Mar 2015 16:06:26 -0700 From: Stephen Hemminger To: "Dumitrescu, Cristian" Message-ID: <20150312160626.47315f49@urahara> In-Reply-To: <3EB4FA525960D640B5BDFFD6A3D89126323225F4@IRSMSX108.ger.corp.intel.com> References: <1426004018-25948-1-git-send-email-stephen@networkplumber.org> <1426004018-25948-6-git-send-email-stephen@networkplumber.org> <3EB4FA525960D640B5BDFFD6A3D89126323225F4@IRSMSX108.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: "dev@dpdk.org" , Stephen Hemminger Subject: Re: [dpdk-dev] [PATCH v2 5/6] rte_sched: allow reading statistics without clearing 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: Thu, 12 Mar 2015 23:06:32 -0000 On Thu, 12 Mar 2015 19:28:11 +0000 "Dumitrescu, Cristian" wrote: > Hi Stephen, > > Thank you for adding flexibility over clearing the stats or not. > > I have one concern though: why change the stats read API to add a clear parameter rather than keep prototype for the stats functions unchanged and add the flag as part of the port creation parameters in struct rte_sched_port_params? This parameter could be saved into the internal struct rte_sched_port, which is passed (as a pointer) to the stats read functions. In my opinion, this approach is slightly more elegant and it keeps the changes to a minimum. > > int > rte_sched_queue_read_stats(struct rte_sched_port *port, > uint32_t queue_id, > struct rte_sched_queue_stats *stats, > uint16_t *qlen) > { > ... > if (port->clear_stats_on_read) > memset(...); > } > > I made this suggestion during the previous round, but I did not get any opinion from you on it yet. > > Regards, > Cristian I rejected the config parameter idea because I don't like it is inconsistent with other statistics in DPDK and in related software. There is not a config parameter that changes what BSD or Linux kernel API does. The only reason for keeping the read and clear in one operation is because you like it, and there are somebody might have built code that expects it. Changing the function signature is a nice red flag so that people will notice at change.