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 89F53A052A; Mon, 25 Jan 2021 15:53:48 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 70F1E140F67; Mon, 25 Jan 2021 15:53:48 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 5594A140F64 for ; Mon, 25 Jan 2021 15:53:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611586425; 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=gmIGyB57pEQdqui796NZt8Wc9nr0wns4aJ/IQKLLbTc=; b=Cx31qr7O0bNfDnRc9SejrY+zhT8hDL+ozVenjWq+NSqKLwu6Yp6uvAFpjbzEblO6/hG7d+ HUQEjX6iUH0w3tvqb8D7oKFdtX7aKlD9b/wvu8PW7pFDmA0/OrU7mC8Clfw5cBdEygjXDd zci0REN61NMZwGMHp9LWA6cDXaR+US8= 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-49-_J9ky919MCmreO0siAmKrg-1; Mon, 25 Jan 2021 09:53:40 -0500 X-MC-Unique: _J9ky919MCmreO0siAmKrg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D94E0101F7A1; Mon, 25 Jan 2021 14:53:37 +0000 (UTC) Received: from [10.36.110.31] (unknown [10.36.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8D17F2C15B; Mon, 25 Jan 2021 14:53:33 +0000 (UTC) To: "Xia, Chenbo" , "dev@dpdk.org" , "olivier.matz@6wind.com" , "amorenoz@redhat.com" , "david.marchand@redhat.com" References: <20210119212507.1043636-1-maxime.coquelin@redhat.com> <20210119212507.1043636-28-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <4fd819b7-8495-1bc5-cdf3-1ccaf4653ee0@redhat.com> Date: Mon, 25 Jan 2021 15:53:32 +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.11 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 v2 27/44] net/virtio: add Virtio-user features 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/22/21 8:25 AM, Xia, Chenbo wrote: > Hi Maxime, > >> -----Original Message----- >> From: Maxime Coquelin >> Sent: Wednesday, January 20, 2021 5:25 AM >> To: dev@dpdk.org; Xia, Chenbo ; olivier.matz@6wind.com; >> amorenoz@redhat.com; david.marchand@redhat.com >> Cc: Maxime Coquelin >> Subject: [PATCH v2 27/44] net/virtio: add Virtio-user features ops >> >> This patch introduces new callbacks for getting >> and setting Virtio features, and implements them >> for the different backend types. >> >> Signed-off-by: Maxime Coquelin >> --- >> drivers/net/virtio/virtio_user/vhost.h | 2 + >> drivers/net/virtio/virtio_user/vhost_kernel.c | 150 +++++++++--------- >> .../net/virtio/virtio_user/vhost_kernel_tap.c | 23 +++ >> .../net/virtio/virtio_user/vhost_kernel_tap.h | 1 + >> drivers/net/virtio/virtio_user/vhost_user.c | 64 +++++++- >> drivers/net/virtio/virtio_user/vhost_vdpa.c | 38 +++-- >> .../net/virtio/virtio_user/virtio_user_dev.c | 5 +- >> drivers/net/virtio/virtio_user_ethdev.c | 3 +- >> 8 files changed, 190 insertions(+), 96 deletions(-) >> >> diff --git a/drivers/net/virtio/virtio_user/vhost.h >> b/drivers/net/virtio/virtio_user/vhost.h >> index 5413ec6778..13a88c7671 100644 >> --- a/drivers/net/virtio/virtio_user/vhost.h >> +++ b/drivers/net/virtio/virtio_user/vhost.h >> @@ -110,6 +110,8 @@ struct virtio_user_dev; > > > >> + >> + ret = tap_support_features(&tap_features); >> + if (ret < 0) { >> + PMD_DRV_LOG(ERR, "Failed to get TAP features)"); > > Delete the ')' before " ? Indeed, done. >> + return -1; >> + } >> + > > > >> >> +static int >> +vhost_user_get_features(struct virtio_user_dev *dev, uint64_t *features) >> +{ >> + int ret; >> + struct vhost_user_msg msg = { >> + .request = VHOST_USER_GET_FEATURES, >> + .flags = VHOST_USER_VERSION, >> + }; >> + >> + ret = vhost_user_write(dev->vhostfd, &msg, NULL, 0); >> + if (ret < 0) >> + goto err; >> + >> + ret = vhost_user_read(dev->vhostfd, &msg); >> + if (ret < 0) >> + goto err; > > Better add error log both after write and read? As you replied later, we already log in read & write functions, so skipping this comment. > Thanks! > Chenbo > Thanks, Maxime