net/dpaa2: fix multi-segment Tx
authorNipun Gupta <nipun.gupta@nxp.com>
Fri, 19 Jul 2019 10:06:09 +0000 (15:36 +0530)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 23 Jul 2019 12:31:36 +0000 (14:31 +0200)
This patch resets frc and ctrl in sg tx fd to avoid corruption.

Fixes: 774e9ea91992 ("net/dpaa2: add support for multi seg buffers")
Cc: stable@dpdk.org
Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Acked-by: Hemant Agrawal <hemant.agrawal@nxp.com>
drivers/bus/fslmc/portal/dpaa2_hw_pvt.h
drivers/net/dpaa2/dpaa2_rxtx.c

index 92fc762..8644761 100644 (file)
@@ -229,6 +229,7 @@ enum qbman_fd_format {
        ((fd)->simple.frc = (0x80000000 | (len)))
 #define DPAA2_GET_FD_FRC_PARSE_SUM(fd) \
                        ((uint16_t)(((fd)->simple.frc & 0xffff0000) >> 16))
+#define DPAA2_RESET_FD_FRC(fd)         ((fd)->simple.frc = 0)
 #define DPAA2_SET_FD_FRC(fd, _frc)     ((fd)->simple.frc = _frc)
 #define DPAA2_RESET_FD_CTRL(fd)         ((fd)->simple.ctrl = 0)
 
index c6e5012..6ca5071 100644 (file)
@@ -370,8 +370,9 @@ eth_mbuf_to_sg_fd(struct rte_mbuf *mbuf,
        DPAA2_SET_FD_LEN(fd, mbuf->pkt_len);
        DPAA2_SET_ONLY_FD_BPID(fd, bpid);
        DPAA2_SET_FD_OFFSET(fd, temp->data_off);
-       DPAA2_SET_FD_ASAL(fd, DPAA2_ASAL_VAL);
        DPAA2_FD_SET_FORMAT(fd, qbman_fd_sg);
+       DPAA2_RESET_FD_FRC(fd);
+       DPAA2_RESET_FD_CTRL(fd);
        /*Set Scatter gather table and Scatter gather entries*/
        sgt = (struct qbman_sge *)(
                        (size_t)DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd))