Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbcDROzg (ORCPT ); Mon, 18 Apr 2016 10:55:36 -0400 Received: from mail-am1on0092.outbound.protection.outlook.com ([157.56.112.92]:8808 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751899AbcDROzd convert rfc822-to-8bit (ORCPT ); Mon, 18 Apr 2016 10:55:33 -0400 X-Greylist: delayed 952 seconds by postgrey-1.27 at vger.kernel.org; Mon, 18 Apr 2016 10:55:31 EDT From: Eli Cohen To: Christoph Hellwig CC: Sinan Kaya , "linux-rdma@vger.kernel.org" , "timur@codeaurora.org" , "cov@codeaurora.org" , Yishai Hadas , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: RE: [PATCH V2] net: ethernet: mellanox: correct page conversion Thread-Topic: [PATCH V2] net: ethernet: mellanox: correct page conversion Thread-Index: AQHRmT8xf5+Q58WWHkGr2QQx2MS/pZ+Py+WAgAABi2A= Date: Mon, 18 Apr 2016 14:39:36 +0000 Message-ID: References: <1460845412-13120-1-git-send-email-okaya@codeaurora.org> <20160418065447.GA11539@x-vnc01.mtx.labs.mlnx> <20160418143255.GA15203@infradead.org> In-Reply-To: <20160418143255.GA15203@infradead.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: infradead.org; dkim=none (message not signed) header.d=none;infradead.org; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [193.47.165.251] x-ms-office365-filtering-correlation-id: 15f71277-11d1-4a0d-a8fd-08d36797441a x-microsoft-exchange-diagnostics: 1;DB5PR05MB1414;5:kG+XeobgWLBmy47wv/bTW6hx6gNhjUHHETwHezZkDweAkW/ZfhQqu5cXhEyE7sHmX7dNL1wM82xFuH5PlH84UcUlf+hCpkKfOUA8i4G8O89VeYXLasYJjoxFAyC5EuW7nXHOh7o8U0Pjwc7bdSp5N3ypJm0JEFiyBkkFw/oZ/gDBl02goY4wV4ZbRyiwryPQ;24:OxRo3LtmaESOB28Wmri5pgne+C35Gwoblv9OzM3/7XGqxLJsyZOpHJi2T4HE6ReiSf2C/X1CAsrx33HHook0aa9g6tK6x1BOlPUMn/dNU58=;7:gdF9il5ocip/MnVR+epOjog9H37lUptmOI97ZEMEnyFHjnlGUAmQTQn0Iy+cBkmqa5piYGh6VsxLsJKEGvi0urew2f+u2KXNDRFYweRuAO6q7kXRJfyRI9WWcQw3tcG/TilUB0H2zNdXSQDXzQA28FIY+K7QbXFn7j8pCEP0Wp2JGCK1dRNeYfhhIYprK98EzgL/zmTQHmIMmfd43x/gkw== x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB5PR05MB1414; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001);SRVR:DB5PR05MB1414;BCL:0;PCL:0;RULEID:;SRVR:DB5PR05MB1414; x-forefront-prvs: 0916FC3A18 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(6009001)(377454003)(51694002)(13464003)(24454002)(106116001)(54356999)(19580395003)(19580405001)(76176999)(66066001)(50986999)(74316001)(110136002)(11100500001)(5003600100002)(86362001)(92566002)(189998001)(76576001)(87936001)(122556002)(9686002)(1096002)(1220700001)(5002640100001)(4326007)(10400500002)(5008740100001)(77096005)(586003)(6116002)(33656002)(102836003)(81166005)(2906002)(3280700002)(3660700001)(2950100001)(3846002);DIR:OUT;SFP:1101;SCL:1;SRVR:DB5PR05MB1414;H:DB5PR05MB1848.eurprd05.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Apr 2016 14:39:36.7973 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB5PR05MB1414 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 30 Right, I did not suggest this as a patch but just wanted to pinpoint the problematic issue which is that virt_to_page does not give you the correct pointer to the page. -----Original Message----- From: Christoph Hellwig [mailto:hch@infradead.org] Sent: Monday, April 18, 2016 9:33 AM To: Eli Cohen Cc: Sinan Kaya ; linux-rdma@vger.kernel.org; timur@codeaurora.org; cov@codeaurora.org; Yishai Hadas ; netdev@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH V2] net: ethernet: mellanox: correct page conversion On Mon, Apr 18, 2016 at 09:54:47AM +0300, Eli Cohen wrote: > Sinan, > > if we get rid of the part this code: > > if (BITS_PER_LONG == 64) { > struct page **pages; > pages = kmalloc(sizeof *pages * buf->nbufs, gfp); > if (!pages) > goto err_free; > ... > ... > if (!buf->direct.buf) > goto err_free; > } > > Does that solve the arm issue? Not quite. You still have code in mlx4_en_map_buffer that performs this mapping later if it it wasn't mapped in mlx4_buf_alloc. You'll need to get rid of that by ensuring max_direct for all the cases currently using mlx4_en_map_buffer as well.