From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150049.outbound.protection.outlook.com [40.107.15.49]) by dpdk.org (Postfix) with ESMTP id 6C5C81B8C4; Thu, 10 Jan 2019 20:10:05 +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:X-MS-Exchange-SenderADCheck; bh=qebyy9l7OS4nAiVKLw5ZpyL9xQPaffw/iFW8ZO0j/dY=; b=J00sL4bhWxBBQI4BlAG9S+2IxWOaj4Ogyzs8ZSfiehS/wNjKY0UKYGHPMzMUDEUv/buizZyo0Z5D4WVRkVPaw4EDfQojy7+6q5D6YfMUn2nUqLvu4iWz4sQ/HpRIx6y2hD5TbGJMsoCPpAoI0FI4NHSLvkCs3QLXaVzkI/Kt0PE= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4476.eurprd05.prod.outlook.com (52.134.109.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1495.9; Thu, 10 Jan 2019 19:10:04 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::b0a0:72a4:7547:1c3c]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::b0a0:72a4:7547:1c3c%4]) with mapi id 15.20.1495.011; Thu, 10 Jan 2019 19:10:04 +0000 From: Shahaf Shuler To: Yongseok Koh , "olivier.matz@6wind.com" CC: "dev@dpdk.org" , "roszenrami@gmail.com" , "david.marchand@redhat.com" , "stable@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v3 2/2] net/mlx5: fix instruction hotspot on replenishing Rx buffer Thread-Index: AQHUqRNLCbB+n4IARUaHr5v4qQfHcaWo3eNw Date: Thu, 10 Jan 2019 19:10:04 +0000 Message-ID: References: <20190109085426.39965-1-yskoh@mellanox.com> <20190110183528.42503-1-yskoh@mellanox.com> <20190110183528.42503-2-yskoh@mellanox.com> In-Reply-To: <20190110183528.42503-2-yskoh@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4476; 6:OzTHGJBGKw1IShUsufkedZLFaJ+uxMQdSh17wyll6K3KXByfVl3MpZW9eoSvekTvM0D5m5koJ5KhCQClTUj+CbPNwdPVnEKL2HPwopHvQWnmWtRkjl6TpbqXExX5wiXhqXNkvPXK+1ANGLL/+B5sbvT97X49pyeGh1T87r67mTs75hgpN3hkcIH7d6ChIbH4QO/LKKmFIktyNd/YRFQiXorrr0mpHLpGmK7dJxOFR22E1K7Ul7svJ3gAdYGdCBwVDmcdvA0CS9+7rHu4AUY1ihQZBID8LtPFBQ43ezB2S/QcCRLdf9dRB6mlyktvgeR4kKanfVWvOkrJMUgYZCeIDEfGT7KxSbA3EiVumo9pTLw4KB0hFFJiw/IW513Z8cw71f76REYUzTu42N+cRznCbdEq5cspVtf3Wb+bSQFB2Pg37eCSirGFqrIUMitehpOGVHnJoOO8Hb50yv85rpU8Aw==; 5:VQyaTW+u4PBGbig4mglc2re1LtTNp7gI6IVtAk1R1eh55EEqBEV2agXYSvLYWs1kOPA2ZFFco6wAmMoAmUemOLJiwenwzOfLRZsgttp9k4YQKkhfQyBCJgekv8YNK4XGTABIy1kB7dDQDu9c6BrJfKbyY2KTVpiMM3f927tRT3PLDYE5FxWM8nnU92iwVTjdbAYD19tGSLCcB8Za3lxmhg==; 7:MRFXpySVdLMMmSXNBoENSa96xwyBVmZs3TLCJQrx0xghtM/LUywxg8nQEY3W9yH3DbcXYM+NfsSDOmKq+Tu6i+iVf+G7+mb3yRbwsRVkWkqRln+gBw+dKt0ea7aFBsN8UDC/W7i5i2L98GlQfli0pQ== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 5fe25235-40a6-4ac6-6af0-08d6772f3a48 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600109)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4476; x-ms-traffictypediagnostic: DB7PR05MB4476: x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(3230021)(908002)(999002)(5005026)(6040522)(8220060)(2401047)(8121501046)(3231475)(944501520)(52105112)(3002001)(93006095)(93001095)(10201501046)(6055026)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699051)(76991095); SRVR:DB7PR05MB4476; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4476; x-forefront-prvs: 0913EA1D60 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(39860400002)(396003)(346002)(136003)(189003)(199004)(81166006)(81156014)(4326008)(105586002)(33656002)(55016002)(5660300001)(6506007)(2906002)(8936002)(6246003)(68736007)(9686003)(26005)(53936002)(39060400002)(14454004)(99286004)(66066001)(305945005)(6436002)(478600001)(7736002)(25786009)(102836004)(106356001)(7696005)(76176011)(316002)(74316002)(54906003)(110136005)(71200400001)(186003)(6116002)(86362001)(256004)(476003)(229853002)(11346002)(446003)(97736004)(486006)(3846002)(2501003)(71190400001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4476; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: EdjW137Bi+gOuE+ufyDtYtLOB+vKOhRJFmTcEhrNFTaCtoxuXuAANoEktUAO7p5xh3fmvdiCri7RM+Dh8rsY2HLbmBjCxirge1jwrkyPiUqqgTixju+ldT+hxKSkzKnzm5bxvvaLRDgREnRks+cJuKQDBq1/RrgLVfbJFuLlBtnzVkcdDtCPjcI+z3UyaZpSP7q1Rhkb3Yaq5/m4tStSZiRQ0CeAo6q2F+evoQmHplRNQ4fr13WcO+zOQh+CL9e9Tz7uUncUXNrX/Ajuo2EHAChQtF1fcANZYDjPb4BZogdHTLtW26/3KV6y3xx5wZIe 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: 5fe25235-40a6-4ac6-6af0-08d6772f3a48 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jan 2019 19:10:04.3435 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4476 Subject: Re: [dpdk-dev] [PATCH v3 2/2] net/mlx5: fix instruction hotspot on replenishing Rx buffer 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: Thu, 10 Jan 2019 19:10:05 -0000 Thursday, January 10, 2019 8:35 PM, Yongseok Koh: > Subject: [dpdk-dev] [PATCH v3 2/2] net/mlx5: fix instruction hotspot on > replenishing Rx buffer >=20 > On replenishing Rx buffers for vectorized Rx, mbuf->buf_addr isn't needed= to > be accessed as it is static and easily calculated from the mbuf address. > Accessing the mbuf content causes unnecessary load stall and it is worsen= ed on > ARM. >=20 > Fixes: 545b884b1da3 ("net/mlx5: fix buffer address posting in SSE Rx") > Cc: stable@dpdk.org >=20 > Signed-off-by: Yongseok Koh Acked-by: Shahaf Shuler > --- >=20 > v3: > * rte_mbuf_buf_addr_default() -> rte_mbuf_buf_addr() >=20 > v2: > * use the newly introduced API - rte_mbuf_buf_addr_default() > * fix error in assert >=20 > drivers/net/mlx5/mlx5_rxtx_vec.h | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) >=20 > diff --git a/drivers/net/mlx5/mlx5_rxtx_vec.h > b/drivers/net/mlx5/mlx5_rxtx_vec.h > index fda7004e2d..989a1fdce5 100644 > --- a/drivers/net/mlx5/mlx5_rxtx_vec.h > +++ b/drivers/net/mlx5/mlx5_rxtx_vec.h > @@ -102,8 +102,10 @@ mlx5_rx_replenish_bulk_mbuf(struct mlx5_rxq_data > *rxq, uint16_t n) > return; > } > for (i =3D 0; i < n; ++i) { > - wq[i].addr =3D rte_cpu_to_be_64((uintptr_t)elts[i]->buf_addr + > - RTE_PKTMBUF_HEADROOM); > + void *buf_addr =3D rte_mbuf_buf_addr(elts[i], rxq->mp); > + > + assert(buf_addr =3D=3D elts[i]->buf_addr); > + wq[i].addr =3D rte_cpu_to_be_64((uintptr_t)buf_addr + > +RTE_PKTMBUF_HEADROOM); > /* If there's only one MR, no need to replace LKey in WQE. */ > if (unlikely(mlx5_mr_btree_len(&rxq->mr_ctrl.cache_bh) > 1)) > wq[i].lkey =3D mlx5_rx_mb2mr(rxq, elts[i]); > -- > 2.11.0