ip_frag: remove IP checkum offload flag
[dpdk.git] / drivers / crypto / dpaa_sec / dpaa_sec.c
index cb99be4..122c80a 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: BSD-3-Clause
  *
  *   Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
- *   Copyright 2017-2018 NXP
+ *   Copyright 2017-2019 NXP
  *
  */
 
@@ -61,7 +61,7 @@ dpaa_sec_op_ending(struct dpaa_sec_op_ctx *ctx)
                ctx->op->status = RTE_CRYPTO_OP_STATUS_ERROR;
        }
 
-       /* report op status to sym->op and then free the ctx memeory  */
+       /* report op status to sym->op and then free the ctx memory  */
        rte_mempool_put(ctx->ctx_pool, (void *)ctx);
 }
 
@@ -1940,13 +1940,13 @@ dpaa_sec_attach_rxq(struct dpaa_sec_dev_private *qi)
 {
        unsigned int i;
 
-       for (i = 0; i < qi->max_nb_sessions; i++) {
+       for (i = 0; i < qi->max_nb_sessions * MAX_DPAA_CORES; i++) {
                if (qi->inq_attach[i] == 0) {
                        qi->inq_attach[i] = 1;
                        return &qi->inq[i];
                }
        }
-       DPAA_SEC_WARN("All ses session in use %x", qi->max_nb_sessions);
+       DPAA_SEC_WARN("All session in use %u", qi->max_nb_sessions);
 
        return NULL;
 }
@@ -2115,7 +2115,7 @@ dpaa_sec_sym_session_clear(struct rte_cryptodev *dev,
                struct rte_cryptodev_sym_session *sess)
 {
        struct dpaa_sec_dev_private *qi = dev->data->dev_private;
-       uint8_t index = dev->driver_id;
+       uint8_t index = dev->driver_id, i;
        void *sess_priv = get_sym_session_private_data(sess, index);
 
        PMD_INIT_FUNC_TRACE();
@@ -2125,9 +2125,12 @@ dpaa_sec_sym_session_clear(struct rte_cryptodev *dev,
        if (sess_priv) {
                struct rte_mempool *sess_mp = rte_mempool_from_obj(sess_priv);
 
-               if (s->inq[rte_lcore_id() % MAX_DPAA_CORES])
-                       dpaa_sec_detach_rxq(qi,
-                               s->inq[rte_lcore_id() % MAX_DPAA_CORES]);
+               for (i = 0; i < MAX_DPAA_CORES; i++) {
+                       if (s->inq[i])
+                               dpaa_sec_detach_rxq(qi, s->inq[i]);
+                       s->inq[i] = NULL;
+                       s->qp[i] = NULL;
+               }
                rte_free(s->cipher_key.data);
                rte_free(s->auth_key.data);
                memset(s, 0, sizeof(dpaa_sec_session));
@@ -2450,7 +2453,7 @@ dpaa_sec_security_session_destroy(void *dev __rte_unused,
 
                rte_free(s->cipher_key.data);
                rte_free(s->auth_key.data);
-               memset(sess, 0, sizeof(dpaa_sec_session));
+               memset(s, 0, sizeof(dpaa_sec_session));
                set_sec_session_private_data(sess, NULL);
                rte_mempool_put(sess_mp, sess_priv);
        }