From patchwork Wed Mar 1 19:49:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vernet X-Patchwork-Id: 63051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3835868wrd; Wed, 1 Mar 2023 11:55:59 -0800 (PST) X-Google-Smtp-Source: AK7set/AZ0ygD5dv2lH60Pn4scn3ycuIkM5XBNSrZS6vpRhhl6pnjDCCnPpERZuwV3y7mGut0QMh X-Received: by 2002:a17:907:38e:b0:88d:3c85:4ccf with SMTP id ss14-20020a170907038e00b0088d3c854ccfmr6699123ejb.25.1677700559215; Wed, 01 Mar 2023 11:55:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677700559; cv=none; d=google.com; s=arc-20160816; b=AVqYsU94jzQ7ejQb+wIaVaWQSpigF56kPrLR7Vc470eWBAIq66pRZMGQ2LUzpQzxRL Zdb4Gu1sOl6es/zSlKp2jsMdvcu4uV6nouLRDK8xVU3tHT61cHTush+G5IklPICH91QH E6pbrYIoLIuFnwB9j/qEWH3H5jNBNZe3b+O7gh6CevJu459nP+nEeHlQK2ouKXXIbFfZ 9NpPZ6TVdTyecPn0zh+5EQTtLmfDqHPTsg/Uw70HAZsn6MJ1dEpvc7toDA9R3gFTYhRM pnm5RPRFHW6MAq7P0zexuLdQ4sNltvd9UdZbaNZy7iqhVpBY+EeWk5M16/Dr79sjlJTN NljQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=SaoAu/dWkCaSTMzj2ZM4Jr76OIYgF7YKtHGbfgwEZcY=; b=L9z3UGri6i2voYlSyWWo8xh/fz0ZPg2Z6eLurIu4HYIY1ubTdScrHquj4niqeh53vs 9HpSJX0sYzgKXUvmyKZpvQ/aK4pH18vDoE9L7VlBuLxlxTRjFulhdcw/lydQrwNXXD1T fz+j596Ee53kfZ6mnF3goYVLMbRpjFi9bkdgNuLz6OV2TgSeRd5QsiDY6QbwXyOPpVOi MTBVii2ygJRh6RcSTrI3y6jnRMPS++jkPE+pB0EOcykE2VeVSzXTwsjjv+tkR460pVDT na5u4yJUQoPazFXF8kzOIQ2r+qHoQOmHbS+knRXM+y63BDab9+0sG1npfnZsImtECQxT qTKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y4-20020a170906524400b008db0c586b50si1941521ejm.763.2023.03.01.11.55.35; Wed, 01 Mar 2023 11:55:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229637AbjCATtR (ORCPT + 99 others); Wed, 1 Mar 2023 14:49:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51034 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229437AbjCATtP (ORCPT ); Wed, 1 Mar 2023 14:49:15 -0500 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 94A8455BE; Wed, 1 Mar 2023 11:49:14 -0800 (PST) Received: by mail-qt1-f179.google.com with SMTP id c19so15581495qtn.13; Wed, 01 Mar 2023 11:49:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677700153; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SaoAu/dWkCaSTMzj2ZM4Jr76OIYgF7YKtHGbfgwEZcY=; b=PcuSxeoOuvcOKqPmSoPaUC8BLOHWeHtfTThR6hjDYjdOEJAxKT4pLXRmJk8ZIpIc4j PRSMysv5kMkG4LfvGf33QKKRXabJUf7lVAx9V4oi7x0++mzYvncHbPvjZ+aKwlocFFu4 L8bXDS+CEd2WcnvL6WWZQQKamloRsNXMKB2lotX+/a0B6ywSbK/6TVdJ6sAXdswjM1BF uh3gYyoifApPzmYok/bEA0G/Ih1GkRZjPG6xCR8ZEM85PNYXRPtLaxUr2f0ZuUklwnKx 5zmFqbAPiQruo0Co0yy1o2jrUMCoUsmUan3actEAdIBBQleOu5jJiG1fteXqAValliUM JCPA== X-Gm-Message-State: AO0yUKWtwJ0jB9zZrqoUrYKlSroJ2EU85nluidetBghcdVB43IM1EZU0 BH2cOCdm4o6GLrRGGhz0moz06dNUjqYIiB/f X-Received: by 2002:ac8:570d:0:b0:3bf:e364:1d19 with SMTP id 13-20020ac8570d000000b003bfe3641d19mr13175262qtw.54.1677700153237; Wed, 01 Mar 2023 11:49:13 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:9336]) by smtp.gmail.com with ESMTPSA id y141-20020a376493000000b00706c1f7a608sm9473326qkb.89.2023.03.01.11.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 11:49:12 -0800 (PST) From: David Vernet To: bpf@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@meta.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next 1/2] bpf: Fix doxygen comments for dynptr slice kfuncs Date: Wed, 1 Mar 2023 13:49:09 -0600 Message-Id: <20230301194910.602738-1-void@manifault.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759196541329696524?= X-GMAIL-MSGID: =?utf-8?q?1759196541329696524?= In commit 66e3a13e7c2c ("bpf: Add bpf_dynptr_slice and bpf_dynptr_slice_rdwr"), the bpf_dynptr_slice() and bpf_dynptr_slice_rdwr() kfuncs were added to BPF. These kfuncs included doxygen headers, but unfortunately those headers are not properly formatted according to [0], and causes the following warnings during the docs build: ./kernel/bpf/helpers.c:2225: warning: \ Excess function parameter 'returns' description in 'bpf_dynptr_slice' ./kernel/bpf/helpers.c:2303: warning: \ Excess function parameter 'returns' description in 'bpf_dynptr_slice_rdwr' ... This patch fixes those doxygen comments. [0]: https://docs.kernel.org/doc-guide/kernel-doc.html#function-documentation Fixes: 66e3a13e7c2c ("bpf: Add bpf_dynptr_slice and bpf_dynptr_slice_rdwr") Signed-off-by: David Vernet --- kernel/bpf/helpers.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c index 648b29e78b84..58431a92bb65 100644 --- a/kernel/bpf/helpers.c +++ b/kernel/bpf/helpers.c @@ -2194,7 +2194,12 @@ __bpf_kfunc struct task_struct *bpf_task_from_pid(s32 pid) } /** - * bpf_dynptr_slice - Obtain a read-only pointer to the dynptr data. + * bpf_dynptr_slice() - Obtain a read-only pointer to the dynptr data. + * @ptr: The dynptr whose data slice to retrieve + * @offset: Offset into the dynptr + * @buffer: User-provided buffer to copy contents into + * @buffer__szk: Size (in bytes) of the buffer. This is the length of the + * requested slice. This must be a constant. * * For non-skb and non-xdp type dynptrs, there is no difference between * bpf_dynptr_slice and bpf_dynptr_data. @@ -2209,13 +2214,7 @@ __bpf_kfunc struct task_struct *bpf_task_from_pid(s32 pid) * bpf_dynptr_slice will not invalidate any ctx->data/data_end pointers in * the bpf program. * - * @ptr: The dynptr whose data slice to retrieve - * @offset: Offset into the dynptr - * @buffer: User-provided buffer to copy contents into - * @buffer__szk: Size (in bytes) of the buffer. This is the length of the - * requested slice. This must be a constant. - * - * @returns: NULL if the call failed (eg invalid dynptr), pointer to a read-only + * Return: NULL if the call failed (eg invalid dynptr), pointer to a read-only * data slice (can be either direct pointer to the data or a pointer to the user * provided buffer, with its contents containing the data, if unable to obtain * direct pointer) @@ -2258,7 +2257,12 @@ __bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr_kern *ptr, u32 offset } /** - * bpf_dynptr_slice_rdwr - Obtain a writable pointer to the dynptr data. + * bpf_dynptr_slice_rdwr() - Obtain a writable pointer to the dynptr data. + * @ptr: The dynptr whose data slice to retrieve + * @offset: Offset into the dynptr + * @buffer: User-provided buffer to copy contents into + * @buffer__szk: Size (in bytes) of the buffer. This is the length of the + * requested slice. This must be a constant. * * For non-skb and non-xdp type dynptrs, there is no difference between * bpf_dynptr_slice and bpf_dynptr_data. @@ -2287,13 +2291,7 @@ __bpf_kfunc void *bpf_dynptr_slice(const struct bpf_dynptr_kern *ptr, u32 offset * bpf_dynptr_slice_rdwr will not invalidate any ctx->data/data_end pointers in * the bpf program. * - * @ptr: The dynptr whose data slice to retrieve - * @offset: Offset into the dynptr - * @buffer: User-provided buffer to copy contents into - * @buffer__szk: Size (in bytes) of the buffer. This is the length of the - * requested slice. This must be a constant. - * - * @returns: NULL if the call failed (eg invalid dynptr), pointer to a + * Return: NULL if the call failed (eg invalid dynptr), pointer to a * data slice (can be either direct pointer to the data or a pointer to the user * provided buffer, with its contents containing the data, if unable to obtain * direct pointer) From patchwork Wed Mar 1 19:49:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Vernet X-Patchwork-Id: 63050 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp3835343wrd; Wed, 1 Mar 2023 11:54:59 -0800 (PST) X-Google-Smtp-Source: AK7set+BCuH67nKhqHXpsTU/JG19cSYc2nYK8Ys+ZZnAYm1+aycOP4scRryHLdHfEtcLnBAdS+SR X-Received: by 2002:aa7:d286:0:b0:4af:7dff:7b8d with SMTP id w6-20020aa7d286000000b004af7dff7b8dmr8580326edq.17.1677700499210; Wed, 01 Mar 2023 11:54:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677700499; cv=none; d=google.com; s=arc-20160816; b=ZrbOd/gXDlAsE0ZgdE+f0XnlHR/iXK2cnu0Kvjjdjd/AevW61RuTqBqjE+rwKSc8Ny kzkhfCNitX5znk0b5K+wYf5R8YugN88xj4TVCG/JK1Mp2P3LvtHkH1dgS+NmsVywn0H0 FEPgnQUxTFpRaMOcQQP8f06yEaqvk00eEgQLoTpC7QbRVR30PsFbv3YxJOVEPKdcSMAt 2J3TK/erZnlyEmMG94JMtXyayrwfADhekbio6iwrv0Mg+1eVVyyP1c2i89VT7e0robcB IlqNkrY/WIUqAzL9DhwtTzgfCTWG2M0mNZ3D7bTfRiIHA6208pXiyvOWgPq5Wdzfbpik 6uNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=NgYDcpBcQyFTWp2ft2xfRcUxCWQprJgnX4NvGVtcxlY=; b=mhOs6UwUGQwg5oiYMjYiq4NH+YFzcrf+tNaohA09iqZ8L5DIAE8JAeX4pQgOmIrfrN jskPMUc4oFP9Xqs3dpon5PQHrXQCXbJYnpPZc3Uynuc6B8lyUMSHmMpsxP+WgyvgOUV2 ROi6VmmASPy1PZYl0Qjf1vHANEr8RYVHTkdnfAfBtCKaOsqf0mZQLsa0C9wGQdFaSQBO +XqyWzPei3nHXqOCJviHwZ7UwisxpBYOdlOjLopSFiZVzrLYFla4h7Ykl4QvFhmm8Iu7 G3+fIkVS1LW7LobCt3ir9NiESYtj7U2yLRWGPgeWCSMuZ/ifT4XXksEYQy8B6ggHPfDc y7Qg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n22-20020aa7c696000000b004acbe83b837si463388edq.213.2023.03.01.11.54.36; Wed, 01 Mar 2023 11:54:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229711AbjCATtT (ORCPT + 99 others); Wed, 1 Mar 2023 14:49:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbjCATtQ (ORCPT ); Wed, 1 Mar 2023 14:49:16 -0500 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DA1BBA27A; Wed, 1 Mar 2023 11:49:15 -0800 (PST) Received: by mail-qt1-f178.google.com with SMTP id h19so15629574qtk.7; Wed, 01 Mar 2023 11:49:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677700154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NgYDcpBcQyFTWp2ft2xfRcUxCWQprJgnX4NvGVtcxlY=; b=e/Ozj1fiwpPtwhwKMMRKJgFluMPEAoZfVvMUfYKefLMFJITDBzwqrM2hLpHGIUdW3Q CKnVOB0s4ULWsSeAOPryHSM8qR/irc/WysewwBXWvPj9UZDDl73W4AGV8M3d/yLV2DYC n39bvtyHxIHdqo/BVLEFXa5HOy+dVGcyzndFTu4p8x6fQYomXjIZfHf1xS4DAQfGaNul xQ4Yd3Ki5rot9NhlJRrHx4qVHkaVb11yr7JRYCBBtwEIHta9FNdV0yPdMgGqLFmq8+z9 EYWlXfKDBeLOIT8akfhJImGsDzI8wevZ02gwRsXAXTElqV+aaSMJUuxntfZaJ2cmprz/ TywQ== X-Gm-Message-State: AO0yUKXQP/706DWUliQxwJCU3yAC99vsIgx34vj7M01WABqUKfDCxIGW 1STx6ECqcdVAQtF3XMydNPStPH4WETIZC+Ma X-Received: by 2002:a05:622a:1d4:b0:3b9:b5c5:ebb1 with SMTP id t20-20020a05622a01d400b003b9b5c5ebb1mr13474164qtw.9.1677700154635; Wed, 01 Mar 2023 11:49:14 -0800 (PST) Received: from localhost ([2620:10d:c091:480::1:9336]) by smtp.gmail.com with ESMTPSA id l22-20020ac84596000000b003b9e1d3a502sm8990002qtn.54.2023.03.01.11.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Mar 2023 11:49:14 -0800 (PST) From: David Vernet To: bpf@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@meta.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH bpf-next 2/2] bpf, docs: Fix __uninit kfunc doc section Date: Wed, 1 Mar 2023 13:49:10 -0600 Message-Id: <20230301194910.602738-2-void@manifault.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230301194910.602738-1-void@manifault.com> References: <20230301194910.602738-1-void@manifault.com> MIME-Version: 1.0 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759196478527526769?= X-GMAIL-MSGID: =?utf-8?q?1759196478527526769?= In commit d96d937d7c5c ("bpf: Add __uninit kfunc annotation"), the __uninit kfunc annotation was documented in kfuncs.rst. You have to fully underline a section in rst, or the build will issue a warning that the title underline is too short: ./Documentation/bpf/kfuncs.rst:104: WARNING: Title underline too short. 2.2.2 __uninit Annotation -------------------- This patch fixes that title underline. Fixes: d96d937d7c5c ("bpf: Add __uninit kfunc annotation") Signed-off-by: David Vernet --- Documentation/bpf/kfuncs.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/bpf/kfuncs.rst b/Documentation/bpf/kfuncs.rst index 9a78533d25ac..9d85bbc3b771 100644 --- a/Documentation/bpf/kfuncs.rst +++ b/Documentation/bpf/kfuncs.rst @@ -101,7 +101,7 @@ size parameter, and the value of the constant matters for program safety, __k suffix should be used. 2.2.2 __uninit Annotation --------------------- +------------------------- This annotation is used to indicate that the argument will be treated as uninitialized.