From patchwork Fri Mar 31 08:56:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13195552 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA879C76196 for ; Fri, 31 Mar 2023 08:57:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231186AbjCaI5N (ORCPT ); Fri, 31 Mar 2023 04:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231167AbjCaI5M (ORCPT ); Fri, 31 Mar 2023 04:57:12 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D13910E7; Fri, 31 Mar 2023 01:57:11 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A4F57B82D6D; Fri, 31 Mar 2023 08:57:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AABB1C433D2; Fri, 31 Mar 2023 08:57:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680253028; bh=uIJIxQuv/Gb7pO/vxDBm4QwOZ3l/iJ1p1YbIJCIbmDc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=QvuosjGkRXQEJapQzDKELHQhqg4xBtleJI+nvc1ZXdDgaXnpARYUD+Xq1+c65WME/ HK7OkCdGWU2ngzb+kKP8ReGCeHocAx2jODrovtRAAjHkEwdsRxbdpMNEb1NnUdNP4P Rtqae8CdYhFsJ3gkSIvijmNH/MAgIkdqH2qkdWv15LK3dCCeQCYlx+TeWHGWDWBUzc uRf/iWQVZS+iVSt4O7roqOYXc6aXipTyw/FSHjClb1EPLjZ0mTMFtH/uz1eDToWh9r rn0BqrHAkFtxbNqrxIJtgm9GfRodWxQzoTI790GERsxYLCInPe8T0erTlc1xT8k7Lq uSGxOG7EndRcA== From: Simon Horman Date: Fri, 31 Mar 2023 10:56:55 +0200 Subject: [PATCH vhost 1/3] vdpa: address kdoc warnings MIME-Version: 1.0 Message-Id: <20230331-vhost-fixes-v1-1-1f046e735b9e@kernel.org> References: <20230331-vhost-fixes-v1-0-1f046e735b9e@kernel.org> In-Reply-To: <20230331-vhost-fixes-v1-0-1f046e735b9e@kernel.org> To: "Michael S. Tsirkin" , Jason Wang Cc: Eli Cohen , Si-Wei Liu , Xie Yongji , Parav Pandit , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch addresses the following minor kdoc problems. * Incorrect spelling of 'callback' and 'notification' * Unrecognised kdoc format for 'struct vdpa_map_file' * Missing documentation of 'get_vendor_vq_stats' member of 'struct vdpa_config_ops' * Missing documentation of 'max_supported_vqs' and 'supported_features' members of 'struct vdpa_mgmt_dev' Most of these problems were flagged by: $ ./scripts/kernel-doc -Werror -none include/linux/vdpa.h include/linux/vdpa.h:20: warning: expecting prototype for struct vdpa_calllback. Prototype was for struct vdpa_callback instead include/linux/vdpa.h:117: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * Corresponding file area for device memory mapping include/linux/vdpa.h:357: warning: Function parameter or member 'get_vendor_vq_stats' not described in 'vdpa_config_ops' include/linux/vdpa.h:518: warning: Function parameter or member 'supported_features' not described in 'vdpa_mgmt_dev' include/linux/vdpa.h:518: warning: Function parameter or member 'max_supported_vqs' not described in 'vdpa_mgmt_dev' The misspelling of 'notification' was flagged by: $ ./scripts/checkpatch.pl --codespell --showfile --strict -f include/linux/vdpa.h include/linux/vdpa.h:171: CHECK: 'notifcation' may be misspelled - perhaps 'notification'? ... Signed-off-by: Simon Horman Acked-by: Jason Wang --- include/linux/vdpa.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index 43f59ef10cc9..010321945997 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -10,7 +10,7 @@ #include /** - * struct vdpa_calllback - vDPA callback definition. + * struct vdpa_callback - vDPA callback definition. * @callback: interrupt callback function * @private: the data passed to the callback function */ @@ -114,7 +114,7 @@ struct vdpa_dev_set_config { }; /** - * Corresponding file area for device memory mapping + * struct vdpa_map_file - file area for device memory mapping * @file: vma->vm_file for the mapping * @offset: mapping offset in the vm_file */ @@ -165,10 +165,16 @@ struct vdpa_map_file { * @vdev: vdpa device * @idx: virtqueue index * @state: pointer to returned state (last_avail_idx) + * @get_vendor_vq_stats: Get the vendor statistics of a device. + * @vdev: vdpa device + * @idx: virtqueue index + * @msg: socket buffer holding stats message + * @extack: extack for reporting error messages + * Returns integer: success (0) or error (< 0) * @get_vq_notification: Get the notification area for a virtqueue (optional) * @vdev: vdpa device * @idx: virtqueue index - * Returns the notifcation area + * Returns the notification area * @get_vq_irq: Get the irq number of a virtqueue (optional, * but must implemented if require vq irq offloading) * @vdev: vdpa device @@ -506,6 +512,8 @@ struct vdpa_mgmtdev_ops { * @config_attr_mask: bit mask of attributes of type enum vdpa_attr that * management device support during dev_add callback * @list: list entry + * @supported_features: features supported by device + * @max_supported_vqs: maximum number of virtqueues supported by device */ struct vdpa_mgmt_dev { struct device *device; From patchwork Fri Mar 31 08:56:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13195554 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72DCBC77B6D for ; Fri, 31 Mar 2023 08:57:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231450AbjCaI5T (ORCPT ); Fri, 31 Mar 2023 04:57:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230003AbjCaI5O (ORCPT ); Fri, 31 Mar 2023 04:57:14 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8BCD10FA; Fri, 31 Mar 2023 01:57:12 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 91D5EB82D63; Fri, 31 Mar 2023 08:57:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6477C4339B; Fri, 31 Mar 2023 08:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680253030; bh=nfqhbMG0lxmbbjcxNP04AkwjjwaQZsVAQxrkkGDhnNY=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=k0XuSiOiAktREiH2nau3/FnqnJTuNgZeIabvaGankpNCYZwxbkfdhQ0/7qFVmbQ09 x5ZT9GEtyYfuNNu0bpzh48ZesmBsE33e/2bAoE3XTJNgCMN0OYhATafkAaBb1U4U2G leoF9TZkIYlJxywgZqpekpOtywA440DUD3JI1agl6w42aSFSbI0XZ6DVbwq2FqKJQG h+4GQE1Wk2CvpBbdEqofsEnLekV2wJyIFNdpV6y4YnPZC9yac8G+u0aIt/+z8EWB4d H0rt3RPYdFmH9JwTThUYXaRXu4aNfNtefYGcVCoQuOJsBzUAMuoDyq6qO/J7I/VP6T KKaz3ydTSiHwg== From: Simon Horman Date: Fri, 31 Mar 2023 10:56:56 +0200 Subject: [PATCH vhost 2/3] vringh: address kdoc warnings MIME-Version: 1.0 Message-Id: <20230331-vhost-fixes-v1-2-1f046e735b9e@kernel.org> References: <20230331-vhost-fixes-v1-0-1f046e735b9e@kernel.org> In-Reply-To: <20230331-vhost-fixes-v1-0-1f046e735b9e@kernel.org> To: "Michael S. Tsirkin" , Jason Wang Cc: Eli Cohen , Si-Wei Liu , Xie Yongji , Parav Pandit , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Address some minor kdoc warnings in vring.h. * Place kdoc for 'struct vringh_config_ops' immediately before the structure * Add missing documentation of members of 'vringh_iov' and 'vringh_kiov' Warnings flagged by: $ ./scripts/kernel-doc -none include/linux/vringh.h include/linux/vringh.h:68: error: Cannot parse struct or union! include/linux/vringh.h:92: warning: Function parameter or member 'iov' not described in 'vringh_iov' include/linux/vringh.h:92: warning: Function parameter or member 'consumed' not described in 'vringh_iov' include/linux/vringh.h:92: warning: Function parameter or member 'i' not described in 'vringh_iov' include/linux/vringh.h:92: warning: Function parameter or member 'used' not described in 'vringh_iov' include/linux/vringh.h:92: warning: Function parameter or member 'max_num' not described in 'vringh_iov' include/linux/vringh.h:104: warning: Function parameter or member 'iov' not described in 'vringh_kiov' include/linux/vringh.h:104: warning: Function parameter or member 'consumed' not described in 'vringh_kiov' include/linux/vringh.h:104: warning: Function parameter or member 'i' not described in 'vringh_kiov' include/linux/vringh.h:104: warning: Function parameter or member 'used' not described in 'vringh_kiov' include/linux/vringh.h:104: warning: Function parameter or member 'max_num' not described in 'vringh_kiov' Signed-off-by: Simon Horman --- include/linux/vringh.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/linux/vringh.h b/include/linux/vringh.h index 1991a02c6431..9f3e7012a255 100644 --- a/include/linux/vringh.h +++ b/include/linux/vringh.h @@ -54,6 +54,9 @@ struct vringh { void (*notify)(struct vringh *); }; +struct virtio_device; +typedef void vrh_callback_t(struct virtio_device *, struct vringh *); + /** * struct vringh_config_ops - ops for creating a host vring from a virtio driver * @find_vrhs: find the host vrings and instantiate them @@ -65,8 +68,6 @@ struct vringh { * Returns 0 on success or error status * @del_vrhs: free the host vrings found by find_vrhs(). */ -struct virtio_device; -typedef void vrh_callback_t(struct virtio_device *, struct vringh *); struct vringh_config_ops { int (*find_vrhs)(struct virtio_device *vdev, unsigned nhvrs, struct vringh *vrhs[], vrh_callback_t *callbacks[]); @@ -81,6 +82,12 @@ struct vringh_range { /** * struct vringh_iov - iovec mangler. + * @iov: array of iovecs to operate on + * @consumed: number of bytes consumed within iov[i] + * @i: index of current iovec + * @used: number of iovecs present in @iov + * @max_num: maximum number of iovecs. + * corresponds to allocated memory of @iov * * Mangles iovec in place, and restores it. * Remaining data is iov + i, of used - i elements. @@ -93,6 +100,12 @@ struct vringh_iov { /** * struct vringh_kiov - kvec mangler. + * @iov: array of iovecs to operate on + * @consumed: number of bytes consumed within iov[i] + * @i: index of current iovec + * @used: number of iovecs present in @iov + * @max_num: maximum number of iovecs. + * corresponds to allocated memory of @iov * * Mangles kvec in place, and restores it. * Remaining data is iov + i, of used - i elements. From patchwork Fri Mar 31 08:56:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13195553 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7CA84C76196 for ; Fri, 31 Mar 2023 08:57:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231326AbjCaI5Q (ORCPT ); Fri, 31 Mar 2023 04:57:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230082AbjCaI5O (ORCPT ); Fri, 31 Mar 2023 04:57:14 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 629318A5E; Fri, 31 Mar 2023 01:57:13 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id F1012625B4; Fri, 31 Mar 2023 08:57:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF612C433D2; Fri, 31 Mar 2023 08:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680253032; bh=HhmtS11lifJh0p+DxBrhsUr+GJEThbU7xivKAEBKBvg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=BJrJ1NIrp4FCUZh2GsNJwgyd6vGiR91fyJlzgaWsDECOTs1ayW+nzbYmZ4BpLGJgu NXs4OjHAEewh/T5XB+HAkIPIefDmVo8f/tHcbY9mgIG9jVgsal3JemId+TXk0LJXz0 qidf3Xd8SKSlD7NRatlGUf+b3lfmUqaboEbEz4KlW8JkAsg2/WG1PQPSF3lkXzhHVn LWW8UuXMrY/dYBx29yRZuj9T7rRKsA0VzPrZo2GwYYQfcbNNuP7SCHtI7s/0bmkjGx nEaDe7XtwEHef5maTH/RSGl7Tu5IqmyJ3cGB1nF1BRaOFJZ2EDI1WgE7o7ePGfqNvv 56EV1c62UClxA== From: Simon Horman Date: Fri, 31 Mar 2023 10:56:57 +0200 Subject: [PATCH vhost 3/3] MAINTAINERS: add vringh.h to Virtio Core and Net Drivers MIME-Version: 1.0 Message-Id: <20230331-vhost-fixes-v1-3-1f046e735b9e@kernel.org> References: <20230331-vhost-fixes-v1-0-1f046e735b9e@kernel.org> In-Reply-To: <20230331-vhost-fixes-v1-0-1f046e735b9e@kernel.org> To: "Michael S. Tsirkin" , Jason Wang Cc: Eli Cohen , Si-Wei Liu , Xie Yongji , Parav Pandit , kvm@vger.kernel.org, virtualization@lists.linux-foundation.org, netdev@vger.kernel.org X-Mailer: b4 0.12.2 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org vringh.h doesn't seem to belong to any section in MAINTAINERS. Add it to Virtio Core and Net Drivers, which seems to be the most appropriate section to me. Signed-off-by: Simon Horman Acked-by: Jason Wang --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 91201c2b8190..7cf548302c56 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22095,6 +22095,7 @@ F: drivers/vdpa/ F: drivers/virtio/ F: include/linux/vdpa.h F: include/linux/virtio*.h +F: include/linux/vringh.h F: include/uapi/linux/virtio_*.h F: tools/virtio/