From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6D73FA3160 for ; Wed, 9 Oct 2019 12:44:47 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 551D01C1F2; Wed, 9 Oct 2019 12:44:46 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id B8C3E1BF51; Wed, 9 Oct 2019 12:44:43 +0200 (CEST) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 03:44:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,273,1566889200"; d="scan'208";a="192845107" Received: from dpdk-virtio-tbie-2.sh.intel.com (HELO ___) ([10.67.104.74]) by fmsmga008.fm.intel.com with ESMTP; 09 Oct 2019 03:44:41 -0700 Date: Wed, 9 Oct 2019 18:41:43 +0800 From: Tiwei Bie To: Andrew Rybchenko Cc: Maxime Coquelin , Zhihong Wang , dev@dpdk.org, Dilshod Urazov , stable@dpdk.org Message-ID: <20191009104143.GA14695@___> References: <1569944672-24754-1-git-send-email-arybchenko@solarflare.com> <1569944672-24754-3-git-send-email-arybchenko@solarflare.com> <20191008054650.GA22478@___> <20191009084341.GA32515@___> <43e11493-65d6-fdf2-8086-106ed7b4eb25@solarflare.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <43e11493-65d6-fdf2-8086-106ed7b4eb25@solarflare.com> User-Agent: Mutt/1.9.4 (2018-02-28) Subject: Re: [dpdk-dev] [PATCH 3/3] net/virtio: reject unsupported Rx multi queue modes 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Oct 09, 2019 at 12:00:28PM +0300, Andrew Rybchenko wrote: > On 10/9/19 11:43 AM, Tiwei Bie wrote: > > On Wed, Oct 09, 2019 at 11:04:38AM +0300, Andrew Rybchenko wrote: > > > On 10/8/19 8:46 AM, Tiwei Bie wrote: > > > > On Tue, Oct 01, 2019 at 04:44:31PM +0100, Andrew Rybchenko wrote: > > > > > From: Dilshod Urazov > > > > > > > > > > This driver supports none of DCB, RSS or VMDQ modes, > > > > > therefore must check and return error if configured incorrectly. > > > > > > > > > > Fixes: c1f86306a026 ("virtio: add new driver") > > > > > Cc: stable@dpdk.org > > > > > > > > > > Signed-off-by: Dilshod Urazov > > > > > Signed-off-by: Andrew Rybchenko > > > > > --- > > > > > drivers/net/virtio/virtio_ethdev.c | 7 +++++++ > > > > > 1 file changed, 7 insertions(+) > > > > > > > > > > diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c > > > > > index 7261109dd..0af4fc392 100644 > > > > > --- a/drivers/net/virtio/virtio_ethdev.c > > > > > +++ b/drivers/net/virtio/virtio_ethdev.c > > > > > @@ -2071,6 +2071,13 @@ virtio_dev_configure(struct rte_eth_dev *dev) > > > > > PMD_INIT_LOG(DEBUG, "configure"); > > > > > req_features = VIRTIO_PMD_DEFAULT_GUEST_FEATURES; > > > > > + if (rxmode->mq_mode != ETH_MQ_RX_NONE) { > > > > > + PMD_DRV_LOG(ERR, > > > > > + "Unsupported Rx multi queue mode %d", > > > > > + rxmode->mq_mode); > > > > > + return -EINVAL; > > > > > + } > > > > We need similar checks for Tx as well. > > > OK, I'll add. > > > > > > However, I'm not 100% sure about RSS. Yes, I know that virtio has > > > no RSS configuration support, but it looks possible to have multi queue > > > in vhost-net case. > > Yeah, it's possible to have MQ in virtio. > > The RSS support in virtio is still WIP. > > https://github.com/oasis-tcs/virtio-spec/issues/48 > > Thanks for the link. So, may be ETH_MQ_RX_RSS should be accepted > as well, but attempts to configure RSS rejected? > Yes, it is a bit strange to accept RSS with empty rss_hf etc, but > at least it is exactly what net/virtio can do. > > And one more thought... > It looks like if more than one Rx queue is configured, mq_mode must > be ETH_MQ_RX_RSS and must not be ETH_MQ_RX_NONE. Some apps in DPDK will set mq_mode to ETH_MQ_RX_NONE while enabling multiple queue pairs, e.g.: https://github.com/DPDK/dpdk/blob/5b5bb56532fd5dea5d6260c0a0e405c0e32da2a0/app/test/test_link_bonding.c#L137 https://github.com/DPDK/dpdk/blob/5b5bb56532fd5dea5d6260c0a0e405c0e32da2a0/app/test/test_link_bonding.c#L181-L182 https://github.com/DPDK/dpdk/blob/5b5bb56532fd5dea5d6260c0a0e405c0e32da2a0/app/test/test_link_bonding.c#L3938-L3948 Testpmd will also set mq_mode to ETH_MQ_RX_NONE when multiple Rx queues are enabled but rss_hf is empty: https://github.com/DPDK/dpdk/blob/5b5bb56532fd5dea5d6260c0a0e405c0e32da2a0/app/test-pmd/testpmd.c#L2935-L2938 https://github.com/DPDK/dpdk/blob/5b5bb56532fd5dea5d6260c0a0e405c0e32da2a0/app/test-pmd/testpmd.c#L2945-L2948 (the flow_type_rss_offloads reported by virtio-PMD is zero) My understanding is that, setting mq_mode to ETH_MQ_RX_NONE means no method is enforced on how to route packets to MQs. It looks that ETH_MQ_RX_NONE is the best fit for virtio currently.