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 77EFBA0A02; Fri, 15 Jan 2021 11:15:57 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0AD8B140EB2; Fri, 15 Jan 2021 11:15:57 +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 7D738140EB0 for ; Fri, 15 Jan 2021 11:15:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610705754; 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=Xe/A6+a7O6aqD7t8Rcs6q7TlFVwlLVbYbRvYfXh3fDU=; b=DL5Vnu5Vwf6lD7qpofpN668P/4O+kwj/FYs7kSPJmPyanR8CkpPMB2rgGHmVjy/48KM6vS 7s9Egu2yVnFJj35sl+NNu8eTvCQXwK0uJ4M0IE/l11MZD286dd7FCbIcqa6s83oXwur7wR f6NvziW7neSYnYWyvFi/lRvFzgwIsms= 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-356-3x-frHR_PH2ofFPbIcrYKg-1; Fri, 15 Jan 2021 05:15:53 -0500 X-MC-Unique: 3x-frHR_PH2ofFPbIcrYKg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 255F310051A7; Fri, 15 Jan 2021 10:15:52 +0000 (UTC) Received: from [10.36.110.24] (unknown [10.36.110.24]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 87FBE63622; Fri, 15 Jan 2021 10:15:46 +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-29-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: Date: Fri, 15 Jan 2021 11:15:45 +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.79 on 10.5.11.15 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 28/40] net/virtio: add Virtio-user vring setting 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:03 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 28/40] net/virtio: add Virtio-user vring setting ops >> >> This patch introduces new callbacks for setting >> and getting vring state. >> >> Signed-off-by: Maxime Coquelin > > > >> >> @@ -327,6 +343,10 @@ struct virtio_user_backend_ops virtio_ops_vdpa = { >> .get_features = vhost_vdpa_get_features, >> .set_features = vhost_vdpa_set_features, >> .set_memory_table = vhost_vdpa_set_memory_table, >> + .set_vring_enable = vhost_vdpa_set_vring_enable, > > Sorry, miss one comment in last email... > > Do we still need to keep set_vring_enable in struct virtio_user_backend_ops? Because > as I notice, it's called only in another callback (enable_qp). Right, it can be dropped now. I'll remove it. Thanks, Maxime > Thanks, > Chenbo > >> + .set_vring_num = vhost_vdpa_set_vring_num, >> + .set_vring_base = vhost_vdpa_set_vring_base, >> + .get_vring_base = vhost_vdpa_get_vring_base, >> .send_request = vhost_vdpa_send_request, >> .enable_qp = vhost_vdpa_enable_queue_pair, >> .dma_map = vhost_vdpa_dma_map, >> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c >> b/drivers/net/virtio/virtio_user/virtio_user_dev.c >> index ae976be158..496a48ee51 100644 >> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c >> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c >> @@ -73,13 +73,13 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, >> uint32_t queue_sel) >> >> state.index = queue_sel; >> state.num = vring->num; >> - dev->ops->send_request(dev, VHOST_USER_SET_VRING_NUM, &state); >> + dev->ops->set_vring_num(dev, &state); >> >> state.index = queue_sel; >> state.num = 0; /* no reservation */ >> if (dev->features & (1ULL << VIRTIO_F_RING_PACKED)) >> state.num |= (1 << 15); >> - dev->ops->send_request(dev, VHOST_USER_SET_VRING_BASE, &state); >> + dev->ops->set_vring_base(dev, &state); >> >> dev->ops->send_request(dev, VHOST_USER_SET_VRING_ADDR, &addr); >> >> @@ -218,9 +218,8 @@ int virtio_user_stop_device(struct virtio_user_dev *dev) >> /* Stop the backend. */ >> for (i = 0; i < dev->max_queue_pairs * 2; ++i) { >> state.index = i; >> - if (dev->ops->send_request(dev, VHOST_USER_GET_VRING_BASE, >> - &state) < 0) { >> - PMD_DRV_LOG(ERR, "get_vring_base failed, index=%u\n", >> + if (dev->ops->get_vring_base(dev, &state) < 0) { >> + PMD_DRV_LOG(ERR, "get_vring_base failed, index=%u", >> i); >> error = -1; >> goto out; >> -- >> 2.29.2 >