From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 4F7921C0F9; Fri, 11 May 2018 04:49:20 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 May 2018 19:49:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,387,1520924400"; d="scan'208";a="38447602" Received: from debian.sh.intel.com (HELO debian) ([10.67.104.164]) by fmsmga007.fm.intel.com with ESMTP; 10 May 2018 19:49:18 -0700 Date: Fri, 11 May 2018 10:49:51 +0800 From: Tiwei Bie To: zhiyong.yang@intel.com Cc: dev@dpdk.org, ferruh.yigit@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org Message-ID: <20180511024951.boqwhaegsjmum32i@debian> References: <20180510093623.82588-1-zhiyong.yang@intel.com> <20180511021247.12411-1-zhiyong.yang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180511021247.12411-1-zhiyong.yang@intel.com> User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH v3] net/virtio-user: fix multiple queues fail in server mode 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, 11 May 2018 02:49:22 -0000 On Fri, May 11, 2018 at 10:12:47AM +0800, zhiyong.yang@intel.com wrote: [...] > @@ -447,11 +447,17 @@ virtio_user_handle_mq(struct virtio_user_dev *dev, uint16_t q_pairs) > return -1; > } > > - for (i = 0; i < q_pairs; ++i) > - ret |= dev->ops->enable_qp(dev, i, 1); > - for (i = q_pairs; i < dev->max_queue_pairs; ++i) > - ret |= dev->ops->enable_qp(dev, i, 0); > - > + /* Server mode can't enable queue pairs if vhostfd is invalid, > + * always return 0 in this case. > + */ > + if (dev->vhostfd >= 0) { There are two spaces between ')' and '{'. > + for (i = 0; i < q_pairs; ++i) > + ret |= dev->ops->enable_qp(dev, i, 1); > + for (i = q_pairs; i < dev->max_queue_pairs; ++i) > + ret |= dev->ops->enable_qp(dev, i, 0); > + } else if (!dev->is_server) { > + ret = ~0; > + } > dev->queue_pairs = q_pairs; > > return ret; [...] > @@ -37,6 +38,25 @@ virtio_user_server_reconnect(struct virtio_user_dev *dev) > return -1; > > dev->vhostfd = connectfd; > + if (dev->ops->send_request(dev, VHOST_USER_GET_FEATURES, > + &dev->device_features) < 0) { > + PMD_INIT_LOG(ERR, "get_features failed: %s", > + strerror(errno)); > + return -1; > + } > + > + features &= ~dev->device_features; > + /* For following bits, vhost-user doesn't really need to know */ > + features &= ~(1ull << VIRTIO_NET_F_MAC); > + features &= ~(1ull << VIRTIO_NET_F_CTRL_VLAN); > + features &= ~(1ull << VIRTIO_NET_F_CTRL_MAC_ADDR); > + features &= ~(1ull << VIRTIO_NET_F_STATUS); > + if (features) > + PMD_INIT_LOG(ERR, "WARNING: Some features 0x%" PRIx64 "are not supported by vhost-user!", A space is missing before "are not ...". Should be: " are not ..." Other than above small typos, Reviewed-by: Tiwei Bie