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 9BE24A0093; Wed, 9 Mar 2022 12:01:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 78F4440395; Wed, 9 Mar 2022 12:01:21 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 2936840150; Wed, 9 Mar 2022 12:01:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646823679; x=1678359679; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=TGIwZL0cjiUluJOw0D8XbfOU1uwL8cXuXveeD+USWnE=; b=HqXpMbvjcqXIlwacDBLrTBER3C6zLlS2hOJ3UMnzelT1W+7HHWWyDdga z65iZOhMA+Mb7ib6KsZcBHuxxQKatEkL7b4Gl2TRBJm3Sglc4mTCvOpiA 7G2kwbXY1RUqc9qBG9JshDnTs5ooTMFptjM9PTmgjDlzQYAz6Ae1h8wWF iC67fhX7UXkxq/nwZUq2v5XbAJ+d9SXSzb0jLXkiAAe4/ip/XcJl6hR/V m3oej2FsAhVKMoplpkAJfcXnXltQGKcWZyaMsTn6pjfZjx2fDGXchR8v+ AVp7JQKfsnmt0M/Mvw8ahvujzTSxts7G0p2EHDf7gx8jqSmTB1LsFV6Wd Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10280"; a="254889678" X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="254889678" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Mar 2022 03:01:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,167,1643702400"; d="scan'208";a="554073658" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga008.jf.intel.com with ESMTP; 09 Mar 2022 03:01:18 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 9 Mar 2022 03:01:17 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 9 Mar 2022 03:01:17 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.103) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Wed, 9 Mar 2022 03:01:17 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dVfixmgVDN/MW4dYV/sv2KfM8HdhpOw8gXyY9SXi8Bnym4ScKIkeDH3iNcZckqiI9q2yt65sMqIE9AjAIpy36D6CHf8XPAkDly+UJfN5q/Zq4dWZ5CTXCQc4N//jvzW1OiKcOklaUOcrTmzE+F7IylPAnYYFLbEcHMBqENvCpFmEaY7teRAudfRh7fcPg78KO+h2EKHfXbmKD1g4haGf1AhMHitnNAUkU7KDOuwTW5AaRHCcW+raSJ7yj/SjaFVpQ5MdjyM6mLaJDDaONoH9TumM4EHAeLXHqoiTxJRwUMbVHMrWPD4Fnyv6HIY6Y2Pk60L7XHEjQQ4qy4KfFW6JfQ== 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=ugzZqNi3emUaCu8w+rElslF+Oiq1VW8pdy3RwasNLG0=; b=ltyjWfw0JR6CQR3bu6e/9e/22tLsHydQeIjRMCJv3BSkYzeLBr2oX/ko7jtCP4FJa/eXnmAFJloHa0Wa1i6hUxnJEYORxZBLKko8fR83HMyo+FB527irRSP+UwCYywseMemHZ1lvMxZeFnczOlIZrOk15O0q7r1/GtEfF79D9iqGF7gRH+xxmdyNmX9w51Zt5oSlO7SP/3lq5WWntVcrS+AD6VbZ3Zlq0lJ9LeqftyXCzy91RL6iarb3hzjcf2SfpfNBFIB2rTaxiQjfhv4TNjqQ+OVVnF0+vZd3gcb1CjKA8KNmAbOPAK0bscC0jB2kOYFUO8Eve2rjfY5sGPH3Qw== 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 Received: from MW5PR11MB5809.namprd11.prod.outlook.com (2603:10b6:303:197::6) by MW5PR11MB5763.namprd11.prod.outlook.com (2603:10b6:303:19a::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13; Wed, 9 Mar 2022 11:01:15 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::6d1f:57eb:d623:5e0c]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::6d1f:57eb:d623:5e0c%3]) with mapi id 15.20.5038.027; Wed, 9 Mar 2022 11:01:15 +0000 From: "Zhang, Roy Fan" To: "De Lara Guarch, Pablo" , "Nicolau, Radu" , "Buckley, Daniel M" CC: "dev@dpdk.org" , "stable@dpdk.org" Subject: RE: [PATCH] crypto/ipsec_mb: fix GMAC parameters setting Thread-Topic: [PATCH] crypto/ipsec_mb: fix GMAC parameters setting Thread-Index: AQHYM6LOFqzFzPvshkiGtDG8Q6KlqKy24pPQ Date: Wed, 9 Mar 2022 11:01:15 +0000 Message-ID: References: <20220309104514.1180589-1-pablo.de.lara.guarch@intel.com> In-Reply-To: <20220309104514.1180589-1-pablo.de.lara.guarch@intel.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.401.20 dlp-reaction: no-action dlp-product: dlpe-windows 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: ceb87045-2dd3-4cbf-8b55-08da01bc2174 x-ms-traffictypediagnostic: MW5PR11MB5763:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5ALb/qeoFrIFBUJTv5AMEG5n8yHSIGgXRWR4ZO9wMUDaADJX56EYwTBVcaPnULhI1ezFourU/j75fJgOo5aBffjlLU+FPGZnIkGfg7oIzIHxca0Lnlc3XvkPcHiPF89K3WzGPhgDwbCYplg9TsZ5AOtxR9VoyQGX0WXAwtyrpKLivrY1Nx9vxe9Tr5pNouksksGG8K0WX2ijEcMyEpFgkehFn6U34+Rwl4n2NoMMeqmx9kyjyllPHXo4C6jH6BvaLk2ikri1CTa9uXqKet1QFtVnaj2j0j8d34UkefsfOCbr+qXVBIViZbvALqhEcvPo3kdIzvWwGtieZJSqbx/VJ8/nL0u5ba1ibGmJO3JizTnZroxoadwAthn18t2oCWMKQdk4LFKtF8etOpWWSe7JVeZhzAdA/AVTyIPzPtmuFUsjFACpqseTM9A2/VBf9WVIdffXvuaFKRsZIKPij+ySuCyT5wlgg6zL3hyooCf0BkFE8Cf+LIZh0mNr4jAwUScvmy818s8BN5wLMJ/Z0AgPmaH/NXbA5CktHgAyImoQGvKgcJ0WObF4GsfEOHASMxExqVXlMLUYxLgrSoAYIE5hBiwENS3BtCfcZlNcIA4gt1gbDUISpbKcsrN7lAsBCpUzZ/OD5MjTT+1qkvzUDyvy3PcwtFy1OkGs5HnomG5j2cZhEuyx3iDCdAkknktYP/hpBpbHNNbDexUj2S4GF0fnQg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW5PR11MB5809.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(53546011)(7696005)(55016003)(6506007)(38100700002)(71200400001)(38070700005)(2906002)(83380400001)(82960400001)(33656002)(76116006)(5660300002)(316002)(26005)(54906003)(66946007)(66556008)(9686003)(52536014)(8936002)(508600001)(122000001)(86362001)(6636002)(186003)(8676002)(64756008)(450100002)(4326008)(66446008)(66476007)(110136005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?m8g3KW8TyHAe2sLHBts0MJlf1lYVkDhuNbwCFwiccAfTMhKLyt5lV7jQ?= =?Windows-1252?Q?ooNBxXa51PU+SCfC6TnMCq16EOzmW/hJ1aO5ycO33C4fTxdwD4irAU6K?= =?Windows-1252?Q?hN3CGIa0S7R6w9AHnDGxYgNqnzVP2g5ZUriidnhAMCai6ewpBfgidjD3?= =?Windows-1252?Q?lPNd4K9MxKiShpc8W/5hVBoYRdORfSLJq2y7cQsRKBY+hEznJzVA/dIe?= =?Windows-1252?Q?fjSfJp3TS08A/Vzc59JDE3MK6MfhF+WNSlH23OSKJtVqzcu9Yry5Ulsm?= =?Windows-1252?Q?dppWX/OqyNynlrYUIJAUbwcaStZvSP1PVcwAgdeNqoUyJcZw/MGisUdg?= =?Windows-1252?Q?jsNEGBBzqHzhoN0yxRttNR+zKDlCorQVUWbgcp4Uc3rhvx49N1UKhHTW?= =?Windows-1252?Q?TIjtjPKOazUGkMIZ6ce3udLL5bjNL7ywMwUs+neezr9QRRudrbfLSxs4?= =?Windows-1252?Q?UBqbZk93Le91RxI4pSssPnG7SvO+xfXs1YBQBY+CBYLtuibxDfimkv8U?= =?Windows-1252?Q?Xcod401gprpd11mVOSh42ouDoGFD/FrkWfSH3+Ksq5yRW7bSDzJPuJCx?= =?Windows-1252?Q?eq6jE0F4wtRrigWdRs+sogwdRjHxiwtAyWkJk5K8mwGae3ORPvrejuY8?= =?Windows-1252?Q?AmwpmwDha09zK0BEJsBElBOwD/CZb/krF1KWrUG1T26MQAComvAbuOfe?= =?Windows-1252?Q?E+7Tlh6dP560mlRWpSkoUWbc3XxF5H5ej7bcEYchpC2X+E7pqDKwrxnC?= =?Windows-1252?Q?1fJJJWY6I+snwVUDDbEW5/Ejx3Z3TwUDmLVBaoT9CPEPu5VxXL+maVz4?= =?Windows-1252?Q?o55R0laKyVyd6jYSr1OhfUKrIwUzb1ThXWrPL1/Nu+rFUTc64VYaYvnc?= =?Windows-1252?Q?TiykCdx9LyxfE8S0plo0WzhMwOYEbPMUr0jj5UlljvaqVIGuAg9zqodt?= =?Windows-1252?Q?fwuss3XPbj5tkxlusI9L6tArOZ8ZLSsxP78znh43BcBBUCkUrmvR/UK1?= =?Windows-1252?Q?iMT3wOgJNyHw09SDnULQBptdgURw3/ssVAHatYpNGkEwojMrIcxIrgRy?= =?Windows-1252?Q?Np1CRB8U7URK+/E05HXKTs/wjmkO51CpxrxoMaFGqgfMRJ0/+AilTORe?= =?Windows-1252?Q?+6/pb71dChaFbU6mtqtFu5nlo7KH8qpUOKiQxmqcKr0hrF7h5f6+Sw0Q?= =?Windows-1252?Q?VNmZa4qaAAPXU8+kiSdhVvggcTeKv7hsEEToSnRRWDWTz2M7lG9C4Zp+?= =?Windows-1252?Q?ffxwkf1XIhN0UoELV0lC1YeG5F8DWBp62jku5M3+hC+s7eJZOgmnxoFe?= =?Windows-1252?Q?QrVyoKah3g+Dxkvv9XHkZSIJKtFV9QlHiXuSQPu16DEA9YZwgX2m1aGe?= =?Windows-1252?Q?1IW8JXUH1kEMvrmPQqBnCcTJzZC8oxoJBSGsgXTsabv0E8D6dE4OXZqi?= =?Windows-1252?Q?bn8rF6EW83TpkHLuhYJiKUqpfH9Qu87my3SSo2phrQwJMCsyeGz8xWq8?= =?Windows-1252?Q?ydsPH+t0SrYFjoYIwpAcTWqo1CeBRsAourZdVr2iLPZyCyA8ABD70w/h?= =?Windows-1252?Q?nAr5BTW5KMpXp5iBARg7cx3StvmO+X1AJvaMa2hmDtIoH5qvmGZmb1Ac?= =?Windows-1252?Q?sc3gsmpVXdwwHm0v3YV79ejfq72hB4LwATKDm4LWE5I7xCdlHTirSzLf?= =?Windows-1252?Q?uMn4B84k6BAL3R6OBE2cw71+A+G3Cr2YuDSoRv02exq3h8G75umCNA?= =?Windows-1252?Q?=3D=3D?= Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW5PR11MB5809.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ceb87045-2dd3-4cbf-8b55-08da01bc2174 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Mar 2022 11:01:15.2330 (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: AkLUravxIIjPJORFUM/nlkov3eHvBr84VsIgx8KDF88NvTPTGZ8+sT9NNRCgIlntOW45zUqQc1hq4hkxNNYsQg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW5PR11MB5763 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: Wednesday, March 9, 2022 10:45 AM > To: Nicolau, Radu ; Buckley, Daniel M > ; Zhang, Roy Fan > Cc: dev@dpdk.org; De Lara Guarch, Pablo ; > stable@dpdk.org > Subject: [PATCH] crypto/ipsec_mb: fix GMAC parameters setting >=20 > AES-GMAC requires plaintext length to be 0 when using AES-GCM, > so only AAD data is used. >=20 > Fixes: a501609ea646 ("crypto/ipsec_mb: fix length and offset settings") > Cc: pablo.de.lara.guarch@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Pablo de Lara > --- > drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 16 +++++++++++++--- > 1 file changed, 13 insertions(+), 3 deletions(-) >=20 > diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > index c974886032..afa0b6e3a4 100644 > --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > @@ -1296,9 +1296,9 @@ set_mb_job_params(IMB_JOB *job, struct > ipsec_mb_qp *qp, > op->sym->aead.data.offset; > job->msg_len_to_hash_in_bytes =3D > op->sym->aead.data.length; > - } else { > - job->msg_len_to_cipher_in_bytes =3D 0; > + } else { /* AES-GMAC only, only AAD used */ > job->msg_len_to_hash_in_bytes =3D 0; > + job->hash_start_src_offset_in_bytes =3D 0; > } >=20 > job->iv =3D rte_crypto_op_ctod_offset(op, uint8_t *, > @@ -1378,8 +1378,18 @@ set_mb_job_params(IMB_JOB *job, struct > ipsec_mb_qp *qp, > job->msg_len_to_cipher_in_bits =3D > op->sym->cipher.data.length; > break; > - case IMB_CIPHER_CCM: > case IMB_CIPHER_GCM: > + if (session->cipher.mode =3D=3D IMB_CIPHER_NULL) { > + /* AES-GMAC only (only AAD used) */ > + job->msg_len_to_cipher_in_bytes =3D 0; > + job->cipher_start_src_offset_in_bytes =3D 0; > + } else { > + job->cipher_start_src_offset_in_bytes =3D > + op->sym->aead.data.offset; > + job->msg_len_to_cipher_in_bytes =3D op->sym- > >aead.data.length; > + } > + break; > + case IMB_CIPHER_CCM: > case IMB_CIPHER_CHACHA20_POLY1305: > job->cipher_start_src_offset_in_bytes =3D > op->sym->aead.data.offset; > -- > 2.25.1 Acked-by: Fan Zhang Thanks Pablo!