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 ADA2DA00C2; Mon, 23 May 2022 15:42:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 92C1B4014F; Mon, 23 May 2022 15:42:53 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id BFC7340141 for ; Mon, 23 May 2022 15:42:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1653313372; x=1684849372; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=1ylUM+ojWIuTLZHE4bntZ6HfvUJoJ67AXqnFIypVKxo=; b=ETVS+2cWzyVYVkFBF8oq03dVDbYvjuWOwNHOcrerqxv8SjVhtHLr6jeu M5oTk9pzjus6j05Y45x/VLHyxu1KGYl27/DAApVj8gVyV2fiquH7+vsGy XFSxFCE8iXaQpAOznFgrcExUz3SaTFX7TXUEHB/WBv0Z+GBYDnC1jNtlu bGcltUG+tMid7KRhwx3Wkbj/pM0bZi+lR2i1EnWSs+kl682Uz/HKS3HJ5 shNG7UktUwKAVhn8bKXGa5bkEPSNY00VTyx2iLgjjKxNVcbYv1E2WmQx5 pAbUqfeE/bdYeRJC5HOcaP87FZBpXddcdEysL4Rdswt9lMV9C6nSWZnxL A==; X-IronPort-AV: E=McAfee;i="6400,9594,10355"; a="255287418" X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="255287418" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2022 06:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.91,246,1647327600"; d="scan'208";a="744741416" Received: from orsmsx606.amr.corp.intel.com ([10.22.229.19]) by orsmga005.jf.intel.com with ESMTP; 23 May 2022 06:42:48 -0700 Received: from orsmsx607.amr.corp.intel.com (10.22.229.20) 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.27; Mon, 23 May 2022 06:42:48 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx607.amr.corp.intel.com (10.22.229.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Mon, 23 May 2022 06:42:48 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.102) 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.27; Mon, 23 May 2022 06:42:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NMLhXAMwCzVRbsSpXepAAc2ImStVM79H8VMDwDbizSbps3cF6SxLZ8FEPVkFA/DvC8u6rrWmqeSI9MNSu5lCa8XP0T8sDlEvuyEbcmO6mOY7V9APqPCBXSR/uNrxg5/xSUWuTOx2M8Et3OV83KFFDgFoK97rtCwiRFCr2X8HUhakqMSJe+HNVQ/obPnj2ZyHDb8le+HImYbysUD0uOUjuFZ6+Z46kz8YPs/43aXA8Y1QnQpEV66pOig12yjHMNjjds505nJThvgVMiDcInu1zUJdwEgKcFrSwpbfmvCRIU0VsgbyLcerKWEfYd+VlNWhaYzauDt/fsvzusvL7wlKtw== 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=AvNeaKpJR/Wi6nIQIhvKq569xGTorIrU8HnkpzEsh5g=; b=iT0mmZsPk+U/aCQF3cO2O8zr1ekfC/DAAYuixTKxhxOScb8i2jBhwW0jc7OeEa42BKB51oWWodItMwb3J7U9xf7MdU0jC23l0D3rdxGquQVELrtJabRvuMCrgGGtP4ZD1BHo1OeOD6R0OR5akifx2ojLD+J4ah3RgkIjMz2/ABYKPt2AkF8Mob/w6jqyU2URw7CPa7jzbVObB7O8iJJfRhRxziRD7SRwdevhcetFEAz7GDkHXL1rFMC9p4oCv0XebNZa1RYXlyOSz0+gstcaX7nciPNsKZG+/upNtZEYYgk5YgeUnYzOnYpwJtWgV6UcAEZTmn5cKN3rMTdqOtwEJA== 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 DM4PR11MB5440.namprd11.prod.outlook.com (2603:10b6:5:39c::7) by CY4PR11MB1318.namprd11.prod.outlook.com (2603:10b6:903:27::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5273.18; Mon, 23 May 2022 13:42:46 +0000 Received: from DM4PR11MB5440.namprd11.prod.outlook.com ([fe80::99f6:b7c4:4832:1b97]) by DM4PR11MB5440.namprd11.prod.outlook.com ([fe80::99f6:b7c4:4832:1b97%5]) with mapi id 15.20.5273.023; Mon, 23 May 2022 13:42:45 +0000 From: "Poczatek, Jakub" To: "Ji, Kai" , "dev@dpdk.org" CC: "gakhil@marvell.com" , "Ji, Kai" Subject: RE: [dpdk-dev v1] crypto/qat: fix of cipher offset and length assignment Thread-Topic: [dpdk-dev v1] crypto/qat: fix of cipher offset and length assignment Thread-Index: AQHYQDqfTFo4tsrKY06tNCkdJb62vK0s1Omg Date: Mon, 23 May 2022 13:42:45 +0000 Message-ID: References: <20220325112207.44344-1-kai.ji@intel.com> In-Reply-To: <20220325112207.44344-1-kai.ji@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.6.401.20 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: 7c39d313-8a89-4ec6-970d-08da3cc21e68 x-ms-traffictypediagnostic: CY4PR11MB1318: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: wNMn6x+hnzlRa7kmXbbMjl/BjNyc6j/1U5lKCVgpE5tuQ+r4aveu8rHTKn8C/sfdv5jEIrUF7ulJhD6xSh1I77O0JuDdfwis/PHRZzDdwXaa6eoaAOIOVEb9X+BFjKCUoWNiYXcfC2wPfoithkkSQbxMAyd57Fl4rzxgi8VSDVad61yb9yZGx+fwrxdu4wEBNWsbgkvn3tuNwiyGjd0EM/b3EDY102ou5QZh5zfJQMIDr056WEce0ZozZAW+KQV9xsP+cMp54GhV/FX4r5F2A9Okr7lTFVfHzk6qC+XPxSi+lrNr/FAcPYmdbYTsCKc2dNYnV3a51M9c7z6v3RswfP3AtT82a8IxKpFEOqjz4T1OAAC7ZM6q9mEVpFwKXiDBSFz84rV9Exlqkzmr0wZp8q3Sh3Y97irYA22M7VjP8pqBHMlnGafX602gM4snm2C5NF9kzrEC3l+sHYJXC4q6FBentqA1aZzTdHaOq+GixV9FNXhcrXWZl1SLgK9ruvARyl1Xd7dtWPdodY7aITyFKdjJ77SjLyUhL45yDQPgpPVbngN857ufFR0o3ealqQL3c13fzk5eu78h4d75kITkv1CvPRLughSSLc31+rIYcjCTHe7z3RY7Z4rlcID2nYT28jyHmns8vmwS0Oc1TvurBeOfhEQtQSlOti5eb1N9XIDQVsoZ1EfZB4rC6s4Gav3/TZxp7bOVQvqF8Qk+95l0/A== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM4PR11MB5440.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(53546011)(71200400001)(38100700002)(6506007)(86362001)(5660300002)(64756008)(316002)(2906002)(9686003)(26005)(7696005)(38070700005)(83380400001)(122000001)(8936002)(4326008)(8676002)(54906003)(33656002)(66446008)(76116006)(66556008)(186003)(66476007)(82960400001)(508600001)(52536014)(110136005)(107886003)(55016003)(66946007); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mRwH8hzHLKwLLT/jaq1T+fn2dTESLkwpgSLoo7CL7XfkUqI837P36la41Hge?= =?us-ascii?Q?pYecnaRtyPEzZ5JajkZEHT00g96xfJHy0ELO7qx3AiBJSORtI1FyUAOonHnT?= =?us-ascii?Q?vEyNGUh9eAIupR53RzPXhLpyNN0hZ84lkS/Q+Pa9VqSUVy/MmNwWpb5UXa/f?= =?us-ascii?Q?9le9E6k4zGD9BlrmyOf9FcG/GacshOzPrQm0zATrGqJ8HqUVCwAIE1GAlYG3?= =?us-ascii?Q?VT4auo2G+TY3kXOV0Am4sfn28ghQvYNX2TcjcTMbjlVEVpSbEpxlshLke9Ft?= =?us-ascii?Q?5zTWlHxaDtxF1HlV+j6IsuzstaNWfwHdelx4prbgouA4E84cJKhLnegPPc2t?= =?us-ascii?Q?YmpUracVpqmkUf1HBRgRLbydFkql2F5t5f5qHx8tpYC8jWjLddXP5wW2A4NR?= =?us-ascii?Q?Hvbxlhj9EtjYvg4t3K93BzGUlUB7qgIdltbqfunJOQNqWAJ6hMksqkyJYYeq?= =?us-ascii?Q?ws9Xlyv3NP5SnRVVHzGC1V8hda2ok6p9NZ2Mgxyu0hqa/aE0fJhHmNxAd0KN?= =?us-ascii?Q?73lcnSi+GQ0ALPq5jeoE8b/P4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ascii?Q?IqsbZL/jl4XEDa3qcLypVj+7FvMCDz/hN4Fnb0I7E8QUtwbEfFbSW/caheEK?= =?us-ascii?Q?D5+0MpJPLUz+Tj8ekZu55/Os0oKg/mbS2EC8pfLSwjWay2tABg1nwdOaGHm7?= =?us-ascii?Q?PbXbByndnSDQj4q3x4ZGMA1pzRaIz2mrr8O/zGnMOJPMsFezLX3Tknghebs4?= =?us-ascii?Q?IGS0MJ9t1fyd/EZ34irgm9z7XoN7NvXOywGuaf91++j4VKlrIUUBpaCvJ3iF?= =?us-ascii?Q?g6ejviezQNUG5epDetbeAHwqZCj0dcZtHMSJVqZJ6arKjWtXlKJs33YtS7EK?= =?us-ascii?Q?gWJjFzTsQA=3D=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: DM4PR11MB5440.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7c39d313-8a89-4ec6-970d-08da3cc21e68 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 May 2022 13:42:45.7200 (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: o2/vn6E/lEvqd38k6sDt4KV8NlQLAWAvYX95MsggKyEBWalVO3VVlWtug64DGrRRp8valJQoFVFejkj4IPLkrrdPKJ0cAKEZSKn5NqE88xA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR11MB1318 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 Hey everyone,=20 Tested-by: Jakub Poczatek =20 -----Original Message----- From: Kai Ji =20 Sent: Friday 25 March 2022 11:22 To: dev@dpdk.org Cc: gakhil@marvell.com; Ji, Kai Subject: [dpdk-dev v1] crypto/qat: fix of cipher offset and length assignme= nt This patch fix the cipher offset and length values when convert mbuf to vec= tor chain for QAT build op. Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request") Signed-off-by: Kai Ji --- drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h b/drivers/crypto/= qat/dev/qat_crypto_pmd_gens.h index 50a9c5ad5b..dc473e0624 100644 --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h @@ -395,12 +395,12 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op = *op, ret =3D qat_cipher_is_len_in_bits(ctx, op); switch (ret) { case 1: - cipher_len =3D op->sym->aead.data.length >> 3; - cipher_ofs =3D op->sym->aead.data.offset >> 3; + cipher_len =3D op->sym->cipher.data.length >> 3; + cipher_ofs =3D op->sym->cipher.data.offset >> 3; break; case 0: - cipher_len =3D op->sym->aead.data.length; - cipher_ofs =3D op->sym->aead.data.offset; + cipher_len =3D op->sym->cipher.data.length; + cipher_ofs =3D op->sym->cipher.data.offset; break; default: QAT_DP_LOG(ERR, @@ -426,7 +426,6 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *o= p, return -EINVAL; } =20 - min_ofs =3D cipher_ofs < auth_ofs ? cipher_ofs : auth_ofs; max_len =3D RTE_MAX(cipher_ofs + cipher_len, auth_ofs + auth_len); =20 /* digest in buffer check. Needed only for wireless algos */ @@ -463,7 +4= 62,8 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, ctx->digest_length); } =20 - n_src =3D rte_crypto_mbuf_to_vec(op->sym->m_src, min_ofs, max_len, + /* Passing 0 as cipher & auth offsets are assigned into ofs later */ + n_src =3D rte_crypto_mbuf_to_vec(op->sym->m_src, 0, max_len, in_sgl->vec, QAT_SYM_SGL_MAX_NUMBER); if (unlikely(n_src < 0 || n_src > op->sym->m_src->nb_segs)) { op->status =3D RTE_CRYPTO_OP_STATUS_ERROR; -- 2.17.1