@@ -57,6 +57,8 @@ int fnic_get_vnic_config(struct fnic *fnic)
57
57
GET_CONFIG (port_down_timeout );
58
58
GET_CONFIG (port_down_io_retries );
59
59
GET_CONFIG (luns_per_tgt );
60
+ GET_CONFIG (intr_mode );
61
+ GET_CONFIG (wq_copy_count );
60
62
61
63
c -> wq_enet_desc_count =
62
64
min_t (u32 , VNIC_FNIC_WQ_DESCS_MAX ,
@@ -131,6 +133,12 @@ int fnic_get_vnic_config(struct fnic *fnic)
131
133
c -> intr_timer = min_t (u16 , VNIC_INTR_TIMER_MAX , c -> intr_timer );
132
134
c -> intr_timer_type = c -> intr_timer_type ;
133
135
136
+ /* for older firmware, GET_CONFIG will not return anything */
137
+ if (c -> wq_copy_count == 0 )
138
+ c -> wq_copy_count = 1 ;
139
+
140
+ c -> wq_copy_count = min_t (u16 , FNIC_WQ_COPY_MAX , c -> wq_copy_count );
141
+
134
142
shost_printk (KERN_INFO , fnic -> lport -> host ,
135
143
"vNIC MAC addr %pM "
136
144
"wq/wq_copy/rq %d/%d/%d\n" ,
@@ -161,6 +169,10 @@ int fnic_get_vnic_config(struct fnic *fnic)
161
169
shost_printk (KERN_INFO , fnic -> lport -> host ,
162
170
"vNIC port dn io retries %d port dn timeout %d\n" ,
163
171
c -> port_down_io_retries , c -> port_down_timeout );
172
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
173
+ "vNIC wq_copy_count: %d\n" , c -> wq_copy_count );
174
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
175
+ "vNIC intr mode: %d\n" , c -> intr_mode );
164
176
165
177
return 0 ;
166
178
}
@@ -187,12 +199,25 @@ int fnic_set_nic_config(struct fnic *fnic, u8 rss_default_cpu,
187
199
void fnic_get_res_counts (struct fnic * fnic )
188
200
{
189
201
fnic -> wq_count = vnic_dev_get_res_count (fnic -> vdev , RES_TYPE_WQ );
190
- fnic -> raw_wq_count = fnic -> wq_count - 1 ;
191
- fnic -> wq_copy_count = fnic -> wq_count - fnic -> raw_wq_count ;
202
+ fnic -> raw_wq_count = 1 ;
203
+ fnic -> wq_copy_count = fnic -> config . wq_copy_count ;
192
204
fnic -> rq_count = vnic_dev_get_res_count (fnic -> vdev , RES_TYPE_RQ );
193
205
fnic -> cq_count = vnic_dev_get_res_count (fnic -> vdev , RES_TYPE_CQ );
194
206
fnic -> intr_count = vnic_dev_get_res_count (fnic -> vdev ,
195
207
RES_TYPE_INTR_CTRL );
208
+
209
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
210
+ "vNIC fw resources wq_count: %d\n" , fnic -> wq_count );
211
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
212
+ "vNIC fw resources raw_wq_count: %d\n" , fnic -> raw_wq_count );
213
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
214
+ "vNIC fw resources wq_copy_count: %d\n" , fnic -> wq_copy_count );
215
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
216
+ "vNIC fw resources rq_count: %d\n" , fnic -> rq_count );
217
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
218
+ "vNIC fw resources cq_count: %d\n" , fnic -> cq_count );
219
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
220
+ "vNIC fw resources intr_count: %d\n" , fnic -> intr_count );
196
221
}
197
222
198
223
void fnic_free_vnic_resources (struct fnic * fnic )
@@ -234,10 +259,15 @@ int fnic_alloc_vnic_resources(struct fnic *fnic)
234
259
intr_mode == VNIC_DEV_INTR_MODE_MSIX ?
235
260
"MSI-X" : "unknown" );
236
261
237
- shost_printk (KERN_INFO , fnic -> lport -> host , "vNIC resources avail: "
238
- "wq %d cp_wq %d raw_wq %d rq %d cq %d intr %d\n" ,
239
- fnic -> wq_count , fnic -> wq_copy_count , fnic -> raw_wq_count ,
240
- fnic -> rq_count , fnic -> cq_count , fnic -> intr_count );
262
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
263
+ "vNIC resources avail: wq %d cp_wq %d raw_wq %d rq %d" ,
264
+ fnic -> wq_count , fnic -> wq_copy_count ,
265
+ fnic -> raw_wq_count , fnic -> rq_count );
266
+
267
+ shost_printk (KERN_INFO , fnic -> lport -> host ,
268
+ "vNIC resources avail: cq %d intr %d cpy-wq desc count %d\n" ,
269
+ fnic -> cq_count , fnic -> intr_count ,
270
+ fnic -> config .wq_copy_desc_count );
241
271
242
272
/* Allocate Raw WQ used for FCS frames */
243
273
for (i = 0 ; i < fnic -> raw_wq_count ; i ++ ) {
0 commit comments