From patchwork Wed Jun 5 13:20:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 165886 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp7340055ili; Wed, 5 Jun 2019 06:20:45 -0700 (PDT) X-Google-Smtp-Source: APXvYqxokQlw77dWHCBsxXtpnY+qg4HwiDsEQeo3Ur/FTkJks8YBLO3xn5S0VPLZWH765MP0Tbtj X-Received: by 2002:a65:41c6:: with SMTP id b6mr4242947pgq.399.1559740845326; Wed, 05 Jun 2019 06:20:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559740845; cv=none; d=google.com; s=arc-20160816; b=UWELPE1Pq7tKbcJQbBKQbu5zgUC8iywgFhR6vfTczxlqCnSmfOBrLJ9pNQ1K5EkcFz XrDq94I32gULXsZtS/nKc7KJi6+bmXPKOMp83BioV3np83q+c7fEFTks9JrB/BLssRYG 1y8nMQy4Ijjj3IFxtkf/RerbUIj0TZ/ARcF3Ihbfh18izO4rzTK1Wf/vlFXogC3BwCE3 vi7Uzfc1V1AbpaV3ptp4+S4VNBLOM9/e/oIQlpynq96GYqyeQNqTyLYG0G6Ubf69bQmy QwvmoPf74+nYfpUXhPtA3bwEnYnUInVK6OwOVXqMpLYrgtBjUTCLGr/ZOCdSRCLAzHRX N1pA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=AdSMTsu+LtgUCnPNRXGwSYsCPQyqbNfQqw5/RcvDJNQ=; b=SU0wv5oLJadiM6zfhurSHyA3I/VCsTraiCknOukVsKAE8y1QQqezHSKk5eVjw+HXV3 WDrvFx24oruzNKPwVpEPTlmiv102i+31Ecq3a2vds5WsbYSfVTYZQaY8K+VCYVJs+e+M w5qzhAEUWEFGWpU28ZsZ0ct69scO3LNotgviqERsbPa7JNmMgZ2aDwyXDoSH+/X8Qy5I zhOyOHQyjgYwacSQBpihKbkWYQveRPMye2LN3s11uJLWAUz3InlGVFt2pXs+T1oPZ+H4 Avi7qACyVTzp0X57vU4vOaAkqJyPFegycOHQEKsc3k0fnuHoUqqbiK9TTdJMCHFl7rKO nVyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=mRYi4qcN; 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 b10si3733551pjw.6.2019.06.05.06.20.44; Wed, 05 Jun 2019 06:20:45 -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=mRYi4qcN; 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 S1728066AbfFENUW (ORCPT + 30 others); Wed, 5 Jun 2019 09:20:22 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:34201 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727941AbfFENUQ (ORCPT ); Wed, 5 Jun 2019 09:20:16 -0400 Received: by mail-lj1-f196.google.com with SMTP id j24so23136109ljg.1 for ; Wed, 05 Jun 2019 06:20:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AdSMTsu+LtgUCnPNRXGwSYsCPQyqbNfQqw5/RcvDJNQ=; b=mRYi4qcNVbZ//c6G57A5oDbp2t2NbASCzTsCDdchf6yJyjEu+CCRyMzKu+9CKFoid3 ZwHgGIiAW5HvrqKBJ1X5jiXV8j+0CWCui9NP5egRT36VcapZyU/vhp6SCCBuya6WqE09 EJI5NV/HOBQBQfIBMKnZYUXlDbPa5bHZf929T1qOP8lEPB6+5X4JX3FTK/mOgRyEjxPo NR9mpIYi6oFT+jPz7XZ9EZc54Uv5lBo2CILwvY4E+3997zzLyyuwJiHIM/f3AzUS5BuF Ott0Mezc+lVW/EK674CogiBpGozPsRXV/dA4sdWr0gp2tJ/mtnknDAgMwxIU0+VWMBe/ l5IA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AdSMTsu+LtgUCnPNRXGwSYsCPQyqbNfQqw5/RcvDJNQ=; b=Wum1//M5Mz8iLby5nusqAVvot0E2UPsI8kAMETeVaz+PsRhXrpZ8r81Gh6q5lFb9GQ YQoqL2z/6hzY4SYTtqR751TiG0oJ2hj3c5gnJw4TmSIJDTpDLZtzr36s0KvW3xbYJGFi vBON2+cVHgfsMk+kZKmHN894V2iFL9oKOSGMM+7Zd+Fz6UVFFaAdPKK7hWaEpcnF7oRu DmmvrWgObMDbbAtFzvXxUA9Ay5KVdNvwGtMS8BIu2F9I/1FxkPJZEzaking7xjdKDrYj rXd6j1xY0mvb8TUICXf9rmVPYW3mY3J23Wu/c7pOqDSujDnPDukeG8ct4GGpaF/rap5R seew== X-Gm-Message-State: APjAAAUnOPa7k2Thh0dyd0KA+RzPSLw6vyZSIs3ET3ESwuqvOefJzNIs H5XJp86LSbGnatvq67S8OMgWPA== X-Received: by 2002:a2e:9c03:: with SMTP id s3mr6004919lji.209.1559740814483; Wed, 05 Jun 2019 06:20:14 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id t3sm1893259lfk.59.2019.06.05.06.20.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Jun 2019 06:20:13 -0700 (PDT) From: Ivan Khoronzhuk To: grygorii.strashko@ti.com, hawk@kernel.org, davem@davemloft.net Cc: ast@kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, xdp-newbies@vger.kernel.org, ilias.apalodimas@linaro.org, netdev@vger.kernel.org, daniel@iogearbox.net, jakub.kicinski@netronome.com, john.fastabend@gmail.com, Jesper Dangaard Brouer , Ivan Khoronzhuk Subject: [PATCH v3 net-next 1/7] net: page_pool: add helper function to retrieve dma addresses Date: Wed, 5 Jun 2019 16:20:03 +0300 Message-Id: <20190605132009.10734-2-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190605132009.10734-1-ivan.khoronzhuk@linaro.org> References: <20190605132009.10734-1-ivan.khoronzhuk@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilias Apalodimas On a previous patch dma addr was stored in 'struct page'. Use that to retrieve DMA addresses used by network drivers Signed-off-by: Ilias Apalodimas Signed-off-by: Jesper Dangaard Brouer Signed-off-by: Ivan Khoronzhuk --- include/net/page_pool.h | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.1 diff --git a/include/net/page_pool.h b/include/net/page_pool.h index 694d055e01ef..b885d86cb7a1 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -132,6 +132,11 @@ static inline void page_pool_recycle_direct(struct page_pool *pool, __page_pool_put_page(pool, page, true); } +static inline dma_addr_t page_pool_get_dma_addr(struct page *page) +{ + return page->dma_addr; +} + static inline bool is_page_pool_compiled_in(void) { #ifdef CONFIG_PAGE_POOL