Lines Matching refs:fnic
34 int fnic_get_vnic_config(struct fnic *fnic) in fnic_get_vnic_config() argument
36 struct vnic_fc_config *c = &fnic->config; in fnic_get_vnic_config()
41 err = vnic_dev_spec(fnic->vdev, \ in fnic_get_vnic_config()
45 shost_printk(KERN_ERR, fnic->lport->host, \ in fnic_get_vnic_config()
146 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
149 fnic->ctlr.ctl_src_addr, in fnic_get_vnic_config()
152 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
155 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
158 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
161 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
164 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
167 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
170 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
173 shost_printk(KERN_INFO, fnic->lport->host, in fnic_get_vnic_config()
180 int fnic_set_nic_config(struct fnic *fnic, u8 rss_default_cpu, in fnic_set_nic_config() argument
196 return vnic_dev_cmd(fnic->vdev, CMD_NIC_CFG, &a0, &a1, wait); in fnic_set_nic_config()
199 void fnic_get_res_counts(struct fnic *fnic) in fnic_get_res_counts() argument
201 fnic->wq_count = vnic_dev_get_res_count(fnic->vdev, RES_TYPE_WQ); in fnic_get_res_counts()
202 fnic->raw_wq_count = fnic->wq_count - 1; in fnic_get_res_counts()
203 fnic->wq_copy_count = fnic->wq_count - fnic->raw_wq_count; in fnic_get_res_counts()
204 fnic->rq_count = vnic_dev_get_res_count(fnic->vdev, RES_TYPE_RQ); in fnic_get_res_counts()
205 fnic->cq_count = vnic_dev_get_res_count(fnic->vdev, RES_TYPE_CQ); in fnic_get_res_counts()
206 fnic->intr_count = vnic_dev_get_res_count(fnic->vdev, in fnic_get_res_counts()
210 void fnic_free_vnic_resources(struct fnic *fnic) in fnic_free_vnic_resources() argument
214 for (i = 0; i < fnic->raw_wq_count; i++) in fnic_free_vnic_resources()
215 vnic_wq_free(&fnic->wq[i]); in fnic_free_vnic_resources()
217 for (i = 0; i < fnic->wq_copy_count; i++) in fnic_free_vnic_resources()
218 vnic_wq_copy_free(&fnic->wq_copy[i]); in fnic_free_vnic_resources()
220 for (i = 0; i < fnic->rq_count; i++) in fnic_free_vnic_resources()
221 vnic_rq_free(&fnic->rq[i]); in fnic_free_vnic_resources()
223 for (i = 0; i < fnic->cq_count; i++) in fnic_free_vnic_resources()
224 vnic_cq_free(&fnic->cq[i]); in fnic_free_vnic_resources()
226 for (i = 0; i < fnic->intr_count; i++) in fnic_free_vnic_resources()
227 vnic_intr_free(&fnic->intr[i]); in fnic_free_vnic_resources()
230 int fnic_alloc_vnic_resources(struct fnic *fnic) in fnic_alloc_vnic_resources() argument
241 intr_mode = vnic_dev_get_intr_mode(fnic->vdev); in fnic_alloc_vnic_resources()
243 shost_printk(KERN_INFO, fnic->lport->host, "vNIC interrupt mode: %s\n", in fnic_alloc_vnic_resources()
249 shost_printk(KERN_INFO, fnic->lport->host, "vNIC resources avail: " in fnic_alloc_vnic_resources()
251 fnic->wq_count, fnic->wq_copy_count, fnic->raw_wq_count, in fnic_alloc_vnic_resources()
252 fnic->rq_count, fnic->cq_count, fnic->intr_count); in fnic_alloc_vnic_resources()
255 for (i = 0; i < fnic->raw_wq_count; i++) { in fnic_alloc_vnic_resources()
256 err = vnic_wq_alloc(fnic->vdev, &fnic->wq[i], i, in fnic_alloc_vnic_resources()
257 fnic->config.wq_enet_desc_count, in fnic_alloc_vnic_resources()
264 for (i = 0; i < fnic->wq_copy_count; i++) { in fnic_alloc_vnic_resources()
265 err = vnic_wq_copy_alloc(fnic->vdev, &fnic->wq_copy[i], in fnic_alloc_vnic_resources()
266 (fnic->raw_wq_count + i), in fnic_alloc_vnic_resources()
267 fnic->config.wq_copy_desc_count, in fnic_alloc_vnic_resources()
274 for (i = 0; i < fnic->rq_count; i++) { in fnic_alloc_vnic_resources()
275 err = vnic_rq_alloc(fnic->vdev, &fnic->rq[i], i, in fnic_alloc_vnic_resources()
276 fnic->config.rq_desc_count, in fnic_alloc_vnic_resources()
283 for (i = 0; i < fnic->rq_count; i++) { in fnic_alloc_vnic_resources()
285 err = vnic_cq_alloc(fnic->vdev, in fnic_alloc_vnic_resources()
286 &fnic->cq[cq_index], cq_index, in fnic_alloc_vnic_resources()
287 fnic->config.rq_desc_count, in fnic_alloc_vnic_resources()
294 for (i = 0; i < fnic->raw_wq_count; i++) { in fnic_alloc_vnic_resources()
295 cq_index = fnic->rq_count + i; in fnic_alloc_vnic_resources()
296 err = vnic_cq_alloc(fnic->vdev, &fnic->cq[cq_index], cq_index, in fnic_alloc_vnic_resources()
297 fnic->config.wq_enet_desc_count, in fnic_alloc_vnic_resources()
304 wq_copy_cq_desc_count = (fnic->config.wq_copy_desc_count * 3); in fnic_alloc_vnic_resources()
305 for (i = 0; i < fnic->wq_copy_count; i++) { in fnic_alloc_vnic_resources()
306 cq_index = fnic->raw_wq_count + fnic->rq_count + i; in fnic_alloc_vnic_resources()
307 err = vnic_cq_alloc(fnic->vdev, &fnic->cq[cq_index], in fnic_alloc_vnic_resources()
315 for (i = 0; i < fnic->intr_count; i++) { in fnic_alloc_vnic_resources()
316 err = vnic_intr_alloc(fnic->vdev, &fnic->intr[i], i); in fnic_alloc_vnic_resources()
321 fnic->legacy_pba = vnic_dev_get_res(fnic->vdev, in fnic_alloc_vnic_resources()
324 if (!fnic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) { in fnic_alloc_vnic_resources()
325 shost_printk(KERN_ERR, fnic->lport->host, in fnic_alloc_vnic_resources()
347 error_interrupt_offset = fnic->err_intr_offset; in fnic_alloc_vnic_resources()
355 for (i = 0; i < fnic->rq_count; i++) { in fnic_alloc_vnic_resources()
357 vnic_rq_init(&fnic->rq[i], in fnic_alloc_vnic_resources()
363 for (i = 0; i < fnic->raw_wq_count; i++) { in fnic_alloc_vnic_resources()
364 cq_index = i + fnic->rq_count; in fnic_alloc_vnic_resources()
365 vnic_wq_init(&fnic->wq[i], in fnic_alloc_vnic_resources()
371 for (i = 0; i < fnic->wq_copy_count; i++) { in fnic_alloc_vnic_resources()
372 vnic_wq_copy_init(&fnic->wq_copy[i], in fnic_alloc_vnic_resources()
378 for (i = 0; i < fnic->cq_count; i++) { in fnic_alloc_vnic_resources()
389 vnic_cq_init(&fnic->cq[i], in fnic_alloc_vnic_resources()
419 for (i = 0; i < fnic->intr_count; i++) { in fnic_alloc_vnic_resources()
420 vnic_intr_init(&fnic->intr[i], in fnic_alloc_vnic_resources()
421 fnic->config.intr_timer, in fnic_alloc_vnic_resources()
422 fnic->config.intr_timer_type, in fnic_alloc_vnic_resources()
427 err = vnic_dev_stats_dump(fnic->vdev, &fnic->stats); in fnic_alloc_vnic_resources()
429 shost_printk(KERN_ERR, fnic->lport->host, in fnic_alloc_vnic_resources()
435 vnic_dev_stats_clear(fnic->vdev); in fnic_alloc_vnic_resources()
440 fnic_free_vnic_resources(fnic); in fnic_alloc_vnic_resources()