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 C38C6A00C4; Wed, 21 Sep 2022 15:02:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 65C874067C; Wed, 21 Sep 2022 15:02:49 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id B86304014F for ; Wed, 21 Sep 2022 15:02:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663765368; x=1695301368; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=BY6fec/suYsuXJROjKtPueivMjPGrvknxeTek8lGEVw=; b=P0A4rleCmluS407NvOUpRUuaHZ6qQ7me1vZ7LEkknt3AZD9Ak+oCEI79 GHhFzV/7Uw+7gOW1n9gTzkbEQhfxL5ZBMK3D21mceN3LFxgGuuM9EE2oE VtEg+7/kb+1pXxIUpg9uVi9YVZkopp4pld9CCGBg6ddsf2GQdVauThlSI qI1X85+wzDCKlI8n0YX1qJ97ib6J4nvltL/UdkWYMaXygi04eK71Cj5n0 THcJjWAtIUOWeKcIVfVrCm0Z2/gTlY1OUta9OthME4qNeOlizJ/wXbG6A o/syqo7kwKmNf/8jFIonf0Wo5nT30PJZwzOtmqeHZezHgL1cPRT+xM28J g==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="297593783" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="297593783" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 06:02:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708438463" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 06:02:28 -0700 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Wed, 21 Sep 2022 06:02:27 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31 via Frontend Transport; Wed, 21 Sep 2022 06:02:27 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2375.31; Wed, 21 Sep 2022 06:02:27 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGZlomwhOJfb06qq2diZTXeGY5NjT2YqV26kUeT7TTpj9jnY/nHacdOgKlzVw+xdrkvGHJziv+T7/Fsock2KMvzQNSZSA2zLREo36aNuZo8wvn/WPn3wxtw2AD2bnwh+WVdXNPBcOB7RsGitm82SEFmH0xf4Z44Qv8anPjnGTorRBJVud6K+dqNJjbkYmcQAxMQZZ+J7zQkKqiKZ+Is+tvcU2/xiV1yIYgLBeJYY93yawPR+dlpmraorhllJCzfZZiChbPE3j0BVMP+3SoSAf2yCt9G5pFfahN8Uo1jwijH0RPEaEaa/kdKBNof2Jve/5PP4GxU7wFw3t99eKqKuRw== 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=9OoVx9WOlFLJmzsDdq0oCrG5gLMWBg7J35+hJoSgIB4=; b=bEgtO6aAHU9dlm9snSWFjCQFGTYra+g1n+mGSy1oCPpY6FMKBvI7Xw4E62NcCX9h2XD19XKbHQDZS6QkEKkqZ0H+7FTX9BC7aMF+aA4BjTBbaOn3U634SpJ2p4R6pilIkPPCAGS99XL+4sBWWs7XURrFChj6i6ZBqCZDINsNf2KIhEvNPJM7DTEzckDOuD+FVwHPiqe65bVuvPfhJMk5O4ijHO5yhaClmQEsquH2VDAfy+/NH24GcRaOT6Smdvj4X0h6jVWXt8n2qtinWK1spnOAquToEzu4599O3OEhktOCmOme1D4G2Yty7RvB4HmNvHeapFSdns22+8FvOvnGWA== 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 MN2PR11MB3821.namprd11.prod.outlook.com (2603:10b6:208:f7::24) by DS7PR11MB5991.namprd11.prod.outlook.com (2603:10b6:8:72::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5632.21; Wed, 21 Sep 2022 13:02:25 +0000 Received: from MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::ab9d:85ca:6bae:cae9]) by MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::ab9d:85ca:6bae:cae9%6]) with mapi id 15.20.5654.017; Wed, 21 Sep 2022 13:02:25 +0000 From: "Power, Ciara" To: "De Lara Guarch, Pablo" , "Zhang, Roy Fan" CC: "dev@dpdk.org" , "Ji, Kai" , "Mrozowicz, SlawomirX" Subject: RE: [PATCH v2 2/5] crypto/ipsec_mb: fix sessionless cleanup Thread-Topic: [PATCH v2 2/5] crypto/ipsec_mb: fix sessionless cleanup Thread-Index: AQHYuI8S87f1fc44Wke3JcyOFfb0Ha3gfj8AgAmDzRA= Date: Wed, 21 Sep 2022 13:02:25 +0000 Message-ID: References: <20220812132334.75707-1-ciara.power@intel.com> <20220825142901.898007-1-ciara.power@intel.com> <20220825142901.898007-3-ciara.power@intel.com> In-Reply-To: Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 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-traffictypediagnostic: MN2PR11MB3821:EE_|DS7PR11MB5991:EE_ x-ms-office365-filtering-correlation-id: 54a8f6b7-0282-4334-f991-08da9bd187bf x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: A4LX8rtI9/eUWWmkNTE/duVdTkl5aLShDf1ZQ4uwqukPDX2lgofugtd5qu/OGmr6W/IgOBcLVxYGMATIeCKoWTajyYZiB6QYMzPH3cedNtnJTNIBG6vX7IAPhMg72GAzt5uonGik0fHNGo00CgD9uGL5feXfPx2y8D5wuUPW3E2Z6RUSmEbVCrfM8z7eNp6gDGAbFTogJcVQDuLXE7o4d4R+nXIvT817pu/UfVq0befSSl8rMT4jVwCENkaR6+hC0IKLDRWSTcBxbeQ9blTLIdDobMpom/oN7ee7aTUCEcjS905ycJU3U0LPMPSbKH9ANOfuvyL3N72vtkDQNDe23paDclxxe6du0N15GMa3YyagMqRWazyusIc1cChW37gE88LNzC7HOHy+FsbuMuygp4Uv/P+wC4eBf5o3zxnecR9hJWYGogJOfEXo79ObiN8bu60oAOIloVN9fDPgqowGW2Ld3zIQjT3IvU0+BKQIbOD2lFS/Aew+MNPUeGYoZo82yI7iJQVg/EmExNMtb1pNghyOkjUYptfZe4nxpcvm1Zvhqhf5RFL/Xp+WdbXB2d4CD9XOK6nTXE+SNJlVYZPfAFupiUp+RiQC1HJH9vO2n9nLGcbFwWrvf8EMF8C71nCfDIajpT/Egc3OtQcB07F/7I+A1jfJgo5Yammwp9/gN+g/3P/e3nphauqmDbsU7n00KjplPGUzKpEwl3Z3z7pNfN3Bp0BfntnnVyCWHPsxN3acrZefKmgy2ix0rcXqGcCGgpQvpXD3jlTJZUz9Kxv0M24dWGZFCTBbtftuEgGtPW8= 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:(13230022)(366004)(396003)(346002)(136003)(376002)(39860400002)(451199015)(478600001)(52536014)(53546011)(5660300002)(66946007)(83380400001)(2906002)(7696005)(110136005)(38070700005)(316002)(41300700001)(966005)(8936002)(86362001)(186003)(64756008)(122000001)(38100700002)(66476007)(66556008)(82960400001)(66446008)(26005)(8676002)(9686003)(71200400001)(33656002)(6506007)(6636002)(54906003)(107886003)(4326008)(55016003)(76116006); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?y5i+BpyF2X0s+sSHM5qY4ZnoaHvFR1U7ytX1PJXUTLytrVDpky7OoYPvNgep?= =?us-ascii?Q?FLnfPsTgVt49X7GR6OOqAWjetbMzAVq/mlvIGD0fRON78nghFh7SywX8D78t?= =?us-ascii?Q?izJ4ZVg+veA+PELYroeqwDPv5B5ZIJeVerwRJ7U6dAHCVGwrJd+3RuGpUdKH?= =?us-ascii?Q?dPZnPdwQ7aM1u0Z5TVu6+3wq/F4clxYMsNZ+EzO+WPbctax7AK1OFQyDDE34?= =?us-ascii?Q?EUx1meSo/8YZyvyaFbePXMTZRLyogAiUwVprLQS6xFR/sn4jkjQtfZrLpSRu?= =?us-ascii?Q?PQWixEz6k9Ya/5q2zA0BHCA7BJqr7QrF6N1uK5L8FQaOmaMQweOaiyMtGqrv?= =?us-ascii?Q?xdyBByfudHtgqkmeHusvmuN21CxbgosQgMfagfTaScbN8DN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yJiMkrQ2JJm7e0erBU1mNauxdHMX?= =?us-ascii?Q?h56Ax6MOl7z9OOCCpcJNqT7TUY84/5XIGDgfxoJzhzORN6xBnOs8lpwmCJ0e?= =?us-ascii?Q?X+em2WMM+d0yrZmRtbdduBOLEAu3Klu/Z8TkhYeK0vJNk4dcdyd1ksZ/iwpC?= =?us-ascii?Q?yjZijEmVxos9MVa65URIzADtYI5AqOIrlRt3I8tPuXCgRDwrX4NcU+09uhSf?= =?us-ascii?Q?X9M776wZJgCToN2eMB4EXhA3Kz60wT7q1icDKJ2FtS5C1LKhG2iccTrnbDpx?= =?us-ascii?Q?5A0v6MHIjMjt9BLd+FcoH5BmC8h+Ey7lSh3Rmu51?= 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: 54a8f6b7-0282-4334-f991-08da9bd187bf X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Sep 2022 13:02:25.4009 (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: UQ8erwGCiTNLD8KwEdOE/1sOQhXtcARpnE2hRqy0nh8bO3Ks5aMAjMWz//yVHuCnzzdku/6zeEmJxEIT/VLacw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR11MB5991 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 Pablo, > -----Original Message----- > From: De Lara Guarch, Pablo > Sent: Thursday 15 September 2022 13:39 > To: Power, Ciara ; Zhang, Roy Fan > > Cc: dev@dpdk.org; Ji, Kai ; Mrozowicz, SlawomirX > > Subject: RE: [PATCH v2 2/5] crypto/ipsec_mb: fix sessionless cleanup >=20 > Hi Ciara, >=20 > > -----Original Message----- > > From: Power, Ciara > > Sent: Thursday, August 25, 2022 3:29 PM > > To: Zhang, Roy Fan ; De Lara Guarch, Pablo > > > > Cc: dev@dpdk.org; Ji, Kai ; Power, Ciara > > ; Mrozowicz, SlawomirX > > > > Subject: [PATCH v2 2/5] crypto/ipsec_mb: fix sessionless cleanup > > > > Currently, for a sessionless op, the session created is reset before > > being put back into the mempool. This causes issues as the object > > isn't correctly released into the mempool. > > > > Fixes: c68d7aa354f6 ("crypto/aesni_mb: use architecture independent > > macros") > > Fixes: b3bbd9e5f265 ("cryptodev: support device independent sessions") > > Fixes: f16662885472 ("crypto/ipsec_mb: add chacha_poly PMD") > > Cc: roy.fan.zhang@intel.com > > Cc: slawomirx.mrozowicz@intel.com > > Cc: kai.ji@intel.com > > > > Signed-off-by: Ciara Power > > --- > > drivers/crypto/ipsec_mb/pmd_aesni_mb.c | 4 ---- > > drivers/crypto/ipsec_mb/pmd_chacha_poly.c | 4 ---- > > drivers/crypto/ipsec_mb/pmd_kasumi.c | 5 ----- > > drivers/crypto/ipsec_mb/pmd_snow3g.c | 4 ---- > > drivers/crypto/ipsec_mb/pmd_zuc.c | 4 ---- > > 5 files changed, 21 deletions(-) > > > > diff --git a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > > b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > > index 6d5d3ce8eb..944fce0261 100644 > > --- a/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > > +++ b/drivers/crypto/ipsec_mb/pmd_aesni_mb.c > > @@ -1770,10 +1770,6 @@ post_process_mb_job(struct ipsec_mb_qp *qp, > > IMB_JOB *job) > > > > /* Free session if a session-less crypto op */ > > if (op->sess_type =3D=3D RTE_CRYPTO_OP_SESSIONLESS) { > > - memset(sess, 0, sizeof(struct aesni_mb_session)); > > - memset(op->sym->session, 0, > > - >=20 > This will leave some info leftover, so it may cause a problem if this obj= ect is > reused? Is this memset clearing mempool object header and that's the reas= on > why it cannot be released properly? > Maybe Fan/Kai/Slawomir will know more on this. [CP]=20 Yes, I believe this would leave data leftover, my initial solution was inco= rrect. I have sent a v3 fix which takes a different approach, after debugging the = issue a little more. I found the sessionless tests were reusing data in old session objects from= previous session testcases, which had not been reset before being put back into the mempool. Once that reset was added, the sessionless tests failed due to session->nb_= drivers being 0 - this was due to the value never being set for sessionless operations. Instead of pulling= from the mempool directly, I added a call to sym_session_create(), which pulls from the mempool, and a= lso sets values such as nb_drivers. These changes can be seen here: https://patchwork.dpdk.org/project/dpdk/pat= ch/20220921125036.9104-3-ciara.power@intel.com/ Thanks for the review.