Lines Matching refs:snic

19 snic_get_vnic_config(struct snic *snic)  in snic_get_vnic_config()  argument
21 struct vnic_snic_config *c = &snic->config; in snic_get_vnic_config()
26 ret = svnic_dev_spec(snic->vdev, \ in snic_get_vnic_config()
31 SNIC_HOST_ERR(snic->shost, \ in snic_get_vnic_config()
106 snic_get_res_counts(struct snic *snic) in snic_get_res_counts() argument
108 snic->wq_count = svnic_dev_get_res_count(snic->vdev, RES_TYPE_WQ); in snic_get_res_counts()
109 SNIC_BUG_ON(snic->wq_count == 0); in snic_get_res_counts()
110 snic->cq_count = svnic_dev_get_res_count(snic->vdev, RES_TYPE_CQ); in snic_get_res_counts()
111 SNIC_BUG_ON(snic->cq_count == 0); in snic_get_res_counts()
112 snic->intr_count = svnic_dev_get_res_count(snic->vdev, in snic_get_res_counts()
114 SNIC_BUG_ON(snic->intr_count == 0); in snic_get_res_counts()
118 snic_free_vnic_res(struct snic *snic) in snic_free_vnic_res() argument
122 for (i = 0; i < snic->wq_count; i++) in snic_free_vnic_res()
123 svnic_wq_free(&snic->wq[i]); in snic_free_vnic_res()
125 for (i = 0; i < snic->cq_count; i++) in snic_free_vnic_res()
126 svnic_cq_free(&snic->cq[i]); in snic_free_vnic_res()
128 for (i = 0; i < snic->intr_count; i++) in snic_free_vnic_res()
129 svnic_intr_free(&snic->intr[i]); in snic_free_vnic_res()
133 snic_alloc_vnic_res(struct snic *snic) in snic_alloc_vnic_res() argument
143 intr_mode = svnic_dev_get_intr_mode(snic->vdev); in snic_alloc_vnic_res()
156 SNIC_INFO("wq %d cq %d intr %d\n", snic->wq_count, in snic_alloc_vnic_res()
157 snic->cq_count, in snic_alloc_vnic_res()
158 snic->intr_count); in snic_alloc_vnic_res()
162 for (i = 0; i < snic->wq_count; i++) { in snic_alloc_vnic_res()
163 ret = svnic_wq_alloc(snic->vdev, in snic_alloc_vnic_res()
164 &snic->wq[i], in snic_alloc_vnic_res()
166 snic->config.wq_enet_desc_count, in snic_alloc_vnic_res()
173 for (i = 0; i < snic->wq_count; i++) { in snic_alloc_vnic_res()
174 ret = svnic_cq_alloc(snic->vdev, in snic_alloc_vnic_res()
175 &snic->cq[i], in snic_alloc_vnic_res()
177 snic->config.wq_enet_desc_count, in snic_alloc_vnic_res()
183 SNIC_BUG_ON(snic->cq_count != 2 * snic->wq_count); in snic_alloc_vnic_res()
185 for (i = snic->wq_count; i < snic->cq_count; i++) { in snic_alloc_vnic_res()
186 ret = svnic_cq_alloc(snic->vdev, in snic_alloc_vnic_res()
187 &snic->cq[i], in snic_alloc_vnic_res()
189 (snic->config.wq_enet_desc_count * 3), in snic_alloc_vnic_res()
195 for (i = 0; i < snic->intr_count; i++) { in snic_alloc_vnic_res()
196 ret = svnic_intr_alloc(snic->vdev, &snic->intr[i], i); in snic_alloc_vnic_res()
207 err_intr_offset = snic->err_intr_offset; in snic_alloc_vnic_res()
209 for (i = 0; i < snic->wq_count; i++) { in snic_alloc_vnic_res()
210 svnic_wq_init(&snic->wq[i], in snic_alloc_vnic_res()
216 for (i = 0; i < snic->cq_count; i++) { in snic_alloc_vnic_res()
219 svnic_cq_init(&snic->cq[i], in snic_alloc_vnic_res()
239 for (i = 0; i < snic->intr_count; i++) { in snic_alloc_vnic_res()
240 svnic_intr_init(&snic->intr[i], in snic_alloc_vnic_res()
241 snic->config.intr_timer, in snic_alloc_vnic_res()
242 snic->config.intr_timer_type, in snic_alloc_vnic_res()
247 ret = svnic_dev_stats_dump(snic->vdev, &snic->stats); in snic_alloc_vnic_res()
249 SNIC_HOST_ERR(snic->shost, in snic_alloc_vnic_res()
256 svnic_dev_stats_clear(snic->vdev); in snic_alloc_vnic_res()
262 snic_free_vnic_res(snic); in snic_alloc_vnic_res()
268 snic_log_q_error(struct snic *snic) in snic_log_q_error() argument
273 for (i = 0; i < snic->wq_count; i++) { in snic_log_q_error()
274 err_status = ioread32(&snic->wq[i].ctrl->error_status); in snic_log_q_error()
276 SNIC_HOST_ERR(snic->shost, in snic_log_q_error()