From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0081.outbound.protection.outlook.com [104.47.0.81]) by dpdk.org (Postfix) with ESMTP id 45E401B29B for ; Mon, 30 Oct 2017 19:11:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nVJUyM7OgjOfYsfwf/FsOOPuXpznSjio397KyDLTt2M=; b=HUpylh0A04LkiJ/nQyVsptpsliAXH2dT0iK3O9FRxTPsKY/db0eLrwVLVeQf4t/m4kAvhxOh167eX8kNIbesOvBmCu9/XZrkaEWtvV/soVMzD9632vwd0Yn5QSc4AKA3wvzvNSPetobq+YQ7GzbdEyKvEvpQK7L/SDumWHomjQU= Received: from HE1PR0502MB3659.eurprd05.prod.outlook.com (10.167.127.17) by DB5PR05MB1254.eurprd05.prod.outlook.com (10.162.157.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.178.6; Mon, 30 Oct 2017 18:11:31 +0000 Received: from HE1PR0502MB3659.eurprd05.prod.outlook.com ([fe80::c524:908c:b99c:3f4b]) by HE1PR0502MB3659.eurprd05.prod.outlook.com ([fe80::c524:908c:b99c:3f4b%13]) with mapi id 15.20.0178.012; Mon, 30 Oct 2017 18:11:31 +0000 From: Matan Azrad To: Adrien Mazarguil CC: "dev@dpdk.org" , Ophir Munk Thread-Topic: [PATCH v3 1/7] net/mlx4: remove error flows from Tx fast path Thread-Index: AQHTUYqoK1psoG+S/UebCWH39dDU1qL8rNyA Date: Mon, 30 Oct 2017 18:11:31 +0000 Message-ID: References: <1508768520-4810-1-git-send-email-ophirmu@mellanox.com> <1509358049-18854-1-git-send-email-matan@mellanox.com> <1509358049-18854-2-git-send-email-matan@mellanox.com> <20171030142314.GX26782@6wind.com> In-Reply-To: <20171030142314.GX26782@6wind.com> Accept-Language: en-US, he-IL Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=matan@mellanox.com; x-originating-ip: [85.64.136.190] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB5PR05MB1254; 6:3NSMSAxKBaQhHNFc1cu6cthS3GJuUWAkQ10yqg3wgqNZyY1JSmCZ2iEvwYl8IvnKr/tr396I2bizYGq3k7Fi30400SREN42BJtdTK0kIKshpydRFrwbHV1TPyd0hXVECjLoC9FV1RoyIwnvJXsVil6BbSBI5bW/xDjw+IeG7c9crMm92ad10G2RmQWTQ4GpW/iWJtvxEOhYCAWWThfPsqgbLTpgW0Du+YDOn325KmsmxKEb0+b0SZjxYNcR+I+viVLRftbdU7c9zHwECa4fN1TZnUfON3HoVUAuBkbPZqAwQ2j/8pxpg00fmnqXjfAjvqT1cH9tvObpksumVYRe/GIGJuYj2knofI9HFH895goc=; 5:Bkj6kV23Re+ItnbQVGjSEUaVQlcGQ/WM+CLOxzB+NLDPFJo3Vw2lQNAodSFr7HiTxD4LRgFZwYzJqmthzkyeVc13Yy6Qes/IFx1BsdK0MaGVRZSkb76ToOlYZGoqAPlq5Mt4/YfBUYtGG0Lt/IrZA0HC1EDj/0lLE1AM0SSd/58=; 24:+ew8NBTuExNuC5rGYesL90osvmKW+fvcti2IaThT7tcbSqQmw/iGuUaxAuSDOOEHJQmhmQbZ/ZeRlQkqUMZHLoiAUSzmqkNbOCJ/LY/eD3E=; 7:sIO68WgjumXAVEXu1sPSlVRB7HWpspcQ8i/fC4sCur7MRIsmVeKWNozSuPkVKSiu6b0pTuKFL0U7ctJ5jq3v6FCB2MIv2gvxzqlPyK3a7onw4r4jM9HD1W+JKIyOTqBkQcRxTNDSvwAK3xxFXUaKTbwBBgY+T0CwvR/8obUxFeKvS9+BHg55sqOn4n/QLjs6Nk66uwqHnFX1l3n0ZwAKHZQOPxdIfJczIsgUnH0CeF97dU0oc1hP5T06CYxfuP/7 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: 01914c8a-f7a1-458f-dd2d-08d51fc1a5d1 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(48565401081)(4534020)(4602075)(2017052603199); SRVR:DB5PR05MB1254; x-ms-traffictypediagnostic: DB5PR05MB1254: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-exchange-antispam-report-test: UriScan:; x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(3231020)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DB5PR05MB1254; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DB5PR05MB1254; x-forefront-prvs: 0476D4AB88 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(979002)(6009001)(39860400002)(346002)(376002)(199003)(189002)(24454002)(13464003)(2950100002)(8936002)(229853002)(55016002)(99286003)(8676002)(9686003)(25786009)(2906002)(68736007)(6246003)(189998001)(107886003)(3660700001)(3280700002)(53936002)(86362001)(93886005)(76176999)(50986999)(316002)(66066001)(53546010)(81156014)(54906003)(101416001)(74316002)(102836003)(105586002)(6116002)(3846002)(6506006)(6436002)(33656002)(7736002)(14454004)(54356999)(81166006)(106356001)(2900100001)(6916009)(97736004)(478600001)(5250100002)(4326008)(305945005)(5660300001)(7696004)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB5PR05MB1254; H:HE1PR0502MB3659.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01914c8a-f7a1-458f-dd2d-08d51fc1a5d1 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Oct 2017 18:11:31.2061 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR05MB1254 Subject: Re: [dpdk-dev] [PATCH v3 1/7] net/mlx4: remove error flows from Tx fast path 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: Mon, 30 Oct 2017 18:11:34 -0000 Hi Adrien > -----Original Message----- > From: Adrien Mazarguil [mailto:adrien.mazarguil@6wind.com] > Sent: Monday, October 30, 2017 4:23 PM > To: Matan Azrad > Cc: dev@dpdk.org; Ophir Munk > Subject: Re: [PATCH v3 1/7] net/mlx4: remove error flows from Tx fast pat= h >=20 > On Mon, Oct 30, 2017 at 10:07:23AM +0000, Matan Azrad wrote: > > Move unnecessary error flows to DEBUG mode. > > > > Signed-off-by: Matan Azrad > > Acked-by: Adrien Mazarguil >=20 > I missed a couple of details while reviewing the original version, the fi= rst one > being mlx4_post_send()'s return value is still documented as updating > rte_errno in case of error, it's not the case anymore after this patch. >=20 Good attention, Will be fixed in next version. > Please see below for the other one: >=20 > > --- > > drivers/net/mlx4/mlx4_rxtx.c | 16 ++++++---------- > > 1 file changed, 6 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/net/mlx4/mlx4_rxtx.c > > b/drivers/net/mlx4/mlx4_rxtx.c > > > /** > > @@ -510,8 +508,6 @@ struct pv { > > assert(max <=3D elts_n); > > /* Always leave one free entry in the ring. */ > > --max; > > - if (max =3D=3D 0) > > - return 0; > > if (max > pkts_n) > > max =3D pkts_n; > > for (i =3D 0; (i !=3D max); ++i) { >=20 > While minor, this change has nothing to do with this patch, right? >=20 Yes you right, maybe it can be merged in patch 4/7. =20 > I think it can slightly degrade an application performance as it removes = the > guarantee that subsequent code only needs to be run if there is at least = one > packet to process in case the TX ring is constantly full (SW faster than = HW). > In case the TX ring is full, the loop condition should fail in the start an= d then return with 0 because the packet counter is 0.(more 2 checks) Since this case are less common (in my opinion) than at least 1 free space = in ring, we can prevent this unnecessary check for all these common cases. = =20 =20 Are you sure the 2 extra check important for performance in this empty case= ? Doesn't the application will call us again?=20 =20 > Can you remove it? >=20 > -- > Adrien Mazarguil > 6WIND