From patchwork Sat Jun 29 05:23:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilias Apalodimas X-Patchwork-Id: 168136 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp375789ilk; Fri, 28 Jun 2019 22:27:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7evoSfxs2BQfBJ2DkFnfFgTAIM4ZrGpm4sMbCgkuE8cNndqWXGy3cXcDiCSXeNV2uhR5d X-Received: by 2002:a17:90a:3344:: with SMTP id m62mr13322233pjb.135.1561786049017; Fri, 28 Jun 2019 22:27:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561786049; cv=none; d=google.com; s=arc-20160816; b=cXNjZa6kGfJPtOLH/GDrRk/5JF9Q0TngJwbLiTB/XSLkr+vb6dieAD8RbiS5T/iP3n DiQdxvPzry2x/qzce721znWjC3d1uOs/e6gQstUOWOtr2MoqIQ0MLkgFcT2TDuYlCnyH 4uY6VeN5xS3nL1erhizlnCf0kpLOZ6WNxmwW4UipmefKAhpHhJeSywuSG+5WfoCMv/Fe Yx4/MJSE5H0f5bzuBfouz48tRyfkvPlCoS/H173KavjgjDIWROPhHTx2PmiHf0LJANR6 boKImJ1vYSTHHC/p8lx9pz2sSL6JogRzaeSCWvxBmO3sYQTEBLi9WQmqm6MTrTFHVqMP uSog== 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=O425yuwbY1vP41J00+b+tBAP0Y03QYkt8HmN5cg10+Q=; b=CXcUXQPy/BLjxXpR1F9w7WrP6QtyHYtKORPrdkyg1j2SF87aOBPvVqqT0fJkIeq+do 8LebUAhFN/P5AdYKukWeGoay2sxEAw+gknA57oaTSby9o6NVZRdCaSHYk/Da2CTm5GMO ThahjnHQXfmZ58sW4oq+gUbivD9NGAw7RPFdtUzdi/UVgtx6imrzgR+o8zhUeveUpNs9 7naIEgr0opyOX5dVgrfaMLMcxiZATmjD29RGvQyRkXyztWq3x7n7XSjkdK/ynch/WxJi fxRw3qFfUIqJNX/64lq4zXesqPA+5Egcya2ziQrEgO7glDJMV9DFh+dYMZvsuauY75sk d4qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j6fYgNnP; 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 m62si3963716pgm.392.2019.06.28.22.27.28; Fri, 28 Jun 2019 22:27:29 -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=j6fYgNnP; 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 S1726817AbfF2FXh (ORCPT + 9 others); Sat, 29 Jun 2019 01:23:37 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55360 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726788AbfF2FXg (ORCPT ); Sat, 29 Jun 2019 01:23:36 -0400 Received: by mail-wm1-f68.google.com with SMTP id a15so10950512wmj.5 for ; Fri, 28 Jun 2019 22:23:34 -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=O425yuwbY1vP41J00+b+tBAP0Y03QYkt8HmN5cg10+Q=; b=j6fYgNnPOfDlxP8gfYq8K9Wtv3Eu0BkhDmSWoogh8QANnsuBIxgYGT0sk8tc7dt8JR uMqI4P6ajir7cSkOmUtWEcZtlIAWC4rOtR6dmb41TEKXP0WbHyDgiXYeMZgk0pHVdglb YmMXDVE9YkI9MoWwbU4jGyZ2nTVc2cZKj8CRHShv+e4npCU/2zPbNyLTBMStcDhirmKr OXfLOFyk71xfNIEzUPL3UAcyYr7jZdjrZTQvePtpxbZQuBW9vlXh2oXXkLTgxcaB4vjr 2LSX6rMAl+7QYVuodXtTn4KrEjTNiaWAEmy6OBxZ0iuGftpgU4gB6pPbiztSvjjqwyFo 3k7w== 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=O425yuwbY1vP41J00+b+tBAP0Y03QYkt8HmN5cg10+Q=; b=kIFWf2xAGZGopMajPpcXKXx08Z+xmMA02PXT7Qdvi2PFTUCiscAszm/INqOUmVmjG3 EgSOOz2CJCYrhNBc73JDa5wAcLnj0E+IQf0U9uIne3ck9EU7n75lZ9rdiPyIbo8MwxZ6 4B/YOqmvXKj01ZswlN0tbkctRbVc3Xqn3DXyYZ044JJRKuXT7Ru2Df6a9l8xvgEvt1hJ nLw2kE9J9DjVGsJUDbN2c2inYfBrbC33/FREedLpIwsmLdQwPr1JXoSyJiFsbp1oqBdn vfKnJHMBPELDMHs250E3R5bwBrNbRBdCGYsJDtshxUNlGrVWs8hMx9gShQvUlGHB/SAl VZNg== X-Gm-Message-State: APjAAAWygSysiPTCMs2FL6GhHmesTKMPfqV+2ZmDrW/WUu4VVAXoha4E tAvp7g+XNCcoJQPJ7UEfrcfF4zhJZ/g= X-Received: by 2002:a1c:7e14:: with SMTP id z20mr9158261wmc.83.1561785813852; Fri, 28 Jun 2019 22:23:33 -0700 (PDT) Received: from apalos.lan (athedsl-4461147.home.otenet.gr. [94.71.2.75]) by smtp.gmail.com with ESMTPSA id g131sm2768887wmf.37.2019.06.28.22.23.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 28 Jun 2019 22:23:33 -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: [net-next, PATCH 2/3, v2] net: page_pool: add helper function for retrieving dma direction Date: Sat, 29 Jun 2019 08:23:24 +0300 Message-Id: <1561785805-21647-3-git-send-email-ilias.apalodimas@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1561785805-21647-1-git-send-email-ilias.apalodimas@linaro.org> References: <1561785805-21647-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 Acked-by: Jesper Dangaard Brouer --- include/net/page_pool.h | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.20.1 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);