]> git.droids-corp.org - dpdk.git/commitdiff
crypto/dpaa2_sec: fix buffer pool ID check
authorGagandeep Singh <g.singh@nxp.com>
Thu, 28 Apr 2022 11:47:21 +0000 (17:17 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Fri, 29 Apr 2022 09:20:09 +0000 (11:20 +0200)
Simple fd rely on bpid of the buffers whereas
other FD types can support buffers without bpid
of pool.

So moving the bpid check to simple fd to mbuf
conversion function.

Fixes: 8d1f3a5d751b ("crypto/dpaa2_sec: support crypto operation")
Cc: stable@dpdk.org
Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c

index 03fef5e500c62d553fc9cb2a4583b1343d2c5a36..2374d6797832c3da5e205c01a976e33291cbb7b8 100644 (file)
@@ -1566,6 +1566,10 @@ sec_simple_fd_to_mbuf(const struct qbman_fd *fd)
        int16_t diff = 0;
        dpaa2_sec_session *sess_priv __rte_unused;
 
+       if (unlikely(DPAA2_GET_FD_IVP(fd))) {
+               DPAA2_SEC_ERR("error: non inline buffer");
+               return NULL;
+       }
        struct rte_mbuf *mbuf = DPAA2_INLINE_MBUF_FROM_BUF(
                DPAA2_IOVA_TO_VADDR(DPAA2_GET_FD_ADDR(fd)),
                rte_dpaa2_bpid_info[DPAA2_GET_FD_BPID(fd)].meta_data_size);
@@ -1612,11 +1616,6 @@ sec_fd_to_mbuf(const struct qbman_fd *fd)
         * We can have a better approach to use the inline Mbuf
         */
 
-       if (unlikely(DPAA2_GET_FD_IVP(fd))) {
-               /* TODO complete it. */
-               DPAA2_SEC_ERR("error: non inline buffer");
-               return NULL;
-       }
        op = (struct rte_crypto_op *)DPAA2_GET_FLE_ADDR((fle - 1));
 
        /* Prefeth op */