Skip to content

Commit

Permalink
net/dpaa: improve errata A010022 handling
Browse files Browse the repository at this point in the history
This patch improves the errata handling for
"RTE_LIBRTE_DPAA_ERRATA_LS1043_A010022"

Signed-off-by: Jun Yang <jun.yang@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
  • Loading branch information
JunYangNXP authored and ferruhy committed Oct 2, 2024
1 parent e498f3b commit a978a7f
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions drivers/net/dpaa/dpaa_rxtx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,35 @@ reallocate_mbuf(struct qman_fq *txq, struct rte_mbuf *mbuf)
return new_mbufs[0];
}

#ifdef RTE_LIBRTE_DPAA_ERRATA_LS1043_A010022
/* In case the data offset is not multiple of 16,
* FMAN can stall because of an errata. So reallocate
* the buffer in such case.
*/
static inline int
dpaa_eth_ls1043a_mbuf_realloc(struct rte_mbuf *mbuf)
{
uint64_t len, offset;

if (dpaa_svr_family != SVR_LS1043A_FAMILY)
return 0;

while (mbuf) {
len = mbuf->data_len;
offset = mbuf->data_off;
if ((mbuf->next &&
!rte_is_aligned((void *)len, 16)) ||
!rte_is_aligned((void *)offset, 16)) {
DPAA_PMD_DEBUG("Errata condition hit");

return 1;
}
mbuf = mbuf->next;
}
return 0;
}
#endif

uint16_t
dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
{
Expand Down Expand Up @@ -1296,21 +1325,16 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
DPAA_TX_BURST_SIZE : nb_bufs;
for (loop = 0; loop < frames_to_send; loop++) {
mbuf = *(bufs++);
/* In case the data offset is not multiple of 16,
* FMAN can stall because of an errata. So reallocate
* the buffer in such case.
*/
if (dpaa_svr_family == SVR_LS1043A_FAMILY &&
(mbuf->data_off & 0x7F) != 0x0)
realloc_mbuf = 1;

fd_arr[loop].cmd = 0;
if (dpaa_ieee_1588) {
fd_arr[loop].cmd |= DPAA_FD_CMD_FCO |
qman_fq_fqid(fq_txconf);
fd_arr[loop].cmd |= DPAA_FD_CMD_RPD |
DPAA_FD_CMD_UPD;
}
#ifdef RTE_LIBRTE_DPAA_ERRATA_LS1043_A010022
realloc_mbuf = dpaa_eth_ls1043a_mbuf_realloc(mbuf);
#endif
seqn = *dpaa_seqn(mbuf);
if (seqn != DPAA_INVALID_MBUF_SEQN) {
index = seqn - 1;
Expand Down

0 comments on commit a978a7f

Please sign in to comment.