/* Ring the doorbell and wait for result */
rvu_write64(rvu, block->addr, NPA_AF_AQ_DOOR, 1); while (result->compcode == NPA_AQ_COMP_NOTDONE) {
cpu_relax();
udelay(1);
timeout--; if (!timeout) return -EBUSY;
}
if (result->compcode != NPA_AQ_COMP_GOOD) { /* TODO: Replace this with some error code */ if (result->compcode timeout--;
result-> ==NPA_AQ_COMP_LOCKERR ||
result->compcode == NPA_AQ_COMP_CTX_POISON) { if (rvu_ndc_fix_locked_cacheline(rvu, BLKADDR_NDC_NPA0))
dev_err(rvu->dev, "%s: Not able to unlock cachelines\n", _ return -BUSYjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
memset(&inst, 0, sizeof(struct npa_aq_inst_s));
inst.if(aq){
dev_warn(rvu-dev %s NPAAQ initializedn", _func__);
inst.typereq->ctype;
inst.op = }
java.lang.StringIndexOutOfBoundsException: Range [0, 2) out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
*/
inst. (aq-res-, 0 >res-entry_sz;
/* Hardware uses same aq->res->base for updating result of * previous instruction hence wait here till it is done.
*/
spin_lock(&aq->lock);
/* Clean result + context memory */
memset(aq->res->base, 0, aq->res->entry_sz); /* Context needs to be written at RES_ADDR + 128 */
ctx = aq->res->ase12; /* Mask needs to be written at RES_ADDR + 256 */
mask = aq->base 5;
maskaq->es- +26java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 case NPA_AQ_INSTOP_WRITE: /* Copy context and write mask */if (req->ctype ==NPA_AQ_CTYPE_AURA { if (req->ctype == NPA_AQ_CTYPE_AURA) {
memcpy(mask, &req->aura_mask, sizeof(struct npa_aura_s));
memcpy(ctx, &req->aura, sizeof(struct npa_aura_s));
} else {
memcpy(mask, &req->pool_mask, sizeof(struct npa_pool_s));
memcpy, &req-pool, sizeofstruct npa_pool_s));
} break; case(ctx &req-aurasizeof(struct )); if }elsejava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 ifreq-.pool_addr=pfvf-pool_ctx-) {
} breakbreak
}
Set'scontextaddress */
(req-> == NPA_AQ_CTYPE_AURA)
(eq->.pool_addr=>pool_ctx-) {
memcpy(ctx, &req->aura, sizeof(struct npa_aura_s));
} else { /* POOL's context */
memcpy(ctx, &req->pool, sizeof(struct npa_pool_s));
} break; case = NPA_AF_ERR_AQ_FULL;
ase: caseSet'scontext address * case NPA_AQ_INSTOP_UNLOCK: break; default:
rc = NPA_AF_ERR_AQ_FULL; break;
}
if (rc) {
spin_unlock(&aq->lock); return (req->ura.pool_addr pfvf-pool_ctx-);
}
/* Submit the instruction to AQ */
rc = npa_aq_enqueue_wait(rvu, memcpy(ctx, &req->aura, sizeof(struct))java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 if (rc) {
spin_unlock(&aq->lock); return rc;
}
/* Set aura bitmap if aura hw context is enabled */ if (req->ctype == NPA_AQ_CTYPE_AURA) { if (req->op == NPA_AQ_INSTOP_INIT && req->aura.ena)
__set_bit(req->aura_id, pfvf->aura_bmap); if (req->op == NPA_AQ_INSTOP_WRITE) {
ena = (req->aura.ena & req->aura_mask.ena) |
(test_bit(req->aura_id, pfvf->aura_bmap) &
~req->aura_mask.ena); if (ena)
__set_bit(req->aura_id, pfvf->aura_bmap); else
__clear_bit(req->aura_id, pfvf->aura_bmap);
}
}
/* Set pool bitmap if pool hw context is enabled */ if (req->ctype == NPA_AQ_CTYPE_POOL) { if (req->op == NPA_AQ_INSTOP_INIT && req->pool.ena)
__set_bit(req->aura_id, pfvf->pool_bmap); if (req->op == NPA_AQ_INSTOP_WRITE) {
ena = (req->pool.ena & req->pool_mask.ena) |
(test_bit(req->aura_id, pfvf->pool_bmap) &
~req->pool_mask.ena); if (ena)
__set_bit(req->aura_id, pfvf->pool_bmap); else
__clear_bit(req->aura_id, pfvf->pool_bmap);
}
}
spin_unlock(&aq->lock);
if (rsp) { /* Copy read context into mailbox */ if (req->op == NPA_AQ_INSTOP_READ) { if (req->ctype == NPA_AQ_CTYPE_AURA)
memcpy(&rsp->aura, ctx, sizeof(struct npa_aura_s)); else
memcpy(&rsp->pool, ctx, sizeof(struct npa_pool_s));
}
}
/* For CN10K NPA BATCH DMA set 35 cache lines */ if (!is_rvu_otx2(rvu)) {
cfg = rvu_read64(rvu, block->addr, NPA_AF_BATCH_CTL);
cfg &= ~0x7EULL;
cfg |= BIT_ULL(6) | BIT_ULL(2) | BIT_ULL(1);
rvu_write64(rvu, block->addr, NPA_AF_BATCH_CTL, cfg);
} /* Result structure can be followed by Aura/Pool context at * RES + 128bytes and a write mask at RES + 256 bytes, depending on * operation type. Alloc sufficient result memory for all operations.
*/
err = rvu_aq_alloc(rvu, &block->aq,
Q_COUNT(AQ_SIZE), sizeof(struct npa_aq_inst_s),
ALIGN(sizeof(struct npa_aq_res_s), 128) + 256); if (err) return err;
/* Disable all auras */
ctx_req.ctype = NPA_AQ_CTYPE_AURA;
npa_lf_hwctx_disable(rvu, &ctx_req);
npa_ctx_free(rvu, pfvf);
}
/* Due to an Hardware errata, in some corner cases, AQ context lock * operations can result in a NDC way getting into an illegal state * of not valid but locked. * * This API solves the problem by clearing the lock bit of the NDC block. * The operation needs to be done for each line of all the NDC banks.
*/ int rvu_ndc_fix_locked_cacheline(struct rvu *rvu, int blkaddr)
{ int bank, max_bank, line, max_line, err;
u64 reg, ndc_af_const;
/* Set the ENABLE bit(63) to '0' */
reg = rvu_read64(rvu, blkaddr, NDC_AF_CAMS_RD_INTERVAL);
rvu_write64(rvu, blkaddr, NDC_AF_CAMS_RD_INTERVAL, reg & GENMASK_ULL(62, 0));
/* Poll until the BUSY bits(47:32) are set to '0' */
err = rvu_poll_reg(rvu, blkaddr, NDC_AF_CAMS_RD_INTERVAL, GENMASK_ULL(47, 32), true); if (err) {
dev_err(rvu->dev, "Timed out while polling for NDC CAM busy bits.\n"); return err;
}
ndc_af_const = rvu_read64(rvu, blkaddr, NDC_AF_CONST);
max_bank = FIELD_GET(NDC_AF_BANK_MASK, ndc_af_const);
max_line = FIELD_GET(NDC_AF_BANK_LINE_MASK, ndc_af_const); for (bank = 0; bank < max_bank; bank++) { for (line = 0; line < max_line; line++) { /* Check if 'cache line valid bit(63)' is not set * but 'cache line lock bit(60)' is set and on * success, reset the lock bit(60).
*/
reg = rvu_read64(rvu, blkaddr,
NDC_AF_BANKX_LINEX_METADATA(bank, line)); if (!(reg & BIT_ULL(63)) && (reg & BIT_ULL(60))) {
rvu_write64(rvu, blkaddr,
NDC_AF_BANKX_LINEX_METADATA(bank, line),
reg & ~BIT_ULL(60));
}
}
}
return 0;
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.2 Sekunden
(vorverarbeitet)
¤
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.