Lines Matching refs:vf
222 struct ecore_vf_info *vf = OSAL_NULL;
231 vf = &p_hwfn->pf_iov_info->vfs_array[relative_vf_id];
236 return vf;
500 struct ecore_vf_info *vf = &p_iov_info->vfs_array[idx];
503 vf->vf_mbx.req_virt = p_req_virt_addr + idx;
504 vf->vf_mbx.req_phys = req_p + idx * sizeof(union vfpf_tlvs);
505 vf->vf_mbx.reply_virt = p_reply_virt_addr + idx;
506 vf->vf_mbx.reply_phys = rply_p + idx * sizeof(union pfvf_tlvs);
509 vf->vf_mbx.sw_mbx.request_size = sizeof(union vfpf_tlvs);
510 vf->vf_mbx.sw_mbx.mbx_state = VF_PF_WAIT_FOR_START_REQUEST;
512 vf->state = VF_STOPPED;
513 vf->b_init = false;
515 vf->bulletin.phys = idx *
518 vf->bulletin.p_virt = p_bulletin_virt + idx;
519 vf->bulletin.size = sizeof(struct ecore_bulletin_content);
521 vf->relative_vf_id = idx;
522 vf->abs_vf_id = idx + p_iov->first_vf_in_pf;
523 concrete = ecore_vfid_to_concrete(p_hwfn, vf->abs_vf_id);
524 vf->concrete_fid = concrete;
526 vf->opaque_fid = (p_hwfn->hw_info.opaque_fid & 0xff) |
527 (vf->abs_vf_id << 8);
529 vf->num_mac_filters = ECORE_ETH_VF_NUM_MAC_FILTERS;
530 vf->num_vlan_filters = ECORE_ETH_VF_NUM_VLAN_FILTERS;
756 struct ecore_vf_info *vf;
762 vf = ecore_iov_get_vf_info(p_hwfn, rel_vf_id, false);
763 if (!vf)
766 vf->to_disable = to_disable;
789 struct ecore_vf_info *vf = ecore_iov_get_vf_info(p_hwfn, vf_id, true);
791 if (vf != OSAL_NULL) {
792 vf->ctx = ctx;
794 vf->vf_mbx.sw_mbx.mbx_state = VF_PF_WAIT_FOR_START_REQUEST;
814 struct ecore_vf_info *vf)
819 ecore_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid);
827 for (i = 0; i < vf->num_sbs; i++)
829 vf->igu_sbs[i],
830 vf->opaque_fid, true);
835 struct ecore_vf_info *vf,
840 ecore_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid);
894 struct ecore_vf_info *vf)
902 vf->b_malicious = false;
904 if (vf->to_disable)
907 DP_VERBOSE(p_hwfn, ECORE_MSG_IOV, "Enable internal access for vf %x [abs %x]\n",
908 vf->abs_vf_id, ECORE_VF_ABS_ID(p_hwfn, vf));
911 ECORE_VF_ABS_ID(p_hwfn, vf));
913 ecore_iov_vf_igu_reset(p_hwfn, p_ptt, vf);
916 vf->abs_vf_id, vf->num_sbs);
920 ecore_fid_pretend(p_hwfn, p_ptt, (u16)vf->concrete_fid);
925 ecore_init_run(p_hwfn, p_ptt, PHASE_VF, vf->abs_vf_id,
931 vf->state = VF_FREE;
945 * @param vf
950 struct ecore_vf_info *vf,
957 for (qid = 0; qid < vf->num_rxqs; qid++) {
958 ecore_fw_l2_queue(p_hwfn, vf->vf_queues[qid].fw_rx_qid,
962 val = enable ? (vf->abs_vf_id | (1 << 8)) : 0;
969 struct ecore_vf_info *vf)
971 /* Reset vf in IGU - interrupts are still disabled */
972 ecore_iov_vf_igu_reset(p_hwfn, p_ptt, vf);
974 ecore_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 1);
977 ecore_iov_config_perm_table(p_hwfn, p_ptt, vf, true);
982 struct ecore_vf_info *vf,
995 SET_FIELD(val, IGU_MAPPING_LINE_FUNCTION_NUMBER, vf->abs_vf_id);
1001 vf->igu_sbs[qid] = p_block->igu_sb_id;
1012 vf->abs_vf_id, 1);
1021 vf->num_sbs = (u8)num_rx_queues;
1023 return vf->num_sbs;
1035 * @param vf
1039 struct ecore_vf_info *vf)
1047 for (idx = 0; idx < vf->num_sbs; idx++) {
1048 igu_id = vf->igu_sbs[idx];
1060 vf->num_sbs = 0;
1109 struct ecore_vf_info *vf = OSAL_NULL;
1115 vf = ecore_iov_get_vf_info(p_hwfn, p_params->rel_vf_id, false);
1116 if (!vf) {
1117 DP_ERR(p_hwfn, "ecore_iov_init_hw_for_vf : vf is OSAL_NULL\n");
1121 if (vf->b_init) {
1152 vf->vport_id = p_params->vport_id;
1153 vf->rss_eng_id = p_params->rss_eng_id;
1183 vf->relative_vf_id, p_params->num_queues, (u16)cids);
1188 vf,
1196 vf->num_rxqs = num_of_vf_avaiable_chains;
1197 vf->num_txqs = num_of_vf_avaiable_chains;
1199 for (i = 0; i < vf->num_rxqs; i++) {
1200 struct ecore_vf_queue *p_queue = &vf->vf_queues[i];
1207 vf->relative_vf_id, i, vf->igu_sbs[i],
1222 rc = ecore_iov_enable_vf_access(p_hwfn, p_ptt, vf);
1225 vf->b_init = true;
1227 p_hwfn->pf_iov_info->active_vfs[vf->relative_vf_id / 64] |=
1228 (1ULL << (vf->relative_vf_id % 64));
1245 struct ecore_vf_info *vf = OSAL_NULL;
1247 vf = ecore_iov_get_vf_info(p_hwfn, rel_vf_id, true);
1248 if (!vf) {
1249 DP_ERR(p_hwfn, "ecore_iov_release_hw_for_vf : vf is NULL\n");
1253 if (vf->bulletin.p_virt)
1254 OSAL_MEMSET(vf->bulletin.p_virt, 0,
1255 sizeof(*vf->bulletin.p_virt));
1257 OSAL_MEMSET(&vf->p_vf_info, 0, sizeof(vf->p_vf_info));
1270 OSAL_MEMSET(&vf->acquire, 0, sizeof(vf->acquire));
1273 * vf-close, however, we could get here without going through vf_close
1276 ecore_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 0);
1279 ecore_iov_config_perm_table(p_hwfn, p_ptt, vf, 0);
1281 vf->num_rxqs = 0;
1282 vf->num_txqs = 0;
1283 ecore_iov_free_vf_igu_sbs(p_hwfn, p_ptt, vf);
1285 if (vf->b_init) {
1286 vf->b_init = false;
1288 p_hwfn->pf_iov_info->active_vfs[vf->relative_vf_id / 64] &=
1289 ~(1ULL << (vf->relative_vf_id / 64));
1305 struct ecore_vf_info *vf,
1309 /* mutex_lock(&vf->op_mutex); @@@TBD MichalK - add lock... */
1312 /* vf->op_current = tlv; @@@TBD MichalK */
1318 "VF[%d]: vf pf channel locked by %s\n",
1319 vf->abs_vf_id,
1324 "VF[%d]: vf pf channel locked by %04x\n",
1325 vf->abs_vf_id, tlv);
1329 struct ecore_vf_info *vf,
1332 /*WARN(expected_tlv != vf->op_current,
1335 channel_tlvs_string[vf->op_current]);
1340 /* mutex_unlock(&vf->op_mutex); @@@TBD MichalK add the lock */
1346 "VF[%d]: vf pf channel unlocked by %s\n",
1347 vf->abs_vf_id,
1352 "VF[%d]: vf pf channel unlocked by %04x\n",
1353 vf->abs_vf_id, expected_tlv);
1356 /* vf->op_current = CHANNEL_TLV_NONE;*/
1557 struct ecore_vf_info *vf = OSAL_NULL;
1559 vf = ecore_iov_get_vf_info(p_hwfn, relative_vf_id, b_enabled_only);
1560 if (!vf)
1563 return &vf->p_vf_info;
1750 struct ecore_vf_info *vf)
1752 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
1773 if (vf->state != VF_FREE &&
1774 vf->state != VF_STOPPED) {
1777 vf->abs_vf_id, vf->state);
1794 vf->abs_vf_id);
1800 vf->abs_vf_id,
1813 vf->abs_vf_id);
1818 if (OSAL_IOV_VF_ACQUIRE(p_hwfn, vf->relative_vf_id) != ECORE_SUCCESS) {
1825 OSAL_MEMCPY(&vf->acquire, req, sizeof(vf->acquire));
1827 vf->opaque_fid = req->vfdev_info.opaque_fid;
1829 vf->vf_bulletin = req->bulletin_addr;
1830 vf->bulletin.size = (vf->bulletin.size < req->bulletin_size) ?
1831 vf->bulletin.size : req->bulletin_size;
1878 vfpf_status = ecore_iov_vf_mbx_acquire_resc(p_hwfn, p_ptt, vf,
1884 rc = ecore_sp_vf_start(p_hwfn, vf);
1887 vf->abs_vf_id);
1895 resp->bulletin_size = vf->bulletin.size;
1896 ecore_iov_post_vf_bulletin(p_hwfn, vf->relative_vf_id, p_ptt);
1901 vf->abs_vf_id, resp->pfdev_info.chip_num,
1907 vf->state = VF_ACQUIRED;
1911 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_ACQUIRE,
2127 struct ecore_vf_info *vf)
2130 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2138 vf_info = ecore_iov_get_vf_info(p_hwfn, (u16)vf->relative_vf_id, true);
2142 vf->relative_vf_id);
2146 vf->state = VF_ENABLED;
2149 ecore_iov_enable_vf_traffic(p_hwfn, p_ptt, vf);
2152 for (sb_id = 0; sb_id < vf->num_sbs; sb_id++) {
2156 vf->relative_vf_id, sb_id);
2162 vf->igu_sbs[sb_id],
2163 vf->abs_vf_id, 1);
2166 vf->mtu = start->mtu;
2167 vf->shadow_config.inner_vlan_removal = start->inner_vlan_removal;
2195 params.concrete_fid = vf->concrete_fid;
2196 params.opaque_fid = vf->opaque_fid;
2197 params.vport_id = vf->vport_id;
2199 params.mtu = vf->mtu;
2203 rc = OSAL_IOV_PRE_START_VPORT(p_hwfn, vf->relative_vf_id, ¶ms);
2216 vf->vport_instance++;
2219 ecore_iov_configure_vport_forced(p_hwfn, vf, *p_bitmap);
2220 OSAL_IOV_POST_START_VPORT(p_hwfn, vf->relative_vf_id,
2221 vf->vport_id, vf->opaque_fid);
2222 __ecore_iov_spoofchk_set(p_hwfn, vf, vf->req_spoofchk_val);
2227 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_START,
2233 struct ecore_vf_info *vf)
2238 OSAL_IOV_VF_VPORT_STOP(p_hwfn, vf);
2239 vf->vport_instance--;
2240 vf->spoof_chk = false;
2242 if ((ecore_iov_validate_active_rxq(vf)) ||
2243 (ecore_iov_validate_active_txq(vf))) {
2244 vf->b_malicious = true;
2247 vf->abs_vf_id);
2252 rc = ecore_sp_vport_stop(p_hwfn, vf->opaque_fid, vf->vport_id);
2260 vf->configured_features = 0;
2261 OSAL_MEMSET(&vf->shadow_config, 0, sizeof(vf->shadow_config));
2264 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_VPORT_TEARDOWN,
2270 struct ecore_vf_info *vf,
2273 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2302 ecore_iov_send_response(p_hwfn, p_ptt, vf, length, status);
2343 struct ecore_vf_info *vf)
2347 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2358 if (!ecore_iov_validate_rxq(p_hwfn, vf, req->rx_qid,
2360 !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
2363 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, false);
2367 p_queue = &vf->vf_queues[req->rx_qid];
2371 vf_legacy = ecore_vf_calculate_legacy(vf);
2376 params.vport_id = vf->vport_id;
2377 params.stats_id = vf->abs_vf_id + 0x10;
2386 vf_params.vfid = vf->relative_vf_id;
2391 p_cid = ecore_eth_queue_to_cid(p_hwfn, vf->opaque_fid,
2402 MSTORM_ETH_VF_PRODS_OFFSET(vf->abs_vf_id, req->rx_qid),
2417 vf->num_active_rxqs++;
2421 ecore_iov_vf_mbx_start_rxq_resp(p_hwfn, p_ptt, vf, status,
2615 struct ecore_vf_info *vf)
2619 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2633 if (!ecore_iov_validate_txq(p_hwfn, vf, req->tx_qid,
2635 !ecore_iov_validate_sb(p_hwfn, vf, req->hw_sb))
2638 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, true);
2642 p_queue = &vf->vf_queues[req->tx_qid];
2646 vf_legacy = ecore_vf_calculate_legacy(vf);
2650 params.vport_id = vf->vport_id;
2651 params.stats_id = vf->abs_vf_id + 0x10;
2660 vf_params.vfid = vf->relative_vf_id;
2665 p_cid = ecore_eth_queue_to_cid(p_hwfn, vf->opaque_fid,
2671 vf->relative_vf_id);
2685 ecore_iov_vf_mbx_start_txq_resp(p_hwfn, p_ptt, vf,
2690 struct ecore_vf_info *vf,
2698 if (!ecore_iov_validate_rxq(p_hwfn, vf, rxq_id,
2702 vf->relative_vf_id, rxq_id, qid_usage_idx);
2706 p_queue = &vf->vf_queues[rxq_id];
2718 vf->relative_vf_id, rxq_id, qid_usage_idx,
2731 vf->num_active_rxqs--;
2737 struct ecore_vf_info *vf,
2744 if (!ecore_iov_validate_txq(p_hwfn, vf, txq_id,
2748 p_queue = &vf->vf_queues[txq_id];
2764 struct ecore_vf_info *vf)
2767 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2781 vf->relative_vf_id);
2787 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, false);
2791 rc = ecore_iov_vf_stop_rxqs(p_hwfn, vf, req->rx_qid,
2796 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_STOP_RXQS,
2802 struct ecore_vf_info *vf)
2805 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2819 vf->relative_vf_id);
2825 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, true);
2829 rc = ecore_iov_vf_stop_txqs(p_hwfn, vf, req->tx_qid,
2835 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_STOP_TXQS,
2841 struct ecore_vf_info *vf)
2845 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
2858 qid_usage_idx = ecore_iov_vf_mbx_qid(p_hwfn, vf, false);
2865 if ((vf->acquire.vfdev_info.capabilities &
2870 vf->relative_vf_id);
2878 if (!ecore_iov_validate_rxq(p_hwfn, vf, i,
2880 !vf->vf_queues[i].cids[qid_usage_idx].p_cid ||
2881 vf->vf_queues[i].cids[qid_usage_idx].b_is_tx) {
2884 vf->relative_vf_id, req->rx_qid,
2893 handlers[i] = vf->vf_queues[qid].cids[qid_usage_idx].p_cid;
2907 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_UPDATE_RXQ,
3084 struct ecore_vf_info *vf,
3116 p_rss->rss_eng_id = vf->rss_eng_id;
3129 if (!ecore_iov_validate_rxq(p_hwfn, vf, q_idx,
3133 vf->relative_vf_id, q_idx);
3138 p_cid = ecore_iov_get_vf_rx_queue_cid(&vf->vf_queues[q_idx]);
3209 struct ecore_vf_info *vf)
3213 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
3221 if (!vf->vport_instance) {
3224 vf->abs_vf_id);
3236 params.opaque_fid = vf->opaque_fid;
3237 params.vport_id = vf->vport_id;
3244 ecore_iov_vp_update_vlan_param(p_hwfn, ¶ms, vf, mbx, &tlvs_mask);
3258 ecore_iov_vp_update_rss_param(p_hwfn, vf, ¶ms, p_rss_params,
3266 if (OSAL_IOV_VF_VPORT_UPDATE(p_hwfn, vf->relative_vf_id,
3293 length = ecore_iov_prep_vp_update_resp_tlvs(p_hwfn, vf, mbx, status,
3295 ecore_iov_send_response(p_hwfn, p_ptt, vf, length, status);
3439 struct ecore_vf_info *vf)
3441 struct ecore_bulletin_content *p_bulletin = vf->bulletin.p_virt;
3442 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
3457 params.vport_to_remove_from = vf->vport_id;
3458 params.vport_to_add_to = vf->vport_id;
3464 vf->abs_vf_id, params.opcode, params.type,
3471 if (!vf->vport_instance) {
3474 vf->abs_vf_id);
3483 if (ecore_iov_vf_update_unicast_shadow(p_hwfn, vf, ¶ms) !=
3510 rc = OSAL_IOV_CHK_UCAST(p_hwfn, vf->relative_vf_id, ¶ms);
3518 rc = ecore_sp_eth_filter_ucast(p_hwfn, vf->opaque_fid, ¶ms,
3524 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_UCAST_FILTER,
3530 struct ecore_vf_info *vf)
3535 for (i = 0; i < vf->num_sbs; i++)
3537 vf->igu_sbs[i],
3538 vf->opaque_fid, false);
3540 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_INT_CLEANUP,
3547 struct ecore_vf_info *vf)
3553 ecore_iov_vf_igu_set_int(p_hwfn, p_ptt, vf, 0);
3556 ecore_iov_config_perm_table(p_hwfn, p_ptt, vf, 0);
3558 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_CLOSE,
3662 struct ecore_vf_info *vf)
3664 struct ecore_iov_vf_mbx *mbx = &vf->vf_mbx;
3679 if (!ecore_iov_validate_rxq(p_hwfn, vf, qid,
3683 vf->abs_vf_id, qid);
3687 if (!ecore_iov_validate_txq(p_hwfn, vf, qid,
3691 vf->abs_vf_id, qid);
3697 vf->abs_vf_id, rx_coal, tx_coal, qid);
3700 p_cid = ecore_iov_get_vf_rx_queue_cid(&vf->vf_queues[qid]);
3706 vf->abs_vf_id, vf->vf_queues[qid].fw_rx_qid);
3709 vf->rx_coal = rx_coal;
3716 struct ecore_vf_queue *p_queue = &vf->vf_queues[qid];
3730 vf->abs_vf_id);
3734 vf->tx_coal = tx_coal;
3739 ecore_iov_prepare_resp(p_hwfn, p_ptt, vf, CHANNEL_TLV_COALESCE_UPDATE,
3749 struct ecore_vf_info *vf;
3760 vf = &p_hwfn->pf_iov_info->vfs_array[vf_id];
3765 if (!ecore_iov_validate_rxq(p_hwfn, vf, qid,
3769 vf->abs_vf_id, qid);
3773 if (!ecore_iov_validate_txq(p_hwfn, vf, qid,
3777 vf->abs_vf_id, qid);
3783 vf->abs_vf_id, rx_coal, tx_coal, qid);
3786 p_cid = ecore_iov_get_vf_rx_queue_cid(&vf->vf_queues[qid]);
3792 vf->abs_vf_id, vf->vf_queues[qid].fw_rx_qid);
3795 vf->rx_coal = rx_coal;
3802 struct ecore_vf_queue *p_queue = &vf->vf_queues[qid];
3816 vf->abs_vf_id);
3820 vf->tx_coal = tx_coal;
4009 * there's no need to wait per-vf, do it before looping.
4148 /* Lock the per vf op mutex and note the locker's identity.
4635 struct ecore_vf_info *vf;
4644 vf = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
4645 if (!vf)
4650 vf->req_spoofchk_val = val;
4655 rc = __ecore_iov_spoofchk_set(p_hwfn, vf, val);
4770 struct ecore_vf_info *vf;
4774 vf = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
4776 if (!vf)
4779 rc = ecore_fw_vport(p_hwfn, vf->vport_id, &abs_vp_id);
4792 struct ecore_vf_info *vf;
4806 vf = ecore_iov_get_vf_info(ECORE_LEADING_HWFN(p_dev), (u16)vfid, true);
4807 vport_id = vf->vport_id;
4818 struct ecore_vf_info *vf;
4820 vf = ecore_iov_get_vf_info(p_hwfn, (u16)vfid, true);
4821 if (!vf)
4824 if (vf->state != VF_ENABLED)
4828 vf->abs_vf_id + 0x10, false);