#define FLE_POOL_NUM_BUFS 32000
#define FLE_POOL_BUF_SIZE 256
#define FLE_POOL_CACHE_SIZE 512
-#define FLE_SG_MEM_SIZE 2048
+#define FLE_SG_MEM_SIZE(num) (FLE_POOL_BUF_SIZE + ((num) * 32))
#define SEC_FLC_DHR_OUTBOUND -114
#define SEC_FLC_DHR_INBOUND 0
mbuf = sym_op->m_src;
/* first FLE entry used to store mbuf and session ctxt */
- fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE,
+ fle = (struct qbman_fle *)rte_malloc(NULL,
+ FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs),
RTE_CACHE_LINE_SIZE);
if (unlikely(!fle)) {
DPAA2_SEC_DP_ERR("Proto:SG: Memory alloc failed for SGE");
return -1;
}
- memset(fle, 0, FLE_SG_MEM_SIZE);
+ memset(fle, 0, FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs));
DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
mbuf = sym_op->m_src;
/* first FLE entry used to store mbuf and session ctxt */
- fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE,
+ fle = (struct qbman_fle *)rte_malloc(NULL,
+ FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs),
RTE_CACHE_LINE_SIZE);
if (unlikely(!fle)) {
DPAA2_SEC_ERR("GCM SG: Memory alloc failed for SGE");
return -1;
}
- memset(fle, 0, FLE_SG_MEM_SIZE);
+ memset(fle, 0, FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs));
DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, (size_t)priv);
mbuf = sym_op->m_src;
/* first FLE entry used to store mbuf and session ctxt */
- fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE,
+ fle = (struct qbman_fle *)rte_malloc(NULL,
+ FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs),
RTE_CACHE_LINE_SIZE);
if (unlikely(!fle)) {
DPAA2_SEC_ERR("AUTHENC SG: Memory alloc failed for SGE");
return -1;
}
- memset(fle, 0, FLE_SG_MEM_SIZE);
+ memset(fle, 0, FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs));
DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
}
mbuf = sym_op->m_src;
- fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE,
+ fle = (struct qbman_fle *)rte_malloc(NULL,
+ FLE_SG_MEM_SIZE(mbuf->nb_segs),
RTE_CACHE_LINE_SIZE);
if (unlikely(!fle)) {
DPAA2_SEC_ERR("AUTH SG: Memory alloc failed for SGE");
return -1;
}
- memset(fle, 0, FLE_SG_MEM_SIZE);
+ memset(fle, 0, FLE_SG_MEM_SIZE(mbuf->nb_segs));
/* first FLE entry used to store mbuf and session ctxt */
DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);
else
mbuf = sym_op->m_src;
- fle = (struct qbman_fle *)rte_malloc(NULL, FLE_SG_MEM_SIZE,
+ /* first FLE entry used to store mbuf and session ctxt */
+ fle = (struct qbman_fle *)rte_malloc(NULL,
+ FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs),
RTE_CACHE_LINE_SIZE);
if (!fle) {
DPAA2_SEC_ERR("CIPHER SG: Memory alloc failed for SGE");
return -1;
}
- memset(fle, 0, FLE_SG_MEM_SIZE);
+ memset(fle, 0, FLE_SG_MEM_SIZE(mbuf->nb_segs + sym_op->m_src->nb_segs));
/* first FLE entry used to store mbuf and session ctxt */
DPAA2_SET_FLE_ADDR(fle, (size_t)op);
DPAA2_FLE_SAVE_CTXT(fle, (ptrdiff_t)priv);