From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4E698A0A02; Fri, 15 Jan 2021 11:19:54 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 12CA3140EB8; Fri, 15 Jan 2021 11:19:54 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id A9CA1140EB2 for ; Fri, 15 Jan 2021 11:19:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610705992; 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: in-reply-to:in-reply-to:references:references; bh=gFpx4b6UjGTsocsApTO/WeNgXLDf0WIuTQKZgcfST00=; b=NHHJNR8cI4pUGhsDo9hQx4/fUxJ27ngFmiFIsxtNHwHlOrLcboP2q3vCG/k3yHPy7NcqFb a7jZuVaXxylutcYO4iL6beDoBsfsln4xuIPYRRf4pn/odVwnK74bE6hOk9tgU669XqcNrO k1PYgx4ncEzEkHmIswa6IuwJ6tqggxw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-304-FD3dfAgROT-Evrsn3dKmdQ-1; Fri, 15 Jan 2021 05:19:50 -0500 X-MC-Unique: FD3dfAgROT-Evrsn3dKmdQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 78A1D18C8C01; Fri, 15 Jan 2021 10:19:49 +0000 (UTC) Received: from [10.36.110.24] (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DCB101A266; Fri, 15 Jan 2021 10:19:38 +0000 (UTC) To: "Xia, Chenbo" , "dev@dpdk.org" , "olivier.matz@6wind.com" , "amorenoz@redhat.com" , "david.marchand@redhat.com" References: <20201220211405.313012-1-maxime.coquelin@redhat.com> <20201220211405.313012-31-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <10f99905-be34-3472-8ef2-463d50eb47dc@redhat.com> Date: Fri, 15 Jan 2021 11:19:37 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH 30/40] net/virtio: add Virtio-user vring address ops X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/6/21 1:06 PM, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Monday, December 21, 2020 5:14 AM >> To: dev@dpdk.org; Xia, Chenbo ; olivier.matz@6wind.com; >> amorenoz@redhat.com; david.marchand@redhat.com >> Cc: Maxime Coquelin >> Subject: [PATCH 30/40] net/virtio: add Virtio-user vring address ops >> >> This patch introduces a new callback for setting >> vrings addresses. >> >> Signed-off-by: Maxime Coquelin >> --- >> drivers/net/virtio/virtio_user/vhost.h | 1 + >> drivers/net/virtio/virtio_user/vhost_kernel.c | 32 +++++++++++++------ >> drivers/net/virtio/virtio_user/vhost_user.c | 29 +++++++++++++---- >> drivers/net/virtio/virtio_user/vhost_vdpa.c | 8 ++++- >> .../net/virtio/virtio_user/virtio_user_dev.c | 2 +- >> 5 files changed, 55 insertions(+), 17 deletions(-) >> >> diff --git a/drivers/net/virtio/virtio_user/vhost.h >> b/drivers/net/virtio/virtio_user/vhost.h >> index b296ee215d..956eb58728 100644 >> --- a/drivers/net/virtio/virtio_user/vhost.h >> +++ b/drivers/net/virtio/virtio_user/vhost.h >> @@ -113,6 +113,7 @@ struct virtio_user_backend_ops { >> int (*get_vring_base)(struct virtio_user_dev *dev, struct >> vhost_vring_state *state); >> int (*set_vring_call)(struct virtio_user_dev *dev, struct >> vhost_vring_file *file); >> int (*set_vring_kick)(struct virtio_user_dev *dev, struct >> vhost_vring_file *file); >> + int (*set_vring_addr)(struct virtio_user_dev *dev, struct >> vhost_vring_addr *addr); >> int (*send_request)(struct virtio_user_dev *dev, >> enum vhost_user_request req, >> void *arg); >> diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c >> b/drivers/net/virtio/virtio_user/vhost_kernel.c >> index 1805aee7f7..8cd86b72c6 100644 >> --- a/drivers/net/virtio/virtio_user/vhost_kernel.c >> +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c >> @@ -294,9 +294,30 @@ vhost_kernel_set_vring_call(struct virtio_user_dev *dev, >> struct vhost_vring_file >> return vhost_kernel_set_vring_file(dev, VHOST_SET_VRING_KICK, file); >> } >> >> +static int >> +vhost_kernel_set_vring_addr(struct virtio_user_dev *dev, struct >> vhost_vring_addr *addr) >> +{ >> + int ret, fd; >> + uint32_t index = addr->index; > > Better use 'unsigned int index' here? It can hardly cause problem but I think > it's better to use the type in struct vhost_vring_addr. Fixed, thanks. Maxime > Thanks, > Chenbo >