Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753452AbdGJJ5y (ORCPT ); Mon, 10 Jul 2017 05:57:54 -0400 Received: from mail-eopbgr40055.outbound.protection.outlook.com ([40.107.4.55]:2288 "EHLO EUR03-DB5-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753224AbdGJJ5w (ORCPT ); Mon, 10 Jul 2017 05:57:52 -0400 From: Ilan Tayari To: Arnd Bergmann , Saeed Mahameed CC: Matan Barak , Leon Romanovsky , Yossi Kuperman , Yevgeny Kliteynik , Boris Pismenny , "netdev@vger.kernel.org" , "linux-rdma@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH] net/mlx5: IPSec, fix 64-bit division correctly Thread-Topic: [PATCH] net/mlx5: IPSec, fix 64-bit division correctly Thread-Index: AQHS+WBWV2Xz59l9c0GrKu3AUIGijqJM0wZA Date: Mon, 10 Jul 2017 09:57:47 +0000 Message-ID: References: <20170710093842.2921914-1-arnd@arndb.de> In-Reply-To: <20170710093842.2921914-1-arnd@arndb.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: arndb.de; dkim=none (message not signed) header.d=none;arndb.de; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [109.67.22.132] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM4PR0501MB1924;7:FjRanINAf99TUyMEJUC5HXv5sW3UiB5FCNThh7IbURghVzsET+EyhHaTI3kh8GYwdOIsIN9rmpv2KW2CPtLSPOzBfz8mdxWMNNAkxhnO6FyFUmg2m1JReMizTAneAbmJUh9ZSIHFlDPpVJdR7eH6e2wOSzRTB+LsRla5G1WtQSanFke74D9VVGuVntQDxE8gnUOo0+fJr8uL0pJG6+x19IehblJLvfzgpzjK7rrM2e+4puP/WxMEZxKJSsM302knKE5kKGWz+MqezD+GOF5BVNpkFlGZu4PUTWcnuaVKPiyrlIMGMSTnhj8iKMv2Y+gOLMU7IJyn67FduDLi2h5+LqQ7dktQ5X8e3HPLFZ0Sdv2hnv7wdsr5QwZeIo4wjo1D+OtH5xFKN9mCjRoN+t/nNFi0xuNrcfRYVNCjgfcd1vhumaVr7lN2qEqmIs1bo2lIeZmDCibf6xS9qPuysiubeakPahWyQBvWLi6dOvWELgwytgSlNWiUmA9SNt7M4jSwswe+RNN0SdvNfGOKd8gvFPTb1PM8LXSubfzKtMkyPTP4YgnaHHdxNn1RVSNxEQDouDkWtfMCdohMV4ImzIci41zGTQPWmBZBvRUYB3nybrTnq67U6bxiZxFEFABlv85gV6Nij6gmM9FmOR2F0HYZmrkU9Fi686VJLUdapXApgyzPe0A78s3Wf4BMnnu8lmrkLvAPPmQrUroHSsp5RY6GDabzzvh4zKatNaruItqsJEDa4wF8Aps4sQ9ULp0PTgcLgYXB4pw9m4UZ0wkPnz5AXrOLW5ZD1LiYrdnnjVkfKEg= x-ms-office365-filtering-correlation-id: e7088594-2f28-468f-a85a-08d4c77a1ec0 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(48565401081)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:AM4PR0501MB1924; x-ms-traffictypediagnostic: AM4PR0501MB1924: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(236129657087228)(148574349560750); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(93006095)(93001095)(10201501046)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:AM4PR0501MB1924;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:AM4PR0501MB1924; x-forefront-prvs: 03648EFF89 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(39450400003)(39840400002)(39860400002)(39410400002)(39400400002)(39850400002)(13464003)(7736002)(229853002)(2906002)(33656002)(8936002)(5250100002)(2900100001)(3280700002)(6246003)(3660700001)(66066001)(8676002)(50986999)(81166006)(76176999)(54356999)(189998001)(55016002)(478600001)(25786009)(38730400002)(9686003)(6636002)(5660300001)(53936002)(7696004)(74316002)(99286003)(4326008)(54906002)(86362001)(6436002)(2950100002)(6116002)(102836003)(6506006)(3846002)(305945005);DIR:OUT;SFP:1101;SCL:1;SRVR:AM4PR0501MB1924;H:AM4PR0501MB1940.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Jul 2017 09:57:47.9775 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR0501MB1924 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v6A9vvM9008530 Content-Length: 1926 Lines: 58 > -----Original Message----- > From: Arnd Bergmann [mailto:arnd@arndb.de] > Subject: [PATCH] net/mlx5: IPSec, fix 64-bit division correctly > > The new IPSec offload code introduced a build error: > > drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.o: In function > `mlx5e_ipsec_build_inverse_table': > ipsec_rxtx.c:(.text+0x556): undefined reference > > Another patch was added on top to fix the build error, but > that introduced a new bug, as we now use the remainder of > the division rather than the result. > > This makes it use the correct helper function instead. > > Fixes: 5dfd87b67cd9 ("net/mlx5: IPSec, Fix 64-bit division on 32-bit > builds") > Fixes: 2ac9cfe78223 ("net/mlx5e: IPSec, Add Innova IPSec offload TX data > path") > Signed-off-by: Arnd Bergmann > --- > drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c > b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c > index 7d06c673851a..4614ddfa91eb 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_rxtx.c > @@ -363,7 +363,6 @@ void mlx5e_ipsec_build_inverse_table(void) > { > u16 mss_inv; > u32 mss; > - u64 n; > > /* Calculate 1/x inverse table for use in GSO data path. > * Using this table, we provide the IPSec accelerator with the value > of > @@ -373,8 +372,7 @@ void mlx5e_ipsec_build_inverse_table(void) > */ > mlx5e_ipsec_inverse_table[1] = htons(0xFFFF); > for (mss = 2; mss < MAX_LSO_MSS; mss++) { > - n = 1ULL << 32; > - mss_inv = do_div(n, mss) >> 16; > + mss_inv = div_u64(1ULL << 32, mss) >> 16; Thanks Arnd, :o I'm surprised... let me check this... > mlx5e_ipsec_inverse_table[mss] = htons(mss_inv); > } > } > -- > 2.9.0