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 D6C4E4552F; Mon, 8 Jul 2024 14:25:21 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5F8240E42; Mon, 8 Jul 2024 14:25:21 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) by mails.dpdk.org (Postfix) with ESMTP id 336DA4066A; Mon, 8 Jul 2024 14:25:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1720441520; x=1751977520; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=kC0TuSx0YYTxC5RyZaAjRx9l5FNBKeOzxOlrZw3/BoM=; b=NBxad8wYzKcBMudsHkZ6nR6dex7KlUNEGhWL5rl7JhYHqzpa0NVHHEKz 7UMIBZXRuvjUQoodpfIjMEVP8hqjVjBwcl1AJrNGBrertJuNV90vj9z0U KIuN5eTANgv9SWYHD3jJ+j85rFHkX6xr/+vhJr5LjqQpnuqj7XVf48g1n RH89yu0lNo6xWd4imdtQzPgz4BVbtksIb00hB+otquVeH/njlTUPxgp+Y ZgdASrLBDLjk0lBfXB2Rj/XTU3IyvttRz85RTkxw2YgF8V0j215mavheG C9bCbfPvzl5J03PKMEGlmN4zt6jfgET5YdBcZVASOFZf4uUiuTCNvILVT Q==; X-CSE-ConnectionGUID: ByPtOvvbQ7ONq40NWlIRQg== X-CSE-MsgGUID: h7P074xqRSarLxIW9iimsg== X-IronPort-AV: E=McAfee;i="6700,10204,11127"; a="17768733" X-IronPort-AV: E=Sophos;i="6.09,191,1716274800"; d="scan'208";a="17768733" Received: from orviesa010.jf.intel.com ([10.64.159.150]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Jul 2024 05:25:19 -0700 X-CSE-ConnectionGUID: xfkfu6SERtOi2awzNQ9veg== X-CSE-MsgGUID: M1hhJoKiTKKtlkYJ9fmsWg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.09,191,1716274800"; d="scan'208";a="47409847" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orviesa010.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 08 Jul 2024 05:25:18 -0700 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2507.39; Mon, 8 Jul 2024 05:25:17 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.39 via Frontend Transport; Mon, 8 Jul 2024 05:25:17 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.46) 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.2507.39; Mon, 8 Jul 2024 05:25:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Opo1B3DwFuCvI2uzxSA7TlKJeBbess9Iph+Ca+Bp5x92naXci2L7nbkpiF6mOBzMgb+gTpeCEpSt60bXPcrmIBzS61LPMTQZiFsBmi+i/2NPDefCxX7CEKY7riVkXjHF1hFyiQ9FQcah8jaIJEVDWghNlL8dhCpS1CjsSy6ogxUIf1GwqQ11XVru5jMWWMkfsO25ze//E1YRDr+GMPtwopX29GudD0HD9gan0y3NAc8sZkdhyVF0xQeZ82brH4bNfHkPuBHplXRYQYE4Tv2PE7D03xleJadz07XPRhy+x4AZGaCK+WuXHj0DItVW1I9Q5Yo0aTOvRI2AtZteeNj95A== 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=xm41m8XDauBui0AGxG3+iBeqwblV0B80oLkp3uZTAU0=; b=IIoEFLgYj0k1j+mIBtLo+wf9sfu8hiy57qZv4MEkwla4wwrp3kQaEgOq3cw5pafnew9wW166n0lZluLqukXZ6LMsAxw7ToZh3lQ7cjT0y3lty3s6VYymWSyjy3DIciVsuS6JwUVyedfQ6rAjVy2gEA6MUC3jvZUG6PKGoarut+FLAcCqqX4IwEDjCkXxu3yYPDAc04aKJAlYsj3p/HcAJ1P5egMwWhYPQYOXHhBDQ/kZnQ74Eskrd1jIO/gD58uv7gUTZejJjXJu7HbeGSU9NMzlgbDAdSUe3Ni3JHhPZj0oy7oqrYY0nNfHcyBExgA0lyyQmRULsNOOcoE3GH8fqA== 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 SJ0PR11MB5056.namprd11.prod.outlook.com (2603:10b6:a03:2d5::6) by SA0PR11MB7158.namprd11.prod.outlook.com (2603:10b6:806:24b::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7741.35; Mon, 8 Jul 2024 12:25:15 +0000 Received: from SJ0PR11MB5056.namprd11.prod.outlook.com ([fe80::4f35:279e:a725:ad08]) by SJ0PR11MB5056.namprd11.prod.outlook.com ([fe80::4f35:279e:a725:ad08%6]) with mapi id 15.20.7741.033; Mon, 8 Jul 2024 12:25:15 +0000 From: "Dooley, Brian" To: "Kusztal, ArkadiuszX" , "dev@dpdk.org" CC: "gakhil@marvell.com" , "stable@dpdk.org" Subject: RE: [PATCH] crypto/qat: fix incorrect placement of oop offset Thread-Topic: [PATCH] crypto/qat: fix incorrect placement of oop offset Thread-Index: AQHazfy5GloMw8hsvUKWAqVVA4xdkrHsxnLg Date: Mon, 8 Jul 2024 12:25:15 +0000 Message-ID: References: <20240704102649.30400-1-arkadiuszx.kusztal@intel.com> In-Reply-To: <20240704102649.30400-1-arkadiuszx.kusztal@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR11MB5056:EE_|SA0PR11MB7158:EE_ x-ms-office365-filtering-correlation-id: 8d04d4d6-75e3-489a-f929-08dc9f4905b1 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?us-ascii?Q?uCHNsxrIV8r89IGOf+2Nwc2Vajx8wHqaBbkdSR8zumo6m6IXn7DpH3lK3USL?= =?us-ascii?Q?2p0oJcBo26s0DO5BngRShiMHwv2boXdvp2Wh4j0BkE2j/lRKR06vhtIjl9hc?= =?us-ascii?Q?y+mx0rM0yw8y4gsdP0T4FKuBctcMIU6QuxNqwk1JRuwKZ8XEURQmSj8DoEPt?= =?us-ascii?Q?bay8mxLZPzrAVO9RkLpcfo0gWMqCFVTEdIfRO/iqupFoKrQ7yz2uDbTCqQfc?= =?us-ascii?Q?2MmxvKjvvaC9IOboWDQyryn+/lq9EbIDc9/4IHtQeQ27yhjv35JU1IhjVb4s?= =?us-ascii?Q?R+R4Tf3m9KpZzauvh0tHj2aN1EOISr8HDz+sXBibaA6Rs1BCXJ4VT69E3YEX?= =?us-ascii?Q?c7CwKKMsYv5TQHZSJdjGTWto1JJIStC5BYRSknhSF4br3Br5s9wvaSw1S4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xZizSlZLF/mHHE1PGIWxrh9xQb?= =?us-ascii?Q?bw+59Evlz62lfFrtSrxZqx+4oSYBHZkqfzvpC3MQoO17nXYDAZb/U3SEQmOL?= =?us-ascii?Q?y1dC4aoZxAjQef2XuNJlaoot39MSmp/ce+1Xm5dWG5m6r+DK3w=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB5056.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?aBJkPntVRsz5+3KbR3aqUkkBspH87YGvdzxY+ScSlFS+JwcpPopHugbn1Ssw?= =?us-ascii?Q?y8VY2FfaQy9OVGcNmCV1mH94ue92x7GSWzIIZCsueeVZqVJ39H2feF3bkIVq?= =?us-ascii?Q?xyaSEjjCAChN/H1mDvcRS2/W0AsI7rm1rI9Jj/wkycNTS5nBISmL1ZwxIZu7?= =?us-ascii?Q?OH16aHKJ29bd6LxEoGQdp9NuXPNfYWz3C9nUDZYyuQNLVejjCKK9A3DgXcca?= =?us-ascii?Q?yz5T6EfiyX0oQ5lCP0WeqWnMJdDt1MUcmdnsxDdt8l8mTuHjSNJCzK8wkKLJ?= =?us-ascii?Q?elTnNzREybLI0z8nygSXY/slURztHB4pErzP4r6b2+wQYxpC7QGLIDTMqSgK?= =?us-ascii?Q?j3Nvl2s43D0vcIDYAh3b8MPjiklCZFCTN2qk9Z2RBkARW5PY3jSY+3doWYG0?= =?us-ascii?Q?azWac7W+jye19W6dKE9LbOMeF/OVWE0blVVhzw5sIx+hCq6Fv0EiCwuXSF74?= =?us-ascii?Q?GDzhF5Sc3FPkJO4ooZRv408ICTCaE4NcDoc5vDpZqS+9xot2FeyJAQFdmLzt?= =?us-ascii?Q?I53NNOpRQcfiMA4XWC+U4uiU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ii?Q?e14UCpm2smuWo3H9GRKdcKTJBKt9QI1L/2gX4QV/dIIeA+Ouf5USO/ZNJbJG?= =?us-ascii?Q?kgRFC082eX8EOp5txUrLnpJan3OtyqwDvBUAW+V8Uvi6Dn4mVPCuidvG5XKG?= =?us-ascii?Q?y0UpQ/1ouiB6vcbbvK5PRQFB/qKcuAm4D4Dn1xBO?= 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: SJ0PR11MB5056.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8d04d4d6-75e3-489a-f929-08dc9f4905b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Jul 2024 12:25:15.6253 (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: yPX4lS7isLjLlgxCOB0pLZqipsRj7IitCIT88gx1I7NMHBpkg5A3k0C4BxQ8ybvtuU36crq2v0uJqly5Mc2VNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR11MB7158 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 Hi Arek, > -----Original Message----- > From: Kusztal, ArkadiuszX > Sent: Thursday, July 4, 2024 11:27 AM > To: dev@dpdk.org > Cc: gakhil@marvell.com; Dooley, Brian ; Kusztal, > ArkadiuszX ; stable@dpdk.org > Subject: [PATCH] crypto/qat: fix incorrect placement of oop offset >=20 > This patch fixes incorrect placement of OOP offset. > Data preceding crypto operation is not copied to the output buffer, which= is > conformant to the API. >=20 > Fixes: a815a04cea05 ("crypto/qat: support symmetric build op request") > Cc: stable@dpdk.org >=20 > Signed-off-by: Arkadiusz Kusztal > --- > drivers/crypto/qat/dev/qat_crypto_pmd_gens.h | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h > b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h > index 1f5d2583c4..83d5870cae 100644 > --- a/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h > +++ b/drivers/crypto/qat/dev/qat_crypto_pmd_gens.h > @@ -399,7 +399,7 @@ qat_sym_convert_op_to_vec_chain(struct > rte_crypto_op *op, > struct qat_sym_op_cookie *cookie) > { > union rte_crypto_sym_ofs ofs; > - uint32_t max_len =3D 0; > + uint32_t max_len =3D 0, oop_offset =3D 0; > uint32_t cipher_len =3D 0, cipher_ofs =3D 0; > uint32_t auth_len =3D 0, auth_ofs =3D 0; > int is_oop =3D (op->sym->m_dst !=3D NULL) && @@ -473,6 +473,16 @@ > qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, >=20 > max_len =3D RTE_MAX(cipher_ofs + cipher_len, auth_ofs + auth_len); >=20 > + /* If OOP, we need to keep in mind that offset needs to start where > + * cipher/auth starts, namely no offset on the smaller one > + */ > + if (is_oop) { > + oop_offset =3D RTE_MIN(auth_ofs, cipher_ofs); > + auth_ofs -=3D oop_offset; > + cipher_ofs -=3D oop_offset; > + max_len -=3D oop_offset; > + } > + > /* digest in buffer check. Needed only for wireless algos > * or combined cipher-crc operations > */ > @@ -513,9 +523,7 @@ qat_sym_convert_op_to_vec_chain(struct > rte_crypto_op *op, > max_len =3D RTE_MAX(max_len, auth_ofs + auth_len + > ctx->digest_length); > } > - > - /* 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, > + n_src =3D rte_crypto_mbuf_to_vec(op->sym->m_src, oop_offset, > 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; @@ -525,7 > +533,7 @@ qat_sym_convert_op_to_vec_chain(struct rte_crypto_op *op, >=20 > if (unlikely((op->sym->m_dst !=3D NULL) && > (op->sym->m_dst !=3D op->sym->m_src))) { > - int n_dst =3D rte_crypto_mbuf_to_vec(op->sym->m_dst, 0, > + int n_dst =3D rte_crypto_mbuf_to_vec(op->sym->m_dst, > oop_offset, > max_len, out_sgl->vec, > QAT_SYM_SGL_MAX_NUMBER); >=20 > if (n_dst < 0 || n_dst > op->sym->m_dst->nb_segs) { > -- > 2.13.6 Acked-by: Brian Dooley