From patchwork Thu May 30 18:20:34 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 165459 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp1314668ili; Thu, 30 May 2019 11:21:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzkulIUD/KvDQlXOfaCchBioO42JZ6p6ryTXSjzVJTA+T/PDwC1dgLiyTlDwd3OROc/F4++ X-Received: by 2002:a17:90a:1951:: with SMTP id 17mr4734195pjh.79.1559240500847; Thu, 30 May 2019 11:21:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559240500; cv=none; d=google.com; s=arc-20160816; b=EMGilt9ZlNvLzVFJoqKU4cCEK3JD7QYh1XvCMjx1c25gv9A1s3M2rVHhzEjvsHffzL 3riWyWg8xw5Th5ydRtfRdycEw1vYekVfUw2or2qnsYqlutiScGZwruQdgRxx20NWUb5D 6hgTZGJsihR9YYaoG/r7ba74FyhjiIf/DM+4Jzdw2MwKSwHkD2YkHhPIDP5XCm8+xjHW Ad/uLHVZoCzqVBOjLA3RoXPR9MbTtCbC9Bo0aUmkq08FbDZ3CZPN058204tfetOxq31Z 0rwJu+52LONv0Rdww5td4FzZOO9IYi/KGucU0h10GxO25bNtXdLS5gjde5ivcZxLc2ke 50CQ== 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=J8udFRfvbZ6fXOojTQ4C0YPBDnze74Ovvj+f7jr19Fw=; b=ozrmCS+NpKLiTuSzYbh2n5GzqZ8PG8duw2NdDY+qCQZawoxFxAiZhEYfJpvEXPMpK/ PzIgBF/nL1JwqpMGO7IjMiEmMCL7d6GlE0Bvkc1nouok42GKo2KGMiiQccKEI8PU5HBf KJlw7Ccghf4kUptFAPubn8+zrGl9L3FoB8mUMCJlei0kMsrD8vfED6hTukq7t7F6zJXt Axyp+6JSQ5cthBp43e55CwOrnyPMctBu3QjJ3Vq6E9BYcmPv/itOV3oAKu9iKa1mbB8e 4Qsd+BvqsG+RBqkPdd7dYOQT3CciUNvUsAuFvIQbSAGiEwoLUCqrnPxIl+L3NLH6pPk8 SNPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=wU1WwXoE; 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 61si3717983plr.51.2019.05.30.11.21.40; Thu, 30 May 2019 11:21:40 -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=wU1WwXoE; 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 S1726963AbfE3SVj (ORCPT + 30 others); Thu, 30 May 2019 14:21:39 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:37163 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726674AbfE3SUy (ORCPT ); Thu, 30 May 2019 14:20:54 -0400 Received: by mail-lf1-f65.google.com with SMTP id m15so5783537lfh.4 for ; Thu, 30 May 2019 11:20:53 -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=J8udFRfvbZ6fXOojTQ4C0YPBDnze74Ovvj+f7jr19Fw=; b=wU1WwXoEjKxZ3uqM80S4B/iacjxdOKTanw/C0MhErCrltoOGbqOgl6D3+r1s/I5MDs 43CeGw6Y6RckooIj+upDJFUOq/x8S44sRl4IecU2CAs9bIntSdh8qHidWHvG+s5sZZwr tMo1h8S1ts9QZr8NNUvE3T9naG3R4FHAPT23kfi5+VV7aUci43qWu5ZZWJKAHQleHoEy /ajuUGqlAVxb3HPheATiiuEdAXwo7PokCTbdy4XNP9sZTvD5RheyUk1vZwg8Azp9xD2i pnBXFBTfRa7tQ02r91dRnH9CWokN/c7+ti7EZKQlpvZEfndG6pFqlRF4421kR1+T9DU1 CSjw== 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=J8udFRfvbZ6fXOojTQ4C0YPBDnze74Ovvj+f7jr19Fw=; b=LD3801oK8dwNL55At8p3UNM5Ih45hHkrgTUkvTHssE2RNEfwEfnfLyziWliTPuQtle ciPDdWyC1jhxnGGnte0Cr/8L3qT3JXrED60jKGOlpBGF6wgFPMeHA5x0hyxWNrOwJJDh AAY4H8aDyUHEqSozCYqkiZwdUwV/ZLWvpu7ssmjy+AynniAQzFdeH68ZV+6IdcPmxtEf Ntc6w4j70VwQP+IHBlm1pXR/YEiqfOJEYs+HXD0KFMW9lt0xSnPLibBTql5Icx5wPzAQ ONwftsK+9d4V3iTGGYA53IZ9dsDkvTFN7kgu4D1yAWiBqOi13xizOZTgh3B+pSdXgxoJ Zv0w== X-Gm-Message-State: APjAAAXoL/7PWSfA/ITejNTvkbVMD5xbYcNRg7k7Ij/pA52OXtSmaLZV J4TMzK8xcXxil473m2Fls70pbg== X-Received: by 2002:ac2:494f:: with SMTP id o15mr2908131lfi.22.1559240452479; Thu, 30 May 2019 11:20:52 -0700 (PDT) Received: from localhost.localdomain (59-201-94-178.pool.ukrtel.net. [178.94.201.59]) by smtp.gmail.com with ESMTPSA id v7sm388946lfe.11.2019.05.30.11.20.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 May 2019 11:20:51 -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 v2 net-next 2/7] net: page_pool: add helper function to unmap dma addresses Date: Thu, 30 May 2019 21:20:34 +0300 Message-Id: <20190530182039.4945-3-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190530182039.4945-1-ivan.khoronzhuk@linaro.org> References: <20190530182039.4945-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 unmap 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 | 1 + net/core/page_pool.c | 7 +++++++ 2 files changed, 8 insertions(+) -- 2.17.1 diff --git a/include/net/page_pool.h b/include/net/page_pool.h index b885d86cb7a1..ad218cef88c5 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -110,6 +110,7 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool) struct page_pool *page_pool_create(const struct page_pool_params *params); void page_pool_destroy(struct page_pool *pool); +void page_pool_unmap_page(struct page_pool *pool, struct page *page); /* Never call this directly, use helpers below */ void __page_pool_put_page(struct page_pool *pool, diff --git a/net/core/page_pool.c b/net/core/page_pool.c index 5b2252c6d49b..205af7bd6d09 100644 --- a/net/core/page_pool.c +++ b/net/core/page_pool.c @@ -190,6 +190,13 @@ static void __page_pool_clean_page(struct page_pool *pool, page->dma_addr = 0; } +/* unmap the page and clean our state */ +void page_pool_unmap_page(struct page_pool *pool, struct page *page) +{ + __page_pool_clean_page(pool, page); +} +EXPORT_SYMBOL(page_pool_unmap_page); + /* Return a page to the page allocator, cleaning up our state */ static void __page_pool_return_page(struct page_pool *pool, struct page *page) {