Skip to content

Commit 5aa8da9

Browse files
JunYangNXPferruhy
authored andcommitted
net/dpaa: improve errata A010022 handling
This patch improves the errata handling for "RTE_LIBRTE_DPAA_ERRATA_LS1043_A010022" Signed-off-by: Jun Yang <[email protected]> Acked-by: Hemant Agrawal <[email protected]>
1 parent bf84bcf commit 5aa8da9

File tree

1 file changed

+32
-8
lines changed

1 file changed

+32
-8
lines changed

drivers/net/dpaa/dpaa_rxtx.c

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,6 +1258,35 @@ reallocate_mbuf(struct qman_fq *txq, struct rte_mbuf *mbuf)
12581258
return new_mbufs[0];
12591259
}
12601260

1261+
#ifdef RTE_LIBRTE_DPAA_ERRATA_LS1043_A010022
1262+
/* In case the data offset is not multiple of 16,
1263+
* FMAN can stall because of an errata. So reallocate
1264+
* the buffer in such case.
1265+
*/
1266+
static inline int
1267+
dpaa_eth_ls1043a_mbuf_realloc(struct rte_mbuf *mbuf)
1268+
{
1269+
uint64_t len, offset;
1270+
1271+
if (dpaa_svr_family != SVR_LS1043A_FAMILY)
1272+
return 0;
1273+
1274+
while (mbuf) {
1275+
len = mbuf->data_len;
1276+
offset = mbuf->data_off;
1277+
if ((mbuf->next &&
1278+
!rte_is_aligned((void *)len, 16)) ||
1279+
!rte_is_aligned((void *)offset, 16)) {
1280+
DPAA_PMD_DEBUG("Errata condition hit");
1281+
1282+
return 1;
1283+
}
1284+
mbuf = mbuf->next;
1285+
}
1286+
return 0;
1287+
}
1288+
#endif
1289+
12611290
uint16_t
12621291
dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
12631292
{
@@ -1296,21 +1325,16 @@ dpaa_eth_queue_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
12961325
DPAA_TX_BURST_SIZE : nb_bufs;
12971326
for (loop = 0; loop < frames_to_send; loop++) {
12981327
mbuf = *(bufs++);
1299-
/* In case the data offset is not multiple of 16,
1300-
* FMAN can stall because of an errata. So reallocate
1301-
* the buffer in such case.
1302-
*/
1303-
if (dpaa_svr_family == SVR_LS1043A_FAMILY &&
1304-
(mbuf->data_off & 0x7F) != 0x0)
1305-
realloc_mbuf = 1;
1306-
13071328
fd_arr[loop].cmd = 0;
13081329
if (dpaa_ieee_1588) {
13091330
fd_arr[loop].cmd |= DPAA_FD_CMD_FCO |
13101331
qman_fq_fqid(fq_txconf);
13111332
fd_arr[loop].cmd |= DPAA_FD_CMD_RPD |
13121333
DPAA_FD_CMD_UPD;
13131334
}
1335+
#ifdef RTE_LIBRTE_DPAA_ERRATA_LS1043_A010022
1336+
realloc_mbuf = dpaa_eth_ls1043a_mbuf_realloc(mbuf);
1337+
#endif
13141338
seqn = *dpaa_seqn(mbuf);
13151339
if (seqn != DPAA_INVALID_MBUF_SEQN) {
13161340
index = seqn - 1;

0 commit comments

Comments
 (0)