From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id CA2E52BB5; Tue, 27 Sep 2016 21:10:49 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga103.fm.intel.com with ESMTP; 27 Sep 2016 12:10:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,406,1470726000"; d="scan'208";a="13817709" Received: from dpdk06.sh.intel.com ([10.239.129.195]) by fmsmga006.fm.intel.com with ESMTP; 27 Sep 2016 12:10:48 -0700 From: Jianfeng Tan To: dev@dpdk.org Cc: stable@dpdk.org, yuanhan.liu@linux.intel.com, Jianfeng Tan Date: Tue, 27 Sep 2016 19:11:04 +0000 Message-Id: <1475003466-146063-2-git-send-email-jianfeng.tan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1475003466-146063-1-git-send-email-jianfeng.tan@intel.com> References: <1470397003-5782-1-git-send-email-jianfeng.tan@intel.com> <1475003466-146063-1-git-send-email-jianfeng.tan@intel.com> Subject: [dpdk-stable] [PATCH v2 1/3] net/virtio_user: fix queue pair not enabled X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Sep 2016 19:10:50 -0000 When virtio_user is used with OVS-DPDK (with mq disabled), it cannot receive any packets. It's because when vhost provides VHOST_USER_GET_PROTOCOL_FEATURES, all queue pairs are initialized in the disabled state. Quote QEMU/docs/specs/vhost-user.txt: If VHOST_USER_F_PROTOCOL_FEATURES has not been negotiated, the ring is initialized in an enabled state. If VHOST_USER_F_PROTOCOL_FEATURES has been negotiated, the ring is initialized in a disabled state. In OVS-DPDK, all queue pairs are in the disabled state by default. When used with QEMU, QEMU will set it as enabled in the process of initialization. So this patch is to add similar logic in virtio_user. Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer") Reported-by: Ning Li Signed-off-by: Jianfeng Tan --- drivers/net/virtio/virtio_user/virtio_user_dev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c index 376c9cf..bf1155c 100644 --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c @@ -131,6 +131,9 @@ virtio_user_start_device(struct virtio_user_dev *dev) } } + /* we enable the 1st queue pair by default. */ + vhost_user_enable_queue_pair(dev->vhostfd, 0, 1); + /* After setup all virtqueues, we need to set_features so that these * features can be set into each virtqueue in vhost side. And before * that, make sure VHOST_USER_F_PROTOCOL_FEATURES is added if mq is -- 2.7.4