Lines Matching refs:pf
28 if (!bp->pf.active_vfs) { in bnxt_vf_ndo_prep()
32 if (vf_id >= bp->pf.max_vfs) { in bnxt_vf_ndo_prep()
52 vf = &bp->pf.vf[vf_id]; in bnxt_set_vf_spoofchk()
92 vf = &bp->pf.vf[vf_id]; in bnxt_get_vf_config()
127 vf = &bp->pf.vf[vf_id]; in bnxt_set_vf_mac()
156 vf = &bp->pf.vf[vf_id]; in bnxt_set_vf_vlan()
185 vf = &bp->pf.vf[vf_id]; in bnxt_set_vf_bw()
225 vf = &bp->pf.vf[vf_id]; in bnxt_set_vf_link_state()
254 vf = &bp->pf.vf[i]; in bnxt_set_vf_attr()
264 struct bnxt_pf_info *pf = &bp->pf; in bnxt_hwrm_func_vf_resource_free() local
270 for (i = pf->first_vf_id; i < pf->first_vf_id + num_vfs; i++) { in bnxt_hwrm_func_vf_resource_free()
286 kfree(bp->pf.vf_event_bmap); in bnxt_free_vf_resources()
287 bp->pf.vf_event_bmap = NULL; in bnxt_free_vf_resources()
290 if (bp->pf.hwrm_cmd_req_addr[i]) { in bnxt_free_vf_resources()
292 bp->pf.hwrm_cmd_req_addr[i], in bnxt_free_vf_resources()
293 bp->pf.hwrm_cmd_req_dma_addr[i]); in bnxt_free_vf_resources()
294 bp->pf.hwrm_cmd_req_addr[i] = NULL; in bnxt_free_vf_resources()
298 kfree(bp->pf.vf); in bnxt_free_vf_resources()
299 bp->pf.vf = NULL; in bnxt_free_vf_resources()
307 bp->pf.vf = kcalloc(num_vfs, sizeof(struct bnxt_vf_info), GFP_KERNEL); in bnxt_alloc_vf_resources()
308 if (!bp->pf.vf) in bnxt_alloc_vf_resources()
319 bp->pf.hwrm_cmd_req_addr[i] = in bnxt_alloc_vf_resources()
321 &bp->pf.hwrm_cmd_req_dma_addr[i], in bnxt_alloc_vf_resources()
324 if (!bp->pf.hwrm_cmd_req_addr[i]) in bnxt_alloc_vf_resources()
328 struct bnxt_vf_info *vf = &bp->pf.vf[k]; in bnxt_alloc_vf_resources()
330 vf->hwrm_cmd_req_addr = bp->pf.hwrm_cmd_req_addr[i] + in bnxt_alloc_vf_resources()
333 bp->pf.hwrm_cmd_req_dma_addr[i] + j * in bnxt_alloc_vf_resources()
340 bp->pf.vf_event_bmap = kzalloc(16, GFP_KERNEL); in bnxt_alloc_vf_resources()
341 if (!bp->pf.vf_event_bmap) in bnxt_alloc_vf_resources()
344 bp->pf.hwrm_cmd_req_pages = nr_pages; in bnxt_alloc_vf_resources()
354 req.req_buf_num_pages = cpu_to_le16(bp->pf.hwrm_cmd_req_pages); in bnxt_hwrm_func_buf_rgtr()
357 req.req_buf_page_addr0 = cpu_to_le64(bp->pf.hwrm_cmd_req_dma_addr[0]); in bnxt_hwrm_func_buf_rgtr()
358 req.req_buf_page_addr1 = cpu_to_le64(bp->pf.hwrm_cmd_req_dma_addr[1]); in bnxt_hwrm_func_buf_rgtr()
359 req.req_buf_page_addr2 = cpu_to_le64(bp->pf.hwrm_cmd_req_dma_addr[2]); in bnxt_hwrm_func_buf_rgtr()
360 req.req_buf_page_addr3 = cpu_to_le64(bp->pf.hwrm_cmd_req_dma_addr[3]); in bnxt_hwrm_func_buf_rgtr()
371 struct bnxt_pf_info *pf = &bp->pf; in bnxt_hwrm_func_cfg() local
381 vf_cp_rings = min_t(u16, bp->pf.max_cp_rings, bp->pf.max_stat_ctxs); in bnxt_hwrm_func_cfg()
385 vf_stat_ctx = (bp->pf.max_stat_ctxs - bp->num_stat_ctxs) / *num_vfs; in bnxt_hwrm_func_cfg()
387 vf_rx_rings = (bp->pf.max_rx_rings - bp->rx_nr_rings * 2) / in bnxt_hwrm_func_cfg()
390 vf_rx_rings = (bp->pf.max_rx_rings - bp->rx_nr_rings) / in bnxt_hwrm_func_cfg()
392 vf_tx_rings = (bp->pf.max_tx_rings - bp->tx_nr_rings) / *num_vfs; in bnxt_hwrm_func_cfg()
421 req.vf_id = cpu_to_le16(pf->first_vf_id + i); in bnxt_hwrm_func_cfg()
426 bp->pf.active_vfs = i + 1; in bnxt_hwrm_func_cfg()
427 bp->pf.vf[i].fw_fid = le16_to_cpu(req.vf_id); in bnxt_hwrm_func_cfg()
431 bp->pf.max_pf_tx_rings = bp->tx_nr_rings; in bnxt_hwrm_func_cfg()
433 bp->pf.max_pf_rx_rings = bp->rx_nr_rings * 2; in bnxt_hwrm_func_cfg()
435 bp->pf.max_pf_rx_rings = bp->rx_nr_rings; in bnxt_hwrm_func_cfg()
458 if (bp->pf.max_rx_rings - bp->rx_nr_rings * 2 >= in bnxt_sriov_enable()
462 if (bp->pf.max_rx_rings - bp->rx_nr_rings >= in bnxt_sriov_enable()
467 if (bp->pf.max_tx_rings - bp->tx_nr_rings >= min_tx_rings) in bnxt_sriov_enable()
470 if (bp->pf.max_rsscos_ctxs - bp->rsscos_nr_ctxs >= min_rss_ctxs) in bnxt_sriov_enable()
538 bp->pf.active_vfs = 0; in bnxt_sriov_disable()
539 bp->pf.max_pf_rx_rings = bp->pf.max_rx_rings; in bnxt_sriov_disable()
540 bp->pf.max_pf_tx_rings = bp->pf.max_tx_rings; in bnxt_sriov_disable()
569 if (num_vfs && num_vfs == bp->pf.active_vfs) in bnxt_sriov_configure()
778 u32 i = 0, active_vfs = bp->pf.active_vfs, vf_id; in bnxt_hwrm_exec_fwd_req()
782 vf_id = find_next_bit(bp->pf.vf_event_bmap, active_vfs, i); in bnxt_hwrm_exec_fwd_req()
786 clear_bit(vf_id, bp->pf.vf_event_bmap); in bnxt_hwrm_exec_fwd_req()
787 bnxt_vf_req_validate_snd(bp, &bp->pf.vf[vf_id]); in bnxt_hwrm_exec_fwd_req()