Lines Matching defs:vf

223 	struct ecore_vf_info *vf = OSAL_NULL;
232 vf = &p_hwfn->pf_iov_info->vfs_array[relative_vf_id];
237 return vf;
501 struct ecore_vf_info *vf = &p_iov_info->vfs_array[idx];
504 vf->vf_mbx.req_virt = p_req_virt_addr + idx;
505 vf->vf_mbx.req_phys = req_p + idx * sizeof(union vfpf_tlvs);
506 vf->vf_mbx.reply_virt = p_reply_virt_addr + idx;
507 vf->vf_mbx.reply_phys = rply_p + idx * sizeof(union pfvf_tlvs);
510 vf->vf_mbx.sw_mbx.request_size = sizeof(union vfpf_tlvs);
511 vf->vf_mbx.sw_mbx.mbx_state = VF_PF_WAIT_FOR_START_REQUEST;
513 vf->state = VF_STOPPED;
514 vf->b_init = false;
516 vf->bulletin.phys = idx *
519 vf->bulletin.p_virt = p_bulletin_virt + idx;
520 vf->bulletin.size = sizeof(struct ecore_bulletin_content);
522 vf->relative_vf_id = idx;
523 vf->abs_vf_id = idx + p_iov->first_vf_in_pf;
524 concrete = ecore_vfid_to_concrete(p_hwfn, vf->abs_vf_id);
525 vf->concrete_fid = concrete;
527 vf->opaque_fid = (p_hwfn->hw_info.opaque_fid & 0xff) |
528 (vf->abs_vf_id << 8);
530 vf->num_mac_filters = ECORE_ETH_VF_NUM_MAC_FILTERS;
531 vf->num_vlan_filters = ECORE_ETH_VF_NUM_VLAN_FILTERS;
757 struct ecore_vf_info *vf;
763 vf = ecore_iov_get_vf_info(p_hwfn, rel_vf_id, false);
764 if (!vf)
767 vf->to_disable = to_disable;
790 struct ecore_vf_info *vf = ecore_iov_get_vf_info(p_hwfn, vf_id, true);
792 if (vf != OSAL_NULL) {
793 vf->ctx = ctx;
795 vf->vf_mbx.sw_mbx.mbx_state = VF_PF_WAIT_FOR_START_REQUEST;
815 struct ecore_vf_info *vf)
820 ecore_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid);
828 for (i = 0; i < vf->num_sbs; i++)
830 vf->igu_sbs[i],
831 vf->opaque_fid, true);
836 struct ecore_vf_info *vf,
841 ecore_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid);
895 struct ecore_vf_info *vf)
903 vf->b_malicious = false;
905 if (vf->to_disable)
908 DP_VERBOSE(p_hwfn, ECORE_MSG_IOV, "Enable internal access for vf %x [abs %x]\n",
909 vf->abs_vf_id, ECORE_VF_ABS_ID(p_hwfn, vf));
912 ECORE_VF_ABS_ID(p_hwfn, vf));
914 ecore_iov_vf_igu_reset(p_hwfn, p_ptt, vf);
917 vf->abs_vf_id, vf->num_sbs);
921 ecore_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid);
926 ecore_init_run(p_hwfn, p_ptt, PHASE_VF, vf->abs_vf_id,
932 vf->state = VF_FREE;
946 * @param vf
951 struct ecore_vf_info *vf,
958 for (qid = 0; qid < vf->num_rxqs; qid++) {
959 ecore_fw_l2_queue(p_hwfn, vf->vf_queues[qid].fw_rx_qid,
963 val = enable ? (vf->abs_vf_id | (1 << 8)) : 0;
970 struct ecore_vf_info *vf)
972 /* Reset vf in IGU - interrupts are still disabled */
973 ecore_iov_vf_igu_reset(p_hwfn, p_ptt, vf);
975 ecore_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 1);
978 ecore_iov_config_perm_table(p_hwfn, p_ptt, vf, true);
983 struct ecore_vf_info *vf,
996 SET_FIELD(val, IGU_MAPPING_LINE_FUNCTION_NUMBER, vf->abs_vf_id);
1002 vf->igu_sbs[qid] = p_block->igu_sb_id;
1013 vf->abs_vf_id, 1);
1022 vf->num_sbs = (u8)num_rx_queues;
1024 return vf->num_sbs;
1036 * @param vf
1040 struct ecore_vf_info *vf)
1048 for (idx = 0; idx < vf->num_sbs; idx++) {
1049 igu_id = vf->igu_sbs[idx];
1061 vf->num_sbs = 0;
1110 struct ecore_vf_info *vf = OSAL_NULL;
1116 vf = ecore_iov_get_vf_info(p_hwfn, p_params->rel_vf_id, false);
1117 if (!vf) {
1118 DP_ERR(p_hwfn, "ecore_iov_init_hw_for_vf : vf is OSAL_NULL\n");
1122 if (vf->b_init) {
1153 vf->vport_id = p_params->vport_id;
1154 vf->rss_eng_id = p_params->rss_eng_id;
1184 vf->relative_vf_id, p_params->num_queues, (u16)cids);
1189 vf,
1197 vf->num_rxqs = num_of_vf_avaiable_chains;
1198 vf->num_txqs = num_of_vf_avaiable_chains;
1200 for (i = 0; i < vf->num_rxqs; i++) {
1201 struct ecore_vf_queue *p_queue = &vf->vf_queues[i];
1208 vf->relative_vf_id, i, vf->igu_sbs[i],
1223 rc = ecore_iov_enable_vf_access(p_hwfn, p_ptt, vf);
1226 vf->b_init = true;
1228 p_hwfn->pf_iov_info->active_vfs[vf->relative_vf_id / 64] |=
1229 (1ULL << (vf->relative_vf_id % 64));
1246 struct ecore_vf_info *vf = OSAL_NULL;
1248 vf = ecore_iov_get_vf_info(p_hwfn, rel_vf_id, true);
1249 if (!vf) {
1250 DP_ERR(p_hwfn, "ecore_iov_release_hw_for_vf : vf is NULL\n");
1254 if (vf->bulletin.p_virt)
1255 OSAL_MEMSET(vf->bulletin.p_virt, 0,
1256 sizeof(*vf->bulletin.p_virt));
1258 OSAL_MEMSET(&vf->p_vf_info, 0, sizeof(vf->p_vf_info));
1271 OSAL_MEMSET(&vf->acquire, 0, sizeof(vf->acquire));
1274 * vf-close, however, we could get here without going through vf_close
1277 ecore_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 0);
1280 ecore_iov_config_perm_table(p_hwfn, p_ptt, vf, 0);
1282 vf->num_rxqs = 0;
1283 vf->num_txqs = 0;
1284 ecore_iov_free_vf_igu_sbs(p_hwfn, p_ptt, vf);
1286 if (vf->b_init) {
1287 vf->b_init = false;
1289 p_hwfn->pf_iov_info->active_vfs[vf->relative_vf_id / 64] &=
1290 ~(1ULL << (vf->relative_vf_id / 64));
1306 struct ecore_vf_info *vf,
1310 /* mutex_lock(&vf->op_mutex); @@@TBD MichalK - add lock... */
1313 /* vf->op_current = tlv; @@@TBD MichalK */
1319 "VF[%d]: vf pf channel locked by %s\n",
1320 vf->abs_vf_id,
1325 "VF[%d]: vf pf channel locked by %04x\n",
1326 vf->abs_vf_id, tlv);
1330 struct ecore_vf_info *vf,
1333 /*WARN(expected_tlv != vf->op_current,
1336 channel_tlvs_string[vf->op_current]);
1341 /* mutex_unlock(&vf->op_mutex); @@@TBD MichalK add the lock */
1347 "VF[%d]: vf pf channel unlocked by %s\n",
1348 vf->abs_vf_id,
1353 "VF[%d]: vf pf channel unlocked by %04x\n",
1354 vf->abs_vf_id, expected_tlv);
1357 /* vf->op_current = CHANNEL_TLV_NONE;*/
1558 struct ecore_vf_info *vf = OSAL_NULL;
1560 vf = ecore_iov_get_vf_info(p_hwfn, relative_vf_id, b_enabled_only);
1561 if (!vf)
1564 return &vf->p_vf_info;
1751 struct ecore_vf_info *vf)
1753 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
1774 if (vf->state != VF_FREE &&
1775 vf->state != VF_STOPPED) {
1778 vf->abs_vf_id, vf->state);
1795 vf->abs_vf_id);
1801 vf->abs_vf_id,
1814 vf->abs_vf_id);
1819 if (OSAL_IOV_VF_ACQUIRE(p_hwfn, vf->relative_vf_id) != ECORE_SUCCESS) {
1826 OSAL_MEMCPY(&vf->acquire, req, sizeof(vf->acquire));
1828 vf->opaque_fid = req->vfdev_info.opaque_fid;
1830 vf->vf_bulletin = req->bulletin_addr;
1831 vf->bulletin.size = (vf->bulletin.size < req->bulletin_size) ?
1832 vf->bulletin.size : req->bulletin_size;
1879 vfpf_status = ecore_iov_vf_mbx_acquire_resc(p_hwfn, p_ptt, vf,
1885 rc = ecore_sp_vf_start(p_hwfn, vf);
1888 vf->abs_vf_id);
1896 resp->bulletin_size = vf->bulletin.size;
1897 ecore_iov_post_vf_bulletin(p_hwfn, vf->relative_vf_id, p_ptt);
1902 vf->abs_vf_id, resp->pfdev_info.chip_num,
1908 vf->state = VF_ACQUIRED;
1912 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_ACQUIRE,
2128 struct ecore_vf_info *vf)
2131 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2139 vf_info = ecore_iov_get_vf_info(p_hwfn, (u16)vf->relative_vf_id, true);
2143 vf->relative_vf_id);
2147 vf->state = VF_ENABLED;
2150 ecore_iov_enable_vf_traffic(p_hwfn, p_ptt, vf);
2153 for (sb_id = 0; sb_id < vf->num_sbs; sb_id++) {
2157 vf->relative_vf_id, sb_id);
2163 vf->igu_sbs[sb_id],
2164 vf->abs_vf_id, 1);
2167 vf->mtu = start->mtu;
2168 vf->shadow_config.inner_vlan_removal = start->inner_vlan_removal;
2196 params.concrete_fid = vf->concrete_fid;
2197 params.opaque_fid = vf->opaque_fid;
2198 params.vport_id = vf->vport_id;
2200 params.mtu = vf->mtu;
2204 rc = OSAL_IOV_PRE_START_VPORT(p_hwfn, vf->relative_vf_id, &params);
2217 vf->vport_instance++;
2220 ecore_iov_configure_vport_forced(p_hwfn, vf, *p_bitmap);
2221 OSAL_IOV_POST_START_VPORT(p_hwfn, vf->relative_vf_id,
2222 vf->vport_id, vf->opaque_fid);
2223 __ecore_iov_spoofchk_set(p_hwfn, vf, vf->req_spoofchk_val);
2228 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_START,
2234 struct ecore_vf_info *vf)
2239 OSAL_IOV_VF_VPORT_STOP(p_hwfn, vf);
2240 vf->vport_instance--;
2241 vf->spoof_chk = false;
2243 if ((ecore_iov_validate_active_rxq(vf)) ||
2244 (ecore_iov_validate_active_txq(vf))) {
2245 vf->b_malicious = true;
2248 vf->abs_vf_id);
2253 rc = ecore_sp_vport_stop(p_hwfn, vf->opaque_fid, vf->vport_id);
2261 vf->configured_features = 0;
2262 OSAL_MEMSET(&vf->shadow_config, 0, sizeof(vf->shadow_config));
2265 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_TEARDOWN,
2271 struct ecore_vf_info *vf,
2274 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2303 ecore_iov_send_response(p_hwfn, p_ptt, vf, length, status);
2344 struct ecore_vf_info *vf)
2348 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2359 if (!ecore_iov_validate_rxq(p_hwfn, vf, req->rx_qid,
2361 !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
2364 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, false);
2368 p_queue = &vf->vf_queues[req->rx_qid];
2372 vf_legacy = ecore_vf_calculate_legacy(vf);
2377 params.vport_id = vf->vport_id;
2378 params.stats_id = vf->abs_vf_id + 0x10;
2387 vf_params.vfid = vf->relative_vf_id;
2392 p_cid = ecore_eth_queue_to_cid(p_hwfn, vf->opaque_fid,
2403 MSTORM_ETH_VF_PRODS_OFFSET(vf->abs_vf_id, req->rx_qid),
2418 vf->num_active_rxqs++;
2422 ecore_iov_vf_mbx_start_rxq_resp(p_hwfn, p_ptt, vf, status,
2616 struct ecore_vf_info *vf)
2620 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2634 if (!ecore_iov_validate_txq(p_hwfn, vf, req->tx_qid,
2636 !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
2639 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, true);
2643 p_queue = &vf->vf_queues[req->tx_qid];
2647 vf_legacy = ecore_vf_calculate_legacy(vf);
2651 params.vport_id = vf->vport_id;
2652 params.stats_id = vf->abs_vf_id + 0x10;
2661 vf_params.vfid = vf->relative_vf_id;
2666 p_cid = ecore_eth_queue_to_cid(p_hwfn, vf->opaque_fid,
2672 vf->relative_vf_id);
2686 ecore_iov_vf_mbx_start_txq_resp(p_hwfn, p_ptt, vf,
2691 struct ecore_vf_info *vf,
2699 if (!ecore_iov_validate_rxq(p_hwfn, vf, rxq_id,
2703 vf->relative_vf_id, rxq_id, qid_usage_idx);
2707 p_queue = &vf->vf_queues[rxq_id];
2719 vf->relative_vf_id, rxq_id, qid_usage_idx,
2732 vf->num_active_rxqs--;
2738 struct ecore_vf_info *vf,
2745 if (!ecore_iov_validate_txq(p_hwfn, vf, txq_id,
2749 p_queue = &vf->vf_queues[txq_id];
2765 struct ecore_vf_info *vf)
2768 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2782 vf->relative_vf_id);
2788 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, false);
2792 rc = ecore_iov_vf_stop_rxqs(p_hwfn, vf, req->rx_qid,
2797 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_STOP_RXQS,
2803 struct ecore_vf_info *vf)
2806 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2820 vf->relative_vf_id);
2826 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, true);
2830 rc = ecore_iov_vf_stop_txqs(p_hwfn, vf, req->tx_qid,
2836 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_STOP_TXQS,
2842 struct ecore_vf_info *vf)
2846 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2859 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, false);
2866 if ((vf->acquire.vfdev_info.capabilities &
2871 vf->relative_vf_id);
2879 if (!ecore_iov_validate_rxq(p_hwfn, vf, i,
2881 !vf->vf_queues[i].cids[qid_usage_idx].p_cid ||
2882 vf->vf_queues[i].cids[qid_usage_idx].b_is_tx) {
2885 vf->relative_vf_id, req->rx_qid,
2894 handlers[i] = vf->vf_queues[qid].cids[qid_usage_idx].p_cid;
2908 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_UPDATE_RXQ,
3085 struct ecore_vf_info *vf,
3117 p_rss->rss_eng_id = vf->rss_eng_id;
3130 if (!ecore_iov_validate_rxq(p_hwfn, vf, q_idx,
3134 vf->relative_vf_id, q_idx);
3139 p_cid = ecore_iov_get_vf_rx_queue_cid(&vf->vf_queues[q_idx]);
3210 struct ecore_vf_info *vf)
3214 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
3222 if (!vf->vport_instance) {
3225 vf->abs_vf_id);
3237 params.opaque_fid = vf->opaque_fid;
3238 params.vport_id = vf->vport_id;
3245 ecore_iov_vp_update_vlan_param(p_hwfn, &params, vf, mbx, &tlvs_mask);
3259 ecore_iov_vp_update_rss_param(p_hwfn, vf, &params, p_rss_params,
3267 if (OSAL_IOV_VF_VPORT_UPDATE(p_hwfn, vf->relative_vf_id,
3294 length = ecore_iov_prep_vp_update_resp_tlvs(p_hwfn, vf, mbx, status,
3296 ecore_iov_send_response(p_hwfn, p_ptt, vf, length, status);
3440 struct ecore_vf_info *vf)
3442 struct ecore_bulletin_content *p_bulletin = vf->bulletin.p_virt;
3443 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
3458 params.vport_to_remove_from = vf->vport_id;
3459 params.vport_to_add_to = vf->vport_id;
3465 vf->abs_vf_id, params.opcode, params.type,
3472 if (!vf->vport_instance) {
3475 vf->abs_vf_id);
3484 if (ecore_iov_vf_update_unicast_shadow(p_hwfn, vf, &params) !=
3511 rc = OSAL_IOV_CHK_UCAST(p_hwfn, vf->relative_vf_id, &params);
3519 rc = ecore_sp_eth_filter_ucast(p_hwfn, vf->opaque_fid, &params,
3525 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_UCAST_FILTER,
3531 struct ecore_vf_info *vf)
3536 for (i = 0; i < vf->num_sbs; i++)
3538 vf->igu_sbs[i],
3539 vf->opaque_fid, false);
3541 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_INT_CLEANUP,
3548 struct ecore_vf_info *vf)
3554 ecore_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 0);
3557 ecore_iov_config_perm_table(p_hwfn, p_ptt, vf, 0);
3559 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_CLOSE,
3663 struct ecore_vf_info *vf)
3665 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
3680 if (!ecore_iov_validate_rxq(p_hwfn, vf, qid,
3684 vf->abs_vf_id, qid);
3688 if (!ecore_iov_validate_txq(p_hwfn, vf, qid,
3692 vf->abs_vf_id, qid);
3698 vf->abs_vf_id, rx_coal, tx_coal, qid);
3701 p_cid = ecore_iov_get_vf_rx_queue_cid(&vf->vf_queues[qid]);
3707 vf->abs_vf_id, vf->vf_queues[qid].fw_rx_qid);
3710 vf->rx_coal = rx_coal;
3717 struct ecore_vf_queue *p_queue = &vf->vf_queues[qid];
3731 vf->abs_vf_id);
3735 vf->tx_coal = tx_coal;
3740 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_COALESCE_UPDATE,
3750 struct ecore_vf_info *vf;
3761 vf = &p_hwfn->pf_iov_info->vfs_array[vf_id];
3766 if (!ecore_iov_validate_rxq(p_hwfn, vf, qid,
3770 vf->abs_vf_id, qid);
3774 if (!ecore_iov_validate_txq(p_hwfn, vf, qid,
3778 vf->abs_vf_id, qid);
3784 vf->abs_vf_id, rx_coal, tx_coal, qid);
3787 p_cid = ecore_iov_get_vf_rx_queue_cid(&vf->vf_queues[qid]);
3793 vf->abs_vf_id, vf->vf_queues[qid].fw_rx_qid);
3796 vf->rx_coal = rx_coal;
3803 struct ecore_vf_queue *p_queue = &vf->vf_queues[qid];
3817 vf->abs_vf_id);
3821 vf->tx_coal = tx_coal;
4010 * there's no need to wait per-vf, do it before looping.
4149 /* Lock the per vf op mutex and note the locker's identity.
4636 struct ecore_vf_info *vf;
4645 vf = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
4646 if (!vf)
4651 vf->req_spoofchk_val = val;
4656 rc = __ecore_iov_spoofchk_set(p_hwfn, vf, val);
4771 struct ecore_vf_info *vf;
4775 vf = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
4777 if (!vf)
4780 rc = ecore_fw_vport(p_hwfn, vf->vport_id, &abs_vp_id);
4793 struct ecore_vf_info *vf;
4807 vf = ecore_iov_get_vf_info(ECORE_LEADING_HWFN(p_dev), (u16)vfid, true);
4808 vport_id = vf->vport_id;
4819 struct ecore_vf_info *vf;
4821 vf = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
4822 if (!vf)
4825 if (vf->state != VF_ENABLED)
4829 vf->abs_vf_id + 0x10, false);