xref: /netbsd-src/sys/dev/pci/ixgbe/ixgbe_rss.h (revision 8467fefbc1f237841c1a319d1036afcc13ab0e94)
1*8467fefbSmsaitoh /* $NetBSD: ixgbe_rss.h,v 1.6 2021/12/24 05:02:11 msaitoh Exp $ */
2dc7f84c8Smsaitoh /******************************************************************************
3dc7f84c8Smsaitoh 
4*8467fefbSmsaitoh   Copyright (c) 2001-2020, Intel Corporation
5dc7f84c8Smsaitoh   All rights reserved.
6dc7f84c8Smsaitoh 
7dc7f84c8Smsaitoh   Redistribution and use in source and binary forms, with or without
8dc7f84c8Smsaitoh   modification, are permitted provided that the following conditions are met:
9dc7f84c8Smsaitoh 
10dc7f84c8Smsaitoh    1. Redistributions of source code must retain the above copyright notice,
11dc7f84c8Smsaitoh       this list of conditions and the following disclaimer.
12dc7f84c8Smsaitoh 
13dc7f84c8Smsaitoh    2. Redistributions in binary form must reproduce the above copyright
14dc7f84c8Smsaitoh       notice, this list of conditions and the following disclaimer in the
15dc7f84c8Smsaitoh       documentation and/or other materials provided with the distribution.
16dc7f84c8Smsaitoh 
17dc7f84c8Smsaitoh    3. Neither the name of the Intel Corporation nor the names of its
18dc7f84c8Smsaitoh       contributors may be used to endorse or promote products derived from
19dc7f84c8Smsaitoh       this software without specific prior written permission.
20dc7f84c8Smsaitoh 
21dc7f84c8Smsaitoh   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22dc7f84c8Smsaitoh   AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23dc7f84c8Smsaitoh   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24dc7f84c8Smsaitoh   ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25dc7f84c8Smsaitoh   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26dc7f84c8Smsaitoh   CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27dc7f84c8Smsaitoh   SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28dc7f84c8Smsaitoh   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29dc7f84c8Smsaitoh   CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30dc7f84c8Smsaitoh   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31dc7f84c8Smsaitoh   POSSIBILITY OF SUCH DAMAGE.
32dc7f84c8Smsaitoh 
33dc7f84c8Smsaitoh ******************************************************************************/
34a06ca633Smsaitoh /*$FreeBSD: head/sys/dev/ixgbe/ixgbe_rss.h 324518 2017-10-11 05:55:52Z sephe $*/
35dc7f84c8Smsaitoh 
36dc7f84c8Smsaitoh #ifndef _IXGBE_RSS_H_
37dc7f84c8Smsaitoh #define _IXGBE_RSS_H_
38dc7f84c8Smsaitoh 
3983c72d69Sknakahara #ifdef __NetBSD__
4083c72d69Sknakahara #include <net/rss_config.h>
4183c72d69Sknakahara 
4283c72d69Sknakahara #define RSS_HASHTYPE_RSS_IPV4          (1 << 1)
4383c72d69Sknakahara #define RSS_HASHTYPE_RSS_TCP_IPV4      (1 << 2)
4483c72d69Sknakahara #define RSS_HASHTYPE_RSS_IPV6          (1 << 3)
4583c72d69Sknakahara #define RSS_HASHTYPE_RSS_TCP_IPV6      (1 << 4)
4683c72d69Sknakahara #define RSS_HASHTYPE_RSS_IPV6_EX       (1 << 5)
4783c72d69Sknakahara #define RSS_HASHTYPE_RSS_TCP_IPV6_EX   (1 << 6)
4883c72d69Sknakahara #define RSS_HASHTYPE_RSS_UDP_IPV4      (1 << 7)
4983c72d69Sknakahara #define RSS_HASHTYPE_RSS_UDP_IPV6      (1 << 9)
5083c72d69Sknakahara #define RSS_HASHTYPE_RSS_UDP_IPV6_EX   (1 << 10)
5183c72d69Sknakahara 
5283c72d69Sknakahara #define rss_getcpu(_a) 0
5383c72d69Sknakahara #define rss_getnumbuckets() 1
5483c72d69Sknakahara #define rss_get_indirection_to_bucket(_a) 0
5583c72d69Sknakahara #define rss_gethashconfig() 0x7E
5683c72d69Sknakahara #define rss_hash2bucket(_a,_b,_c) -1
5783c72d69Sknakahara 
5883c72d69Sknakahara #else
59dc7f84c8Smsaitoh #ifdef RSS
60dc7f84c8Smsaitoh 
61dc7f84c8Smsaitoh #include <net/rss_config.h>
62dc7f84c8Smsaitoh #include <netinet/in_rss.h>
63dc7f84c8Smsaitoh 
64dc7f84c8Smsaitoh #else
65dc7f84c8Smsaitoh 
66dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_IPV4          (1 << 1)
67dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_TCP_IPV4      (1 << 2)
68dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_IPV6          (1 << 3)
69dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_TCP_IPV6      (1 << 4)
70dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_IPV6_EX       (1 << 5)
71dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_TCP_IPV6_EX   (1 << 6)
72dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_UDP_IPV4      (1 << 7)
73dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_UDP_IPV6      (1 << 9)
74dc7f84c8Smsaitoh #define RSS_HASHTYPE_RSS_UDP_IPV6_EX   (1 << 10)
75dc7f84c8Smsaitoh 
76dc7f84c8Smsaitoh #define rss_getcpu(_a) 0
77dc7f84c8Smsaitoh #define rss_getnumbuckets() 1
78dc7f84c8Smsaitoh #define rss_getkey(_a)		do { } while (/*CONSTCOND*/false)
79dc7f84c8Smsaitoh #define rss_get_indirection_to_bucket(_a) 0
80dc7f84c8Smsaitoh #define rss_gethashconfig() 0x7E
81dc7f84c8Smsaitoh #define rss_hash2bucket(_a,_b,_c) -1
82dc7f84c8Smsaitoh 
83dc7f84c8Smsaitoh #endif
8483c72d69Sknakahara #endif /* __NetBSD__ */
85dc7f84c8Smsaitoh #endif /* _IXGBE_RSS_H_ */
86