From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 6C4E32BB9 for ; Fri, 16 Jun 2017 12:58:36 +0200 (CEST) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga104.jf.intel.com with ESMTP; 16 Jun 2017 03:58:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,346,1493708400"; d="scan'208";a="1161254082" Received: from gklab-246-153.igk.intel.com (HELO Sent) ([10.217.246.153]) by fmsmga001.fm.intel.com with SMTP; 16 Jun 2017 03:58:33 -0700 Received: by Sent (sSMTP sendmail emulation); Fri, 16 Jun 2017 16:33:05 +0200 From: Dariusz Stojaczyk To: dev@dpdk.org Cc: Dariusz Stojaczyk Date: Fri, 16 Jun 2017 16:32:05 +0200 Message-Id: <1497623525-163750-1-git-send-email-dariuszx.stojaczyk@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [dpdk-dev] [PATCH] vhost: added error log in vhost_user_set_features 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: Fri, 16 Jun 2017 10:58:36 -0000 Since vhost_user_set_features failure is not handled in any way, a single error log has been added to at least to let the user know that something has gone wrong. Signed-off-by: Dariusz Stojaczyk --- lib/librte_vhost/vhost_user.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/librte_vhost/vhost_user.c b/lib/librte_vhost/vhost_user.c index 5c8058b..b3aff90 100644 --- a/lib/librte_vhost/vhost_user.c +++ b/lib/librte_vhost/vhost_user.c @@ -164,8 +164,12 @@ vhost_user_set_features(struct virtio_net *dev, uint64_t features) uint64_t vhost_features = 0; rte_vhost_driver_get_features(dev->ifname, &vhost_features); - if (features & ~vhost_features) + if (features & ~vhost_features) { + RTE_LOG(ERR, VHOST_CONFIG, + "(%d) received invalid negotiated features.\n", + dev->vid); return -1; + } if ((dev->flags & VIRTIO_DEV_RUNNING) && dev->features != features) { if (dev->notify_ops->features_changed) -- 2.7.4