Message ID | 1422599787-12009-2-git-send-email-huawei.xie@intel.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Return-Path: <dev-bounces@dpdk.org> X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 701B35AA6; Fri, 30 Jan 2015 07:36:41 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id EB7235A97 for <dev@dpdk.org>; Fri, 30 Jan 2015 07:36:38 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP; 29 Jan 2015 22:30:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.09,490,1418112000"; d="scan'208";a="644914939" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by orsmga001.jf.intel.com with ESMTP; 29 Jan 2015 22:36:36 -0800 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t0U6aX0k006051; Fri, 30 Jan 2015 14:36:33 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t0U6aV1i012051; Fri, 30 Jan 2015 14:36:33 +0800 Received: (from hxie5@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t0U6aVm7012047; Fri, 30 Jan 2015 14:36:31 +0800 From: Huawei Xie <huawei.xie@intel.com> To: dev@dpdk.org Date: Fri, 30 Jan 2015 14:36:16 +0800 Message-Id: <1422599787-12009-2-git-send-email-huawei.xie@intel.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1422599787-12009-1-git-send-email-huawei.xie@intel.com> References: <1422599787-12009-1-git-send-email-huawei.xie@intel.com> Subject: [dpdk-dev] [PATCH 01/12] lib/librte_vhost: enable VIRTIO_NET_F_CTRL_RX X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK <dev.dpdk.org> List-Unsubscribe: <http://dpdk.org/ml/options/dev>, <mailto:dev-request@dpdk.org?subject=unsubscribe> List-Archive: <http://dpdk.org/ml/archives/dev/> List-Post: <mailto:dev@dpdk.org> List-Help: <mailto:dev-request@dpdk.org?subject=help> List-Subscribe: <http://dpdk.org/ml/listinfo/dev>, <mailto:dev-request@dpdk.org?subject=subscribe> Errors-To: dev-bounces@dpdk.org Sender: "dev" <dev-bounces@dpdk.org> |
Commit Message
Huawei Xie
Jan. 30, 2015, 6:36 a.m. UTC
VIRTIO_NET_F_CTRL_RX is dependant on VIRTIO_NET_F_CTRL_VQ.
Observed that virtio-net driver in guest would crash with only CTRL_RX enabled.
In virtnet_send_command:
/* Caller should know better */
BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ) ||
(out + in > VIRTNET_SEND_COMMAND_SG_MAX));
Signed-off-by: Huawei Xie <huawei.xie@intel.com>
---
lib/librte_vhost/virtio-net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Comments
On 2015/01/30 15:36, Huawei Xie wrote: > VIRTIO_NET_F_CTRL_RX is dependant on VIRTIO_NET_F_CTRL_VQ. > > Observed that virtio-net driver in guest would crash with only CTRL_RX enabled. > > In virtnet_send_command: > > /* Caller should know better */ > BUG_ON(!virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ) || > (out + in > VIRTNET_SEND_COMMAND_SG_MAX)); > > Signed-off-by: Huawei Xie <huawei.xie@intel.com> > --- > lib/librte_vhost/virtio-net.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c > index b041849..52b4957 100644 > --- a/lib/librte_vhost/virtio-net.c > +++ b/lib/librte_vhost/virtio-net.c > @@ -73,7 +73,8 @@ static struct virtio_net_config_ll *ll_root; > > /* Features supported by this lib. */ > #define VHOST_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \ > - (1ULL << VIRTIO_NET_F_CTRL_RX)) > + (1ULL << VIRTIO_NET_F_CTRL_VQ) | \ > + (1ULL << VIRTIO_NET_F_CTRL_RX)) > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > /* Line size for reading maps file. */ Hi Xie, Could you please check below code? --------------------- examples/vhost/main.c --------------------- case 'P': promiscuous = 1; vmdq_conf_default.rx_adv_conf.vmdq_rx_conf.rx_mode = ETH_VMDQ_ACCEPT_BROADCAST | ETH_VMDQ_ACCEPT_MULTICAST; rte_vhost_feature_enable(1ULL << VIRTIO_NET_F_CTRL_RX); VIRTIO_NET_F_CTRL_RX is always enabled by this patch. So if 'P' isn't specified in vhost example, does it need to be disabled? Thanks, Tetsuya
> @@ -73,7 +73,8 @@ static struct virtio_net_config_ll *ll_root; > > > > /* Features supported by this lib. */ > > #define VHOST_SUPPORTED_FEATURES ((1ULL << > VIRTIO_NET_F_MRG_RXBUF) | \ > > - (1ULL << VIRTIO_NET_F_CTRL_RX)) > > + (1ULL << VIRTIO_NET_F_CTRL_VQ) | \ > > + (1ULL << VIRTIO_NET_F_CTRL_RX)) > > static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; > > > > /* Line size for reading maps file. */ > > Hi Xie, > > Could you please check below code? > > --------------------- > examples/vhost/main.c > --------------------- > case 'P': > promiscuous = 1; > vmdq_conf_default.rx_adv_conf.vmdq_rx_conf.rx_mode = > ETH_VMDQ_ACCEPT_BROADCAST | > ETH_VMDQ_ACCEPT_MULTICAST; > rte_vhost_feature_enable(1ULL << > VIRTIO_NET_F_CTRL_RX); > > > VIRTIO_NET_F_CTRL_RX is always enabled by this patch. > So if 'P' isn't specified in vhost example, does it need to be disabled? Sounds reasonable. I find that the subject shoud be "enable CTRL_VQ". So issue with CTRL_RX should be fixed in other patch rather than in this patchset. Besides, even CTRL_VQ is a little weird, as we don't do anything with multiple enabling in vhost library. > > Thanks, > Tetsuya
diff --git a/lib/librte_vhost/virtio-net.c b/lib/librte_vhost/virtio-net.c index b041849..52b4957 100644 --- a/lib/librte_vhost/virtio-net.c +++ b/lib/librte_vhost/virtio-net.c @@ -73,7 +73,8 @@ static struct virtio_net_config_ll *ll_root; /* Features supported by this lib. */ #define VHOST_SUPPORTED_FEATURES ((1ULL << VIRTIO_NET_F_MRG_RXBUF) | \ - (1ULL << VIRTIO_NET_F_CTRL_RX)) + (1ULL << VIRTIO_NET_F_CTRL_VQ) | \ + (1ULL << VIRTIO_NET_F_CTRL_RX)) static uint64_t VHOST_FEATURES = VHOST_SUPPORTED_FEATURES; /* Line size for reading maps file. */