net/tap: report on supported RSS hash functions
[dpdk.git] / drivers / net / tap / tap_rss.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright 2017 Mellanox Technologies, Ltd
3  */
4
5 #ifndef _TAP_RSS_H_
6 #define _TAP_RSS_H_
7
8 #ifndef TAP_MAX_QUEUES
9 #define TAP_MAX_QUEUES 16
10 #endif
11
12 /* Fixed RSS hash key size in bytes. */
13 #define TAP_RSS_HASH_KEY_SIZE 40
14
15 /* hashed fields for RSS */
16 enum hash_field {
17         HASH_FIELD_IPV4_L3,     /* IPv4 src/dst addr */
18         HASH_FIELD_IPV4_L3_L4,  /* IPv4 src/dst addr + L4 src/dst ports */
19         HASH_FIELD_IPV6_L3,     /* IPv6 src/dst addr */
20         HASH_FIELD_IPV6_L3_L4,  /* IPv6 src/dst addr + L4 src/dst ports */
21         HASH_FIELD_L2_SRC,      /* Ethernet src addr */
22         HASH_FIELD_L2_DST,      /* Ethernet dst addr */
23         HASH_FIELD_L3_SRC,      /* L3 src addr */
24         HASH_FIELD_L3_DST,      /* L3 dst addr */
25         HASH_FIELD_L4_SRC,      /* TCP/UDP src ports */
26         HASH_FIELD_L4_DST,      /* TCP/UDP dst ports */
27 };
28
29 struct rss_key {
30          __u8 key[128];
31         __u32 hash_fields;
32         __u32 key_size;
33         __u32 queues[TAP_MAX_QUEUES];
34         __u32 nb_queues;
35 } __attribute__((packed));
36
37 #endif /* _TAP_RSS_H_ */