From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5D509C06513 for ; Thu, 4 Jul 2019 10:00:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30711218AD for ; Thu, 4 Jul 2019 10:00:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NoDFVWvo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30711218AD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BNlTgAGjmZLIix0Z7KIOjkZQCWiCXOQPzins14EAySQ=; b=NoDFVWvoB1A6dd ISsfpVODURw6nDrisFXV3sSKv5WkTjGmERgY+Tn3x3L97LpfN90cI2b/qSeTXjDdmC0G754PhBbNj KV2F6Ze9fB/OXeFAJkVaMhTfnyY+2xQnuPbWnwp4OLkZhpxfbaEY8WlXK8IQn1ko3AU/8v40Nes1a dUTs2UrvlPdguVvJ9zxkaKt8aJZKodOb/vIFgH0vYzRITYD3G/TwF2infBP/7UDVrtYP6umpsFHl7 jJG6vG+gB7BdewfClSdDMba7f+XORnSDmfao1kkR1eJt8aweNziPc3/X2jtvxTX9JIsoXAQFtRJto FVNf9ALov3qV2rVGecOg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hiyXd-0001SM-Im; Thu, 04 Jul 2019 10:00:37 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.92 #3 (Red Hat Linux)) id 1hiyXZ-0001QD-DT for linux-arm-kernel@lists.infradead.org; Thu, 04 Jul 2019 10:00:34 +0000 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 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 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) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190704_030033_470287_7253B63E X-CRM114-Status: GOOD ( 13.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joao Pinto , Alexandre Torgue , Maxime Ripard , netdev@vger.kernel.org, Ilias Apalodimas , linux-kernel@vger.kernel.org, "David S . Miller" , Chen-Yu Tsai , Maxime Coquelin , brouer@redhat.com, Giuseppe Cavallaro , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel