Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2040520ybi; Thu, 4 Jul 2019 04:12:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqxYYKQzeBkCq3dGfItbyHFsqucThXzmEXce/dnMyOd9tbXsiI7+kyA95NLBP3DS3XPRyrx6 X-Received: by 2002:a63:e5a:: with SMTP id 26mr13668535pgo.3.1562238773991; Thu, 04 Jul 2019 04:12:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562238773; cv=none; d=google.com; s=arc-20160816; b=kFU/0t0gjX6Vm04vyebyM9dFLOfUtgt46AhA6aQVNKcP0tiVHHn43Ac/rmzDY/fLa+ pUdUagVhww/VxS2DpSDvJ3E8tjhCQ4tj0wHefBWeHmxh/r2S/BiwiDQ+znHNzN0Wphv4 PRTovWexYVvSm9+BsS2R+EzkK3qhJQ+ChBkxew5fPBS3gAyRU5h0RfBxHSu143B84a7C pZmbpMc6NW1WQWHDGntLQ6AZNWg9CSqpZp/MhL0MYbcFFLl0Xxba93CEyAKNBeAUeEmh 6Kmw+VkUpqp1Knw2DxH/ZImnGbepcdkjfocpzw99pwboWEBzy/qLzpNhaVSOdTyR30mF Ttag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=l8xOwRoeewzebcQAt1yKxsHLrRV9J9YjppTfdC6bYO4=; b=y0SkvJpbs13+IlMzhPNZ1ehGvjZNUkeNRVV1HudsJG9IC2K64MUj+x1S8Pj4+mMHOD +i5mTGgtnDWPqmLdBiE7jVImyRbJhrdXpuOuCZyCNAkhWIcUD4D19zy5FnRxP6YNqMjF AXmzjieaoIhgMll3zMI/dax12EU+Rs+N5p6Ub7bPkEwxXX0v1tTXxprsEbALgddZAQVj 3k3JYBM18MQy9qxZ3qcMBXPSOzAIXTYbzrY4nBCj/nk5HSzBLn0qj/PaCebdLtahIQoH Bd0QB1p3U1q/mObfxvdkrS4KYEfY8f8ZnDEsKAm7UQEUUQClUbVW5KUFa87RV+TCdlYU ES8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AcU/Og0I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l6si4869509pgh.150.2019.07.04.04.12.38; Thu, 04 Jul 2019 04:12:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="AcU/Og0I"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727611AbfGDLLQ (ORCPT + 99 others); Thu, 4 Jul 2019 07:11:16 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:40943 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727640AbfGDLLP (ORCPT ); Thu, 4 Jul 2019 07:11:15 -0400 Received: by mail-wr1-f68.google.com with SMTP id p11so6172098wre.7 for ; Thu, 04 Jul 2019 04:11:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=l8xOwRoeewzebcQAt1yKxsHLrRV9J9YjppTfdC6bYO4=; b=AcU/Og0Im9zeCUoAjQfz6t1TPM7Mfh0ysWoMMrnoAxopui+jfwRP+8ITrmS17IrY1C KEs0UE42QQXFtM3Plib24n04BsaZx7YpdSdT+lXwkDmW5UXo5AVmjENp8T4Yk5L4W3qL ya3qtdkWWGhERgwew7vMxaZiQ0oib0yFn8XnrueuwqH8INdv94RXEj/zk8dU3Gtn4O0A 6EwHajqBOaWPjJJmtSLrm8PZE5Ma9nIUkyig0AkkUrnFH46TF6oLK4F+36SuPCPJzrid vsMqp3WqEkNc7NWqF0JoS9TZcj/Wt9C7JFdlMtv8VS6Ms36Kj4I2IsGthBfqv69AJ3yx KAhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=l8xOwRoeewzebcQAt1yKxsHLrRV9J9YjppTfdC6bYO4=; b=bffMdWuWsV34vVU1JoQjba9wxp721DE/hcg690QRHiGCawOE50/eZ294oUfe4XFriq zF8F8VpcrCwWbQLM5dod0ZH5oCvZp958sVSbQTDgDkvljByL2eXCbn9RaMQjg+YtWJN/ mrLwC91Kg7+q4+d6UcLKFUgfefwdLXpb5NMv+P3gJILmRlLAblzrGwIUNoK3F6qTzW7M SpVQjU6AHS8EVfioklecuV3Eccp7HXAJxASAnr/Hnp/60qgN7I6Opz/oBe/R3Ay3nFIA c9GJQ7KXFxtn+pvqKkr+3ggYxrGr0q4Y3cejY1xSDoNmgw+/GlCIAXjoJFS3Yps+xYaD D7Cg== X-Gm-Message-State: APjAAAVnmbA2oDZk/YJNAuyIZmP9v2tnudOXHoFOkYruFgTsancFWbKN 5fDFl0o8PRM2xfhFI01nLYdd1w== X-Received: by 2002:adf:dfc4:: with SMTP id q4mr32763692wrn.54.1562238673665; Thu, 04 Jul 2019 04:11:13 -0700 (PDT) Received: from apalos (athedsl-428434.home.otenet.gr. [79.131.225.144]) by smtp.gmail.com with ESMTPSA id r4sm4942586wrv.34.2019.07.04.04.11.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 04 Jul 2019 04:11:12 -0700 (PDT) Date: Thu, 4 Jul 2019 14:11:09 +0300 From: Ilias Apalodimas To: Jose Abreu Cc: Jesper Dangaard Brouer , "linux-kernel@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , Joao Pinto , "David S . Miller" , Giuseppe Cavallaro , Alexandre Torgue , Maxime Coquelin , Maxime Ripard , Chen-Yu Tsai Subject: Re: [PATCH net-next 3/3] net: stmmac: Introducing support for Page Pool Message-ID: <20190704111109.GA12011@apalos> References: <1b254bb7fc6044c5e6e2fdd9e00088d1d13a808b.1562149883.git.joabreu@synopsys.com> <20190704120018.4523a119@carbon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 04, 2019 at 10:13:37AM +0000, Jose Abreu wrote: > From: Jesper Dangaard Brouer > > > The page_pool DMA mapping cannot be "kept" when page traveling into the > > network stack attached to an SKB. (Ilias and I have a long term plan[1] > > to allow this, but you cannot do it ATM). > > The reason I recycle the page is this previous call to: > > skb_copy_to_linear_data() > > So, technically, I'm syncing to CPU the page(s) and then memcpy to a > previously allocated SKB ... So it's safe to just recycle the mapping I > think. > > Its kind of using bounce buffers and I do see performance gain in this > (I think the reason is because my setup uses swiotlb for DMA mapping). Maybe. Have you tested this on big/small packets? Can you do a test with 64b/128b and 1024b for example? The memcpy might be cheap for the small sized packets (and cheaper than the dma map/unmap) > > Anyway, I'm open to some suggestions on how to improve this ... > > > Also remember that the page_pool requires you driver to do the DMA-sync > > operation. I see a dma_sync_single_for_cpu(), but I didn't see a > > dma_sync_single_for_device() (well, I noticed one getting removed). > > (For some HW Ilias tells me that the dma_sync_single_for_device can be > > elided, so maybe this can still be correct for you). > > My HW just needs descriptors refilled which are in different coherent > region so I don't see any reason for dma_sync_single_for_device() ... I am abit overloaded at the moment. I'll try to have a look at this and get back to you Cheers /Ilias