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()
1124 struct bnx2x_virtf *vf) in bnx2x_vf_mbx_resp_single_tlv() argument
1126 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_single_tlv()
1140 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_send_msg() argument
1143 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp_send_msg()
1166 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1172 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1179 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1184 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp_send_msg()
1190 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_resp_send_msg()
1194 vf->abs_vfid); in bnx2x_vf_mbx_resp_send_msg()
1200 bnx2x_vf_release(bp, vf); in bnx2x_vf_mbx_resp_send_msg()
1204 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp() argument
1207 bnx2x_vf_mbx_resp_single_tlv(bp, vf); in bnx2x_vf_mbx_resp()
1208 bnx2x_vf_mbx_resp_send_msg(bp, vf, rc); in bnx2x_vf_mbx_resp()
1212 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_phys_port() argument
1235 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_resp_fp_hsi_ver() argument
1246 fp_hsi->is_supported = (vf->fp_hsi > ETH_FP_HSI_VERSION) ? 0 : 1; in bnx2x_vf_mbx_resp_fp_hsi_ver()
1254 static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_resp() argument
1281 resc->num_rxqs = vf_rxq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
1282 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
1283 resc->num_txqs = vf_txq_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_sbs = vf_sb_count(vf); in bnx2x_vf_mbx_acquire_resp()
1286 resc->num_mac_filters = vf_mac_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1287 resc->num_vlan_filters = vf_vlan_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
1293 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_acquire_resp()
1295 for_each_vfq(vf, i) in bnx2x_vf_mbx_acquire_resp()
1297 vfq_qzone_id(vf, vfq_get(vf, i)); in bnx2x_vf_mbx_acquire_resp()
1299 for_each_vf_sb(vf, i) { in bnx2x_vf_mbx_acquire_resp()
1300 resc->hw_sbs[i].hw_sb_id = vf_igu_sb(vf, i); in bnx2x_vf_mbx_acquire_resp()
1301 resc->hw_sbs[i].sb_qid = vf_hc_qzone(vf, i); in bnx2x_vf_mbx_acquire_resp()
1314 vf->abs_vfid, in bnx2x_vf_mbx_acquire_resp()
1328 for (i = 0; i < vf_rxq_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1331 for (i = 0; i < vf_sb_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1347 bnx2x_vf_mbx_resp_phys_port(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1353 bnx2x_vf_mbx_resp_fp_hsi_ver(bp, vf, &mbx->msg->resp, &length); in bnx2x_vf_mbx_acquire_resp()
1359 bnx2x_vf_mbx_resp_send_msg(bp, vf, vfop_status); in bnx2x_vf_mbx_acquire_resp()
1380 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_chk_dorq() argument
1397 static void bnx2x_vf_mbx_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire() argument
1406 vf->abs_vfid, acquire->vfdev_info.vf_id, acquire->vfdev_info.vf_os, in bnx2x_vf_mbx_acquire()
1416 rc = bnx2x_vf_mbx_acquire_chk_dorq(bp, vf, mbx); in bnx2x_vf_mbx_acquire()
1420 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1428 vf->fp_hsi = acquire->vfdev_info.fp_hsi_ver; in bnx2x_vf_mbx_acquire()
1430 vf->fp_hsi = max_t(u8, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1432 if (vf->fp_hsi > ETH_FP_HSI_VERSION) { in bnx2x_vf_mbx_acquire()
1435 vf->abs_vfid, acquire->vfdev_info.fp_hsi_ver, in bnx2x_vf_mbx_acquire()
1442 rc = bnx2x_vf_acquire(bp, vf, &acquire->resc_request); in bnx2x_vf_mbx_acquire()
1445 vf->bulletin_map = acquire->bulletin_addr; in bnx2x_vf_mbx_acquire()
1448 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1449 vf->cfg_flags |= VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1451 vf->cfg_flags &= ~VF_CFG_EXT_BULLETIN; in bnx2x_vf_mbx_acquire()
1456 vf->abs_vfid); in bnx2x_vf_mbx_acquire()
1457 vf->cfg_flags |= VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1459 vf->cfg_flags &= ~VF_CFG_VLAN_FILTER; in bnx2x_vf_mbx_acquire()
1464 bnx2x_vf_mbx_acquire_resp(bp, vf, mbx, rc); in bnx2x_vf_mbx_acquire()
1467 static void bnx2x_vf_mbx_init_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_init_vf() argument
1474 vf->fw_stat_map = init->stats_addr; in bnx2x_vf_mbx_init_vf()
1475 vf->stats_stride = init->stats_stride; in bnx2x_vf_mbx_init_vf()
1476 rc = bnx2x_vf_init(bp, vf, (dma_addr_t *)init->sb_addr); in bnx2x_vf_mbx_init_vf()
1480 vf->cfg_flags |= VF_CFG_STATS_COALESCE; in bnx2x_vf_mbx_init_vf()
1483 if (vf->cfg_flags & VF_CFG_EXT_BULLETIN) in bnx2x_vf_mbx_init_vf()
1484 bnx2x_iov_link_update_vf(bp, vf->index); in bnx2x_vf_mbx_init_vf()
1487 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_init_vf()
1518 static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_setup_q() argument
1526 if (setup_q->vf_qid >= vf_rxq_count(vf)) { in bnx2x_vf_mbx_setup_q()
1528 setup_q->vf_qid, vf_rxq_count(vf)); in bnx2x_vf_mbx_setup_q()
1537 struct bnx2x_vf_queue *q = vfq_get(vf, setup_q->vf_qid); in bnx2x_vf_mbx_setup_q()
1544 bnx2x_leading_vfq_init(bp, vf, q); in bnx2x_vf_mbx_setup_q()
1582 bnx2x_vfop_qctor_dump_tx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1626 u8 mcast_id = FW_VF_HANDLE(vf->abs_vfid); in bnx2x_vf_mbx_setup_q()
1632 bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1636 bnx2x_vfop_qctor_prep(bp, vf, q, &qctor, q_type); in bnx2x_vf_mbx_setup_q()
1638 rc = bnx2x_vf_queue_setup(bp, vf, q->index, &qctor); in bnx2x_vf_mbx_setup_q()
1643 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_setup_q()
1647 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_macvlan_list() argument
1731 static int bnx2x_vf_mbx_qfilters(struct bnx2x *bp, struct bnx2x_virtf *vf) in bnx2x_vf_mbx_qfilters() argument
1736 &BP_VF_MBX(bp, vf->index)->msg->req.set_q_filters; in bnx2x_vf_mbx_qfilters()
1743 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1751 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1761 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1768 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1778 rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vf_mbx_qfilters()
1785 rc = bnx2x_vf_mac_vlan_config_list(bp, vf, fl, in bnx2x_vf_mbx_qfilters()
1797 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_qfilters()
1813 (!(vf->cfg_flags & VF_CFG_VLAN_FILTER) || in bnx2x_vf_mbx_qfilters()
1818 rc = bnx2x_vf_rxmode(bp, vf, msg->vf_qid, accept); in bnx2x_vf_mbx_qfilters()
1825 rc = bnx2x_vf_mcast(bp, vf, msg->multicast, in bnx2x_vf_mbx_qfilters()
1833 vf->abs_vfid, msg->vf_qid, rc); in bnx2x_vf_mbx_qfilters()
1838 struct bnx2x_virtf *vf, in bnx2x_filters_validate_mac() argument
1841 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_mac()
1863 vf->abs_vfid, in bnx2x_filters_validate_mac()
1876 vf->abs_vfid); in bnx2x_filters_validate_mac()
1888 struct bnx2x_virtf *vf, in bnx2x_filters_validate_vlan() argument
1891 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_filters_validate_vlan()
1901 vf->abs_vfid); in bnx2x_filters_validate_vlan()
1908 if (filters->vf_qid > vf_rxq_count(vf)) { in bnx2x_filters_validate_vlan()
1918 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_set_q_filters() argument
1924 rc = bnx2x_filters_validate_mac(bp, vf, filters); in bnx2x_vf_mbx_set_q_filters()
1928 rc = bnx2x_filters_validate_vlan(bp, vf, filters); in bnx2x_vf_mbx_set_q_filters()
1933 vf->abs_vfid, in bnx2x_vf_mbx_set_q_filters()
1939 rc = bnx2x_vf_mbx_qfilters(bp, vf); in bnx2x_vf_mbx_set_q_filters()
1941 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_set_q_filters()
1944 static void bnx2x_vf_mbx_teardown_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_teardown_q() argument
1951 vf->abs_vfid, qid); in bnx2x_vf_mbx_teardown_q()
1953 rc = bnx2x_vf_queue_teardown(bp, vf, qid); in bnx2x_vf_mbx_teardown_q()
1954 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_teardown_q()
1957 static void bnx2x_vf_mbx_close_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_close_vf() argument
1962 DP(BNX2X_MSG_IOV, "VF[%d] VF_CLOSE\n", vf->abs_vfid); in bnx2x_vf_mbx_close_vf()
1964 rc = bnx2x_vf_close(bp, vf); in bnx2x_vf_mbx_close_vf()
1965 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_close_vf()
1968 static void bnx2x_vf_mbx_release_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_release_vf() argument
1973 DP(BNX2X_MSG_IOV, "VF[%d] VF_RELEASE\n", vf->abs_vfid); in bnx2x_vf_mbx_release_vf()
1975 rc = bnx2x_vf_free(bp, vf); in bnx2x_vf_mbx_release_vf()
1976 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_release_vf()
1979 static void bnx2x_vf_mbx_update_rss(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_update_rss() argument
1989 vf->index); in bnx2x_vf_mbx_update_rss()
2000 rss.rss_obj = &vf->rss_conf_obj; in bnx2x_vf_mbx_update_rss()
2035 rc = bnx2x_vf_rss_update(bp, vf, &rss); in bnx2x_vf_mbx_update_rss()
2037 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_update_rss()
2063 static void bnx2x_vf_mbx_update_tpa(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_update_tpa() argument
2098 rc = bnx2x_vf_tpa_update(bp, vf, tpa_tlv, &vf_op_params); in bnx2x_vf_mbx_update_tpa()
2101 bnx2x_vf_mbx_resp(bp, vf, rc); in bnx2x_vf_mbx_update_tpa()
2105 static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_request() argument
2110 if (vf->state == VF_LOST) { in bnx2x_vf_mbx_request()
2116 "VF 0x%x lost, not handling the request\n", vf->abs_vfid); in bnx2x_vf_mbx_request()
2118 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2127 bnx2x_lock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2132 bnx2x_vf_mbx_acquire(bp, vf, mbx); in bnx2x_vf_mbx_request()
2135 bnx2x_vf_mbx_init_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2138 bnx2x_vf_mbx_setup_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
2141 bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); in bnx2x_vf_mbx_request()
2144 bnx2x_vf_mbx_teardown_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
2147 bnx2x_vf_mbx_close_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2150 bnx2x_vf_mbx_release_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
2153 bnx2x_vf_mbx_update_rss(bp, vf, mbx); in bnx2x_vf_mbx_request()
2156 bnx2x_vf_mbx_update_tpa(bp, vf, mbx); in bnx2x_vf_mbx_request()
2169 vf->state); in bnx2x_vf_mbx_request()
2176 if (vf->state == VF_ACQUIRED || vf->state == VF_ENABLED) { in bnx2x_vf_mbx_request()
2178 bnx2x_vf_mbx_resp(bp, vf, PFVF_STATUS_NOT_SUPPORTED); in bnx2x_vf_mbx_request()
2184 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_request()
2186 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
2240 struct bnx2x_virtf *vf = BP_VF(bp, vf_idx); in bnx2x_vf_mbx() local
2253 vf->abs_vfid, mbx->vf_addr_hi, in bnx2x_vf_mbx()
2258 vf->abs_vfid); in bnx2x_vf_mbx()
2259 bnx2x_vf_release(bp, vf); in bnx2x_vf_mbx()
2272 bnx2x_vf_mbx_request(bp, vf, mbx); in bnx2x_vf_mbx()
2288 int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf) in bnx2x_post_vf_bulletin() argument
2290 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf); in bnx2x_post_vf_bulletin()
2292 vf * BULLETIN_CONTENT_SIZE; in bnx2x_post_vf_bulletin()
2293 dma_addr_t vf_addr = bnx2x_vf(bp, vf, bulletin_map); in bnx2x_post_vf_bulletin()
2297 if (bnx2x_vf(bp, vf, state) != VF_ENABLED && in bnx2x_post_vf_bulletin()
2298 bnx2x_vf(bp, vf, state) != VF_ACQUIRED) in bnx2x_post_vf_bulletin()
2304 (bnx2x_vf(bp, vf, cfg_flags) & in bnx2x_post_vf_bulletin()
2309 bnx2x_vf(bp, vf, abs_vfid), U64_HI(vf_addr), in bnx2x_post_vf_bulletin()