Lines Matching refs:vf
853 static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf) in bnx2x_vf_mbx_resp() argument
855 struct bnx2x_vf_mbx *mbx = BP_VF_MBX(bp, vf->index); in bnx2x_vf_mbx_resp()
868 resp->hdr.status = bnx2x_pfvf_status_codes(vf->op_rc); in bnx2x_vf_mbx_resp()
888 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp()
894 vf->abs_vfid); in bnx2x_vf_mbx_resp()
902 storm_memset_vf_mbx_ack(bp, vf->abs_vfid); in bnx2x_vf_mbx_resp()
911 rc = bnx2x_copy32_vf_dmae(bp, false, pf_addr, vf->abs_vfid, in bnx2x_vf_mbx_resp()
917 bnx2x_unlock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_resp()
921 vf->abs_vfid); in bnx2x_vf_mbx_resp()
927 bnx2x_vf_release(bp, vf, false); /* non blocking */ in bnx2x_vf_mbx_resp()
930 static void bnx2x_vf_mbx_acquire_resp(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire_resp() argument
954 resc->num_rxqs = vf_rxq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
955 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
956 resc->num_txqs = vf_txq_count(vf) ? : in bnx2x_vf_mbx_acquire_resp()
957 bnx2x_vf_max_queue_cnt(bp, vf); in bnx2x_vf_mbx_acquire_resp()
958 resc->num_sbs = vf_sb_count(vf); in bnx2x_vf_mbx_acquire_resp()
959 resc->num_mac_filters = vf_mac_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
960 resc->num_vlan_filters = vf_vlan_rules_cnt(vf); in bnx2x_vf_mbx_acquire_resp()
966 BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_acquire_resp()
968 for_each_vfq(vf, i) in bnx2x_vf_mbx_acquire_resp()
970 vfq_qzone_id(vf, vfq_get(vf, i)); in bnx2x_vf_mbx_acquire_resp()
972 for_each_vf_sb(vf, i) { in bnx2x_vf_mbx_acquire_resp()
973 resc->hw_sbs[i].hw_sb_id = vf_igu_sb(vf, i); in bnx2x_vf_mbx_acquire_resp()
974 resc->hw_sbs[i].sb_qid = vf_hc_qzone(vf, i); in bnx2x_vf_mbx_acquire_resp()
987 vf->abs_vfid, in bnx2x_vf_mbx_acquire_resp()
1001 for (i = 0; i < vf_rxq_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1004 for (i = 0; i < vf_sb_count(vf); i++) in bnx2x_vf_mbx_acquire_resp()
1011 vf->op_rc = vfop_status; in bnx2x_vf_mbx_acquire_resp()
1012 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_acquire_resp()
1015 static void bnx2x_vf_mbx_acquire(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_acquire() argument
1024 vf->abs_vfid, acquire->vfdev_info.vf_id, acquire->vfdev_info.vf_os, in bnx2x_vf_mbx_acquire()
1031 rc = bnx2x_vf_acquire(bp, vf, &acquire->resc_request); in bnx2x_vf_mbx_acquire()
1034 vf->bulletin_map = acquire->bulletin_addr; in bnx2x_vf_mbx_acquire()
1037 bnx2x_vf_mbx_acquire_resp(bp, vf, mbx, rc); in bnx2x_vf_mbx_acquire()
1040 static void bnx2x_vf_mbx_init_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_init_vf() argument
1046 vf->spq_map = init->spq_addr; in bnx2x_vf_mbx_init_vf()
1047 vf->fw_stat_map = init->stats_addr; in bnx2x_vf_mbx_init_vf()
1048 vf->op_rc = bnx2x_vf_init(bp, vf, (dma_addr_t *)init->sb_addr); in bnx2x_vf_mbx_init_vf()
1051 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_init_vf()
1080 static void bnx2x_vf_mbx_setup_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_setup_q() argument
1090 if (setup_q->vf_qid >= vf_rxq_count(vf)) { in bnx2x_vf_mbx_setup_q()
1092 setup_q->vf_qid, vf_rxq_count(vf)); in bnx2x_vf_mbx_setup_q()
1093 vf->op_rc = -EINVAL; in bnx2x_vf_mbx_setup_q()
1101 struct bnx2x_vf_queue *q = vfq_get(vf, setup_q->vf_qid); in bnx2x_vf_mbx_setup_q()
1108 memset(&vf->op_params.qctor, 0 , sizeof(vf->op_params.qctor)); in bnx2x_vf_mbx_setup_q()
1109 setup_p = &vf->op_params.qctor.prep_qsetup; in bnx2x_vf_mbx_setup_q()
1110 init_p = &vf->op_params.qctor.qstate.params.init; in bnx2x_vf_mbx_setup_q()
1142 bnx2x_vfop_qctor_dump_tx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1184 bnx2x_vfop_qctor_dump_rx(bp, vf, init_p, setup_p, in bnx2x_vf_mbx_setup_q()
1188 bnx2x_vfop_qctor_prep(bp, vf, q, &vf->op_params.qctor, q_type); in bnx2x_vf_mbx_setup_q()
1190 vf->op_rc = bnx2x_vfop_qsetup_cmd(bp, vf, &cmd, q->index); in bnx2x_vf_mbx_setup_q()
1191 if (vf->op_rc) in bnx2x_vf_mbx_setup_q()
1196 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_setup_q()
1208 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_macvlan_list() argument
1283 static void bnx2x_vfop_mbx_qfilters(struct bnx2x *bp, struct bnx2x_virtf *vf) in bnx2x_vfop_mbx_qfilters() argument
1288 &BP_VF_MBX(bp, vf->index)->msg->req.set_q_filters; in bnx2x_vfop_mbx_qfilters()
1290 struct bnx2x_vfop *vfop = bnx2x_vfop_cur(bp, vf); in bnx2x_vfop_mbx_qfilters()
1313 vfop->rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vfop_mbx_qfilters()
1320 rc = bnx2x_vfop_mac_list_cmd(bp, vf, &cmd, fl, in bnx2x_vfop_mbx_qfilters()
1341 vfop->rc = bnx2x_vf_mbx_macvlan_list(bp, vf, msg, &fl, in bnx2x_vfop_mbx_qfilters()
1348 rc = bnx2x_vfop_vlan_list_cmd(bp, vf, &cmd, fl, in bnx2x_vfop_mbx_qfilters()
1390 rc = bnx2x_vfop_rxmode_cmd(bp, vf, &cmd, in bnx2x_vfop_mbx_qfilters()
1406 rc = bnx2x_vfop_mcast_cmd(bp, vf, &cmd, msg->multicast, in bnx2x_vfop_mbx_qfilters()
1417 bnx2x_vfop_end(bp, vf, vfop); in bnx2x_vfop_mbx_qfilters()
1421 vf->abs_vfid, msg->vf_qid, vfop->rc); in bnx2x_vfop_mbx_qfilters()
1430 struct bnx2x_virtf *vf, in bnx2x_vfop_mbx_qfilters_cmd() argument
1433 struct bnx2x_vfop *vfop = bnx2x_vfop_add(bp, vf); in bnx2x_vfop_mbx_qfilters_cmd()
1437 return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_mbx_qfilters, in bnx2x_vfop_mbx_qfilters_cmd()
1444 struct bnx2x_virtf *vf, in bnx2x_vf_mbx_set_q_filters() argument
1448 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf->index); in bnx2x_vf_mbx_set_q_filters()
1463 vf->abs_vfid); in bnx2x_vf_mbx_set_q_filters()
1464 vf->op_rc = -EPERM; in bnx2x_vf_mbx_set_q_filters()
1472 vf->abs_vfid); in bnx2x_vf_mbx_set_q_filters()
1474 vf->op_rc = -EPERM; in bnx2x_vf_mbx_set_q_filters()
1480 if (filters->vf_qid > vf_rxq_count(vf)) in bnx2x_vf_mbx_set_q_filters()
1484 vf->abs_vfid, in bnx2x_vf_mbx_set_q_filters()
1490 vf->op_rc = bnx2x_vfop_mbx_qfilters_cmd(bp, vf, &cmd); in bnx2x_vf_mbx_set_q_filters()
1491 if (vf->op_rc) in bnx2x_vf_mbx_set_q_filters()
1496 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_set_q_filters()
1499 static void bnx2x_vf_mbx_teardown_q(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_teardown_q() argument
1509 vf->abs_vfid, qid); in bnx2x_vf_mbx_teardown_q()
1511 vf->op_rc = bnx2x_vfop_qdown_cmd(bp, vf, &cmd, qid); in bnx2x_vf_mbx_teardown_q()
1512 if (vf->op_rc) in bnx2x_vf_mbx_teardown_q()
1513 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_teardown_q()
1516 static void bnx2x_vf_mbx_close_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_close_vf() argument
1524 DP(BNX2X_MSG_IOV, "VF[%d] VF_CLOSE\n", vf->abs_vfid); in bnx2x_vf_mbx_close_vf()
1526 vf->op_rc = bnx2x_vfop_close_cmd(bp, vf, &cmd); in bnx2x_vf_mbx_close_vf()
1527 if (vf->op_rc) in bnx2x_vf_mbx_close_vf()
1528 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_close_vf()
1531 static void bnx2x_vf_mbx_release_vf(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_release_vf() argument
1539 DP(BNX2X_MSG_IOV, "VF[%d] VF_RELEASE\n", vf->abs_vfid); in bnx2x_vf_mbx_release_vf()
1541 vf->op_rc = bnx2x_vfop_release_cmd(bp, vf, &cmd); in bnx2x_vf_mbx_release_vf()
1542 if (vf->op_rc) in bnx2x_vf_mbx_release_vf()
1543 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_release_vf()
1547 static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf, in bnx2x_vf_mbx_request() argument
1557 bnx2x_lock_vf_pf_channel(bp, vf, mbx->first_tlv.tl.type); in bnx2x_vf_mbx_request()
1562 bnx2x_vf_mbx_acquire(bp, vf, mbx); in bnx2x_vf_mbx_request()
1565 bnx2x_vf_mbx_init_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
1568 bnx2x_vf_mbx_setup_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
1571 bnx2x_vf_mbx_set_q_filters(bp, vf, mbx); in bnx2x_vf_mbx_request()
1574 bnx2x_vf_mbx_teardown_q(bp, vf, mbx); in bnx2x_vf_mbx_request()
1577 bnx2x_vf_mbx_close_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
1580 bnx2x_vf_mbx_release_vf(bp, vf, mbx); in bnx2x_vf_mbx_request()
1600 if (vf->state == VF_ACQUIRED) { in bnx2x_vf_mbx_request()
1602 vf->op_rc = PFVF_STATUS_NOT_SUPPORTED; in bnx2x_vf_mbx_request()
1605 bnx2x_vf_mbx_resp(bp, vf); in bnx2x_vf_mbx_request()
1610 bnx2x_unlock_vf_pf_channel(bp, vf, in bnx2x_vf_mbx_request()
1619 struct bnx2x_virtf *vf; in bnx2x_vf_mbx() local
1647 vf = BP_VF(bp, vf_idx); in bnx2x_vf_mbx()
1656 rc = bnx2x_copy32_vf_dmae(bp, true, mbx->msg_mapping, vf->abs_vfid, in bnx2x_vf_mbx()
1660 BNX2X_ERR("Failed to copy request VF %d\n", vf->abs_vfid); in bnx2x_vf_mbx()
1668 bnx2x_vf_mbx_request(bp, vf, mbx); in bnx2x_vf_mbx()
1672 bnx2x_vf_release(bp, vf, false); /* non blocking */ in bnx2x_vf_mbx()
1678 int bnx2x_post_vf_bulletin(struct bnx2x *bp, int vf) in bnx2x_post_vf_bulletin() argument
1680 struct pf_vf_bulletin_content *bulletin = BP_VF_BULLETIN(bp, vf); in bnx2x_post_vf_bulletin()
1682 vf * BULLETIN_CONTENT_SIZE; in bnx2x_post_vf_bulletin()
1683 dma_addr_t vf_addr = bnx2x_vf(bp, vf, bulletin_map); in bnx2x_post_vf_bulletin()
1687 if (bnx2x_vf(bp, vf, state) != VF_ENABLED && in bnx2x_post_vf_bulletin()
1688 bnx2x_vf(bp, vf, state) != VF_ACQUIRED) in bnx2x_post_vf_bulletin()
1698 bnx2x_vf(bp, vf, abs_vfid), U64_HI(vf_addr), in bnx2x_post_vf_bulletin()