@@ -17,12 +17,22 @@ struct cq_enet_wq_desc {
17
17
u8 type_color ;
18
18
};
19
19
20
- static inline void cq_enet_wq_desc_dec (struct cq_enet_wq_desc * desc ,
21
- u8 * type , u8 * color , u16 * q_number , u16 * completed_index )
22
- {
23
- cq_desc_dec ((struct cq_desc * )desc , type ,
24
- color , q_number , completed_index );
25
- }
20
+ /*
21
+ * Defines and Capabilities for CMD_CQ_ENTRY_SIZE_SET
22
+ */
23
+ #define VNIC_RQ_ALL (~0ULL)
24
+
25
+ #define VNIC_RQ_CQ_ENTRY_SIZE_16 0
26
+ #define VNIC_RQ_CQ_ENTRY_SIZE_32 1
27
+ #define VNIC_RQ_CQ_ENTRY_SIZE_64 2
28
+
29
+ #define VNIC_RQ_CQ_ENTRY_SIZE_16_CAPABLE BIT(VNIC_RQ_CQ_ENTRY_SIZE_16)
30
+ #define VNIC_RQ_CQ_ENTRY_SIZE_32_CAPABLE BIT(VNIC_RQ_CQ_ENTRY_SIZE_32)
31
+ #define VNIC_RQ_CQ_ENTRY_SIZE_64_CAPABLE BIT(VNIC_RQ_CQ_ENTRY_SIZE_64)
32
+
33
+ #define VNIC_RQ_CQ_ENTRY_SIZE_ALL_BIT (VNIC_RQ_CQ_ENTRY_SIZE_16_CAPABLE | \
34
+ VNIC_RQ_CQ_ENTRY_SIZE_32_CAPABLE | \
35
+ VNIC_RQ_CQ_ENTRY_SIZE_64_CAPABLE)
26
36
27
37
/* Completion queue descriptor: Ethernet receive queue, 16B */
28
38
struct cq_enet_rq_desc {
@@ -36,6 +46,45 @@ struct cq_enet_rq_desc {
36
46
u8 type_color ;
37
47
};
38
48
49
+ /* Completion queue descriptor: Ethernet receive queue, 32B */
50
+ struct cq_enet_rq_desc_32 {
51
+ __le16 completed_index_flags ;
52
+ __le16 q_number_rss_type_flags ;
53
+ __le32 rss_hash ;
54
+ __le16 bytes_written_flags ;
55
+ __le16 vlan ;
56
+ __le16 checksum_fcoe ;
57
+ u8 flags ;
58
+ u8 fetch_index_flags ;
59
+ __le32 time_stamp ;
60
+ __le16 time_stamp2 ;
61
+ __le16 pie_info ;
62
+ __le32 pie_info2 ;
63
+ __le16 pie_info3 ;
64
+ u8 pie_info4 ;
65
+ u8 type_color ;
66
+ };
67
+
68
+ /* Completion queue descriptor: Ethernet receive queue, 64B */
69
+ struct cq_enet_rq_desc_64 {
70
+ __le16 completed_index_flags ;
71
+ __le16 q_number_rss_type_flags ;
72
+ __le32 rss_hash ;
73
+ __le16 bytes_written_flags ;
74
+ __le16 vlan ;
75
+ __le16 checksum_fcoe ;
76
+ u8 flags ;
77
+ u8 fetch_index_flags ;
78
+ __le32 time_stamp ;
79
+ __le16 time_stamp2 ;
80
+ __le16 pie_info ;
81
+ __le32 pie_info2 ;
82
+ __le16 pie_info3 ;
83
+ u8 pie_info4 ;
84
+ u8 reserved [32 ];
85
+ u8 type_color ;
86
+ };
87
+
39
88
#define CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT (0x1 << 12)
40
89
#define CQ_ENET_RQ_DESC_FLAGS_FCOE (0x1 << 13)
41
90
#define CQ_ENET_RQ_DESC_FLAGS_EOP (0x1 << 14)
@@ -88,85 +137,4 @@ struct cq_enet_rq_desc {
88
137
#define CQ_ENET_RQ_DESC_FLAGS_IPV4_FRAGMENT (0x1 << 6)
89
138
#define CQ_ENET_RQ_DESC_FLAGS_FCS_OK (0x1 << 7)
90
139
91
- static inline void cq_enet_rq_desc_dec (struct cq_enet_rq_desc * desc ,
92
- u8 * type , u8 * color , u16 * q_number , u16 * completed_index ,
93
- u8 * ingress_port , u8 * fcoe , u8 * eop , u8 * sop , u8 * rss_type ,
94
- u8 * csum_not_calc , u32 * rss_hash , u16 * bytes_written , u8 * packet_error ,
95
- u8 * vlan_stripped , u16 * vlan_tci , u16 * checksum , u8 * fcoe_sof ,
96
- u8 * fcoe_fc_crc_ok , u8 * fcoe_enc_error , u8 * fcoe_eof ,
97
- u8 * tcp_udp_csum_ok , u8 * udp , u8 * tcp , u8 * ipv4_csum_ok ,
98
- u8 * ipv6 , u8 * ipv4 , u8 * ipv4_fragment , u8 * fcs_ok )
99
- {
100
- u16 completed_index_flags ;
101
- u16 q_number_rss_type_flags ;
102
- u16 bytes_written_flags ;
103
-
104
- cq_desc_dec ((struct cq_desc * )desc , type ,
105
- color , q_number , completed_index );
106
-
107
- completed_index_flags = le16_to_cpu (desc -> completed_index_flags );
108
- q_number_rss_type_flags =
109
- le16_to_cpu (desc -> q_number_rss_type_flags );
110
- bytes_written_flags = le16_to_cpu (desc -> bytes_written_flags );
111
-
112
- * ingress_port = (completed_index_flags &
113
- CQ_ENET_RQ_DESC_FLAGS_INGRESS_PORT ) ? 1 : 0 ;
114
- * fcoe = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_FCOE ) ?
115
- 1 : 0 ;
116
- * eop = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_EOP ) ?
117
- 1 : 0 ;
118
- * sop = (completed_index_flags & CQ_ENET_RQ_DESC_FLAGS_SOP ) ?
119
- 1 : 0 ;
120
-
121
- * rss_type = (u8 )((q_number_rss_type_flags >> CQ_DESC_Q_NUM_BITS ) &
122
- CQ_ENET_RQ_DESC_RSS_TYPE_MASK );
123
- * csum_not_calc = (q_number_rss_type_flags &
124
- CQ_ENET_RQ_DESC_FLAGS_CSUM_NOT_CALC ) ? 1 : 0 ;
125
-
126
- * rss_hash = le32_to_cpu (desc -> rss_hash );
127
-
128
- * bytes_written = bytes_written_flags &
129
- CQ_ENET_RQ_DESC_BYTES_WRITTEN_MASK ;
130
- * packet_error = (bytes_written_flags &
131
- CQ_ENET_RQ_DESC_FLAGS_TRUNCATED ) ? 1 : 0 ;
132
- * vlan_stripped = (bytes_written_flags &
133
- CQ_ENET_RQ_DESC_FLAGS_VLAN_STRIPPED ) ? 1 : 0 ;
134
-
135
- /*
136
- * Tag Control Information(16) = user_priority(3) + cfi(1) + vlan(12)
137
- */
138
- * vlan_tci = le16_to_cpu (desc -> vlan );
139
-
140
- if (* fcoe ) {
141
- * fcoe_sof = (u8 )(le16_to_cpu (desc -> checksum_fcoe ) &
142
- CQ_ENET_RQ_DESC_FCOE_SOF_MASK );
143
- * fcoe_fc_crc_ok = (desc -> flags &
144
- CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK ) ? 1 : 0 ;
145
- * fcoe_enc_error = (desc -> flags &
146
- CQ_ENET_RQ_DESC_FCOE_ENC_ERROR ) ? 1 : 0 ;
147
- * fcoe_eof = (u8 )((le16_to_cpu (desc -> checksum_fcoe ) >>
148
- CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT ) &
149
- CQ_ENET_RQ_DESC_FCOE_EOF_MASK );
150
- * checksum = 0 ;
151
- } else {
152
- * fcoe_sof = 0 ;
153
- * fcoe_fc_crc_ok = 0 ;
154
- * fcoe_enc_error = 0 ;
155
- * fcoe_eof = 0 ;
156
- * checksum = le16_to_cpu (desc -> checksum_fcoe );
157
- }
158
-
159
- * tcp_udp_csum_ok =
160
- (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_TCP_UDP_CSUM_OK ) ? 1 : 0 ;
161
- * udp = (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_UDP ) ? 1 : 0 ;
162
- * tcp = (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_TCP ) ? 1 : 0 ;
163
- * ipv4_csum_ok =
164
- (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_IPV4_CSUM_OK ) ? 1 : 0 ;
165
- * ipv6 = (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_IPV6 ) ? 1 : 0 ;
166
- * ipv4 = (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_IPV4 ) ? 1 : 0 ;
167
- * ipv4_fragment =
168
- (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_IPV4_FRAGMENT ) ? 1 : 0 ;
169
- * fcs_ok = (desc -> flags & CQ_ENET_RQ_DESC_FLAGS_FCS_OK ) ? 1 : 0 ;
170
- }
171
-
172
140
#endif /* _CQ_ENET_DESC_H_ */
0 commit comments