Lines Matching refs:vf
542 static void bnx2x_leading_vfq_init(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_leading_vfq_init() argument
545 u8 cl_id = vfq_cl_id(vf, q); in bnx2x_leading_vfq_init()
546 u8 func_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_leading_vfq_init()
551 bnx2x_vf_sp(bp, vf, mac_rdata), in bnx2x_leading_vfq_init()
552 bnx2x_vf_sp_map(bp, vf, mac_rdata), in bnx2x_leading_vfq_init()
554 &vf->filter_state, in bnx2x_leading_vfq_init()
556 &vf->vf_macs_pool); in bnx2x_leading_vfq_init()
560 bnx2x_vf_sp(bp, vf, vlan_rdata), in bnx2x_leading_vfq_init()
561 bnx2x_vf_sp_map(bp, vf, vlan_rdata), in bnx2x_leading_vfq_init()
563 &vf->filter_state, in bnx2x_leading_vfq_init()
565 &vf->vf_vlans_pool); in bnx2x_leading_vfq_init()
569 bnx2x_vf_sp(bp, vf, vlan_mac_rdata), in bnx2x_leading_vfq_init()
570 bnx2x_vf_sp_map(bp, vf, vlan_mac_rdata), in bnx2x_leading_vfq_init()
572 &vf->filter_state, in bnx2x_leading_vfq_init()
574 &vf->vf_macs_pool, in bnx2x_leading_vfq_init()
575 &vf->vf_vlans_pool); in bnx2x_leading_vfq_init()
577 bnx2x_init_mcast_obj(bp, &vf->mcast_obj, cl_id, in bnx2x_leading_vfq_init()
579 bnx2x_vf_sp(bp, vf, mcast_rdata), in bnx2x_leading_vfq_init()
580 bnx2x_vf_sp_map(bp, vf, mcast_rdata), in bnx2x_leading_vfq_init()
582 &vf->filter_state, in bnx2x_leading_vfq_init()
586 bnx2x_init_rss_config_obj(bp, &vf->rss_conf_obj, cl_id, q->cid, in bnx2x_leading_vfq_init()
588 bnx2x_vf_sp(bp, vf, rss_rdata), in bnx2x_leading_vfq_init()
589 bnx2x_vf_sp_map(bp, vf, rss_rdata), in bnx2x_leading_vfq_init()
591 &vf->filter_state, in bnx2x_leading_vfq_init()
594 vf->leading_rss = cl_id; in bnx2x_leading_vfq_init()
1125 struct bnx2x_virtf *vf) in bnx2x_vf_mbx_resp_single_tlv() argument
1127 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_single_tlv()
1141 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_send_msg() argument
1144 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_send_msg()
1167 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1173 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1180 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1186 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1192 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_resp_send_msg()
1196 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1202 bnx2x_vf_release(bp, vf); in bnx2x_vf_mbx_resp_send_msg()
1206 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp() argument
1209 bnx2x_vf_mbx_resp_single_tlv(bp, vf); in bnx2x_vf_mbx_resp()
1210 bnx2x_vf_mbx_resp_send_msg(bp, vf, rc); in bnx2x_vf_mbx_resp()
1214 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_phys_port() argument
1237 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_fp_hsi_ver() argument
1248 fp_hsi->is_supported = (vf->fp_hsi > ETH_FP_HSI_VERSION) ? 0 : 1; in bnx2x_vf_mbx_resp_fp_hsi_ver()
1256 static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_resp() argument
1283 resc->num_rxqs = vf_rxq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1284 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
1285 resc->num_txqs = vf_txq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1286 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
1287 resc->num_sbs = vf_sb_count(vf); in bnx2x_vf_mbx_acquire_resp()
1288 resc->num_mac_filters = vf_mac_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1289 resc->num_vlan_filters = vf_vlan_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1295 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_acquire_resp()
1297 for_each_vfq(vf, i) in bnx2x_vf_mbx_acquire_resp()
1299 vfq_qzone_id(vf, vfq_get(vf, i)); in bnx2x_vf_mbx_acquire_resp()
1301 for_each_vf_sb(vf, i) { in bnx2x_vf_mbx_acquire_resp()
1302 resc->hw_sbs[i].hw_sb_id = vf_igu_sb(vf, i); in bnx2x_vf_mbx_acquire_resp()
1303 resc->hw_sbs[i].sb_qid = vf_hc_qzone(vf, i); in bnx2x_vf_mbx_acquire_resp()
1316 vf->abs_vfid, in bnx2x_vf_mbx_acquire_resp()
1330 for (i = 0; i < vf_rxq_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1333 for (i = 0; i < vf_sb_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1349 bnx2x_vf_mbx_resp_phys_port(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1355 bnx2x_vf_mbx_resp_fp_hsi_ver(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1361 bnx2x_vf_mbx_resp_send_msg(bp, vf, vfop_status); in bnx2x_vf_mbx_acquire_resp()
1382 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_chk_dorq() argument
1399 static void bnx2x_vf_mbx_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire() argument
1408 vf->abs_vfid, acquire->vfdev_info.vf_id, acquire->vfdev_info.vf_os, in bnx2x_vf_mbx_acquire()
1418 rc = bnx2x_vf_mbx_acquire_chk_dorq(bp, vf, mbx); in bnx2x_vf_mbx_acquire()
1422 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1430 vf->fp_hsi = acquire->vfdev_info.fp_hsi_ver; in bnx2x_vf_mbx_acquire()
1432 vf->fp_hsi = max_t(u8, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1434 if (vf->fp_hsi > ETH_FP_HSI_VERSION) { in bnx2x_vf_mbx_acquire()
1437 vf->abs_vfid, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1444 rc = bnx2x_vf_acquire(bp, vf, &acquire->resc_request); in bnx2x_vf_mbx_acquire()
1447 vf->bulletin_map = acquire->bulletin_addr; in bnx2x_vf_mbx_acquire()
1450 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1451 vf->cfg_flags |= VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1453 vf->cfg_flags &= ~VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1458 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1459 vf->cfg_flags |= VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1461 vf->cfg_flags &= ~VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1466 bnx2x_vf_mbx_acquire_resp(bp, vf, mbx, rc); in bnx2x_vf_mbx_acquire()
1469 static void bnx2x_vf_mbx_init_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_init_vf() argument
1476 vf->fw_stat_map = init->stats_addr; in bnx2x_vf_mbx_init_vf()
1477 vf->stats_stride = init->stats_stride; in bnx2x_vf_mbx_init_vf()
1478 rc = bnx2x_vf_init(bp, vf, (dma_addr_t *)init->sb_addr); in bnx2x_vf_mbx_init_vf()
1482 vf->cfg_flags |= VF_CFG_STATS_COALESCE; in bnx2x_vf_mbx_init_vf()
1485 if (vf->cfg_flags & VF_CFG_EXT_BULLETIN) in bnx2x_vf_mbx_init_vf()
1486 bnx2x_iov_link_update_vf(bp, vf->index); in bnx2x_vf_mbx_init_vf()
1489 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_init_vf()
1520 static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_setup_q() argument
1528 if (setup_q->vf_qid >= vf_rxq_count(vf)) { in bnx2x_vf_mbx_setup_q()
1530 setup_q->vf_qid, vf_rxq_count(vf)); in bnx2x_vf_mbx_setup_q()
1539 struct bnx2x_vf_queue *q = vfq_get(vf, setup_q->vf_qid); in bnx2x_vf_mbx_setup_q()
1546 bnx2x_leading_vfq_init(bp, vf, q); in bnx2x_vf_mbx_setup_q()
1584 bnx2x_vfop_qctor_dump_tx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1628 u8 mcast_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_vf_mbx_setup_q()
1634 bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1638 bnx2x_vfop_qctor_prep(bp, vf, q, &qctor, q_type); in bnx2x_vf_mbx_setup_q()
1640 rc = bnx2x_vf_queue_setup(bp, vf, q->index, &qctor); in bnx2x_vf_mbx_setup_q()
1645 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_setup_q()
1649 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_macvlan_list() argument
1737 static int bnx2x_vf_mbx_qfilters(struct bnx2x *bp, struct bnx2x_virtf *vf) in bnx2x_vf_mbx_qfilters() argument
1742 &BP_VF_MBX(bp, vf->index)->msg->req.set_q_filters; in bnx2x_vf_mbx_qfilters()
1749 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1757 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1767 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1774 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1786 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_qfilters()
1802 (!(vf->cfg_flags & VF_CFG_VLAN_FILTER) || in bnx2x_vf_mbx_qfilters()
1807 rc = bnx2x_vf_rxmode(bp, vf, msg->vf_qid, accept); in bnx2x_vf_mbx_qfilters()
1814 rc = bnx2x_vf_mcast(bp, vf, msg->multicast, in bnx2x_vf_mbx_qfilters()
1822 vf->abs_vfid, msg->vf_qid, rc); in bnx2x_vf_mbx_qfilters()
1827 struct bnx2x_virtf *vf, in bnx2x_filters_validate_mac() argument
1830 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_mac()
1852 vf->abs_vfid, in bnx2x_filters_validate_mac()
1865 vf->abs_vfid); in bnx2x_filters_validate_mac()
1877 struct bnx2x_virtf *vf, in bnx2x_filters_validate_vlan() argument
1880 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_vlan()
1890 vf->abs_vfid); in bnx2x_filters_validate_vlan()
1897 if (filters->vf_qid > vf_rxq_count(vf)) { in bnx2x_filters_validate_vlan()
1907 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_set_q_filters() argument
1913 rc = bnx2x_filters_validate_mac(bp, vf, filters); in bnx2x_vf_mbx_set_q_filters()
1917 rc = bnx2x_filters_validate_vlan(bp, vf, filters); in bnx2x_vf_mbx_set_q_filters()
1922 vf->abs_vfid, in bnx2x_vf_mbx_set_q_filters()
1928 rc = bnx2x_vf_mbx_qfilters(bp, vf); in bnx2x_vf_mbx_set_q_filters()
1930 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_set_q_filters()
1933 static void bnx2x_vf_mbx_teardown_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_teardown_q() argument
1940 vf->abs_vfid, qid); in bnx2x_vf_mbx_teardown_q()
1942 rc = bnx2x_vf_queue_teardown(bp, vf, qid); in bnx2x_vf_mbx_teardown_q()
1943 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_teardown_q()
1946 static void bnx2x_vf_mbx_close_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_close_vf() argument
1951 DP(BNX2X_MSG_IOV, "VF[%d] VF_CLOSE\n", vf->abs_vfid); in bnx2x_vf_mbx_close_vf()
1953 rc = bnx2x_vf_close(bp, vf); in bnx2x_vf_mbx_close_vf()
1954 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_close_vf()
1957 static void bnx2x_vf_mbx_release_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_release_vf() argument
1962 DP(BNX2X_MSG_IOV, "VF[%d] VF_RELEASE\n", vf->abs_vfid); in bnx2x_vf_mbx_release_vf()
1964 rc = bnx2x_vf_free(bp, vf); in bnx2x_vf_mbx_release_vf()
1965 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_release_vf()
1968 static void bnx2x_vf_mbx_update_rss(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_update_rss() argument
1978 vf->index); in bnx2x_vf_mbx_update_rss()
1989 rss.rss_obj = &vf->rss_conf_obj; in bnx2x_vf_mbx_update_rss()
2024 rc = bnx2x_vf_rss_update(bp, vf, &rss); in bnx2x_vf_mbx_update_rss()
2026 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_update_rss()
2052 static void bnx2x_vf_mbx_update_tpa(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_update_tpa() argument
2087 rc = bnx2x_vf_tpa_update(bp, vf, tpa_tlv, &vf_op_params); in bnx2x_vf_mbx_update_tpa()
2090 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_update_tpa()
2094 static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_request() argument
2104 bnx2x_lock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2109 bnx2x_vf_mbx_acquire(bp, vf, mbx); in bnx2x_vf_mbx_request()
2112 bnx2x_vf_mbx_init_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2115 bnx2x_vf_mbx_setup_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
2118 bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); in bnx2x_vf_mbx_request()
2121 bnx2x_vf_mbx_teardown_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
2124 bnx2x_vf_mbx_close_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2127 bnx2x_vf_mbx_release_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2130 bnx2x_vf_mbx_update_rss(bp, vf, mbx); in bnx2x_vf_mbx_request()
2133 bnx2x_vf_mbx_update_tpa(bp, vf, mbx); in bnx2x_vf_mbx_request()
2146 vf->state); in bnx2x_vf_mbx_request()
2153 if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { in bnx2x_vf_mbx_request()
2155 bnx2x_vf_mbx_resp(bp, vf, PFVF_STATUS_NOT_SUPPORTED); in bnx2x_vf_mbx_request()
2161 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2164 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2216 struct bnx2x_virtf *vf = BP_VF(bp, vf_idx); in bnx2x_vf_mbx() local
2229 vf->abs_vfid, mbx->vf_addr_hi, in bnx2x_vf_mbx()
2234 vf->abs_vfid); in bnx2x_vf_mbx()
2235 bnx2x_vf_release(bp, vf); in bnx2x_vf_mbx()
2248 bnx2x_vf_mbx_request(bp, vf, mbx); in bnx2x_vf_mbx()
2264 int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf) in bnx2x_post_vf_bulletin() argument
2266 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf); in bnx2x_post_vf_bulletin()
2268 vf * BULLETIN_CONTENT_SIZE; in bnx2x_post_vf_bulletin()
2269 dma_addr_t vf_addr = bnx2x_vf(bp, vf, bulletin_map); in bnx2x_post_vf_bulletin()
2273 if (bnx2x_vf(bp, vf, state) != VF_ENABLED && in bnx2x_post_vf_bulletin()
2274 bnx2x_vf(bp, vf, state) != VF_ACQUIRED) in bnx2x_post_vf_bulletin()
2280 (bnx2x_vf(bp, vf, cfg_flags) & in bnx2x_post_vf_bulletin()
2285 bnx2x_vf(bp, vf, abs_vfid), U64_HI(vf_addr), in bnx2x_post_vf_bulletin()