Lines Matching refs:vf
541 static void bnx2x_leading_vfq_init(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_leading_vfq_init() argument
544 u8 cl_id = vfq_cl_id(vf, q); in bnx2x_leading_vfq_init()
545 u8 func_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_leading_vfq_init()
550 bnx2x_vf_sp(bp, vf, mac_rdata), in bnx2x_leading_vfq_init()
551 bnx2x_vf_sp_map(bp, vf, mac_rdata), in bnx2x_leading_vfq_init()
553 &vf->filter_state, in bnx2x_leading_vfq_init()
555 &vf->vf_macs_pool); in bnx2x_leading_vfq_init()
559 bnx2x_vf_sp(bp, vf, vlan_rdata), in bnx2x_leading_vfq_init()
560 bnx2x_vf_sp_map(bp, vf, vlan_rdata), in bnx2x_leading_vfq_init()
562 &vf->filter_state, in bnx2x_leading_vfq_init()
564 &vf->vf_vlans_pool); in bnx2x_leading_vfq_init()
568 bnx2x_vf_sp(bp, vf, vlan_mac_rdata), in bnx2x_leading_vfq_init()
569 bnx2x_vf_sp_map(bp, vf, vlan_mac_rdata), in bnx2x_leading_vfq_init()
571 &vf->filter_state, in bnx2x_leading_vfq_init()
573 &vf->vf_macs_pool, in bnx2x_leading_vfq_init()
574 &vf->vf_vlans_pool); in bnx2x_leading_vfq_init()
576 bnx2x_init_mcast_obj(bp, &vf->mcast_obj, cl_id, in bnx2x_leading_vfq_init()
578 bnx2x_vf_sp(bp, vf, mcast_rdata), in bnx2x_leading_vfq_init()
579 bnx2x_vf_sp_map(bp, vf, mcast_rdata), in bnx2x_leading_vfq_init()
581 &vf->filter_state, in bnx2x_leading_vfq_init()
585 bnx2x_init_rss_config_obj(bp, &vf->rss_conf_obj, cl_id, q->cid, in bnx2x_leading_vfq_init()
587 bnx2x_vf_sp(bp, vf, rss_rdata), in bnx2x_leading_vfq_init()
588 bnx2x_vf_sp_map(bp, vf, rss_rdata), in bnx2x_leading_vfq_init()
590 &vf->filter_state, in bnx2x_leading_vfq_init()
593 vf->leading_rss = cl_id; in bnx2x_leading_vfq_init()
1123 struct bnx2x_virtf *vf) in bnx2x_vf_mbx_resp_single_tlv() argument
1125 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_single_tlv()
1139 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_send_msg() argument
1142 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_send_msg()
1165 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1171 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1178 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1183 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1189 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_resp_send_msg()
1193 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1199 bnx2x_vf_release(bp, vf); in bnx2x_vf_mbx_resp_send_msg()
1203 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp() argument
1206 bnx2x_vf_mbx_resp_single_tlv(bp, vf); in bnx2x_vf_mbx_resp()
1207 bnx2x_vf_mbx_resp_send_msg(bp, vf, rc); in bnx2x_vf_mbx_resp()
1211 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_phys_port() argument
1234 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_fp_hsi_ver() argument
1245 fp_hsi->is_supported = (vf->fp_hsi > ETH_FP_HSI_VERSION) ? 0 : 1; in bnx2x_vf_mbx_resp_fp_hsi_ver()
1253 static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_resp() argument
1280 resc->num_rxqs = vf_rxq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1281 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
1282 resc->num_txqs = vf_txq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1283 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
1284 resc->num_sbs = vf_sb_count(vf); in bnx2x_vf_mbx_acquire_resp()
1285 resc->num_mac_filters = vf_mac_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1286 resc->num_vlan_filters = vf_vlan_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1292 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_acquire_resp()
1294 for_each_vfq(vf, i) in bnx2x_vf_mbx_acquire_resp()
1296 vfq_qzone_id(vf, vfq_get(vf, i)); in bnx2x_vf_mbx_acquire_resp()
1298 for_each_vf_sb(vf, i) { in bnx2x_vf_mbx_acquire_resp()
1299 resc->hw_sbs[i].hw_sb_id = vf_igu_sb(vf, i); in bnx2x_vf_mbx_acquire_resp()
1300 resc->hw_sbs[i].sb_qid = vf_hc_qzone(vf, i); in bnx2x_vf_mbx_acquire_resp()
1313 vf->abs_vfid, in bnx2x_vf_mbx_acquire_resp()
1327 for (i = 0; i < vf_rxq_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1330 for (i = 0; i < vf_sb_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1346 bnx2x_vf_mbx_resp_phys_port(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1352 bnx2x_vf_mbx_resp_fp_hsi_ver(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1358 bnx2x_vf_mbx_resp_send_msg(bp, vf, vfop_status); in bnx2x_vf_mbx_acquire_resp()
1379 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_chk_dorq() argument
1396 static void bnx2x_vf_mbx_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire() argument
1405 vf->abs_vfid, acquire->vfdev_info.vf_id, acquire->vfdev_info.vf_os, in bnx2x_vf_mbx_acquire()
1415 rc = bnx2x_vf_mbx_acquire_chk_dorq(bp, vf, mbx); in bnx2x_vf_mbx_acquire()
1419 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1427 vf->fp_hsi = acquire->vfdev_info.fp_hsi_ver; in bnx2x_vf_mbx_acquire()
1429 vf->fp_hsi = max_t(u8, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1431 if (vf->fp_hsi > ETH_FP_HSI_VERSION) { in bnx2x_vf_mbx_acquire()
1434 vf->abs_vfid, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1441 rc = bnx2x_vf_acquire(bp, vf, &acquire->resc_request); in bnx2x_vf_mbx_acquire()
1444 vf->bulletin_map = acquire->bulletin_addr; in bnx2x_vf_mbx_acquire()
1447 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1448 vf->cfg_flags |= VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1450 vf->cfg_flags &= ~VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1455 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1456 vf->cfg_flags |= VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1458 vf->cfg_flags &= ~VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1463 bnx2x_vf_mbx_acquire_resp(bp, vf, mbx, rc); in bnx2x_vf_mbx_acquire()
1466 static void bnx2x_vf_mbx_init_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_init_vf() argument
1473 vf->fw_stat_map = init->stats_addr; in bnx2x_vf_mbx_init_vf()
1474 vf->stats_stride = init->stats_stride; in bnx2x_vf_mbx_init_vf()
1475 rc = bnx2x_vf_init(bp, vf, (dma_addr_t *)init->sb_addr); in bnx2x_vf_mbx_init_vf()
1479 vf->cfg_flags |= VF_CFG_STATS_COALESCE; in bnx2x_vf_mbx_init_vf()
1482 if (vf->cfg_flags & VF_CFG_EXT_BULLETIN) in bnx2x_vf_mbx_init_vf()
1483 bnx2x_iov_link_update_vf(bp, vf->index); in bnx2x_vf_mbx_init_vf()
1486 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_init_vf()
1517 static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_setup_q() argument
1525 if (setup_q->vf_qid >= vf_rxq_count(vf)) { in bnx2x_vf_mbx_setup_q()
1527 setup_q->vf_qid, vf_rxq_count(vf)); in bnx2x_vf_mbx_setup_q()
1536 struct bnx2x_vf_queue *q = vfq_get(vf, setup_q->vf_qid); in bnx2x_vf_mbx_setup_q()
1543 bnx2x_leading_vfq_init(bp, vf, q); in bnx2x_vf_mbx_setup_q()
1581 bnx2x_vfop_qctor_dump_tx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1625 u8 mcast_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_vf_mbx_setup_q()
1631 bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1635 bnx2x_vfop_qctor_prep(bp, vf, q, &qctor, q_type); in bnx2x_vf_mbx_setup_q()
1637 rc = bnx2x_vf_queue_setup(bp, vf, q->index, &qctor); in bnx2x_vf_mbx_setup_q()
1642 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_setup_q()
1646 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_macvlan_list() argument
1730 static int bnx2x_vf_mbx_qfilters(struct bnx2x *bp, struct bnx2x_virtf *vf) in bnx2x_vf_mbx_qfilters() argument
1735 &BP_VF_MBX(bp, vf->index)->msg->req.set_q_filters; in bnx2x_vf_mbx_qfilters()
1742 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1750 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1760 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1767 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1777 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1784 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1796 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_qfilters()
1812 (!(vf->cfg_flags & VF_CFG_VLAN_FILTER) || in bnx2x_vf_mbx_qfilters()
1817 rc = bnx2x_vf_rxmode(bp, vf, msg->vf_qid, accept); in bnx2x_vf_mbx_qfilters()
1824 rc = bnx2x_vf_mcast(bp, vf, msg->multicast, in bnx2x_vf_mbx_qfilters()
1832 vf->abs_vfid, msg->vf_qid, rc); in bnx2x_vf_mbx_qfilters()
1837 struct bnx2x_virtf *vf, in bnx2x_filters_validate_mac() argument
1840 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_mac()
1862 vf->abs_vfid, in bnx2x_filters_validate_mac()
1875 vf->abs_vfid); in bnx2x_filters_validate_mac()
1887 struct bnx2x_virtf *vf, in bnx2x_filters_validate_vlan() argument
1890 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_vlan()
1900 vf->abs_vfid); in bnx2x_filters_validate_vlan()
1907 if (filters->vf_qid > vf_rxq_count(vf)) { in bnx2x_filters_validate_vlan()
1917 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_set_q_filters() argument
1923 rc = bnx2x_filters_validate_mac(bp, vf, filters); in bnx2x_vf_mbx_set_q_filters()
1927 rc = bnx2x_filters_validate_vlan(bp, vf, filters); in bnx2x_vf_mbx_set_q_filters()
1932 vf->abs_vfid, in bnx2x_vf_mbx_set_q_filters()
1938 rc = bnx2x_vf_mbx_qfilters(bp, vf); in bnx2x_vf_mbx_set_q_filters()
1940 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_set_q_filters()
1943 static void bnx2x_vf_mbx_teardown_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_teardown_q() argument
1950 vf->abs_vfid, qid); in bnx2x_vf_mbx_teardown_q()
1952 rc = bnx2x_vf_queue_teardown(bp, vf, qid); in bnx2x_vf_mbx_teardown_q()
1953 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_teardown_q()
1956 static void bnx2x_vf_mbx_close_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_close_vf() argument
1961 DP(BNX2X_MSG_IOV, "VF[%d] VF_CLOSE\n", vf->abs_vfid); in bnx2x_vf_mbx_close_vf()
1963 rc = bnx2x_vf_close(bp, vf); in bnx2x_vf_mbx_close_vf()
1964 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_close_vf()
1967 static void bnx2x_vf_mbx_release_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_release_vf() argument
1972 DP(BNX2X_MSG_IOV, "VF[%d] VF_RELEASE\n", vf->abs_vfid); in bnx2x_vf_mbx_release_vf()
1974 rc = bnx2x_vf_free(bp, vf); in bnx2x_vf_mbx_release_vf()
1975 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_release_vf()
1978 static void bnx2x_vf_mbx_update_rss(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_update_rss() argument
1988 vf->index); in bnx2x_vf_mbx_update_rss()
1999 rss.rss_obj = &vf->rss_conf_obj; in bnx2x_vf_mbx_update_rss()
2034 rc = bnx2x_vf_rss_update(bp, vf, &rss); in bnx2x_vf_mbx_update_rss()
2036 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_update_rss()
2062 static void bnx2x_vf_mbx_update_tpa(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_update_tpa() argument
2097 rc = bnx2x_vf_tpa_update(bp, vf, tpa_tlv, &vf_op_params); in bnx2x_vf_mbx_update_tpa()
2100 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_update_tpa()
2104 static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_request() argument
2109 if (vf->state == VF_LOST) { in bnx2x_vf_mbx_request()
2115 "VF 0x%x lost, not handling the request\n", vf->abs_vfid); in bnx2x_vf_mbx_request()
2117 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2126 bnx2x_lock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2131 bnx2x_vf_mbx_acquire(bp, vf, mbx); in bnx2x_vf_mbx_request()
2134 bnx2x_vf_mbx_init_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2137 bnx2x_vf_mbx_setup_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
2140 bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); in bnx2x_vf_mbx_request()
2143 bnx2x_vf_mbx_teardown_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
2146 bnx2x_vf_mbx_close_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2149 bnx2x_vf_mbx_release_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2152 bnx2x_vf_mbx_update_rss(bp, vf, mbx); in bnx2x_vf_mbx_request()
2155 bnx2x_vf_mbx_update_tpa(bp, vf, mbx); in bnx2x_vf_mbx_request()
2168 vf->state); in bnx2x_vf_mbx_request()
2175 if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { in bnx2x_vf_mbx_request()
2177 bnx2x_vf_mbx_resp(bp, vf, PFVF_STATUS_NOT_SUPPORTED); in bnx2x_vf_mbx_request()
2183 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2185 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2239 struct bnx2x_virtf *vf = BP_VF(bp, vf_idx); in bnx2x_vf_mbx() local
2252 vf->abs_vfid, mbx->vf_addr_hi, in bnx2x_vf_mbx()
2257 vf->abs_vfid); in bnx2x_vf_mbx()
2258 bnx2x_vf_release(bp, vf); in bnx2x_vf_mbx()
2271 bnx2x_vf_mbx_request(bp, vf, mbx); in bnx2x_vf_mbx()
2287 int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf) in bnx2x_post_vf_bulletin() argument
2289 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf); in bnx2x_post_vf_bulletin()
2291 vf * BULLETIN_CONTENT_SIZE; in bnx2x_post_vf_bulletin()
2292 dma_addr_t vf_addr = bnx2x_vf(bp, vf, bulletin_map); in bnx2x_post_vf_bulletin()
2296 if (bnx2x_vf(bp, vf, state) != VF_ENABLED && in bnx2x_post_vf_bulletin()
2297 bnx2x_vf(bp, vf, state) != VF_ACQUIRED) in bnx2x_post_vf_bulletin()
2303 (bnx2x_vf(bp, vf, cfg_flags) & in bnx2x_post_vf_bulletin()
2308 bnx2x_vf(bp, vf, abs_vfid), U64_HI(vf_addr), in bnx2x_post_vf_bulletin()