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 0845EA052A; Mon, 25 Jan 2021 15:56:53 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7F165140F67; Mon, 25 Jan 2021 15:56:53 +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 A3F0B140F64 for ; Mon, 25 Jan 2021 15:56:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611586610; 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=/8bVXOtJ/5wkveLmiYTgpMP62EmHsrzMm8JDXcA4Dlk=; b=hGYjqFEkUzhRkDv5rVwv01zaB+RKv5Nqae9qQE+HCLVwaLOVOJW1IYDfawlvM8FuhSPxG3 1MXzpLzGj3LMG/fA1oBOFIzoPXExd1nGI9aY4QLTW00l/d4wCREwp5VoqsbA3pQZEw9YWR +cKXSnf+LWoSPIujzrCJfGo5quXSq1s= 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-248-Vqyr-MwYMQW9jATzGkMDFw-1; Mon, 25 Jan 2021 09:56:48 -0500 X-MC-Unique: Vqyr-MwYMQW9jATzGkMDFw-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 CBAB2107ACE3; Mon, 25 Jan 2021 14:56:47 +0000 (UTC) Received: from [10.36.110.31] (unknown [10.36.110.31]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 872AC5D6AB; Mon, 25 Jan 2021 14:56:43 +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-30-maxime.coquelin@redhat.com> From: Maxime Coquelin Message-ID: <31785a89-4676-5d58-48e5-6276020c0078@redhat.com> Date: Mon, 25 Jan 2021 15:56:42 +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 v2 29/44] net/virtio: add Virtio-user memory tables 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:34 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 29/44] net/virtio: add Virtio-user memory tables ops >> >> This patch implements a dedicated callback for >> preparing and sending memory table to the backends. >> >> Signed-off-by: Maxime Coquelin >> --- >> drivers/net/virtio/virtio_user/vhost.h | 1 + >> drivers/net/virtio/virtio_user/vhost_kernel.c | 60 ++++++------- >> drivers/net/virtio/virtio_user/vhost_user.c | 86 ++++++++++++++----- >> drivers/net/virtio/virtio_user/vhost_vdpa.c | 8 +- >> .../net/virtio/virtio_user/virtio_user_dev.c | 4 +- >> 5 files changed, 101 insertions(+), 58 deletions(-) >> ... >> +static int >> +vhost_user_check_reply_ack(struct virtio_user_dev *dev, struct vhost_user_msg >> *msg) >> +{ >> + enum vhost_user_request req = msg->request; >> + int ret; >> + >> + if (!(msg->flags & VHOST_USER_NEED_REPLY_MASK)) >> + return 0; >> + >> + ret = vhost_user_read(dev->vhostfd, msg); >> + if (ret < 0) { >> + PMD_DRV_LOG(ERR, "Failed to read reply-ack"); >> + return -1; >> + } >> + >> + if (req != msg->request) { >> + PMD_DRV_LOG(ERR, "Unexpected reply-ack request type (%d)", msg- >>> request); >> + return -1; >> + } >> + >> + if (msg->size != sizeof(msg->payload.u64)) { >> + PMD_DRV_LOG(ERR, "Unexpected reply-ack payload size (%d)", msg- >>> size); > > Better to use '%u'? Done >> + return -1; >> + } >> + >> + if (msg->payload.u64) { >> + PMD_DRV_LOG(ERR, "Slave replied NACK to request type %d", msg- >>> request); > > Replace '%d' with '(%d)' to align with the above style? :P Added to make style consistent. > Thanks, > Chenbo > Thanks, Maxime