From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 723C2A0096 for ; Mon, 8 Apr 2019 18:29:55 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C92BB2BCE; Mon, 8 Apr 2019 18:29:53 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 238772BC9 for ; Mon, 8 Apr 2019 18:29:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Apr 2019 09:29:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,325,1549958400"; d="scan'208";a="334889204" Received: from irsmsx103.ger.corp.intel.com ([163.33.3.157]) by fmsmga006.fm.intel.com with ESMTP; 08 Apr 2019 09:29:50 -0700 Received: from irsmsx101.ger.corp.intel.com ([169.254.1.115]) by IRSMSX103.ger.corp.intel.com ([169.254.3.30]) with mapi id 14.03.0415.000; Mon, 8 Apr 2019 17:29:49 +0100 From: "Trahe, Fiona" To: "Ananyev, Konstantin" , "Iremonger, Bernard" , "dev@dpdk.org" , "akhil.goyal@nxp.com" CC: "Trahe, Fiona" Thread-Topic: [PATCH] crypto/qat: fix segmentation fault in QAT PMD Thread-Index: AQHU7fi6L1YcDCGkeEOVKpma8OXxXqYyGyWAgABXQMA= Date: Mon, 8 Apr 2019 16:29:48 +0000 Message-ID: <348A99DA5F5B7549AA880327E580B4358973BCD1@IRSMSX101.ger.corp.intel.com> References: <1554720537-14959-1-git-send-email-bernard.iremonger@intel.com> <2601191342CEEE43887BDE71AB9772580148A9449B@irsmsx105.ger.corp.intel.com> In-Reply-To: <2601191342CEEE43887BDE71AB9772580148A9449B@irsmsx105.ger.corp.intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOWVjMGU5ZjEtN2RlYy00MmJhLWE0ZWQtOTg2YzRjMDEyNDg5IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZjZTY2FzSXFPM2dFQXZlY2pHT1wvZldWOHFnVzJmNzV5VmxYXC8wdDgxXC9zZFVqTEFrQ0dQXC85ZjVqOTFoMVJuTHMifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] crypto/qat: fix segmentation fault in QAT PMD 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" Message-ID: <20190408162948.IrSCAV8rVRKQGcWG2YtgciEW_nZwQGG9s2bTWZEJx_w@z> Hi Bernard, Konstantin, > -----Original Message----- > From: Ananyev, Konstantin > Sent: Monday, April 8, 2019 1:10 PM > To: Iremonger, Bernard ; dev@dpdk.org; Trahe= , Fiona > ; akhil.goyal@nxp.com > Subject: RE: [PATCH] crypto/qat: fix segmentation fault in QAT PMD >=20 > Hi Bernard, >=20 > > > > While running the IPsec unit test program the following > > segmentation fault is occurring: > > > > Thread 1 "test" received signal SIGSEGV, Segmentation fault. > > 0x0000000000beaece in qat_sym_build_request(in_op=3D0x0, > > out_msg=3D0x100450580 "", op_cookie=3D0x101c6fd80, qat_dev_gen=3DQAT_GE= N1) > > at /root/dpdk_ipsec_master-1/drivers/crypto/qat/qat_sym.c:165 > > 165 if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { > > > > Fixes: c0f87eb5252b ("cryptodev: change burst API to be crypto op orien= ted") > > Signed-off-by: Bernard Iremonger > > --- > > drivers/crypto/qat/qat_sym.c | 6 ++++++ > > 1 file changed, 6 insertions(+) > > > > diff --git a/drivers/crypto/qat/qat_sym.c b/drivers/crypto/qat/qat_sym.= c > > index 8801ca5..4a7d11e 100644 > > --- a/drivers/crypto/qat/qat_sym.c > > +++ b/drivers/crypto/qat/qat_sym.c > > @@ -162,6 +162,12 @@ qat_sym_build_request(void *in_op, uint8_t *out_ms= g, > > struct qat_sym_op_cookie *cookie =3D > > (struct qat_sym_op_cookie *)op_cookie; > > > > + if (op =3D=3D NULL) { > > + QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " > > + "operation requests, op (%p) is NULL", op); > > + return -EINVAL; > > + } > > + > > if (unlikely(op->type !=3D RTE_CRYPTO_OP_TYPE_SYMMETRIC)) { > > QAT_DP_LOG(ERR, "QAT PMD only supports symmetric crypto " > > "operation requests, op (%p) is not a " >=20 > This is crypto-dev enqueue data-path, if I am not mistaken. > I think in that case it is caller responsibility to make sure that ops[] = contain valid crypto-ops > (as in majority of other data-path functions). > Suppose the main question here - why ipsec UT passes NULL as crypto-op he= re? > Konstantin [Fiona] Agree with Konstantin - it's the data-path - we expect a valid op p= tr. Can the real issue be related to the recent addition of asymmetric QAT PMD? Not all QAT PMDs support symmetric crypto now. Is IPSec unit test finding a QAT asymm PMD and not checking it's capabiliti= es=20 or checking but not handling the result well and following a path that pass= es a NULL op to it?