From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1E19CA0C4B; Tue, 23 Nov 2021 09:22:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DB30E40040; Tue, 23 Nov 2021 09:22:08 +0100 (CET) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mails.dpdk.org (Postfix) with ESMTP id 6A2CE4003C; Tue, 23 Nov 2021 09:22:06 +0100 (CET) X-IronPort-AV: E=McAfee;i="6200,9189,10176"; a="321212054" X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="321212054" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Nov 2021 00:22:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,257,1631602800"; d="scan'208";a="649998158" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by fmsmga001.fm.intel.com with ESMTP; 23 Nov 2021 00:22:05 -0800 Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 23 Nov 2021 00:22:05 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 23 Nov 2021 00:22:05 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.108) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 23 Nov 2021 00:22:01 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hWxrncAnO1QijA/NOgNXYJ9SFHuDOFVU/sX9AxmkjHfcquOMLZfqmA16wqjeFgP0E67FHCBCvEPu07VagCbIUhqrHMdxnom2/YDQawV3m2g65IP7NWelOB8SQlsVcpp1XdNh8IcKJS0WDw/LZBj0UWhczC33GRpz3htP1YS2ym1VN/yPH8pCN5hmUtDEu41A+CPp30LdHs6abXtEIWcGIwFXsTSEKFcoa+bRGst6twKPTVEhz07r9rHLZ7sCRvJ3Sw+rTFpCfn0QuMXfAcNiHCeOG+zqbNPMp4QpyqaGD3Pj92WAbkSLUuPYqL/uH/3Vgc8TooMoyYfkg6V5n9xu/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0xStjDKcIoz0QpInQJIMpt3K+vX9kr/3xLld9WZP2JM=; b=MZz/KWq9xmIEviTwFkFV2nrIlSURql+SUEj3rgZWj5681rcdmLOYEHjxzncJX47O9CZwVElR09hNuPdH4PiN1Rz1N++SLKYnPqRLvMmMYgVJwFP8IGPYxCIy2dNk5fFkJc6f2v0Wx6dhWqstGhFZqQ2XYeneKRjLG+8L6mEG0wBRMqYEysG67YrfxRYZB0BL4MBQNU97QUhv9kOba/czZI+bI0eci8Zjp1lhNBQeMS3Iifbb4JDdfcTxMiJiJs2DjPA7AFpzE+UKLkHVScDyXJEOrAu+3Ku7Oe6nJiwCxb6VzA1W5QCTnpdQ81lRXSK3oqwpXLugPFBqRiz2T51inw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0xStjDKcIoz0QpInQJIMpt3K+vX9kr/3xLld9WZP2JM=; b=DscCpfYOPApN9gDL6bxSKNzzdxjh52Fc1XK7I0vMvlItsfIlQUzK27jm9PyFVu64RRP9xhIFnIp6ZgqkoR3VwVaXgknYSsUE2AeF1TGDfbfyVYVWXjmWcBHPO1eMVs6hqtux7+qisr+CHNk2yKcqler/SkUtn9e1vU6N5RvBm5s= Received: from MN2PR11MB3821.namprd11.prod.outlook.com (2603:10b6:208:f7::24) by MN2PR11MB3760.namprd11.prod.outlook.com (2603:10b6:208:fa::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.24; Tue, 23 Nov 2021 08:22:00 +0000 Received: from MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::304c:39f1:9d95:4ba2]) by MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::304c:39f1:9d95:4ba2%6]) with mapi id 15.20.4690.027; Tue, 23 Nov 2021 08:22:00 +0000 From: "Power, Ciara" To: "De Lara Guarch, Pablo" , "Zhang, Roy Fan" CC: "dev@dpdk.org" , "stable@dpdk.org" Subject: RE: [PATCH] crypto/ipsec_mb: fix cipher key setting Thread-Topic: [PATCH] crypto/ipsec_mb: fix cipher key setting Thread-Index: AQHX38kWjmWzdfmIfUOVDafEBXKR6qwQxq6g Date: Tue, 23 Nov 2021 08:22:00 +0000 Message-ID: References: <20211122174729.1153925-1-pablo.de.lara.guarch@intel.com> In-Reply-To: <20211122174729.1153925-1-pablo.de.lara.guarch@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: fbcd4e4b-b83d-4b7a-35af-08d9ae5a528e x-ms-traffictypediagnostic: MN2PR11MB3760: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:4941; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: NV4tV6BYiOI6IOC10G+zurAPE2GTaQqJTy2OrW9ive/FIe2vZDjqMIQPskTfZa8oGixQ2UOjm4RxbPPq9+k2l+UeC83zBPC0y/5FIE3HZTXdm8cfnIyNzOZ82qX/Ai1vBOgYdeJwlyJYTGPv6gCnotzniXoIl1JOMiN6jeExG9VnNF5Q4obfy7GSymOTcXAHKwTXpiXrqCS7SR3AqmPZWGk+iqcxHzKWiXA/37sGDI51HV2qKbiEtJS2ngAq2uR/8CAwJN1HwoVvu81cRY3eUxkf1SwDue3HC/SCPxGOilSB41YoK30hrf34qTHQ/+udK2WbHuuVVwpnCuNaOxttazNfT4lu/HgMqxKnFOQ3imef8hi4BTg2zffaoTGBpaTloqBoSWpk2katVk2dksOFjOJwjD7SdPiEEjH7VCjQ56E2QCmfKpDUW/hYwOqpIF1L1TKkMaez9nNN8nmMGu4r1Xr80ZeWZw/nGL48oQ9Rtn/rSEKOqhUG4qIDsBvPjA9dS1AiousbkZK/ubttX5BTxyekH+WgthIMxrAwnEc578y8cEcqQtGkKrCfuQFIiQW0lg6eUpj70R4f0A3TkbkT8spMtJBVpDKsq0+u3s2mu4p2+vO/5Ph9F8VVb7ACnba1L+DWG7bmh9DIcdh26iq9m/RUqkebplm4K0EjWC+E79W5ZMdrCxDaWcsXgtdDT9OyeO+2WVrRkYiiTDTHv1aYtg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3821.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(2906002)(54906003)(186003)(52536014)(6636002)(55016003)(26005)(38070700005)(8936002)(66556008)(64756008)(66446008)(66476007)(7696005)(82960400001)(316002)(110136005)(71200400001)(8676002)(66946007)(4326008)(6506007)(122000001)(5660300002)(33656002)(508600001)(450100002)(9686003)(76116006)(38100700002)(86362001)(83380400001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XpO7h4MfgqsUnLpNRnnjDT4W0wmNJF0BysQh329ThrZYvy/wd1pc8AcqsFsa?= =?us-ascii?Q?cUDYXp0r1+i+9xM4sFiJYO1enxRxU5Tvf/9FPcwZhyZPWrP5QpkfivIFmeJW?= =?us-ascii?Q?R0UZ6n6DaaEOKBR+Lof+o5nBq9gMHIJWT9WRfyny4kxY3hm1ixficDSZXSVD?= =?us-ascii?Q?YvwXEGr97z8gCkirZ111S3wLAbJ+KMlZbIK+9urnPYNdI+PPJzctAHKIDblj?= =?us-ascii?Q?uu4TAIyKUOLpV/9KOlXKR+Ur5gujQ85KKitaocAkoN2U+YNYqEkVVOuFZpaF?= =?us-ascii?Q?l2M3WidjV5ojH/wTfE49yZ6I6z1WgqIgk/eTUEMq15uD/jDvCW8sk87YIQqG?= =?us-ascii?Q?AjtpSMaOD4V/4nP/Jw8wtXwYCywci6HSgKU4kJ4+5206cNMHYp0sXSghhHgL?= =?us-ascii?Q?fGsF0D7UXoVYLwSYhAGEICU1oPllHBGGuLgWEEYb1R8ZtRvjlNF8r5caPhiI?= =?us-ascii?Q?zqz5TfhFff9xmpHEtjCw/5RYNX8kBXhY/Im3rqXzs8t2Ugr/YaWBeuGoTNr3?= =?us-ascii?Q?kcnNxk3K2xVdq/lrm7IcNnKVaLggBZGCXaaDjt24AxyqMkujej3ko+q2c1Aw?= =?us-ascii?Q?72Nm4sbzhun++uKEkqQzwPJDVYc92Oe4rJzr8gTxdtUgRd2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kji/yPMkZzD/j52gyMP+CELiOnEdjxrAXsB/8sp8DM1smuSYlK?= =?us-ascii?Q?LPRR4UtdLfaPYkjVgKEU4mUoWn7CiSYjlHPwH0cpZU3BBNCymPQJZ/fc4VvA?= =?us-ascii?Q?e+h8josSdwR7o9U84o0AFBE=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB3821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: fbcd4e4b-b83d-4b7a-35af-08d9ae5a528e X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2021 08:22:00.3507 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ThNiK8+s7mYfOkusKLgM+HIwESn02qaNNuFoPhpL28iKFkr5rzOSngdza3ezacHVMkanYvuVKmbFUyr+H6kTPQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3760 X-OriginatorOrg: intel.com X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org >-----Original Message----- >From: De Lara Guarch, Pablo >Sent: Monday 22 November 2021 17:47 >To: Zhang, Roy Fan ; Power, Ciara > >Cc: dev@dpdk.org; De Lara Guarch, Pablo ; >stable@dpdk.org >Subject: [PATCH] crypto/ipsec_mb: fix cipher key setting > >When authenticating with SNOW3G, KASUMI and ZUC, the pointers for >encryption/decryption keys is not set. >If a cipher algorithm such as AES-CBC is also used, the application would = seg >fault. >Hence, these pointers should be set to some value by default. > >Command line to replicate the issue: >./build/app/dpdk-test-crypto-perf -l 4,5 -n 6 --vdev=3D"crypto_aesni_mb" -= - \ -- >devtype=3D"crypto_aesni_mb" --optype=3Dcipher-then-auth --auth-algo snow3g= - >uia2 \ --auth-key-sz 16 --auth-iv-sz 16 --digest-sz 4 --silent --total-op= s 1000000 >\ --auth-op generate --burst-sz 32 --cipher-algo aes-ctr --cipher-key-sz= 16 -- >cipher-iv-sz 16 > >Fixes: ae8e085c608d ("crypto/aesni_mb: support KASUMI F8/F9") >Fixes: 6c42e0cf4d12 ("crypto/aesni_mb: support SNOW3G-UEA2/UIA2") >Fixes: fd8df85487c4 ("crypto/aesni_mb: support ZUC-EEA3/EIA3") >Cc: stable@dpdk.org > >Signed-off-by: Pablo de Lara >--- > drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 15 ++++++++------- > 1 file changed, 8 insertions(+), 7 deletions(-) > >diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c >b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c >index e05bc04c3b..a308d42ffa 100644 >--- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c >+++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c >@@ -1120,6 +1120,14 @@ set_mb_job_params(IMB_JOB *job, struct >ipsec_mb_qp *qp, > > const int aead =3D is_aead_algo(job->hash_alg, job->cipher_mode); > >+ if (job->cipher_mode =3D=3D IMB_CIPHER_DES3) { >+ job->enc_keys =3D session->cipher.exp_3des_keys.ks_ptr; >+ job->dec_keys =3D session->cipher.exp_3des_keys.ks_ptr; >+ } else { >+ job->enc_keys =3D session- >>cipher.expanded_aes_keys.encode; >+ job->dec_keys =3D session- >>cipher.expanded_aes_keys.decode; >+ } >+ > switch (job->hash_alg) { > case IMB_AUTH_AES_XCBC: > job->u.XCBC._k1_expanded =3D session- >>auth.xcbc.k1_expanded; @@ -1189,13 +1197,6 @@ >set_mb_job_params(IMB_JOB *job, struct ipsec_mb_qp *qp, > job->u.HMAC._hashed_auth_key_xor_opad =3D > session->auth.pads.outer; > >- if (job->cipher_mode =3D=3D IMB_CIPHER_DES3) { >- job->enc_keys =3D session- >>cipher.exp_3des_keys.ks_ptr; >- job->dec_keys =3D session- >>cipher.exp_3des_keys.ks_ptr; >- } else { >- job->enc_keys =3D session- >>cipher.expanded_aes_keys.encode; >- job->dec_keys =3D session- >>cipher.expanded_aes_keys.decode; >- } > } > > if (aead) >-- >2.25.1 Acked-by: Ciara Power