From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0068.outbound.protection.outlook.com [104.47.38.68]) by dpdk.org (Postfix) with ESMTP id 78A4F5A6E for ; Fri, 1 Sep 2017 09:47:20 +0200 (CEST) Received: from BN3PR03CA0094.namprd03.prod.outlook.com (10.174.66.12) by CY4PR03MB3319.namprd03.prod.outlook.com (10.171.247.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10; Fri, 1 Sep 2017 07:47:18 +0000 Received: from BN1AFFO11FD027.protection.gbl (2a01:111:f400:7c10::171) by BN3PR03CA0094.outlook.office365.com (2603:10b6:400:4::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.10 via Frontend Transport; Fri, 1 Sep 2017 07:47:17 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; cisco.com; dkim=none (message not signed) header.d=none;cisco.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1AFFO11FD027.mail.protection.outlook.com (10.58.52.87) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1385.11 via Frontend Transport; Fri, 1 Sep 2017 07:47:17 +0000 Received: from [10.232.133.65] ([10.232.133.65]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id v817lFxJ012099; Fri, 1 Sep 2017 00:47:15 -0700 To: David Harton , References: <20170810132952.26974-1-dharton@cisco.com> <20170901022631.19529-1-dharton@cisco.com> CC: From: Hemant Agrawal Message-ID: Date: Fri, 1 Sep 2017 13:17:14 +0530 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170901022631.19529-1-dharton@cisco.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-Matching-Connectors: 131487256377924901; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(336005)(39380400002)(39860400002)(2980300002)(1110001)(1109001)(339900001)(377454003)(199003)(24454002)(189002)(305945005)(65826007)(105606002)(5660300001)(53546010)(68736007)(77096006)(76176999)(54356999)(50986999)(23746002)(2950100002)(229853002)(8936002)(31686004)(64126003)(81156014)(8676002)(104016004)(33646002)(81166006)(53936002)(36756003)(50466002)(106466001)(356003)(47776003)(230700001)(6246003)(575784001)(65956001)(65806001)(97736004)(498600001)(31696002)(4001350100001)(85426001)(86362001)(83506001)(2906002)(189998001)(4326008)(626005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR03MB3319; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD027; 1:AkedjZ6llgR3i20Bsq8FbVGQz7LzHI/+pN/icoOHS1n3mjzyMcY9C7Q0uxDyT6RWeQ+8mNhz/jBsHdtmQmZNu92tz+KTC/DE8X8lgK8W6IbAtQ/mS4HmA1cLPf4mNbvy X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8f1dc088-c75a-4437-3bc5-08d4f10dab5a X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(2017052603199)(201703131430075)(201703131517081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY4PR03MB3319; X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 3:xiv1+4rjOGJA7fkeb0VzSI1XavEcfRIqfD/bYY7vXnBbAGZr5BvPvSHB1E3RmTwLbvkSeUT+zXe4fViFzembi6WrgBu6fThv5tucv02lvFSrzGrXkmKBcgUm8nv5cLsXgvAp03HUwdMW26UD0WJQI8xCk0Y6f4RP+9dZW4llBFkuKfu2k7uNGEkMzcKcy+MQnrn+kgu2yPsQ5jP4eKYKh7yUcU1ZsmE+gxiuSj3WHQUBbjLEYRmVisSQ4nCCfSZIZWSN71mUZ3nO5pGDGv4mq9VDv9EknHvHvlbiRMps8pk74OJC1yWufQKzs0U3zLb2zK8CNQF+okOwnfcazawyHN0yzK+NvXYVfrDzeueJayc=; 25:qsFzUZ5pY9Q5BUTLjpZftyVBrQCvWpTU1R9H6XY7Sf0Jsay+OtEWApdHlQrWouvF/A1cp0YnrotS6jDUz1FMcJInR9akXP81B19c+JLyc3hmAWtrda67WHCRR6AG767JyHuhg5zHOG/lIfucX7Dt55VCWyj3yIKTxsqS4yLYXHfxVQXLdz3Rz+xvLTnHe0aI/oX10nUu/i0W6tdk9E3vZA/g/PPSJcHeyEAP4RF1ZIrBY94Lzin/Moq8yQk2m22o3ul37lkW6X3YpfDeadi9bc51L8h0gGVZLj8XbQtrtpFCP8sFySeOYi/kVXrPo/XYDIVQnMDpHnY9DExeYdmiyA== X-MS-TrafficTypeDiagnostic: CY4PR03MB3319: X-Microsoft-Exchange-Diagnostics: 1; CY4PR03MB3319; 31:KgxtWV+MrHsTAAHUtnp90RpI0IKQAM14UNunnu0m8oOOZEhnlbMUl05f71uS0fCUq41+ZLsO3EJZ3AiEGQ6E6ICjfkjzZLvnQo5M9jJVw7Y98+lXmkTLLocMDWV6GzEyfFpBeBtQrUTqZxW+NcF74ncG+zopVh3M6xLUBq4CmsRMffp5lI0/dYWecgRNIxEMpzW/NE7cyi3H4mNF5zI8Gx7OJHgkVDyCYNO2qyI2k4g=; 4:HB4NxOTGqLNwtFNkbF1DHmPPkSx8upLcdSVm7fOBE2HSwqGpR2/7nr/qA1rcA7pPo13yq1iXLxc3IQUxCl5SLaqxt4Vu5C45E/rncSkd0kWmcDeFURURZLGEixZHaztOHMTu52oR6cygeTfts5ilG6UPfpU4RZ5f3GsmbtrUi+UAO49ThAmkogJU4C+HIagHTrVUcMteOrjZsIOLZ8SDVH+TF0xnYgxEnZd+xisVblCyl36fgPnvOLFDaETnY+9Lu3bJEpZWsVVyorbJBl19WP2OMSvI8GBUqTjZieQDcjZUXFsOUmrlJhh+7POyU2kR4DxEfjLn8Y6Gl7lGob1BtA== X-Exchange-Antispam-Report-Test: UriScan:(185117386973197)(95692535739014); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6095135)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6096035)(20161123565025)(20161123563025)(20161123556025)(20161123561025)(201703131430075)(201703131433075)(201703131441075)(201703131448075)(201703161259150)(20161123559100)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR03MB3319; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(400006)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR03MB3319; X-Forefront-PRVS: 0417A3FFD2 X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1; CY4PR03MB3319; 23:ieIBdOSTtSRvObRWypg8VD4rQyadF8IT+nks1?= =?Windows-1252?Q?+JsNbtA1BPmleIzNI6PncOe66wb+nc0VWo9K94qMvNYd64jfI/21BIhu?= =?Windows-1252?Q?WhDR+1XjG/Jj9epBPjEnWOUdcHk7Frg3/L7tY4fEGgmKhzNOVQyAUa+a?= =?Windows-1252?Q?kAcBp6wIIMJqqxfdwxyxCOOnMIfAVQUBiGq271Z3Wubmb07GbPrinmvf?= =?Windows-1252?Q?4kR7s3SvzbvbUfpidN36it6dSZ5woWqf4ZUmki6wOpb9bqQ5zsKoc3E9?= =?Windows-1252?Q?gFQWWsC8DGbW5zqUL2M0o3+oqIQMtuGb5R0mtgTr30TMn4vTGdhJhwYW?= =?Windows-1252?Q?CTiKSJYwXeGgnhTLVORlP2SPFK0AG5uaedhOXwnHrsiwBa5TV57VZl5D?= =?Windows-1252?Q?DvhrxJvzKb2O8TzrLWZoGPLFKJoX7rqoTDBXxQ3OMkZiFqPSV3uenOQS?= =?Windows-1252?Q?s0fZCYEVqObQOGj67x/cA6vimVT76kX15xX7cu6W+kttsPoidKm2vwLa?= =?Windows-1252?Q?5CnI+IUYixRjqkfi55vxIZy1UFteF8v5k17r5MJZlWsU1lMukFeHBml9?= =?Windows-1252?Q?AQOBW64leUC1tneTwN+9yenZ5V+bgkz9R2D/Wo87lKB8XglOtgr7psst?= =?Windows-1252?Q?EZfAl39mQrC3ZcXngqmHy+nGNRHMc4+OaOvfUqj9NLE2DS7Hod2QWvEV?= =?Windows-1252?Q?gr15se1UmtJDDYM0r7XodWRw5GxzAmW9fJFPfB0+LbraRYs35T2bqFrk?= =?Windows-1252?Q?/MYLW32VtpuD9BGK4YV3oT579DfrlNvv3DtLNoA/eCcUkOivrk3i6GBu?= =?Windows-1252?Q?JLgF8+pS7xwm43IfdEgexJJWigYmN8QKOSgjyvlwjiFfiR2uQdkmVkO5?= =?Windows-1252?Q?QbpWIkKseHA+zKRRq8yzZ7jJ5OigiHjTpko5P3cHZqbZ1Hdvd6k5TkwK?= =?Windows-1252?Q?Wh9AZtvEVpuNXrCwbrrWlv1R0QcyH4GNWLaIte74ZWF2RDT276wkdigE?= =?Windows-1252?Q?goTX0gmZGms8b6dtpwXeqekZBH3lKl5tsrqTO/duovL9zfl+3BhkMngd?= =?Windows-1252?Q?rrHNTAifiRTg0mO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7:c8+uMnrFTC7rxt2WrZZ4XtYSBb7+795hH12znex8dZ/+S46VG+RdUCrS3IDtGM9rXYAlK9tlito33ViGJyLLXg8Xo9KtcOVc4NQ9SN4Eb8LHIV3FocZx999aUi6EKB0YROzz7jXxQWWqnqMFzW8GMAWwGVi+T4aajyJDQhzDgaocECbAMt+IEgrej4ShWS+yw4S1nWNhRrOoBJWj17F18pQryWucj7zyjcI2TSF42uk= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2017 07:47:17.6052 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB3319 Subject: Re: [dpdk-dev] [PATCH v5] ethdev: add return code to rte_eth_stats_reset() 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: Fri, 01 Sep 2017 07:47:20 -0000 On 9/1/2017 7:56 AM, David Harton wrote: > Some devices do not support reset of eth stats. An application may > need to know not to clear shadow stats if the device cannot. > > rte_eth_stats_reset is updated to provide a return code to share > whether the device supports reset or not. > > Signed-off-by: David Harton > --- > > v5: > * squashed doc patch > * moved rel_note change from ABI to API section > > v4: > * commented return values > > v3: > * overcame noob errors and figured out patch challenged > > v2: > * fixed soft tab issue inserted while moving changes > > doc/guides/rel_notes/release_17_11.rst | 13 +++++++++++++ > lib/librte_ether/rte_ethdev.c | 8 +++++--- > lib/librte_ether/rte_ethdev.h | 6 +++++- > 3 files changed, 23 insertions(+), 4 deletions(-) > > diff --git a/doc/guides/rel_notes/release_17_11.rst b/doc/guides/rel_notes/release_17_11.rst > index 22df4fd..6282667 100644 > --- a/doc/guides/rel_notes/release_17_11.rst > +++ b/doc/guides/rel_notes/release_17_11.rst > @@ -110,6 +110,19 @@ API Changes > Also, make sure to start the actual text at the margin. > ========================================================= > > +* **Modified the return type of rte_eth_stats_reset.** > + > + Changed return type of ``rte_eth_stats_reset`` from ``void`` to ``int`` > + so the caller may know whether a device supports the operation or not > + and if the operation was carried out. > + > +* **Modified the vlan_offload_set_t function prototype in the ethdev library.** > + > + Changed the function prototype of ``vlan_offload_set_t``. The return value > + has been changed from ``void`` to ``int`` so the caller to knows whether > + the backing device supports the operation or if the operation was > + successfully performed. > + > * **Modified the vlan_offload_set_t function prototype in the ethdev library.** > > Changed the function prototype of ``vlan_offload_set_t``. The return value > diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c > index 05e52b8..f0f1775 100644 > --- a/lib/librte_ether/rte_ethdev.c > +++ b/lib/librte_ether/rte_ethdev.c > @@ -1341,17 +1341,19 @@ struct rte_eth_dev * > return 0; > } > > -void > +int > rte_eth_stats_reset(uint8_t port_id) > { > struct rte_eth_dev *dev; > > - RTE_ETH_VALID_PORTID_OR_RET(port_id); > + RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV); > dev = &rte_eth_devices[port_id]; > > - RTE_FUNC_PTR_OR_RET(*dev->dev_ops->stats_reset); > + RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_reset, -ENOTSUP); > (*dev->dev_ops->stats_reset)(dev); > dev->data->rx_mbuf_alloc_failed = 0; > + > + return 0; > } > > static int > diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h > index 7254fd0..9110725 100644 > --- a/lib/librte_ether/rte_ethdev.h > +++ b/lib/librte_ether/rte_ethdev.h > @@ -2246,8 +2246,12 @@ int rte_eth_tx_queue_setup(uint8_t port_id, uint16_t tx_queue_id, > * > * @param port_id > * The port identifier of the Ethernet device. > + * @return > + * - (0) if device notified to reset stats. > + * - (-ENOTSUP) if hardware doesn't support. > + * - (-ENODEV) if *port_id* invalid. > */ > -void rte_eth_stats_reset(uint8_t port_id); > +int rte_eth_stats_reset(uint8_t port_id); > > /** > * Retrieve names of extended statistics of an Ethernet device. > Acked-by: Hemant Agrawal