Thread (10 messages) 10 messages, 3 authors, 2021-10-29

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

From: Maxime Coquelin <hidden>
Date: 2021-10-29 17:54:52


On 10/29/21 19:40, Ferruh Yigit wrote:
On 10/27/2021 3:22 PM, Maxime Coquelin wrote:
quoted
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 <redacted>
<...>
quoted
+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().
Thanks, for doing the change.

When rebasing, I renamed most of these defines, but forgot the ones in
these two functions.

Maxime
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help