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