DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: dev@dpdk.org, yliu@fridaylinux.org, tiwei.bie@intel.com,
	jianfeng.tan@intel.com
Cc: lprosek@redhat.com, lersek@redhat.com,
	Maxime Coquelin <maxime.coquelin@redhat.com>
Subject: [dpdk-dev] [PATCH 2/4] vhost: propagate VHOST_USER_SET_FEATURES handling error
Date: Mon,  4 Dec 2017 15:08:58 +0100	[thread overview]
Message-ID: <20171204140900.7906-3-maxime.coquelin@redhat.com> (raw)
In-Reply-To: <20171204140900.7906-1-maxime.coquelin@redhat.com>

Not propagating VHOST_USER_SET_FEATURES request handling
error may result in unpredictable behavior, as host and
guests features may no more be synchronized.

This patch fixes this by reporting the error to the upper
layer, which would result in the device being destroyed
and the connection with the master to be closed.

Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 lib/librte_vhost/vhost_user.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c
index f51055ab2..7d84af3e2 100644
--- a/lib/librte_vhost/vhost_user.c
+++ b/lib/librte_vhost/vhost_user.c
@@ -1263,7 +1263,9 @@ vhost_user_msg_handler(int vid, int fd)
 		send_vhost_reply(fd, &msg);
 		break;
 	case VHOST_USER_SET_FEATURES:
-		vhost_user_set_features(dev, msg.payload.u64);
+		ret = vhost_user_set_features(dev, msg.payload.u64);
+		if (ret)
+			return -1;
 		break;
 
 	case VHOST_USER_GET_PROTOCOL_FEATURES:
-- 
2.14.3

  parent reply	other threads:[~2017-12-04 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-04 14:08 [dpdk-dev] [PATCH 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ not negotiated Maxime Coquelin
2017-12-04 14:08 ` [dpdk-dev] [PATCH 1/4] vhost: prevent features to be changed while device is running Maxime Coquelin
2017-12-04 14:17   ` Ladi Prosek
2017-12-04 14:20     ` Maxime Coquelin
2017-12-04 14:08 ` Maxime Coquelin [this message]
2017-12-04 14:08 ` [dpdk-dev] [PATCH 3/4] vhost: extract virtqueue cleaning and freeing functions Maxime Coquelin
2017-12-04 14:09 ` [dpdk-dev] [PATCH 4/4] vhost: destroy unused virtqueues when multiqueue not negotiated Maxime Coquelin
2017-12-04 14:27 ` [dpdk-dev] [PATCH 0/4] Vhost: fix mq=on but VIRTIO_NET_F_MQ " Ladi Prosek
2017-12-04 14:48   ` Maxime Coquelin

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=20171204140900.7906-3-maxime.coquelin@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=lersek@redhat.com \
    --cc=lprosek@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=yliu@fridaylinux.org \
    /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).