Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp445111pxb; Wed, 22 Sep 2021 05:50:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwx2QCkKmZH6Ohr/5xVzw0aLL0T5iHrwZ/Oshw5iBSEP2NbpKGLtJtXDIVXp9xGgMuV/YxL X-Received: by 2002:a50:9dcf:: with SMTP id l15mr29399943edk.128.1632315059539; Wed, 22 Sep 2021 05:50:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632315059; cv=none; d=google.com; s=arc-20160816; b=1FKrznL0zHHcU1GGm3n37/2P/GQ+vcAGrNKpIvnjiekBI2YyJg1HqBb30gHKmnCYDy Qrep8VieYfx2niflVNUkdOJ1iJrMToQwMhQbIkwIidP8t47nvMUJ5UzOkTx/UtqjNXgW 6NnE8W227noWqbrjdzw2ldQLnn8KQ3Sz2RmYH2xf3BooqLre2izDFCStDgPCkX80DASv 9aZm3g+XlS8Tvw+dZcmAHbqvYjs0pWZ/MBJTVifA8NRFvOr0LpQDs+H7Zm/DlR07GCBu woLhGvDnVd5MBF7SwlDF3xTHhNpSGPonxyAfzFtyzBPd5KvPx+h4yBmSQckFmRDcVxWr FBXw== 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=Wryc5/dJgBqaLkcrhFwGrnHbVAtRpWJZAq/hISH9UlI=; b=EY2/yktR/NJJ/AT3RpCJ6NY4E8OYe81Iup1qKJKXQS4w+ia+BOjI5GypNeC0w6Bj1f wlg0YjwitmBwa6dEsqnENXVI4c7lu4aXGIP3ILwhglBxVo9BlZEuejrmAaOrT/0uz0MY MhY7MZrnyVIgplLcCvKw+EpM+kUb9xfcagkRQqgrEUfO1PFlXATcnAxAm7ccsavg6XNC hsx1FdicLqNQ5eJqLJQFcVsuBD4m8C5K4Dr0XxXw9R6Z9nGR4rhmJIW1Dki9Nf6Q4hbT 4sYamyRR7Dgy+dlM2WEzEhLEKXV6IiUuu/x0auNkKay35bwXdTr+VXPgceUB70jbzveQ eHUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j24si2618338ejo.673.2021.09.22.05.50.35; Wed, 22 Sep 2021 05:50:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236055AbhIVMsV (ORCPT + 99 others); Wed, 22 Sep 2021 08:48:21 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:36449 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236035AbhIVMsS (ORCPT ); Wed, 22 Sep 2021 08:48:18 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=wuzongyong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0UpEJoj9_1632314798; Received: from localhost.localdomain(mailfrom:wuzongyong@linux.alibaba.com fp:SMTPD_---0UpEJoj9_1632314798) by smtp.aliyun-inc.com(127.0.0.1); Wed, 22 Sep 2021 20:46:47 +0800 From: Wu Zongyong To: wuzongyong@linux.alibaba.com, jasowang@redhat.com, virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, mst@redhat.com Cc: wei.yang1@linux.alibaba.com Subject: [PATCH v3 4/7] vdpa: add new callback get_vq_num_min in vdpa_config_ops Date: Wed, 22 Sep 2021 20:46:27 +0800 Message-Id: <451ce3c272ebd5d532db1ed19c2ab53c4609f7ad.1632313398.git.wuzongyong@linux.alibaba.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This callback is optional. For vdpa devices that not support to change virtqueue size, get_vq_num_min and get_vq_num_max will return the same value, so that users can choose a correct value for that device. Suggested-by: Jason Wang Signed-off-by: Wu Zongyong --- include/linux/vdpa.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/vdpa.h b/include/linux/vdpa.h index a896ee021e5f..30864848950b 100644 --- a/include/linux/vdpa.h +++ b/include/linux/vdpa.h @@ -171,6 +171,9 @@ struct vdpa_map_file { * @get_vq_num_max: Get the max size of virtqueue * @vdev: vdpa device * Returns u16: max size of virtqueue + * @get_vq_num_min: Get the min size of virtqueue (optional) + * @vdev: vdpa device + * Returns u16: min size of virtqueue * @get_device_id: Get virtio device id * @vdev: vdpa device * Returns u32: virtio device id @@ -266,6 +269,7 @@ struct vdpa_config_ops { void (*set_config_cb)(struct vdpa_device *vdev, struct vdpa_callback *cb); u16 (*get_vq_num_max)(struct vdpa_device *vdev); + u16 (*get_vq_num_min)(struct vdpa_device *vdev); u32 (*get_device_id)(struct vdpa_device *vdev); u32 (*get_vendor_id)(struct vdpa_device *vdev); u8 (*get_status)(struct vdpa_device *vdev); -- 2.31.1