Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1970558ybi; Thu, 4 Jul 2019 03:01:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqwL316rDL6CZwmfa/ptEKriBF/FWcCAZ8eyxclyiFtL1Op+hGW8pCeLeCjeBtLY2BIO6jHy X-Received: by 2002:a17:902:6b44:: with SMTP id g4mr48052699plt.152.1562234472459; Thu, 04 Jul 2019 03:01:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562234472; cv=none; d=google.com; s=arc-20160816; b=v75gU48+E2uU64tG+gAPI0X+8YJ+2X/Ux0U3kx+pEJTvnROQ/BcCQyDGvopG85f/NV 2hT0eJxWC2B5lQvZeQfU6Ho6tKnnPgsfHmOcYZn0+kQNNXdaqjWk0gb3CRn6m79G3O7O PGG1BPjNLfla3hlV/vF/GskDGsGdLY6tAuFp2tL7DCjMflfl1yC/zDYy0eEEaA6O0oHT E/TR5hKXE1HJ0fWVg0WUiWSXQesZw8PXjGGu3mAKgyUALo5Aas4jRtXUZTLsWKmR/dBi 5JJxDG01hRUCvn86jmPBKiicWZ+CD9oS1dib612xTAIWpGDVJBeyghU/bL2Q4HbRkg50 sgEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=XAo7yFE6ZQ91YSlQwWrY53Vh2yyyIQX2YelkrY1ubHI=; b=kopufNMBXwM6IVIwdpoF760Y7VJL8YnCRDybEut2u9jQeVj2GAKNNAEseACoTk/PDP 3V8SQKMzo6mDY2aiQCUOcAQGglGs83wm5ADMgRsxNsAvlSgK/kicNa42ICJgPBkVyo4d 06YNQIBG2wuVUrXLaeg0J5uDeJoFET6oFjH5+1pGT+hZiWEkIOaxdyj4+HSSMbBX4vSm SOSySjzxZwOt588YwU5YcWJH6f1tUzANllJ7TIDDVrYamuaTU/XeTRQrkTGucjjfBew8 aw7a8w4ODRXWuYTSo3mWXySo4GkUKdQq93jYE+1f4wChp7MMgRkegEFLQO9Mh3xmF7F6 5+aQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 5si5198965pfh.3.2019.07.04.03.00.54; Thu, 04 Jul 2019 03:01:12 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727512AbfGDKAd (ORCPT + 99 others); Thu, 4 Jul 2019 06:00:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39094 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727470AbfGDKAc (ORCPT ); Thu, 4 Jul 2019 06:00:32 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D6434C0586C4; Thu, 4 Jul 2019 10:00:28 +0000 (UTC) Received: from carbon (ovpn-200-17.brq.redhat.com [10.40.200.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 879E2379C; Thu, 4 Jul 2019 10:00:19 +0000 (UTC) Date: Thu, 4 Jul 2019 12:00:18 +0200 From: Jesper Dangaard Brouer To: Jose Abreu Cc: brouer@redhat.com, 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 , Ilias Apalodimas Subject: Re: [PATCH net-next 3/3] net: stmmac: Introducing support for Page Pool Message-ID: <20190704120018.4523a119@carbon> In-Reply-To: <1b254bb7fc6044c5e6e2fdd9e00088d1d13a808b.1562149883.git.joabreu@synopsys.com> References: <1b254bb7fc6044c5e6e2fdd9e00088d1d13a808b.1562149883.git.joabreu@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Thu, 04 Jul 2019 10:00:32 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 3 Jul 2019 12:37:50 +0200 Jose Abreu wrote: > @@ -3547,6 +3456,9 @@ static int stmmac_rx(struct stmmac_priv *priv, int limit, u32 queue) > > napi_gro_receive(&ch->rx_napi, skb); > > + page_pool_recycle_direct(rx_q->page_pool, buf->page); This doesn't look correct. 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). You will have to call: page_pool_release_page(rx_q->page_pool, buf->page); This will do a DMA-unmap, and you will likely loose your performance gain :-( > + buf->page = NULL; > + > priv->dev->stats.rx_packets++; > priv->dev->stats.rx_bytes += frame_len; > } 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). [1] https://github.com/xdp-project/xdp-project/blob/master/areas/mem/page_pool02_SKB_return_callback.org -- Best regards, Jesper Dangaard Brouer MSc.CS, Principal Kernel Engineer at Red Hat LinkedIn: http://www.linkedin.com/in/brouer