From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 1820E5A1F for ; Thu, 31 Dec 2015 13:54:11 +0100 (CET) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP; 31 Dec 2015 04:54:11 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,503,1444719600"; d="scan'208";a="626193594" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by FMSMGA003.fm.intel.com with ESMTP; 31 Dec 2015 04:54:12 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 31 Dec 2015 04:54:11 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 31 Dec 2015 04:54:10 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.133]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.220]) with mapi id 14.03.0248.002; Thu, 31 Dec 2015 20:54:09 +0800 From: "Tan, Jianfeng" To: Pavel Fedin , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [RFC 0/5] virtio support for container Thread-Index: AdFC5lAx4gxjgPHsRda0ClGnzG0GiAAwk/4w//+HE4D//3X7sIAAmkGA//9q9QCAALhNgP//d9jA Date: Thu, 31 Dec 2015 12:54:08 +0000 Message-ID: References: <002a01d142e6$fbfeb4e0$f3fc1ea0$@samsung.com> <002401d143af$38a6fa60$a9f4ef20$@samsung.com> <002c01d143b7$568aace0$03a006a0$@samsung.com> <003901d143c8$f8472f70$e8d58e50$@samsung.com> In-Reply-To: <003901d143c8$f8472f70$e8d58e50$@samsung.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [RFC 0/5] virtio support for container X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2015 12:54:12 -0000 Hello! >=20 > I've made some progress about (a). It's tricky. This caused by this frag= ment: >=20 > if (vhost_user_read(vhost->sockfd, &msg, len, fds, fd_num) < 0) > return 0; >=20 > Here you ignore errors. And this particular request for some reason ends= up > in EBADF. The most magic part is that sometimes it just > works... > Not sure if i can finish it today, and here in Russia we have New Year h= olidays > until 11th. Oops, I made a mistake here. I got vhost_user_read() and vhost_user_write()= backwards. + len =3D VHOST_USER_HDR_SIZE + msg.size; + if (vhost_user_read(hw->sockfd, &msg, len, fds, fd_num) < 0) + return 0; + + if (need_reply) { + if (vhost_user_write(hw->sockfd, &msg) < 0) + return -1; + + if (req !=3D msg.request) { + PMD_DRV_LOG(ERR, "Received unexpected msg type." + " Expected %d received %d", + req, msg.request); + return -1; + } Thanks, Jianfeng