[dpdk-dev] [PATCH v6 1/5] net/virtio: add initial RSS support

Ferruh Yigit ferruh.yigit at intel.com
Fri Oct 29 19:40:14 CEST 2021


On 10/27/2021 3:22 PM, Maxime Coquelin wrote:
> Provide the capability to update the hash key, hash types
> and RETA table on the fly (without needing to stop/start
> the device). However, the key length and the number of RETA
> entries are fixed to 40B and 128 entries respectively. This
> is done in order to simplify the design, but may be
> revisited later as the Virtio spec provides this
> flexibility.
> 
> Note that only VIRTIO_NET_F_RSS support is implemented,
> VIRTIO_NET_F_HASH_REPORT, which would enable reporting the
> packet RSS hash calculated by the device into mbuf.rss, is
> not yet supported.
> 
> Regarding the default RSS configuration, it has been
> chosen to use the default Intel ixgbe key as default key,
> and default RETA is a simple modulo between the hash and
> the number of Rx queues.
> 
> Signed-off-by: Maxime Coquelin <maxime.coquelin at redhat.com>

<...>

> +static uint64_t
> +ethdev_to_virtio_rss_offloads(uint64_t ethdev_hash_types)
> +{
> +	uint64_t virtio_hash_types = 0;
> +
> +	if (ethdev_hash_types & (ETH_RSS_IPV4 | ETH_RSS_FRAG_IPV4 | ETH_RSS_NONFRAG_IPV4_OTHER))
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_IPV4;
> +
> +	if (ethdev_hash_types & ETH_RSS_NONFRAG_IPV4_TCP)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_TCPV4;
> +
> +	if (ethdev_hash_types & ETH_RSS_NONFRAG_IPV4_UDP)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_UDPV4;
> +
> +	if (ethdev_hash_types & (ETH_RSS_IPV6 | ETH_RSS_FRAG_IPV6 | ETH_RSS_NONFRAG_IPV6_OTHER))
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_IPV6;
> +
> +	if (ethdev_hash_types & ETH_RSS_NONFRAG_IPV6_TCP)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_TCPV6;
> +
> +	if (ethdev_hash_types & ETH_RSS_NONFRAG_IPV6_UDP)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_UDPV6;
> +
> +	if (ethdev_hash_types & ETH_RSS_IPV6_EX)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_IP_EX;
> +
> +	if (ethdev_hash_types & ETH_RSS_IPV6_TCP_EX)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_TCP_EX;
> +
> +	if (ethdev_hash_types & ETH_RSS_IPV6_UDP_EX)
> +		virtio_hash_types |= VIRTIO_NET_HASH_TYPE_UDP_EX;

Should use RTE_ETH_RSS macros with RTE_ prefix versions, updating in next-net.
Same for below virtio_to_ethdev_rss_offloads().



More information about the dev mailing list