Lines Matching refs:enic
42 int enic_get_vnic_config(struct enic *enic) in enic_get_vnic_config() argument
44 struct vnic_enet_config *c = &enic->config; in enic_get_vnic_config()
47 err = vnic_dev_get_mac_addr(enic->vdev, enic->mac_addr); in enic_get_vnic_config()
49 dev_err(enic_get_dev(enic), in enic_get_vnic_config()
56 err = vnic_dev_spec(enic->vdev, \ in enic_get_vnic_config()
60 dev_err(enic_get_dev(enic), \ in enic_get_vnic_config()
95 vnic_dev_get_intr_coal_timer_max(enic->vdev)); in enic_get_vnic_config()
97 dev_info(enic_get_dev(enic), in enic_get_vnic_config()
99 enic->mac_addr, c->wq_desc_count, c->rq_desc_count, c->mtu); in enic_get_vnic_config()
101 dev_info(enic_get_dev(enic), "vNIC csum tx/rx %s/%s " in enic_get_vnic_config()
104 ENIC_SETTING(enic, TXCSUM) ? "yes" : "no", in enic_get_vnic_config()
105 ENIC_SETTING(enic, RXCSUM) ? "yes" : "no", in enic_get_vnic_config()
106 ENIC_SETTING(enic, TSO) ? "yes" : "no", in enic_get_vnic_config()
107 ENIC_SETTING(enic, LRO) ? "yes" : "no", in enic_get_vnic_config()
108 ENIC_SETTING(enic, RSS) ? "yes" : "no", in enic_get_vnic_config()
122 int enic_add_vlan(struct enic *enic, u16 vlanid) in enic_add_vlan() argument
128 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait); in enic_add_vlan()
130 dev_err(enic_get_dev(enic), "Can't add vlan id, %d\n", err); in enic_add_vlan()
135 int enic_del_vlan(struct enic *enic, u16 vlanid) in enic_del_vlan() argument
141 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait); in enic_del_vlan()
143 dev_err(enic_get_dev(enic), "Can't delete vlan id, %d\n", err); in enic_del_vlan()
148 int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type, in enic_set_nic_cfg() argument
168 return vnic_dev_cmd(enic->vdev, cmd, &a0, &a1, wait); in enic_set_nic_cfg()
171 int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len) in enic_set_rss_key() argument
176 return vnic_dev_cmd(enic->vdev, CMD_RSS_KEY, &a0, &a1, wait); in enic_set_rss_key()
179 int enic_set_rss_cpu(struct enic *enic, dma_addr_t cpu_pa, u64 len) in enic_set_rss_cpu() argument
184 return vnic_dev_cmd(enic->vdev, CMD_RSS_CPU, &a0, &a1, wait); in enic_set_rss_cpu()
187 void enic_free_vnic_resources(struct enic *enic) in enic_free_vnic_resources() argument
191 for (i = 0; i < enic->wq_count; i++) in enic_free_vnic_resources()
192 vnic_wq_free(&enic->wq[i]); in enic_free_vnic_resources()
193 for (i = 0; i < enic->rq_count; i++) in enic_free_vnic_resources()
194 vnic_rq_free(&enic->rq[i]); in enic_free_vnic_resources()
195 for (i = 0; i < enic->cq_count; i++) in enic_free_vnic_resources()
196 vnic_cq_free(&enic->cq[i]); in enic_free_vnic_resources()
197 for (i = 0; i < enic->intr_count; i++) in enic_free_vnic_resources()
198 vnic_intr_free(&enic->intr[i]); in enic_free_vnic_resources()
201 void enic_get_res_counts(struct enic *enic) in enic_get_res_counts() argument
203 enic->wq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ); in enic_get_res_counts()
204 enic->rq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ); in enic_get_res_counts()
205 enic->cq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ); in enic_get_res_counts()
206 enic->intr_count = vnic_dev_get_res_count(enic->vdev, in enic_get_res_counts()
209 dev_info(enic_get_dev(enic), in enic_get_res_counts()
211 enic->wq_count, enic->rq_count, in enic_get_res_counts()
212 enic->cq_count, enic->intr_count); in enic_get_res_counts()
215 void enic_init_vnic_resources(struct enic *enic) in enic_init_vnic_resources() argument
225 intr_mode = vnic_dev_get_intr_mode(enic->vdev); in enic_init_vnic_resources()
239 error_interrupt_offset = enic->intr_count - 2; in enic_init_vnic_resources()
247 for (i = 0; i < enic->rq_count; i++) { in enic_init_vnic_resources()
249 vnic_rq_init(&enic->rq[i], in enic_init_vnic_resources()
255 for (i = 0; i < enic->wq_count; i++) { in enic_init_vnic_resources()
256 cq_index = enic->rq_count + i; in enic_init_vnic_resources()
257 vnic_wq_init(&enic->wq[i], in enic_init_vnic_resources()
269 for (i = 0; i < enic->cq_count; i++) { in enic_init_vnic_resources()
280 vnic_cq_init(&enic->cq[i], in enic_init_vnic_resources()
309 for (i = 0; i < enic->intr_count; i++) { in enic_init_vnic_resources()
310 vnic_intr_init(&enic->intr[i], in enic_init_vnic_resources()
311 enic->config.intr_timer_usec, in enic_init_vnic_resources()
312 enic->config.intr_timer_type, in enic_init_vnic_resources()
317 int enic_alloc_vnic_resources(struct enic *enic) in enic_alloc_vnic_resources() argument
323 intr_mode = vnic_dev_get_intr_mode(enic->vdev); in enic_alloc_vnic_resources()
325 dev_info(enic_get_dev(enic), "vNIC resources used: " in enic_alloc_vnic_resources()
327 enic->wq_count, enic->rq_count, in enic_alloc_vnic_resources()
328 enic->cq_count, enic->intr_count, in enic_alloc_vnic_resources()
337 for (i = 0; i < enic->wq_count; i++) { in enic_alloc_vnic_resources()
338 err = vnic_wq_alloc(enic->vdev, &enic->wq[i], i, in enic_alloc_vnic_resources()
339 enic->config.wq_desc_count, in enic_alloc_vnic_resources()
345 for (i = 0; i < enic->rq_count; i++) { in enic_alloc_vnic_resources()
346 err = vnic_rq_alloc(enic->vdev, &enic->rq[i], i, in enic_alloc_vnic_resources()
347 enic->config.rq_desc_count, in enic_alloc_vnic_resources()
353 for (i = 0; i < enic->cq_count; i++) { in enic_alloc_vnic_resources()
354 if (i < enic->rq_count) in enic_alloc_vnic_resources()
355 err = vnic_cq_alloc(enic->vdev, &enic->cq[i], i, in enic_alloc_vnic_resources()
356 enic->config.rq_desc_count, in enic_alloc_vnic_resources()
359 err = vnic_cq_alloc(enic->vdev, &enic->cq[i], i, in enic_alloc_vnic_resources()
360 enic->config.wq_desc_count, in enic_alloc_vnic_resources()
366 for (i = 0; i < enic->intr_count; i++) { in enic_alloc_vnic_resources()
367 err = vnic_intr_alloc(enic->vdev, &enic->intr[i], i); in enic_alloc_vnic_resources()
375 enic->legacy_pba = vnic_dev_get_res(enic->vdev, in enic_alloc_vnic_resources()
377 if (!enic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) { in enic_alloc_vnic_resources()
378 dev_err(enic_get_dev(enic), in enic_alloc_vnic_resources()
387 enic_free_vnic_resources(enic); in enic_alloc_vnic_resources()