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()
94 vnic_dev_get_intr_coal_timer_max(enic->vdev)); in enic_get_vnic_config()
96 dev_info(enic_get_dev(enic), in enic_get_vnic_config()
98 enic->mac_addr, c->wq_desc_count, c->rq_desc_count, c->mtu); in enic_get_vnic_config()
100 dev_info(enic_get_dev(enic), "vNIC csum tx/rx %s/%s " in enic_get_vnic_config()
103 ENIC_SETTING(enic, TXCSUM) ? "yes" : "no", in enic_get_vnic_config()
104 ENIC_SETTING(enic, RXCSUM) ? "yes" : "no", in enic_get_vnic_config()
105 ENIC_SETTING(enic, TSO) ? "yes" : "no", in enic_get_vnic_config()
106 ENIC_SETTING(enic, LRO) ? "yes" : "no", in enic_get_vnic_config()
107 ENIC_SETTING(enic, RSS) ? "yes" : "no", in enic_get_vnic_config()
121 int enic_add_vlan(struct enic *enic, u16 vlanid) in enic_add_vlan() argument
127 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait); in enic_add_vlan()
129 dev_err(enic_get_dev(enic), "Can't add vlan id, %d\n", err); in enic_add_vlan()
134 int enic_del_vlan(struct enic *enic, u16 vlanid) in enic_del_vlan() argument
140 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait); in enic_del_vlan()
142 dev_err(enic_get_dev(enic), "Can't delete vlan id, %d\n", err); in enic_del_vlan()
147 int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type, in enic_set_nic_cfg() argument
162 return vnic_dev_cmd(enic->vdev, CMD_NIC_CFG, &a0, &a1, wait); in enic_set_nic_cfg()
165 int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len) in enic_set_rss_key() argument
170 return vnic_dev_cmd(enic->vdev, CMD_RSS_KEY, &a0, &a1, wait); in enic_set_rss_key()
173 int enic_set_rss_cpu(struct enic *enic, dma_addr_t cpu_pa, u64 len) in enic_set_rss_cpu() argument
178 return vnic_dev_cmd(enic->vdev, CMD_RSS_CPU, &a0, &a1, wait); in enic_set_rss_cpu()
181 void enic_free_vnic_resources(struct enic *enic) in enic_free_vnic_resources() argument
185 for (i = 0; i < enic->wq_count; i++) in enic_free_vnic_resources()
186 vnic_wq_free(&enic->wq[i]); in enic_free_vnic_resources()
187 for (i = 0; i < enic->rq_count; i++) in enic_free_vnic_resources()
188 vnic_rq_free(&enic->rq[i]); in enic_free_vnic_resources()
189 for (i = 0; i < enic->cq_count; i++) in enic_free_vnic_resources()
190 vnic_cq_free(&enic->cq[i]); in enic_free_vnic_resources()
191 for (i = 0; i < enic->intr_count; i++) in enic_free_vnic_resources()
192 vnic_intr_free(&enic->intr[i]); in enic_free_vnic_resources()
195 void enic_get_res_counts(struct enic *enic) in enic_get_res_counts() argument
197 enic->wq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ); in enic_get_res_counts()
198 enic->rq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ); in enic_get_res_counts()
199 enic->cq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ); in enic_get_res_counts()
200 enic->intr_count = vnic_dev_get_res_count(enic->vdev, in enic_get_res_counts()
203 dev_info(enic_get_dev(enic), in enic_get_res_counts()
205 enic->wq_count, enic->rq_count, in enic_get_res_counts()
206 enic->cq_count, enic->intr_count); in enic_get_res_counts()
209 void enic_init_vnic_resources(struct enic *enic) in enic_init_vnic_resources() argument
219 intr_mode = vnic_dev_get_intr_mode(enic->vdev); in enic_init_vnic_resources()
233 error_interrupt_offset = enic->intr_count - 2; in enic_init_vnic_resources()
241 for (i = 0; i < enic->rq_count; i++) { in enic_init_vnic_resources()
243 vnic_rq_init(&enic->rq[i], in enic_init_vnic_resources()
249 for (i = 0; i < enic->wq_count; i++) { in enic_init_vnic_resources()
250 cq_index = enic->rq_count + i; in enic_init_vnic_resources()
251 vnic_wq_init(&enic->wq[i], in enic_init_vnic_resources()
263 for (i = 0; i < enic->cq_count; i++) { in enic_init_vnic_resources()
274 vnic_cq_init(&enic->cq[i], in enic_init_vnic_resources()
303 for (i = 0; i < enic->intr_count; i++) { in enic_init_vnic_resources()
304 vnic_intr_init(&enic->intr[i], in enic_init_vnic_resources()
305 enic->config.intr_timer_usec, in enic_init_vnic_resources()
306 enic->config.intr_timer_type, in enic_init_vnic_resources()
311 int enic_alloc_vnic_resources(struct enic *enic) in enic_alloc_vnic_resources() argument
317 intr_mode = vnic_dev_get_intr_mode(enic->vdev); in enic_alloc_vnic_resources()
319 dev_info(enic_get_dev(enic), "vNIC resources used: " in enic_alloc_vnic_resources()
321 enic->wq_count, enic->rq_count, in enic_alloc_vnic_resources()
322 enic->cq_count, enic->intr_count, in enic_alloc_vnic_resources()
331 for (i = 0; i < enic->wq_count; i++) { in enic_alloc_vnic_resources()
332 err = vnic_wq_alloc(enic->vdev, &enic->wq[i], i, in enic_alloc_vnic_resources()
333 enic->config.wq_desc_count, in enic_alloc_vnic_resources()
339 for (i = 0; i < enic->rq_count; i++) { in enic_alloc_vnic_resources()
340 err = vnic_rq_alloc(enic->vdev, &enic->rq[i], i, in enic_alloc_vnic_resources()
341 enic->config.rq_desc_count, in enic_alloc_vnic_resources()
347 for (i = 0; i < enic->cq_count; i++) { in enic_alloc_vnic_resources()
348 if (i < enic->rq_count) in enic_alloc_vnic_resources()
349 err = vnic_cq_alloc(enic->vdev, &enic->cq[i], i, in enic_alloc_vnic_resources()
350 enic->config.rq_desc_count, in enic_alloc_vnic_resources()
353 err = vnic_cq_alloc(enic->vdev, &enic->cq[i], i, in enic_alloc_vnic_resources()
354 enic->config.wq_desc_count, in enic_alloc_vnic_resources()
360 for (i = 0; i < enic->intr_count; i++) { in enic_alloc_vnic_resources()
361 err = vnic_intr_alloc(enic->vdev, &enic->intr[i], i); in enic_alloc_vnic_resources()
369 enic->legacy_pba = vnic_dev_get_res(enic->vdev, in enic_alloc_vnic_resources()
371 if (!enic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) { in enic_alloc_vnic_resources()
372 dev_err(enic_get_dev(enic), in enic_alloc_vnic_resources()
381 enic_free_vnic_resources(enic); in enic_alloc_vnic_resources()