/* Read the current lmt addr of pcifunc */
tbl_idx = rvu_get_lmtst_tbl_index(rvu, pcifunc);
err = lmtst_map_table_ops(rvu, tbl_idx, &val, LMT_TBL_OP_READ); if (err) {
dev_err(rvu->dev, "Failed to read LMT map table: index 0x%x err %d\n",
tbl_idx, err); return err;
}
/* Storing the seondary's lmt base address as this needs to be *revertedinFLR.Alsomakingsurethisdefaultvaluedoesn't *getoverwrittenonmultiplecallstothismailbox.
*/ if (!pfvf->lmt_base_addr)
pfvf->lmt_base_addr = val;
/* Update the LMT table with new addr */
err = lmtst_map_table_ops(rvu, tbl_idx, &lmt_addr, LMT_TBL_OP_WRITE); if (err) {
dev_err(rvu->dev, "Failed to update LMT map table: index 0x%x err %d\n",
tbl_idx, err); return err;
} return0;
}
/* Check if PF_FUNC wants to use its own local memory as LMTLINE *region,ifso,convertthatIOVAtophysicaladdressand *populateLMTtablewiththataddress
*/ if (req->use_local_lmt_region) {
err = rvu_get_lmtaddr(rvu, req->hdr.pcifunc,
req->lmt_iova, &lmt_addr); if (err < 0) return err;
/* Update the lmt addr for this PFFUNC in the LMT table */
err = rvu_update_lmtaddr(rvu, req->hdr.pcifunc, lmt_addr); if (err) return err;
}
/* Reconfiguring lmtst map table in lmt region shared mode i.e. make *multiplePF_FUNCstoshareanLMTLINEregion,soprimary/base *pcifunc(whichispassedasanargumenttomailbox)istheone *whoselmtbaseaddresswillbesharedamongothersecondary *pcifunc(willbetheonewhoiscallingthismailbox).
*/ if (req->base_pcifunc) { /* Calculating the LMT table index equivalent to primary *pcifunc.
*/
pri_tbl_idx = rvu_get_lmtst_tbl_index(rvu, req->base_pcifunc);
/* Read the base lmt addr of the primary pcifunc */
err = lmtst_map_table_ops(rvu, pri_tbl_idx, &val,
LMT_TBL_OP_READ); if (err) {
dev_err(rvu->dev, "Failed to read LMT map table: index 0x%x err %d\n",
pri_tbl_idx, err); goto error;
}
/* Update the base lmt addr of secondary with primary's base *lmtaddr.
*/
err = rvu_update_lmtaddr(rvu, req->hdr.pcifunc, val); if (err) return err;
}
/* This mailbox can also be used to update word1 of APR_LMT_MAP_ENTRY_S *likeenablingscheduledLMTST,disableLMTLINEprefetch,disable *earlycompletionfororderedLMTST.
*/ if (req->sch_ena || req->dis_sched_early_comp || req->dis_line_pref) {
tbl_idx = rvu_get_lmtst_tbl_index(rvu, req->hdr.pcifunc);
err = lmtst_map_table_ops(rvu, tbl_idx + LMT_MAP_TBL_W1_OFF,
&val, LMT_TBL_OP_READ); if (err) {
dev_err(rvu->dev, "Failed to read LMT map table: index 0x%x err %d\n",
tbl_idx + LMT_MAP_TBL_W1_OFF, err); goto error;
}
/* Storing lmt map table entry word1 default value as this needs *toberevertedinFLR.Alsomakingsurethisdefaultvalue *doesn'tgetoverwrittenonmultiplecallstothismailbox.
*/ if (!pfvf->lmt_map_ent_w1)
pfvf->lmt_map_ent_w1 = val;
/* Disable early completion for Ordered LMTSTs. */ if (req->dis_sched_early_comp)
val |= (req->dis_sched_early_comp <<
APR_LMT_MAP_ENT_DIS_SCH_CMP_SHIFT); /* Enable scheduled LMTST */ if (req->sch_ena)
val |= (req->sch_ena << APR_LMT_MAP_ENT_SCH_ENA_SHIFT) |
req->ssow_pf_func; /* Disables LMTLINE prefetch before receiving store data. */ if (req->dis_line_pref)
val |= (req->dis_line_pref <<
APR_LMT_MAP_ENT_DIS_LINE_PREF_SHIFT);
err = lmtst_map_table_ops(rvu, tbl_idx + LMT_MAP_TBL_W1_OFF,
&val, LMT_TBL_OP_WRITE); if (err) {
dev_err(rvu->dev, "Failed to update LMT map table: index 0x%x err %d\n",
tbl_idx + LMT_MAP_TBL_W1_OFF, err); goto error;
}
}
error: return err;
}
/* Resetting the lmtst map table to original base addresses */ void rvu_reset_lmt_map_tbl(struct rvu *rvu, u16 pcifunc)
{ struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);
u32 tbl_idx; int err;
if (is_rvu_otx2(rvu)) return;
if (pfvf->lmt_base_addr || pfvf->lmt_map_ent_w1) { /* This corresponds to lmt map table index */
tbl_idx = rvu_get_lmtst_tbl_index(rvu, pcifunc); /* Reverting back original lmt base addr for respective *pcifunc.
*/ if (pfvf->lmt_base_addr) {
err = lmtst_map_table_ops(rvu, tbl_idx,
&pfvf->lmt_base_addr,
LMT_TBL_OP_WRITE); if (err)
dev_err(rvu->dev, "Failed to update LMT map table: index 0x%x err %d\n",
tbl_idx, err);
pfvf->lmt_base_addr = 0;
} /* Reverting back to orginal word1 val of lmtst map table entry *whichunderwentchanges.
*/ if (pfvf->lmt_map_ent_w1) {
err = lmtst_map_table_ops(rvu,
tbl_idx + LMT_MAP_TBL_W1_OFF,
&pfvf->lmt_map_ent_w1,
LMT_TBL_OP_WRITE); if (err)
dev_err(rvu->dev, "Failed to update LMT map table: index 0x%x err %d\n",
tbl_idx + LMT_MAP_TBL_W1_OFF, err);
pfvf->lmt_map_ent_w1 = 0;
}
}
}
sdp_chan_base = hw->lbk_chan_base + hw->lbk_links * nr_lbk_chans; /* Round up base channel to multiple of number of channels */
hw->sdp_chan_base = ALIGN(sdp_chan_base, nr_sdp_chans);
/* Out of 4096 channels start CPT from 2048 so *thatMSBforCPTchannelsisalwaysset
*/ if (cpt_chan_base <= NIX_CHAN_CPT_CH_START) {
hw->cpt_chan_base = NIX_CHAN_CPT_CH_START;
} else {
dev_err(rvu->dev, "CPT channels could not fit in the range 2048-4095\n"); return -EINVAL;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.