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 /* Size of the map from BPF classid to queue table */ 9 #ifndef TAP_RSS_MAX 10 #define TAP_RSS_MAX 32 11 #endif 12 13 /* Standard Toeplitz hash key size */ 14 #define TAP_RSS_HASH_KEY_SIZE 40 15 16 /* hashed fields for RSS */ 17 enum hash_field { 18 HASH_FIELD_IPV4_L3, /* IPv4 src/dst addr */ 19 HASH_FIELD_IPV4_L3_L4, /* IPv4 src/dst addr + L4 src/dst ports */ 20 HASH_FIELD_IPV6_L3, /* IPv6 src/dst addr */ 21 HASH_FIELD_IPV6_L3_L4, /* IPv6 src/dst addr + L4 src/dst ports */ 22 }; 23 24 struct rss_key { 25 __u32 hash_fields; 26 __u8 key[TAP_RSS_HASH_KEY_SIZE]; 27 __u32 nb_queues; 28 __u32 queues[TAP_MAX_QUEUES]; 29 } __attribute__((packed)); 30 31 #endif /* _TAP_RSS_H_ */ 32