From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tiwei Bie Subject: Re: [PATCH v3] net/virtio-user: fix multiple queues fail in server mode Date: Fri, 11 May 2018 10:49:51 +0800 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 Cc: dev@dpdk.org, ferruh.yigit@intel.com, maxime.coquelin@redhat.com, stable@dpdk.org To: zhiyong.yang@intel.com Return-path: Content-Disposition: inline In-Reply-To: <20180511021247.12411-1-zhiyong.yang@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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