From patchwork Fri Oct 25 08:33:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 177705 Delivered-To: patch@linaro.org Received: by 2002:ac9:3c86:0:0:0:0:0 with SMTP id w6csp3287010ocf; Fri, 25 Oct 2019 01:36:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqzrteaslmHRDsGlMDARf3oi8q+bF3Zz6VoxDLaZDVL0Q1QptFgosqeLus/CRjBcfLsrS1No X-Received: by 2002:a50:91f6:: with SMTP id h51mr2506286eda.99.1571992607707; Fri, 25 Oct 2019 01:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571992607; cv=none; d=google.com; s=arc-20160816; b=Wo+eqpYLjoHIjkzU8a7R0UkSeLp4J8DMeYHIO3v3htyhqnqeqnYqjErpC0pFVMSbUR PlSPshm3k0Ih4RDsa42A+P3OMVkq29oYMwgBcvSwKX2ZCEp6DGplJ2yBx7ZWYiIcYs1V R/JQnpivB3iT2i/hgGJTR0niyEm8K8NMBLX3YwEuRpF/P/Y/7DImsSwoG8kayuvKMXgi PzFlzWZ11B7Fkw1AkJ4fICcdHx0PhAur6pY61IjJfU4uag8uDYCBmNNf+cPGy2i0wS3o lkn1I69wMT9AyRhIyxFEkCgL8kXTYoryEqKKad9jyUIS1o3GUhz5ECSeFOnvMav3LXVU Uo9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:cc:to:from; bh=un79PbIJWKZhLeLXcpoPveV/TK5X7/KQZ/nqbTSNCoM=; b=hnWL/kRC839DwruLSU0gBdGzfK9pW5AYKg49KPqPTmHsL6yMauUXk2KjTjJ+dlgrXa ARKDiZogOaSZGhDcLpAm+qy3vbrgoIKs4Yl8P4BYLHkWoMaG2YNZVOCyfAwtEN9FszmG SG0Rcp7VeW7lRq/QwIdeLnOWPVgT30xbDI758IxhxxqqCafgBVYvGHYlDiTLOweLMIcN w9oISqFjMeRHLfjtZSu83VTv+DGsY9bEdbI74QogSeqAyM1xm2PpjdC0d933lDUWI0ZO cU0EWVsHN/xsjciGszwmCT9Uv5R1u1uMTbZI6FXKN6JoOhPmFdk0Zl2l1FoswhgzgFxH eIqw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id u22si786397ejm.363.2019.10.25.01.36.47; Fri, 25 Oct 2019 01:36:47 -0700 (PDT) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A92191C1BC; Fri, 25 Oct 2019 10:36:38 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by dpdk.org (Postfix) with ESMTP id 8EA281BEE3 for ; Fri, 25 Oct 2019 10:36:32 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 71E261A0A3C; Fri, 25 Oct 2019 10:36:32 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id A427D1A0A18; Fri, 25 Oct 2019 10:36:30 +0200 (CEST) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 3E1A6402DF; Fri, 25 Oct 2019 16:36:28 +0800 (SGT) From: Hemant Agrawal To: dev@dpdk.org, akhil.goyal@nxp.com Cc: Hemant Agrawal Date: Fri, 25 Oct 2019 14:03:31 +0530 Message-Id: <20191025083336.24212-3-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191025083336.24212-1-hemant.agrawal@nxp.com> References: <20191025083336.24212-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 3/8] crypto/dpaa_sec: add check for the session validity X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Check if the session is not null during processing. Signed-off-by: Hemant Agrawal --- drivers/crypto/dpaa_sec/dpaa_sec.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.17.1 diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index 632ce9fdc..aeee74ff3 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -1773,6 +1773,14 @@ dpaa_sec_enqueue_burst(void *qp, struct rte_crypto_op **ops, nb_ops = loop; goto send_pkts; } + + if (!ses) { + DPAA_SEC_DP_ERR("session not available"); + frames_to_send = loop; + nb_ops = loop; + goto send_pkts; + } + if (unlikely(!ses->qp[rte_lcore_id() % MAX_DPAA_CORES])) { if (dpaa_sec_attach_sess_q(qp, ses)) { frames_to_send = loop;