Lines Matching refs:enic
29 int enic_get_vnic_config(struct enic *enic) in enic_get_vnic_config() argument
31 struct vnic_enet_config *c = &enic->config; in enic_get_vnic_config()
34 err = vnic_dev_get_mac_addr(enic->vdev, enic->mac_addr); in enic_get_vnic_config()
36 dev_err(enic_get_dev(enic), in enic_get_vnic_config()
43 err = vnic_dev_spec(enic->vdev, \ in enic_get_vnic_config()
47 dev_err(enic_get_dev(enic), \ in enic_get_vnic_config()
82 vnic_dev_get_intr_coal_timer_max(enic->vdev)); in enic_get_vnic_config()
84 dev_info(enic_get_dev(enic), in enic_get_vnic_config()
86 enic->mac_addr, c->wq_desc_count, c->rq_desc_count, c->mtu); in enic_get_vnic_config()
88 dev_info(enic_get_dev(enic), "vNIC csum tx/rx %s/%s " in enic_get_vnic_config()
91 ENIC_SETTING(enic, TXCSUM) ? "yes" : "no", in enic_get_vnic_config()
92 ENIC_SETTING(enic, RXCSUM) ? "yes" : "no", in enic_get_vnic_config()
93 ENIC_SETTING(enic, TSO) ? "yes" : "no", in enic_get_vnic_config()
94 ENIC_SETTING(enic, LRO) ? "yes" : "no", in enic_get_vnic_config()
95 ENIC_SETTING(enic, RSS) ? "yes" : "no", in enic_get_vnic_config()
109 int enic_add_vlan(struct enic *enic, u16 vlanid) in enic_add_vlan() argument
115 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_ADD, &a0, &a1, wait); in enic_add_vlan()
117 dev_err(enic_get_dev(enic), "Can't add vlan id, %d\n", err); in enic_add_vlan()
122 int enic_del_vlan(struct enic *enic, u16 vlanid) in enic_del_vlan() argument
128 err = vnic_dev_cmd(enic->vdev, CMD_VLAN_DEL, &a0, &a1, wait); in enic_del_vlan()
130 dev_err(enic_get_dev(enic), "Can't delete vlan id, %d\n", err); in enic_del_vlan()
135 int enic_set_nic_cfg(struct enic *enic, u8 rss_default_cpu, u8 rss_hash_type, in enic_set_nic_cfg() argument
155 return vnic_dev_cmd(enic->vdev, cmd, &a0, &a1, wait); in enic_set_nic_cfg()
158 int enic_set_rss_key(struct enic *enic, dma_addr_t key_pa, u64 len) in enic_set_rss_key() argument
163 return vnic_dev_cmd(enic->vdev, CMD_RSS_KEY, &a0, &a1, wait); in enic_set_rss_key()
166 int enic_set_rss_cpu(struct enic *enic, dma_addr_t cpu_pa, u64 len) in enic_set_rss_cpu() argument
171 return vnic_dev_cmd(enic->vdev, CMD_RSS_CPU, &a0, &a1, wait); in enic_set_rss_cpu()
174 void enic_free_vnic_resources(struct enic *enic) in enic_free_vnic_resources() argument
178 for (i = 0; i < enic->wq_count; i++) in enic_free_vnic_resources()
179 vnic_wq_free(&enic->wq[i]); in enic_free_vnic_resources()
180 for (i = 0; i < enic->rq_count; i++) in enic_free_vnic_resources()
181 vnic_rq_free(&enic->rq[i]); in enic_free_vnic_resources()
182 for (i = 0; i < enic->cq_count; i++) in enic_free_vnic_resources()
183 vnic_cq_free(&enic->cq[i]); in enic_free_vnic_resources()
184 for (i = 0; i < enic->intr_count; i++) in enic_free_vnic_resources()
185 vnic_intr_free(&enic->intr[i]); in enic_free_vnic_resources()
188 void enic_get_res_counts(struct enic *enic) in enic_get_res_counts() argument
190 enic->wq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_WQ); in enic_get_res_counts()
191 enic->rq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_RQ); in enic_get_res_counts()
192 enic->cq_count = vnic_dev_get_res_count(enic->vdev, RES_TYPE_CQ); in enic_get_res_counts()
193 enic->intr_count = vnic_dev_get_res_count(enic->vdev, in enic_get_res_counts()
196 dev_info(enic_get_dev(enic), in enic_get_res_counts()
198 enic->wq_count, enic->rq_count, in enic_get_res_counts()
199 enic->cq_count, enic->intr_count); in enic_get_res_counts()
202 void enic_init_vnic_resources(struct enic *enic) in enic_init_vnic_resources() argument
212 intr_mode = vnic_dev_get_intr_mode(enic->vdev); in enic_init_vnic_resources()
226 error_interrupt_offset = enic->intr_count - 2; in enic_init_vnic_resources()
234 for (i = 0; i < enic->rq_count; i++) { in enic_init_vnic_resources()
236 vnic_rq_init(&enic->rq[i], in enic_init_vnic_resources()
242 for (i = 0; i < enic->wq_count; i++) { in enic_init_vnic_resources()
243 cq_index = enic->rq_count + i; in enic_init_vnic_resources()
244 vnic_wq_init(&enic->wq[i], in enic_init_vnic_resources()
256 for (i = 0; i < enic->cq_count; i++) { in enic_init_vnic_resources()
267 vnic_cq_init(&enic->cq[i], in enic_init_vnic_resources()
296 for (i = 0; i < enic->intr_count; i++) { in enic_init_vnic_resources()
297 vnic_intr_init(&enic->intr[i], in enic_init_vnic_resources()
298 enic->config.intr_timer_usec, in enic_init_vnic_resources()
299 enic->config.intr_timer_type, in enic_init_vnic_resources()
304 int enic_alloc_vnic_resources(struct enic *enic) in enic_alloc_vnic_resources() argument
310 intr_mode = vnic_dev_get_intr_mode(enic->vdev); in enic_alloc_vnic_resources()
312 dev_info(enic_get_dev(enic), "vNIC resources used: " in enic_alloc_vnic_resources()
314 enic->wq_count, enic->rq_count, in enic_alloc_vnic_resources()
315 enic->cq_count, enic->intr_count, in enic_alloc_vnic_resources()
324 for (i = 0; i < enic->wq_count; i++) { in enic_alloc_vnic_resources()
325 err = vnic_wq_alloc(enic->vdev, &enic->wq[i], i, in enic_alloc_vnic_resources()
326 enic->config.wq_desc_count, in enic_alloc_vnic_resources()
332 for (i = 0; i < enic->rq_count; i++) { in enic_alloc_vnic_resources()
333 err = vnic_rq_alloc(enic->vdev, &enic->rq[i], i, in enic_alloc_vnic_resources()
334 enic->config.rq_desc_count, in enic_alloc_vnic_resources()
340 for (i = 0; i < enic->cq_count; i++) { in enic_alloc_vnic_resources()
341 if (i < enic->rq_count) in enic_alloc_vnic_resources()
342 err = vnic_cq_alloc(enic->vdev, &enic->cq[i], i, in enic_alloc_vnic_resources()
343 enic->config.rq_desc_count, in enic_alloc_vnic_resources()
346 err = vnic_cq_alloc(enic->vdev, &enic->cq[i], i, in enic_alloc_vnic_resources()
347 enic->config.wq_desc_count, in enic_alloc_vnic_resources()
353 for (i = 0; i < enic->intr_count; i++) { in enic_alloc_vnic_resources()
354 err = vnic_intr_alloc(enic->vdev, &enic->intr[i], i); in enic_alloc_vnic_resources()
362 enic->legacy_pba = vnic_dev_get_res(enic->vdev, in enic_alloc_vnic_resources()
364 if (!enic->legacy_pba && intr_mode == VNIC_DEV_INTR_MODE_INTX) { in enic_alloc_vnic_resources()
365 dev_err(enic_get_dev(enic), in enic_alloc_vnic_resources()
374 enic_free_vnic_resources(enic); in enic_alloc_vnic_resources()