From nobody Wed Nov 29 16:37:59 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4SgQ3r1D6Tz52wq0; Wed, 29 Nov 2023 16:38:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4SgQ3q6q9mz3Gx3; Wed, 29 Nov 2023 16:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xzyMYQjVVkgpNPxTxMFcAJS5Ucmg421P/pGZzNw7Kks=; b=LGY+0tBD1e9x+oJr6GF/xOa6xfzniXyzaE+x7rNIHA06z2KGcAXCie+RCJigDHDVBtWAGA NPQrevk/CMTY0t/wWw3xYZhWb/fQIqt8eD7TNeDx1R5Ih5+c9kc3SHl/doW5/mAUkjNlhr BoX0eFLd5ztIRw6Y9rXCrI8dXy/PYMC/6D8/uo09xxgYmQjO5d1/zPbu08H3HN8RQCbSvl Ts84eOpqsOnlinE1NJ8xAJFkDrXjLp1f0KZJyZoO8TqgCEETsBuU5f5Jz4k33F7epyRh8w 9GCjpSOKPYDBKSl610tTN4BDlmgPcMlQII4VV3FIA9oMTDzyat6Uqv7g2rs4HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275880; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=xzyMYQjVVkgpNPxTxMFcAJS5Ucmg421P/pGZzNw7Kks=; b=CBDjoO5lULwGX1Lxh55KVlGBay3WAIcffPQQoqGwkXw5mNutnEb0RibfO/LEgQrjpvhyM5 ACWJGlEO8U6tqHhl/eO8Xh822seSX86tvRkDB6nRsksgtCFGS52WqpJHVRBjnYlfHbjNuF b9SyFMXh4OO/slyG3GfE7utU5XJ3d9zN/mQRITtJyInSXTM2nI0ZMraX2y6/XiCsEhcTq6 sz684JSE/WKhnQMw3H2mTYtus1bveexOR6yVK/OupNDLq96g7O9/GTG4DAcN7OYjlwTHNV WifaI6inAdkHRFXv0GYb98BaJEi5Ze1TM8v5/r3yww1Ws0tNTa9xHSUqPr2oJw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701275880; a=rsa-sha256; cv=none; b=y2jS4WIj/JgVTThzX6vAERAN06PETVw+GnrhHEycFtJHSJ0ocpjuHSeTZ80gMVumvGPzA1 jqjFYftygH2CHQxwCnlcpq6BrBFH+zZFZL3xrPqfFSnD5BdCxuFyXmG8pmFVL/35n/ruwm m5grbDcZY4EXBGCcdLuXwBgjFMM/ksfkEVCe1p9vtfu/75mz1wTee4zzM7Smg33eKTIpkw 1Ez6DlUJ9RTFWs6OMZuZWKxdBrLssNf0edYUf7ChGwaqL2iERqM2BgARbPyHT6Mh4U4rJQ N/4XVTC/An9T1nWQM7pJ3PdfCEze/NKzOlTOomoc142NMgeCfasQ61iEGEuACQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4SgQ3q5stcz1C2D; Wed, 29 Nov 2023 16:37:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3ATGbxgE044686; Wed, 29 Nov 2023 16:37:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGbxTF044683; Wed, 29 Nov 2023 16:37:59 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:37:59 GMT Message-Id: <202311291637.3ATGbxTF044683@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4317faf44d43 - stable/13 - LinuxKPI: add page pool skeleton List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 4317faf44d434f514487c1c1c54b760971ed6f9c Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4317faf44d434f514487c1c1c54b760971ed6f9c commit 4317faf44d434f514487c1c1c54b760971ed6f9c Author: Bjoern A. Zeeb AuthorDate: 2023-05-23 23:15:57 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-29 16:36:04 +0000 LinuxKPI: add page pool skeleton Add the page pool skeleton based on a wireless driver. We have to sort out some struct page problems first before we can start implementing this but that should happen independent of all other changes. (cherry picked from commit 517e0978db1ff92d9f2b86fe735aba24bca72038) --- sys/compat/linuxkpi/common/include/net/page_pool.h | 119 +++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/net/page_pool.h b/sys/compat/linuxkpi/common/include/net/page_pool.h new file mode 100644 index 000000000000..4377ec1d53d4 --- /dev/null +++ b/sys/compat/linuxkpi/common/include/net/page_pool.h @@ -0,0 +1,119 @@ +/*- + * Copyright (c) 2023 Bjoern A. Zeeb + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUXKPI_NET_PAGE_POOL_H +#define _LINUXKPI_NET_PAGE_POOL_H + +#include /* pr_debug */ +#include +#include + +struct device; + +struct page_pool_params { + struct device *dev; + uint32_t flags; + uint32_t order; + uint32_t pool_size; + uint32_t max_len; + uint32_t offset; + int nid; /* NUMA */ + enum dma_data_direction dma_dir; +}; + +struct page_pool { +}; + +#define PP_FLAG_DMA_MAP BIT(0) +#define PP_FLAG_DMA_SYNC_DEV BIT(1) +#define PP_FLAG_PAGE_FRAG BIT(2) + +static inline struct page_pool * +page_pool_create(const struct page_pool_params *ppparams) +{ + + pr_debug("%s: TODO\n", __func__); + return (NULL); +} + +static inline void +page_pool_destroy(struct page_pool *ppool) +{ + + pr_debug("%s: TODO\n", __func__); +} + +static inline struct page * +page_pool_dev_alloc_frag(struct page_pool *ppool, uint32_t *offset, + size_t size) +{ + + pr_debug("%s: TODO\n", __func__); + return (NULL); +} + +static inline dma_addr_t +page_pool_get_dma_addr(struct page *page) +{ + + pr_debug("%s: TODO\n", __func__); + return (0); +} + +static inline enum dma_data_direction +page_pool_get_dma_dir(const struct page_pool *ppool) +{ + + pr_debug("%s: TODO\n", __func__); + return (DMA_BIDIRECTIONAL); +} + +static inline void +page_pool_put_full_page(struct page_pool *ppool, struct page *page, + bool allow_direct) +{ + + pr_debug("%s: TODO\n", __func__); +} + +static inline int +page_pool_ethtool_stats_get_count(void) +{ + + pr_debug("%s: TODO\n", __func__); + return (0); +} + +static inline uint8_t * +page_pool_ethtool_stats_get_strings(uint8_t *x) +{ + + pr_debug("%s: TODO\n", __func__); + return (x); +} + +#endif /* _LINUXKPI_NET_PAGE_POOL_H */