Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp328571pxb; Fri, 15 Oct 2021 06:23:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvGwoAfhtwrczURfCR1Lnwt8GcHYPC4Zs/qfcauQgUBpApRoKjAHy6oHT9tnRyp8sjOMZU X-Received: by 2002:a17:90a:8912:: with SMTP id u18mr13138791pjn.69.1634304202304; Fri, 15 Oct 2021 06:23:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634304202; cv=none; d=google.com; s=arc-20160816; b=VZUSysa0OLgeVL5TrigSqyo49N+ERUfSWsoU+1QaJ0f87l/7jQ+uA6+X4RDnLq37CD JJwXqpdVOIwNx2oVmjzZGqzesPjTs8jvB2dC1RPatC2xb/sho8zpi/cml2LbZvXx+JRB hVlFfNuF0CcGGY6G6TqLEdL2ul1lCN7o0oi5i/dMZ79OWFlv3LIeMJYhPocGDMmfF18w i6tDOri21Sz4vJZCHvZ+1shG2M3bpwR58jy+/OxF9WEZZm6ZhMaTir8snC2eu2biPC+l ZHPdA251ScS/XBiIDy4q8QgoDfttHOR7Q3U/MJHXbEwAg0I5Lds7VsRTbWAI0aG/ETSf n66g== 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=qrdy9WaAPilWQLkrg1WwFBPwLJaVRRxR8twOJifEWSjwhvVTURvuGmBfC0ZF83dS3j K1K4k47GY/jO8+CWc2dCAztWmH4N0dFN7rJrYbF2GZUuMN8myWpoyPUOZpbM0J3Dulte mC9dgFcSG+WVDrhIvnal1u3v6bq+XJdydocveG84c59qvYA6ZxEeUvzoqN4PxNSN4Kz3 2BXTRFWarmU1SoiSZDpP7iD3DYWYhQcYx78vMH7DdizjkSHZaA1/AnaS+qRL7aL8QMDN MJpdCmJqNVX2ss1M9tA9gH+Kfj92hlM6MhQ8EEV0+w3ydJaQGJvEsH0rKAF1c/3N86jw rSJw== 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 w132si7806510pff.278.2021.10.15.06.23.06; Fri, 15 Oct 2021 06:23:22 -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 S235974AbhJOHR1 (ORCPT + 99 others); Fri, 15 Oct 2021 03:17:27 -0400 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:35147 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235955AbhJOHRY (ORCPT ); Fri, 15 Oct 2021 03:17:24 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R331e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=wuzongyong@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0Us6A078_1634282107; Received: from localhost.localdomain(mailfrom:wuzongyong@linux.alibaba.com fp:SMTPD_---0Us6A078_1634282107) by smtp.aliyun-inc.com(127.0.0.1); Fri, 15 Oct 2021 15:15:17 +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 v5 4/8] vdpa: add new callback get_vq_num_min in vdpa_config_ops Date: Fri, 15 Oct 2021 15:14:57 +0800 Message-Id: <25435d5cde12f298133196e866662b0ef2225205.1634281805.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