From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by dpdk.org (Postfix) with ESMTP id 780ED2C36 for ; Thu, 29 Mar 2018 14:23:24 +0200 (CEST) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EB2DD406E971; Thu, 29 Mar 2018 12:23:23 +0000 (UTC) Received: from [10.36.112.54] (ovpn-112-54.ams2.redhat.com [10.36.112.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F5BC7C36; Thu, 29 Mar 2018 12:23:22 +0000 (UTC) To: Tiwei Bie , dev@dpdk.org Cc: jianfeng.tan@intel.com, yliu@fridaylinux.org, zhihong.wang@intel.com, xiao.w.wang@intel.com, cunming.liang@intel.com, dan.daly@intel.com References: <20180306104327.14470-1-tiwei.bie@intel.com> <20180306104327.14470-3-tiwei.bie@intel.com> From: Maxime Coquelin Message-ID: <52d27570-bf85-58bf-f5b1-7b9ad8857fcc@redhat.com> Date: Thu, 29 Mar 2018 14:23:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180306104327.14470-3-tiwei.bie@intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 29 Mar 2018 12:23:24 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Thu, 29 Mar 2018 12:23:24 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'maxime.coquelin@redhat.com' RCPT:'' Subject: Re: [dpdk-dev] [PATCH 2/3] vhost: support sending fds via send_vhost_message() X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Mar 2018 12:23:24 -0000 On 03/06/2018 11:43 AM, Tiwei Bie wrote: > This function will be used to send fds to QEMU via slave channel. > > Signed-off-by: Tiwei Bie Reviewed-by: Maxime Coquelin Thanks, Maxime > --- > lib/librte_vhost/vhost_user.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c > index 8b07b6c43..e3a1dfbfb 100644 > --- a/lib/librte_vhost/vhost_user.c > +++ b/lib/librte_vhost/vhost_user.c > @@ -1308,13 +1308,13 @@ read_vhost_message(int sockfd, struct VhostUserMsg *msg) > } > > static int > -send_vhost_message(int sockfd, struct VhostUserMsg *msg) > +send_vhost_message(int sockfd, struct VhostUserMsg *msg, int *fds, int fd_num) > { > if (!msg) > return 0; > > return send_fd_message(sockfd, (char *)msg, > - VHOST_USER_HDR_SIZE + msg->size, NULL, 0); > + VHOST_USER_HDR_SIZE + msg->size, fds, fd_num); > } > > static int > @@ -1328,7 +1328,7 @@ send_vhost_reply(int sockfd, struct VhostUserMsg *msg) > msg->flags |= VHOST_USER_VERSION; > msg->flags |= VHOST_USER_REPLY_MASK; > > - return send_vhost_message(sockfd, msg); > + return send_vhost_message(sockfd, msg, NULL, 0); > } > > /* > @@ -1643,7 +1643,7 @@ vhost_user_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm) > }, > }; > > - ret = send_vhost_message(dev->slave_req_fd, &msg); > + ret = send_vhost_message(dev->slave_req_fd, &msg, NULL, 0); > if (ret < 0) { > RTE_LOG(ERR, VHOST_CONFIG, > "Failed to send IOTLB miss message (%d)\n", >