crypto/dpaa_sec: do not attach session for non-matching qp
authorAkhil Goyal <akhil.goyal@nxp.com>
Thu, 30 Aug 2018 05:50:59 +0000 (11:20 +0530)
committerAkhil Goyal <akhil.goyal@nxp.com>
Wed, 26 Sep 2018 11:18:38 +0000 (13:18 +0200)
if session->qp != qp to be enqueued, it should show an error and
not try to re-attach another qp.

Signed-off-by: Akhil Goyal <akhil.goyal@nxp.com>
drivers/crypto/dpaa_sec/dpaa_sec.c

index 095e218..f6b2e36 100644 (file)
@@ -1448,14 +1448,18 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops,
                                nb_ops = loop;
                                goto send_pkts;
                        }
                                nb_ops = loop;
                                goto send_pkts;
                        }
-                       if (unlikely(!ses->qp || ses->qp != qp)) {
-                               DPAA_SEC_DP_ERR("sess->qp - %p qp %p",
-                                            ses->qp, qp);
+                       if (unlikely(!ses->qp)) {
                                if (dpaa_sec_attach_sess_q(qp, ses)) {
                                        frames_to_send = loop;
                                        nb_ops = loop;
                                        goto send_pkts;
                                }
                                if (dpaa_sec_attach_sess_q(qp, ses)) {
                                        frames_to_send = loop;
                                        nb_ops = loop;
                                        goto send_pkts;
                                }
+                       } else if (unlikely(ses->qp != qp)) {
+                               DPAA_SEC_DP_ERR("Old:sess->qp = %p"
+                                       " New qp = %p\n", ses->qp, qp);
+                               frames_to_send = loop;
+                               nb_ops = loop;
+                               goto send_pkts;
                        }
 
                        auth_only_len = op->sym->auth.data.length -
                        }
 
                        auth_only_len = op->sym->auth.data.length -