From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934629AbdBQPUl convert rfc822-to-8bit (ORCPT ); Fri, 17 Feb 2017 10:20:41 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:42638 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934570AbdBQPUh (ORCPT ); Fri, 17 Feb 2017 10:20:37 -0500 From: Gregory CLEMENT To: Thomas Petazzoni Cc: Jisheng Zhang , , , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH net-next v2 2/2] net: mvneta: Use cacheable memory to store the rx buffer DMA address References: <20170217100233.2325-1-jszhang@marvell.com> <20170217100233.2325-3-jszhang@marvell.com> <87o9y1aqsk.fsf@free-electrons.com> <20170217145501.5b90a977@free-electrons.com> Date: Fri, 17 Feb 2017 16:20:34 +0100 In-Reply-To: <20170217145501.5b90a977@free-electrons.com> (Thomas Petazzoni's message of "Fri, 17 Feb 2017 14:55:01 +0100") Message-ID: <87fujcc08t.fsf@free-electrons.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, On ven., févr. 17 2017, Thomas Petazzoni wrote: > Does not make sense, because it's not the SW that refills the RX > descriptors with the address of the RX buffers. It's done by the HW. > > With HWBM, I believe you have no choice but to read the physical > address from the RX descriptor. But you can probably optimize things a > little bit by reading it only once, and then storing it into a > cacheable variable. > > So maybe: > > - For SWBM, use the strategy proposed by Jisheng > - For HWBM, at the beginning of the RX completion path, read once the > rx_desc->buf_phys_addr, and store it in rxq->buf_dma_addr[index] For the HWBM path storing rx_desc->buf_phys_addr in rxq->buf_dma_addr[index] is not useful as we only use it in a single function. But a quick improvement could be to use the phys_addr variable. Indeed we store the value of rx_desc->buf_phys_addr in it and we never used it, instead we always use rx_desc->buf_phys_addr. Gregory > > Of course that's just a very rough proposal. I've been looking mainly > at mvpp2 lately, and I'm not sure I still remember how mvneta works in > the details. > > Best regards, > > Thomas > -- > Thomas Petazzoni, CTO, Free Electrons > Embedded Linux and Kernel engineering > http://free-electrons.com -- Gregory Clement, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com