mbox series

[v6,0/5] Virtio PMD RSS support & RSS fixes

Message ID 20211027142213.556166-1-maxime.coquelin@redhat.com (mailing list archive)
Headers
Series Virtio PMD RSS support & RSS fixes |

Message

Maxime Coquelin Oct. 27, 2021, 2:22 p.m. UTC
  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 v6:
==============
- Rebased on top of main, including convertion to new naming of some defines
- Convert hash types definition to RTE_BIT32() (Andrew)
- Add build check for RETA size being a pow2 (Andrew)
- Restore RSS config if device update fails (Andrew)
- Prevent RSS config if RXq number == 0 (Andrew)
- Reconfigure the RETA if the number of RXq changed (Andrew)
- Apply rss_conf even if the RSS key had previously been configured (Andrew)

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            |  32 +-
 drivers/net/virtio/virtio_ethdev.c     | 436 ++++++++++++++++++++++++-
 drivers/net/virtio/virtio_ethdev.h     |   3 +-
 drivers/net/virtio/virtqueue.h         |  25 ++
 10 files changed, 513 insertions(+), 12 deletions(-)
  

Comments

Maxime Coquelin Oct. 29, 2021, 10:36 a.m. UTC | #1
On 10/27/21 16:22, Maxime Coquelin wrote:
> 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 v6:
> ==============
> - Rebased on top of main, including convertion to new naming of some defines
> - Convert hash types definition to RTE_BIT32() (Andrew)
> - Add build check for RETA size being a pow2 (Andrew)
> - Restore RSS config if device update fails (Andrew)
> - Prevent RSS config if RXq number == 0 (Andrew)
> - Reconfigure the RETA if the number of RXq changed (Andrew)
> - Apply rss_conf even if the RSS key had previously been configured (Andrew)
> 
> 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            |  32 +-
>   drivers/net/virtio/virtio_ethdev.c     | 436 ++++++++++++++++++++++++-
>   drivers/net/virtio/virtio_ethdev.h     |   3 +-
>   drivers/net/virtio/virtqueue.h         |  25 ++
>   10 files changed, 513 insertions(+), 12 deletions(-)
> 


Applied to dpdk-next-virtio/main.

Thanks,
Maxime