xref: /dpdk/drivers/net/tap/tap_rss.h (revision 68a03efeed657e6e05f281479b33b51102797e15)
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 /* Supported RSS */
16 #define TAP_RSS_HF_MASK (~(ETH_RSS_IP | ETH_RSS_UDP | ETH_RSS_TCP))
17 
18 /* hashed fields for RSS */
19 enum hash_field {
20 	HASH_FIELD_IPV4_L3,	/* IPv4 src/dst addr */
21 	HASH_FIELD_IPV4_L3_L4,	/* IPv4 src/dst addr + L4 src/dst ports */
22 	HASH_FIELD_IPV6_L3,	/* IPv6 src/dst addr */
23 	HASH_FIELD_IPV6_L3_L4,	/* IPv6 src/dst addr + L4 src/dst ports */
24 	HASH_FIELD_L2_SRC,	/* Ethernet src addr */
25 	HASH_FIELD_L2_DST,	/* Ethernet dst addr */
26 	HASH_FIELD_L3_SRC,	/* L3 src addr */
27 	HASH_FIELD_L3_DST,	/* L3 dst addr */
28 	HASH_FIELD_L4_SRC,	/* TCP/UDP src ports */
29 	HASH_FIELD_L4_DST,	/* TCP/UDP dst ports */
30 };
31 
32 struct rss_key {
33 	 __u8 key[128];
34 	__u32 hash_fields;
35 	__u32 key_size;
36 	__u32 queues[TAP_MAX_QUEUES];
37 	__u32 nb_queues;
38 } __rte_packed;
39 
40 #endif /* _TAP_RSS_H_ */
41