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 <dilshod.ura...@oktetlabs.ru> > > > > > > > > > > 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: sta...@dpdk.org > > > > > > > > > > Signed-off-by: Dilshod Urazov <dilshod.ura...@oktetlabs.ru> > > > > > Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com> > > > > > --- > > > > > 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.