Lines Matching +full:1 +full:ac
82 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_map_skb()
111 ash->dma_handle[i + 1] = da; in mana_map_skb()
112 ash->size[i + 1] = skb_frag_size(frag); in mana_map_skb()
114 tp->wqe_req.sgl[i + 1].address = ash->dma_handle[i + 1]; in mana_map_skb()
115 tp->wqe_req.sgl[i + 1].mem_key = gd->gpa_mkey; in mana_map_skb()
116 tp->wqe_req.sgl[i + 1].size = ash->size[i + 1]; in mana_map_skb()
122 for (i = i - 1; i >= 0; i--) in mana_map_skb()
123 dma_unmap_page(dev, ash->dma_handle[i + 1], ash->size[i + 1], in mana_map_skb()
136 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_start_xmit()
178 pkg.wqe_req.num_sge = 1 + skb_shinfo(skb)->nr_frags; in mana_start_xmit()
202 pkg.tx_oob.s_oob.comp_iphdr_csum = 1; in mana_start_xmit()
203 pkg.tx_oob.s_oob.comp_tcp_csum = 1; in mana_start_xmit()
229 pkg.tx_oob.s_oob.comp_tcp_csum = 1; in mana_start_xmit()
236 pkg.tx_oob.s_oob.comp_udp_csum = 1; in mana_start_xmit()
363 if (ndev->real_num_tx_queues == 1) in mana_select_queue()
403 static int mana_send_request(struct mana_context *ac, void *in_buf, in mana_send_request() argument
406 struct gdma_context *gc = ac->gdma_dev->gdma_context; in mana_send_request()
459 req.attached_gfid = 1; in mana_pf_register_hw_vport()
460 req.is_pf_default_vport = 1; in mana_pf_register_hw_vport()
461 req.allow_all_ether_types = 1; in mana_pf_register_hw_vport()
463 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_pf_register_hw_vport()
492 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_pf_deregister_hw_vport()
519 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_pf_register_filter()
548 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_pf_deregister_filter()
564 static int mana_query_device_cfg(struct mana_context *ac, u32 proto_major_ver, in mana_query_device_cfg() argument
568 struct gdma_context *gc = ac->gdma_dev->gdma_context; in mana_query_device_cfg()
580 err = mana_send_request(ac, &req, sizeof(req), &resp, sizeof(resp)); in mana_query_device_cfg()
613 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_query_vport_cfg()
649 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_cfg_vport()
708 req_indir_tab = (mana_handle_t *)(req + 1); in mana_cfg_vport_steering()
713 err = mana_send_request(apc->ac, req, req_buf_size, &resp, in mana_cfg_vport_steering()
759 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_create_wq_obj()
804 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_destroy_wq_obj()
818 static void mana_destroy_eq(struct mana_context *ac) in mana_destroy_eq() argument
820 struct gdma_context *gc = ac->gdma_dev->gdma_context; in mana_destroy_eq()
824 if (!ac->eqs) in mana_destroy_eq()
828 eq = ac->eqs[i].eq; in mana_destroy_eq()
835 kfree(ac->eqs); in mana_destroy_eq()
836 ac->eqs = NULL; in mana_destroy_eq()
839 static int mana_create_eq(struct mana_context *ac) in mana_create_eq() argument
841 struct gdma_dev *gd = ac->gdma_dev; in mana_create_eq()
847 ac->eqs = kcalloc(gc->max_num_queues, sizeof(struct mana_eq), in mana_create_eq()
849 if (!ac->eqs) in mana_create_eq()
856 spec.eq.context = ac->eqs; in mana_create_eq()
860 err = mana_gd_create_mana_eq(gd, &spec, &ac->eqs[i].eq); in mana_create_eq()
867 mana_destroy_eq(ac); in mana_create_eq()
883 err = mana_send_request(apc->ac, &req, sizeof(req), &resp, in mana_fence_rq()
944 struct gdma_context *gc = apc->ac->gdma_dev->gdma_context; in mana_unmap_skb()
950 for (i = 1; i < skb_shinfo(skb)->nr_frags + 1; i++) in mana_unmap_skb()
978 if (comp_read < 1) in mana_poll_tx_cq()
1005 WARN_ONCE(1, "TX: CQE error %d: ignored.\n", in mana_poll_tx_cq()
1013 WARN_ONCE(1, "TX: Unexpected CQE type %d: HW BUG?\n", in mana_poll_tx_cq()
1058 WARN_ON_ONCE(1); in mana_poll_tx_cq()
1080 WARN_ON_ONCE(recv_buf_oob->wqe_inf.wqe_size_in_bu != 1); in mana_post_pkt_rxq()
1236 WARN_ON_ONCE(rxbuf_oob->wqe_inf.wqe_size_in_bu != 1); in mana_process_rx_cqe()
1355 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_deinit_cq()
1365 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_deinit_txq()
1401 struct mana_context *ac = apc->ac; in mana_create_txq() local
1402 struct gdma_dev *gd = ac->gdma_dev; in mana_create_txq()
1463 spec.cq.parent_eq = ac->eqs[i].eq; in mana_create_txq()
1520 struct gdma_context *gc = apc->ac->gdma_dev->gdma_context; in mana_destroy_rxq()
1572 struct gdma_context *gc = apc->ac->gdma_dev->gdma_context; in mana_alloc_rx_wqe()
1603 rx_oob->num_sge = 1; in mana_alloc_rx_wqe()
1606 rx_oob->sgl[0].mem_key = apc->ac->gdma_dev->gpa_mkey; in mana_alloc_rx_wqe()
1645 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_create_rxq()
1735 netif_napi_add_weight(ndev, &cq->napi, mana_poll, 1); in mana_create_rxq()
1762 struct mana_context *ac = apc->ac; in mana_add_rx_queues() local
1768 rxq = mana_create_rxq(apc, i, &ac->eqs[i], ndev); in mana_add_rx_queues()
1786 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_destroy_vport()
1808 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_create_vport()
1898 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_alloc_queues()
1913 apc->rss_state = apc->num_queues > 1 ? TRI_STATE_TRUE : TRI_STATE_FALSE; in mana_alloc_queues()
1975 struct gdma_dev *gd = apc->ac->gdma_dev; in mana_dealloc_queues()
2048 static int mana_probe_port(struct mana_context *ac, int port_idx, in mana_probe_port() argument
2051 struct gdma_context *gc = ac->gdma_dev->gdma_context; in mana_probe_port()
2064 apc->ac = ac; in mana_probe_port()
2118 struct mana_context *ac = gd->driver_data; in mana_probe() local
2133 ac = kzalloc(sizeof(*ac), GFP_KERNEL); in mana_probe()
2134 if (!ac) in mana_probe()
2137 ac->gdma_dev = gd; in mana_probe()
2138 gd->driver_data = ac; in mana_probe()
2141 err = mana_create_eq(ac); in mana_probe()
2145 err = mana_query_device_cfg(ac, MANA_MAJOR_VERSION, MANA_MINOR_VERSION, in mana_probe()
2151 ac->num_ports = num_ports; in mana_probe()
2153 if (ac->num_ports != num_ports) { in mana_probe()
2155 ac->num_ports, num_ports); in mana_probe()
2161 if (ac->num_ports == 0) in mana_probe()
2164 if (ac->num_ports > MAX_PORTS_IN_MANA_DEV) in mana_probe()
2165 ac->num_ports = MAX_PORTS_IN_MANA_DEV; in mana_probe()
2168 for (i = 0; i < ac->num_ports; i++) { in mana_probe()
2169 err = mana_probe_port(ac, i, &ac->ports[i]); in mana_probe()
2174 for (i = 0; i < ac->num_ports; i++) { in mana_probe()
2176 err = mana_attach(ac->ports[i]); in mana_probe()
2192 struct mana_context *ac = gd->driver_data; in mana_remove() local
2198 for (i = 0; i < ac->num_ports; i++) { in mana_remove()
2199 ndev = ac->ports[i]; in mana_remove()
2229 mana_destroy_eq(ac); in mana_remove()
2239 kfree(ac); in mana_remove()