From patchwork Mon Oct 18 10:20:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Coquelin X-Patchwork-Id: 101956 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id B506AA0C43; Mon, 18 Oct 2021 12:21:12 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 714BC40141; Mon, 18 Oct 2021 12:21:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mails.dpdk.org (Postfix) with ESMTP id 86BD74003C for ; Mon, 18 Oct 2021 12:21:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634552471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=bXwvGNvoR8RgIhlMmlO6ClFsHsOH6Yi/QsWUGK1qT84=; b=MqX2LG7e96yoOj08PxVZbzR9frxl6RsLtcU+iOyRpzH479GhMO4yCg50LWoAwDDN9IjeH5 razdH/ijVIxIVB60vsNJ37YDJvWvU493ViM8aBzALF8KlJKjb9y6XUrhABCf97vPj5v19u Lo6WgeF8VLO0+e4x9/A7/iEh6YnJuzk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-203--SOeTQKQOaCzTLhDtk1Xlw-1; Mon, 18 Oct 2021 06:21:06 -0400 X-MC-Unique: -SOeTQKQOaCzTLhDtk1Xlw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 631BA1018721; Mon, 18 Oct 2021 10:21:04 +0000 (UTC) Received: from max-t490s.redhat.com (unknown [10.39.208.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8D1AB22719; Mon, 18 Oct 2021 10:20:49 +0000 (UTC) From: Maxime Coquelin To: dev@dpdk.org, chenbo.xia@intel.com, amorenoz@redhat.com, david.marchand@redhat.com, andrew.rybchenko@oktetlabs.ru, ferruh.yigit@intel.com, michaelba@nvidia.com, viacheslavo@nvidia.com, xiaoyun.li@intel.com Cc: nelio.laranjeiro@6wind.com, yvugenfi@redhat.com, ybendito@redhat.com, Maxime Coquelin Date: Mon, 18 Oct 2021 12:20:40 +0200 Message-Id: <20211018102045.255831-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v5 0/5] Virtio PMD RSS support & RSS fixes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This series is mainly adding support for RSS to Virtio PMD driver. The two last patches are fixing an issue in testpmd that could cause out of bounds access, and fix an issue spotted in the mlx5 driver while looking for inspiration. The first motivation for this series is to eventually support RSS down to the Vhost-user library, so that OVS can benefit from it. But it will be also useful with vDPA devices in the future. Regarding the testing, I have tested it with qemu v5.2 from Fedora 34. Since libvirt does not support yet enabling RSS feature in the Qemu virtio-net device, and this feature is disabled by default, the tester can either rebuild the qemu package to enable it by default or use the qemu cmdline to do the same. The tester can use testpmd in icmpecho mode in the guest and scapy on the host to inject random traffic on the tap interface, e.g.: sendp(Ether(src=RandMAC()) / IP(src=RandIP(), dst='192.168.123.9') / UDP(sport=RandShort(), dport=RandShort()), loop=True, iface='vnet7') Then it can play with RSS config in testpmd to change the RETA, or hash type and see traffic being steered accordingly by checking the Rx xstats. Changes in v5: ============== - Remove unneeded index init (Chenbo) - Improve error print (Chenbo) - Add missed comment on RSS ctrl message Changes in v4: ============== - s/GPTU/GTPU/ (Xiaoyun) Changes in v3: ============== - Add applying user-specified RSS conf a device config time (Andrew) - Remove useless checks (Chenbo) - Clean control message payload dlen variable (Chenbo) - Add GTPU offload type (Xiaoyun) - Add missing types to str2flowtype() (Xiaoyun) Changes in v2: ============== - Rework patch 2 to keep old behaviour, but fix possible out of bounds due to key length (Andrew/Nelio/Xiaoyun) - s/reta/RETA/ (Andrew) - Applied A-by on patch 3 (Slava) - Fix display of configured hash types - Add missing flow types definition to testpmd's port info command Maxime Coquelin (5): net/virtio: add initial RSS support app/testpmd: fix RSS key length app/testpmd: fix RSS type display net/mlx5: fix RSS RETA update app/testpmd: add missing flow types in port info app/test-pmd/cmdline.c | 4 + app/test-pmd/config.c | 11 +- doc/guides/nics/features/virtio.ini | 3 + doc/guides/nics/virtio.rst | 3 + doc/guides/rel_notes/release_21_11.rst | 6 + drivers/net/mlx5/mlx5_rss.c | 2 +- drivers/net/virtio/virtio.h | 31 +- drivers/net/virtio/virtio_ethdev.c | 394 ++++++++++++++++++++++++- drivers/net/virtio/virtio_ethdev.h | 3 +- drivers/net/virtio/virtqueue.h | 25 ++ 10 files changed, 470 insertions(+), 12 deletions(-)