DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: Pavel Fedin <p.fedin@samsung.com>, "dev@dpdk.org" <dev@dpdk.org>
Subject: Re: [dpdk-dev] [RFC 0/5] virtio support for container
Date: Thu, 31 Dec 2015 12:54:08 +0000	[thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E36031B7833@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <003901d143c8$f8472f70$e8d58e50$@samsung.com>

Hello!

> 
>  I've made some progress about (a). It's tricky. This caused by this fragment:
> 
>         if (vhost_user_read(vhost->sockfd, &msg, len, fds, fd_num) < 0)
>                 return 0;
> 
>  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 holidays
> until 11th.

Oops, I made a mistake here. I got vhost_user_read() and vhost_user_write() backwards.

+	len = 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 != msg.request) {
+			PMD_DRV_LOG(ERR, "Received unexpected msg type."
+					" Expected %d received %d",
+					req, msg.request);
+			return -1;
+		}

Thanks,
Jianfeng

  reply	other threads:[~2015-12-31 12:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-30  9:46 Pavel Fedin
2015-12-31  9:19 ` Tan, Jianfeng
2015-12-31  9:40   ` Pavel Fedin
2015-12-31 10:02     ` Tan, Jianfeng
2015-12-31 10:38       ` Pavel Fedin
2015-12-31 11:58         ` Tan, Jianfeng
2015-12-31 12:44           ` Pavel Fedin
2015-12-31 12:54             ` Tan, Jianfeng [this message]
2015-12-31 13:07               ` Pavel Fedin
2015-12-31 13:47           ` Pavel Fedin
2015-12-31 15:39           ` Pavel Fedin
2016-01-06  5:47             ` Tan, Jianfeng
  -- strict thread matches above, loose matches on Subject: below --
2017-06-15  8:21 Avi Cohen (A)
2015-11-05 18:31 Jianfeng Tan
2015-11-24  3:53 ` Zhuangyanying
2015-11-24  6:19   ` Tan, Jianfeng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ED26CBA2FAD1BF48A8719AEF02201E36031B7833@shsmsx102.ccr.corp.intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=p.fedin@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).