From patchwork Fri Jun 28 10:39:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 168059 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp3521683ilk; Fri, 28 Jun 2019 03:39:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHLahPpFhPwrdg/2FUL5XsW3mbqaRsiUfDBocURW10DKSXcPA4a/11SAb+ve9ivZt/qYim X-Received: by 2002:a17:902:6848:: with SMTP id f8mr10718557pln.102.1561718386599; Fri, 28 Jun 2019 03:39:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561718386; cv=none; d=google.com; s=arc-20160816; b=yrPaG0JTqHJt0grDXsVv8a5Gngcnpzhsw7BfCMew5sCS3hhDwoNiLVLuCMLh2BBP3y Z1js6OpWiYNMqyOSG2p5in/LN6lBZXQxJCZze5GYPXfd6pEdWp5FF5tGyBEG3h3etEcq b/73QZDBMKN11sm7Uo/wFkwzllZVvwAHorFcV0ZpzfVfbwt+91S7aqlbjHfhpGKxjPbE 49H37VEFshS9izpcKuUFB6XjhIgcup1i9e58yBXccLkOt73AYbFL1YjzBq703RpAHus5 unBedHZTsiU0W5bn6JxOgzoqwIQoYEn5kGurWDKetPR7PaVdAQgXBz0OxIZzMrb/eI8C LJ6A== 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=Z2LIGKls7zdQKVPI0zcAfuwyrWIatXu4izZ3CIRS768=; b=l3Bu+0AhiBML3BHFK05XZuziYDHbMowyFyc5OEWSqF7b5Jzj6UQL80SjTirsaiQVU/ x9PGMbR0BH9T/USirg5PT+YFGfCOoMFl3bBotXA8IWdEyrLTr09ZKWudYJU14hs8g3IL 4qK8FRi9J9PAu8agV+asMpGlbp9CBnG++ewNb4Zdn81HjN4imQJAC1cD9LomI3FgBzvv qVd0kQ+JEwllmOT7NW8Lsk9EljNXHRvmWKYeuA0qJmILq0MHJmCwEbI6SwFsHhhCSnVB yEm0seadogjIUVqRWUSoMiIQS4xhxIUUgN9Wa2i4Q0Lw3T2uijYwVQuqSNN88LMXjbIR LIBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ThtdY1gM; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 s12si1938723pfm.113.2019.06.28.03.39.46; Fri, 28 Jun 2019 03:39:46 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of netdev-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=ThtdY1gM; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 S1726833AbfF1Kjp (ORCPT + 9 others); Fri, 28 Jun 2019 06:39:45 -0400 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54810 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726524AbfF1Kjn (ORCPT ); Fri, 28 Jun 2019 06:39:43 -0400 Received: by mail-wm1-f66.google.com with SMTP id g135so8608907wme.4 for ; Fri, 28 Jun 2019 03:39:42 -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=Z2LIGKls7zdQKVPI0zcAfuwyrWIatXu4izZ3CIRS768=; b=ThtdY1gMwIWKDilrAXPEQGalbzSd02mtPgySi4oQdsY/HA7cZZ1MBNrqy6R2qwBveU qSte4MffImE1J7k6TAtUfisiGZ2wsc+b909DlluOgBmjl7d/YFLhMZvS6vMZ/N3GuerU f2Vpt7NBrIx86p6AoQqMzqSh4sLKzBAiAdNNcYdG8kry0fT03dltvba3mZ08xr5B+she t8v9b8+EIuvdTd+v5sVkgFGWoEzqfNupG8eL+TsUNY/G79TOOczmxt3nPN1khe+ljRLE UjmuTgzLu7almDIeAhVX3wWUxKZPPaP7bucyVyTfWJS6HTzn5ks9XKY8Xc5gor4nri/U +F+A== 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=Z2LIGKls7zdQKVPI0zcAfuwyrWIatXu4izZ3CIRS768=; b=JrItgC7x5bHVTQtwqHr4Anv7QpwltmzVf3uK6r9MStnpUm2UHaXuDLgzkzD/R2fwk1 6uMAFGSCwJOiRWK6I/S763KOsj0jWaK1uQTebfEBl0zUPbY1OoeqtO8TbrgJ2aXKDUrh K6HARr8Jbb3/SWqp8gw1vrAkAkedF1q1jtHF3o9QMGJNE52uxjEx1PzLstPjOMt2Wuta xlhE4X3Xi7GZIwUVMAO3fI8mfyx/GCmjiF45TJ/dSzlnS7hBX57paDzYk6xpaguyJoon 2zks5kDmSigEuFZUZjBgyaWBm3pqENL41iwmZPhQS4OpSMXgDw2zYaTnCX7Dq2rEA2Kq ymwA== X-Gm-Message-State: APjAAAXFdThNYLaMHxF8lcpJAtdUR2nsmkj4Fh1+1EFJsxLhVNjXQZ23 VtkXY18dJxXZNmJAVMN5F+UvaJz4170= X-Received: by 2002:a1c:99ca:: with SMTP id b193mr6645469wme.31.1561718381500; Fri, 28 Jun 2019 03:39:41 -0700 (PDT) Received: from apalos.lan (athedsl-4461147.home.otenet.gr. [94.71.2.75]) by smtp.gmail.com with ESMTPSA id r5sm3397742wrg.10.2019.06.28.03.39.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Jun 2019 03:39:40 -0700 (PDT) From: Ilias Apalodimas To: netdev@vger.kernel.org, jaswinder.singh@linaro.org Cc: ard.biesheuvel@linaro.org, bjorn.topel@intel.com, magnus.karlsson@intel.com, brouer@redhat.com, daniel@iogearbox.net, ast@kernel.org, makita.toshiaki@lab.ntt.co.jp, jakub.kicinski@netronome.com, john.fastabend@gmail.com, davem@davemloft.net, maciejromanfijalkowski@gmail.com, Ilias Apalodimas Subject: [PATCH 2/3, net-next] net: page_pool: add helper function for retrieving dma direction Date: Fri, 28 Jun 2019 13:39:14 +0300 Message-Id: <1561718355-13919-3-git-send-email-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561718355-13919-1-git-send-email-ilias.apalodimas@linaro.org> References: <1561718355-13919-1-git-send-email-ilias.apalodimas@linaro.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Since the dma direction is stored in page pool params, offer an API helper for driver that choose not to keep track of it locally Signed-off-by: Ilias Apalodimas --- include/net/page_pool.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 Acked-by: Jesper Dangaard Brouer diff --git a/include/net/page_pool.h b/include/net/page_pool.h index f07c518ef8a5..ee9c871d2043 100644 --- a/include/net/page_pool.h +++ b/include/net/page_pool.h @@ -112,6 +112,15 @@ static inline struct page *page_pool_dev_alloc_pages(struct page_pool *pool) return page_pool_alloc_pages(pool, gfp); } +/* get the stored dma direction. A driver might decide to treat this locally and + * avoid the extra cache line from page_pool to determine the direction + */ +static +inline enum dma_data_direction page_pool_get_dma_dir(struct page_pool *pool) +{ + return pool->p.dma_dir; +} + struct page_pool *page_pool_create(const struct page_pool_params *params); void __page_pool_free(struct page_pool *pool);