From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) by dpdk.org (Postfix) with ESMTP id A857C7D6E for ; Thu, 24 Aug 2017 00:19:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2321; q=dns/txt; s=iport; t=1503526776; x=1504736376; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=4ioGH9xMfa5uLc65FGlerV7/imOd8Ntynk9tE0plieo=; b=XyhYaNbvieplrnr64DG3iGTPAP2y906HcLIR6AAyRgXcTuNZLJFpGc9T H+RXp35MZor85GBLctQci/HHF95O7oJ35dug2Y/RPR1Hx1DGvd5D0AYN8 8fyrxHlUHYpTKGNZFdezZUkL0uF3ysfUT0tcN/25Kj6cxRvcehwhvL22F M=; X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C1AADg/p1Z/4MNJK1dGQEBAQEBAQEBA?= =?us-ascii?q?QEBBwEBAQEBg1qBeQeODZAXgXCRQIRkghKFRwKERz8YAQIBAQEBAQEBayiFGAE?= =?us-ascii?q?BAQEDJxM/DAQCAQgRBAEBAR4JBzIUCQgCBA4FCIopsAw6i2EBAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBAQEdgyqCAoFMhQqEPoYpBaBYApQ5km1IlWUBHziBCncVhhWBTna?= =?us-ascii?q?IQIEygQ8BAQE?= X-IronPort-AV: E=Sophos;i="5.41,417,1498521600"; d="scan'208";a="286580093" Received: from alln-core-1.cisco.com ([173.36.13.131]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 23 Aug 2017 22:19:35 +0000 Received: from XCH-RCD-017.cisco.com (xch-rcd-017.cisco.com [173.37.102.27]) by alln-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id v7NMJZb7007784 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=FAIL); Wed, 23 Aug 2017 22:19:35 GMT Received: from xch-rcd-016.cisco.com (173.37.102.26) by XCH-RCD-017.cisco.com (173.37.102.27) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Wed, 23 Aug 2017 17:19:34 -0500 Received: from xch-rcd-016.cisco.com ([173.37.102.26]) by XCH-RCD-016.cisco.com ([173.37.102.26]) with mapi id 15.00.1210.000; Wed, 23 Aug 2017 17:19:34 -0500 From: "David Harton (dharton)" To: Stephen Hemminger CC: "thomas@monjalon.net" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2 1/2] ethdev: stop overriding rx_nombuf by rte_eth_stats_get Thread-Index: AQHTG7tY3pFJFf86Tka5akmSQJp7mqKS0baA//+wHuA= Date: Wed, 23 Aug 2017 22:19:34 +0000 Message-ID: References: <20170823011937.37579-1-dharton@cisco.com> <20170823025555.19022-1-dharton@cisco.com> <20170823145631.5fce68dc@xeon-e3> In-Reply-To: <20170823145631.5fce68dc@xeon-e3> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.82.213.192] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2 1/2] ethdev: stop overriding rx_nombuf by rte_eth_stats_get 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: , X-List-Received-Date: Wed, 23 Aug 2017 22:19:37 -0000 > -----Original Message----- > From: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Wednesday, August 23, 2017 5:57 PM > To: David Harton (dharton) > Cc: thomas@monjalon.net; dev@dpdk.org > Subject: Re: [dpdk-dev] [PATCH v2 1/2] ethdev: stop overriding rx_nombuf > by rte_eth_stats_get >=20 > On Tue, 22 Aug 2017 22:55:55 -0400 > David Harton wrote: >=20 > > rte_eth_stats_get() unconditonally would set rx_nombuf even if the > > device was setting the value. A check has been added in > > rte_eth_stats_get() to leave the device value in-tact when non-zero. > > > > Signed-off-by: David Harton > > --- > > > > v2: Fixed braces complaint required by other coding standards. > > > > lib/librte_ether/rte_ethdev.c | 5 ++++- > > 1 file changed, 4 insertions(+), 1 deletion(-) > > > > diff --git a/lib/librte_ether/rte_ethdev.c > > b/lib/librte_ether/rte_ethdev.c index 0597641..0a1d3b8 100644 > > --- a/lib/librte_ether/rte_ethdev.c > > +++ b/lib/librte_ether/rte_ethdev.c > > @@ -1336,8 +1336,11 @@ struct rte_eth_dev * > > memset(stats, 0, sizeof(*stats)); > > > > RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP); > > - stats->rx_nombuf =3D dev->data->rx_mbuf_alloc_failed; > > (*dev->dev_ops->stats_get)(dev, stats); > > + /* only set rx_nombuf if not set by the device */ > > + if (!stats->rx_nombuf) > > + stats->rx_nombuf =3D dev->data->rx_mbuf_alloc_failed; > > + > > return 0; > > } > > >=20 > This seems backwards. It seems like the original way worked fine. > If device specific code wanted to override rx_nombuf it could do so eithe= r > by adding it's additional value or just setting rx_nombuf. >=20 > Adding special cases seems like it would start a bad precedent and the > could would end up quite complex as some values had one semantic and > others were only from driver. Eternal apologies. This is another example of me trying to upstream a fix = we've held on to for far too long and not realizing it has been addressed. = I see that this was fixed here: 53ecfa24fbcd17d9855937391ce347f37434fbfa Again, apologies...I'll be careful publishing any further fixes trying to d= etermine if others have fixed in different ways. Regards, Dave