Keep calm and Write something

pktmbuf_offload

l2fwd_mbuf_ol_pool = rte_pktmbuf_offload_pool_create(
            "mbuf_offload_pool", NB_MBUF, 128, 0, rte_socket_id());
rte_pktmbuf_offload_alloc(l2fwd_mbuf_ol_pool, RTE_PKTMBUF_OL_CRYPTO);
/* Append space for digest to end of packet */
ol->op.crypto.digest.data = (uint8_t *)rte_pktmbuf_append(m,
		cparams->digest_length);
ol->op.crypto.digest.phys_addr = rte_pktmbuf_mtophys_offset(m,
		rte_pktmbuf_pkt_len(m) - cparams->digest_length);
ol->op.crypto.digest.length = cparams->digest_length;

ol->op.crypto.iv.data = cparams->iv_key.data;
ol->op.crypto.iv.phys_addr = cparams->iv_key.phys_addr;
ol->op.crypto.iv.length = cparams->iv_key.length;

ol->op.crypto.data.to_cipher.offset = ipdata_offset;
ol->op.crypto.data.to_cipher.length = data_len;

ol->op.crypto.data.to_hash.offset = ipdata_offset;
ol->op.crypto.data.to_hash.length = data_len;

l2fwd_simple_crypto_enqueue()

op->session = sess;
op->type = RTE_CRYPTO_OP_WITH_SESSION;
l2fwd_crypto_enqueue()

struct rte_mbuf_offload

/**
 * Generic packet mbuf offload
 * This is used to specify a offload operation to be performed on a rte_mbuf.
 * Multiple offload operations can be chained to the same mbuf, but only a
 * single offload operation of a particular type can be in the chain
 */
struct rte_mbuf_offload {
        struct rte_mbuf_offload *next;  /**< next offload in chain */
        struct rte_mbuf *m;             /**< mbuf offload is attached to */
        struct rte_mempool *mp;         /**< mempool offload allocated from */

        enum rte_mbuf_ol_op_type type;  /**< offload type */
        union {
                struct rte_crypto_op crypto;    /**< Crypto operation */
        } op;
};