crypto/dpaa_sec: fix auth-cipher check for AEAD
[dpdk.git] / drivers / crypto / dpaa_sec / dpaa_sec.h
index 6049c1d..009ab75 100644 (file)
@@ -10,6 +10,7 @@
 #define CRYPTODEV_NAME_DPAA_SEC_PMD    crypto_dpaa_sec
 /**< NXP DPAA - SEC PMD device name */
 
+#define MAX_DPAA_CORES         4
 #define NUM_POOL_CHANNELS      4
 #define DPAA_SEC_BURST         7
 #define DPAA_SEC_ALG_UNSUPPORT (-1)
@@ -18,6 +19,8 @@
 #define AES_CTR_IV_LEN         16
 #define AES_GCM_IV_LEN         12
 
+#define DPAA_IPv6_DEFAULT_VTC_FLOW     0x60000000
+
 /* Minimum job descriptor consists of a oneword job descriptor HEADER and
  * a pointer to the shared descriptor.
  */
@@ -26,7 +29,7 @@
 #define CTX_POOL_NUM_BUFS      32000
 #define CTX_POOL_BUF_SIZE      sizeof(struct dpaa_sec_op_ctx)
 #define CTX_POOL_CACHE_SIZE    512
-#define RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS 2048
+#define RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS 1024
 
 #define DIR_ENC                 1
 #define DIR_DEC                 0
@@ -100,9 +103,12 @@ struct sec_pdcp_ctxt {
        int8_t bearer;  /*!< PDCP bearer ID */
        int8_t pkt_dir;/*!< PDCP Frame Direction 0:UL 1:DL*/
        int8_t hfn_ovd;/*!< Overwrite HFN per packet*/
+       uint8_t sn_size;        /*!< Sequence number size, 5/7/12/15/18 */
+       uint32_t hfn_ovd_offset;/*!< offset from rte_crypto_op at which
+                                * per packet hfn is stored
+                                */
        uint32_t hfn;   /*!< Hyper Frame Number */
        uint32_t hfn_threshold; /*!< HFN Threashold for key renegotiation */
-       uint8_t sn_size;        /*!< Sequence number size, 7/12/15 */
 };
 
 typedef struct dpaa_sec_session_entry {
@@ -138,18 +144,21 @@ typedef struct dpaa_sec_session_entry {
                        uint32_t digest_length;
                        struct ipsec_decap_pdb decap_pdb;
                        struct ipsec_encap_pdb encap_pdb;
-                       struct ip ip4_hdr;
+                       union {
+                               struct ip ip4_hdr;
+                               struct rte_ipv6_hdr ip6_hdr;
+                       };
                };
                struct sec_pdcp_ctxt pdcp;
        };
-       struct dpaa_sec_qp *qp;
-       struct qman_fq *inq;
+       struct dpaa_sec_qp *qp[MAX_DPAA_CORES];
+       struct qman_fq *inq[MAX_DPAA_CORES];
        struct sec_cdb cdb;     /**< cmd block associated with qp */
-       struct rte_mempool *ctx_pool; /* session mempool for dpaa_sec_op_ctx */
 } dpaa_sec_session;
 
 struct dpaa_sec_qp {
        struct dpaa_sec_dev_private *internals;
+       struct rte_mempool *ctx_pool; /* mempool for dpaa_sec_op_ctx */
        struct qman_fq outq;
        int rx_pkts;
        int rx_errs;
@@ -158,13 +167,12 @@ struct dpaa_sec_qp {
 };
 
 #define RTE_DPAA_MAX_NB_SEC_QPS 2
-#define RTE_DPAA_MAX_RX_QUEUE RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS
+#define RTE_DPAA_MAX_RX_QUEUE (MAX_DPAA_CORES * RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS)
 #define DPAA_MAX_DEQUEUE_NUM_FRAMES 63
 
 /* internal sec queue interface */
 struct dpaa_sec_dev_private {
        void *sec_hw;
-       struct rte_mempool *ctx_pool; /* per dev mempool for dpaa_sec_op_ctx */
        struct dpaa_sec_qp qps[RTE_DPAA_MAX_NB_SEC_QPS]; /* i/o queue for sec */
        struct qman_fq inq[RTE_DPAA_MAX_RX_QUEUE];
        unsigned char inq_attach[RTE_DPAA_MAX_RX_QUEUE];
@@ -174,13 +182,11 @@ struct dpaa_sec_dev_private {
 };
 
 #define MAX_SG_ENTRIES         16
-#define SG_CACHELINE_0         0
-#define SG_CACHELINE_1         4
-#define SG_CACHELINE_2         8
-#define SG_CACHELINE_3         12
+#define MAX_JOB_SG_ENTRIES     36
+
 struct dpaa_sec_job {
        /* sg[0] output, sg[1] input, others are possible sub frames */
-       struct qm_sg_entry sg[MAX_SG_ENTRIES];
+       struct qm_sg_entry sg[MAX_JOB_SG_ENTRIES];
 };
 
 #define DPAA_MAX_NB_MAX_DIGEST 32