From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id A8C9B1B462 for ; Sat, 16 Feb 2019 14:23:24 +0100 (CET) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Feb 2019 05:23:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,376,1544515200"; d="scan'208";a="124953126" Received: from irsmsx153.ger.corp.intel.com ([163.33.192.75]) by fmsmga008.fm.intel.com with ESMTP; 16 Feb 2019 05:23:22 -0800 Received: from irsmsx155.ger.corp.intel.com (163.33.192.3) by IRSMSX153.ger.corp.intel.com (163.33.192.75) with Microsoft SMTP Server (TLS) id 14.3.408.0; Sat, 16 Feb 2019 13:23:21 +0000 Received: from irsmsx105.ger.corp.intel.com ([169.254.7.72]) by irsmsx155.ger.corp.intel.com ([169.254.14.230]) with mapi id 14.03.0415.000; Sat, 16 Feb 2019 13:23:21 +0000 From: "Ananyev, Konstantin" To: Stephen Hemminger , Thomas Monjalon CC: David Marchand , "Richardson, Bruce" , "dev@dpdk.org" , "Lu, Wenzhuo" , "Wu, Jingjing" , "Iremonger, Bernard" , Maxime Coquelin , "Yigit, Ferruh" , "Andrew Rybchenko" , "Wiles, Keith" Thread-Topic: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats Thread-Index: AQHUxVy+ySl801avPkWKPTgCEmdwhaXhMQuwgAAQbICAAFNEAIAA0mHw Date: Sat, 16 Feb 2019 13:23:19 +0000 Message-ID: <2601191342CEEE43887BDE71AB977258012413A7D9@irsmsx105.ger.corp.intel.com> References: <1550158972-21895-1-git-send-email-david.marchand@redhat.com> <2601191342CEEE43887BDE71AB977258012413A4D8@irsmsx105.ger.corp.intel.com> <6177115.1iB7W0vHcD@xps> <20190215163700.1b04ba6f@shemminger-XPS-13-9360> In-Reply-To: <20190215163700.1b04ba6f@shemminger-XPS-13-9360> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzgxNzFmMDQtNDc5Yi00MDAyLTkxZDUtMDcwYWY0MjRhNTA3IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiTGNuVytaQklHU1ZBZ0ViSk45T3NPSElzYXd4aGNHTndBYW00QjVNcERScEZtT0NDa3B2UTJTNkQ0UjVheDErQiJ9 x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH 3/5] app/testpmd: add missing transmit errors stats 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: Sat, 16 Feb 2019 13:23:25 -0000 >=20 > On Fri, 15 Feb 2019 20:38:59 +0100 > Thomas Monjalon wrote: >=20 > > 15/02/2019 19:42, Ananyev, Konstantin: > > > >>> From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of David Marcha= nd > > > >>> I am also for option 2 especially because of this. > > > >>> A driver that refuses a packet for reason X (which is a limitatio= n, or an > > > >>> incorrect config or whatever that is not a transient condition) b= ut gives > > > >>> it back to the application is a bad driver. > > > > > > >>Why? What.s wrong to leave it to the upper layer to decide what to > > > >>do with the packets that can't be sent (by one reason or another)? > > > > > > >How does the upper layer know if this is a transient state or someth= ing that can't be resolved? > > > > > > Via rte_errno, for example. > > > > rte_errno is not a result per packet. > > I think it is better to "eat" the packet > > as it is done for those transmitted to the HW. > > > > >=20 > First off rte_errno doesn't work for a burst API. It doesn't allow to return individual error value for each packet. Though if we stop after first error happens - it is sufficient. >=20 > IMHO (which matches /2) all drivers should only increment oerrors for som= ething for > a packet which it could not transmit because of hardware condition (link = down etc) It sounds too expensive to check that HW is in healthy state and link is up= for every tx_burst operation.=20 > or mbuf which has parameters which can not be handled. Right now it is responsibility of different function - tx_prepare(). > In either case, the packet > must be dropped by driver and oerrors incremented. =20 Right now tx_burst() only cares - is there enough free TX descriptors to su= bmit packet or not. >>From my perspective - it is better to keep it that way. If the user would like to drop packets if the link is down, or if the packet is malformed - there should be no problem to create a wra= pper on top of tx_burst() that would do all these extra checking and packet freeing= . >The driver should also maintain > internal stats (available by xstats) for any conditions like this. >=20 > When no tx descriptors are available, the driver must not increment any c= ounter > and return partial success to the application. If application then wants = to do > back pressure or drop it should keep its own statistics. >=20 > This is close to the original model in the Intel drivers, and matches wha= t BSD and > Linux do on the OS level for drivers. Like many driver assumptions the co= rner > cases were not explicitly documented and new drivers probably don't follo= w > the same pattern.