X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=lib%2Fcryptodev%2Frte_crypto_sym.h;h=daa090b97820fb45013f6625102eccc45d0cd916;hb=28dde5da503ed09f10cdfb295e390b114df7330a;hp=1106ad6201d3affbfec5495fc0a9dfa3888f0113;hpb=cab0c8f3c09ee9fd8fdd9bb73d24ea50df61698d;p=dpdk.git diff --git a/lib/cryptodev/rte_crypto_sym.h b/lib/cryptodev/rte_crypto_sym.h index 1106ad6201..daa090b978 100644 --- a/lib/cryptodev/rte_crypto_sym.h +++ b/lib/cryptodev/rte_crypto_sym.h @@ -37,6 +37,8 @@ struct rte_crypto_vec { rte_iova_t iova; /** length of the data buffer */ uint32_t len; + /** total buffer length */ + uint32_t tot_len; }; /** @@ -69,7 +71,9 @@ struct rte_crypto_sym_vec { /** number of operations to perform */ uint32_t num; /** array of SGL vectors */ - struct rte_crypto_sgl *sgl; + struct rte_crypto_sgl *src_sgl; + /** array of SGL vectors for OOP, keep it NULL for inplace*/ + struct rte_crypto_sgl *dest_sgl; /** array of pointers to cipher IV */ struct rte_crypto_va_iova_ptr *iv; /** array of pointers to digest */ @@ -963,6 +967,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, vec[0].base = rte_pktmbuf_mtod_offset(mb, void *, ofs); vec[0].iova = rte_pktmbuf_iova_offset(mb, ofs); + vec[0].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; /* whole data lies in the first segment */ seglen = mb->data_len - ofs; @@ -978,12 +983,14 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, vec[i].base = rte_pktmbuf_mtod(nseg, void *); vec[i].iova = rte_pktmbuf_iova(nseg); + vec[i].tot_len = mb->buf_len - rte_pktmbuf_headroom(mb) - ofs; seglen = nseg->data_len; if (left <= seglen) { /* whole requested data is completed */ vec[i].len = left; left = 0; + i++; break; } @@ -993,7 +1000,7 @@ rte_crypto_mbuf_to_vec(const struct rte_mbuf *mb, uint32_t ofs, uint32_t len, } RTE_ASSERT(left == 0); - return i + 1; + return i; }