Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1089630ybi; Thu, 30 May 2019 11:23:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSwyfY2g95uEvqJEBBO6gwpIjVvf/+5AnUp6vWKovHPpEFfRkAo69G1ggLMgVi+yLcbyTY X-Received: by 2002:a17:90a:1b68:: with SMTP id q95mr5004537pjq.114.1559240615418; Thu, 30 May 2019 11:23:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559240615; cv=none; d=google.com; s=arc-20160816; b=D1iufWFQ76pEAEJeohy7K39kAawZ3OPqUpt2ANLjXQ8ntT9r8QQQdZP8/1nF+GJmCA 2Lz0S+RkujhmRz/5anh3tswwHSUYseE5waMjjmIj40Rka0izoipY5Q80e4KpkLiqrk1c oW52LI1H+A0dgxA4tiupNNmTiFNml4Ljf5mfRhQQQvqW0uiajpnEeyKFQjdCJPsTN6i6 7jG1Q4Ihu9W0yAT6iJCCtXS9x/Fun5yRYFrNLFfz7j8Ghy8Ogs2LXPjFDe19BAbk5Axo cwD7h/ZGJJaalz4OylIH8E7DchSZTDA2r4y/ZeUBK3dBJTdInSzNp1ChiY44AhEUX48F CCmg== 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 o6si3742564pgh.163.2019.05.30.11.23.19; Thu, 30 May 2019 11:23:35 -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 S1726959AbfE3SVj (ORCPT + 99 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(+) 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) { -- 2.17.1