net/tap: report on supported RSS hash functions
authorOphir Munk <ophirmu@mellanox.com>
Tue, 8 May 2018 17:07:35 +0000 (17:07 +0000)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:31:51 +0000 (22:31 +0100)
Report on TAP supported RSS functions as part of dev_infos_get
callback: ETH_RSS_IP, ETH_RSS_UDP and ETH_RSS_TCP.
Known limitation: TAP supports all of the above hash functions together
and not in partial combinations.
Previous to this commit RSS support was reported as none. Since the
introduction of [1] it is required that all RSS configurations will be
verified.

[1] commit 8863a1fbfc66 ("ethdev: add supported hash function check")

Signed-off-by: Ophir Munk <ophirmu@mellanox.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
doc/guides/nics/tap.rst
drivers/net/tap/rte_eth_tap.c
drivers/net/tap/tap_bpf_program.c
drivers/net/tap/tap_rss.h

index dca64c9..2714868 100644 (file)
@@ -258,6 +258,11 @@ Please refer to ``iproute2`` package file ``lib/bpf.c`` function
 An example utility for eBPF instruction generation in the format of C arrays will
 be added in next releases
 
+TAP reports on supported RSS functions as part of dev_infos_get callback:
+``ETH_RSS_IP``, ``ETH_RSS_UDP`` and ``ETH_RSS_TCP``.
+**Known limitation:** TAP supports all of the above hash functions together
+and not in partial combinations.
+
 Systems supporting flow API
 ---------------------------
 
index 172a7ba..b9dac19 100644 (file)
@@ -35,6 +35,7 @@
 #include <linux/if_ether.h>
 #include <fcntl.h>
 
+#include <tap_rss.h>
 #include <rte_eth_tap.h>
 #include <tap_flow.h>
 #include <tap_netlink.h>
@@ -758,6 +759,13 @@ tap_dev_info(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)
        dev_info->tx_queue_offload_capa = tap_tx_offload_get_queue_capa();
        dev_info->tx_offload_capa = tap_tx_offload_get_port_capa() |
                                    dev_info->tx_queue_offload_capa;
+       dev_info->hash_key_size = TAP_RSS_HASH_KEY_SIZE;
+       /*
+        * limitation: TAP suppors all of the following hash
+        * functions together and not in partial combinations
+        */
+       dev_info->flow_type_rss_offloads =
+               ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP;
 }
 
 static int
index dabbf7c..1cb7382 100644 (file)
@@ -84,7 +84,7 @@ struct ipv6_l3_l4_tuple {
        __u16       sport;
 } __attribute__((packed));
 
-static const __u8 def_rss_key[] = {
+static const __u8 def_rss_key[TAP_RSS_HASH_KEY_SIZE] = {
        0xd1, 0x81, 0xc6, 0x2c,
        0xf7, 0xf4, 0xdb, 0x5b,
        0x19, 0x83, 0xa2, 0xfc,
index 4ebb653..bd6b97b 100644 (file)
@@ -9,6 +9,9 @@
 #define TAP_MAX_QUEUES 16
 #endif
 
+/* Fixed RSS hash key size in bytes. */
+#define TAP_RSS_HASH_KEY_SIZE 40
+
 /* hashed fields for RSS */
 enum hash_field {
        HASH_FIELD_IPV4_L3,     /* IPv4 src/dst addr */