1 | /* SPDX-License-Identifier: GPL-2.0 */ |
2 | /* Copyright (c) 2021, Intel Corporation. */ |
3 | |
4 | #ifndef _IAVF_ADV_RSS_H_ |
5 | #define |
6 | |
7 | struct iavf_adapter; |
8 | |
9 | /* State of advanced RSS configuration */ |
10 | enum { |
11 | , /* User requests to add RSS */ |
12 | , /* RSS pending add by the PF */ |
13 | , /* Driver requests to delete RSS */ |
14 | , /* RSS pending delete by the PF */ |
15 | , /* RSS configuration is active */ |
16 | }; |
17 | |
18 | enum { |
19 | = 0x00000000, |
20 | = 0x00000001, |
21 | = 0x00000002, |
22 | = 0x00000004, |
23 | = 0x00000008, |
24 | = 0x00000010, |
25 | }; |
26 | |
27 | #define \ |
28 | (IAVF_ADV_RSS_FLOW_SEG_HDR_IPV4 | \ |
29 | IAVF_ADV_RSS_FLOW_SEG_HDR_IPV6) |
30 | |
31 | #define \ |
32 | (IAVF_ADV_RSS_FLOW_SEG_HDR_TCP | \ |
33 | IAVF_ADV_RSS_FLOW_SEG_HDR_UDP | \ |
34 | IAVF_ADV_RSS_FLOW_SEG_HDR_SCTP) |
35 | |
36 | enum { |
37 | /* L3 */ |
38 | , |
39 | , |
40 | , |
41 | , |
42 | /* L4 */ |
43 | , |
44 | , |
45 | , |
46 | , |
47 | , |
48 | , |
49 | |
50 | /* The total number of enums must not exceed 64 */ |
51 | |
52 | }; |
53 | |
54 | #define 0 |
55 | #define \ |
56 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_IPV4_SA) |
57 | #define \ |
58 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_IPV6_SA) |
59 | #define \ |
60 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_IPV4_DA) |
61 | #define \ |
62 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_IPV6_DA) |
63 | #define \ |
64 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_TCP_SRC_PORT) |
65 | #define \ |
66 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_TCP_DST_PORT) |
67 | #define \ |
68 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_UDP_SRC_PORT) |
69 | #define \ |
70 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_UDP_DST_PORT) |
71 | #define \ |
72 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_SCTP_SRC_PORT) |
73 | #define \ |
74 | BIT_ULL(IAVF_ADV_RSS_FLOW_FIELD_IDX_SCTP_DST_PORT) |
75 | |
76 | /* bookkeeping of advanced RSS configuration */ |
77 | struct { |
78 | enum iavf_adv_rss_state_t ; |
79 | struct list_head ; |
80 | |
81 | u32 ; |
82 | u64 ; |
83 | |
84 | struct virtchnl_rss_cfg ; |
85 | }; |
86 | |
87 | int |
88 | (struct virtchnl_rss_cfg *, |
89 | u32 packet_hdrs, u64 hash_flds); |
90 | struct iavf_adv_rss * |
91 | (struct iavf_adapter *adapter, u32 packet_hdrs); |
92 | void |
93 | (struct iavf_adapter *adapter, struct iavf_adv_rss *, |
94 | const char *action, const char *result); |
95 | #endif /* _IAVF_ADV_RSS_H_ */ |
96 | |