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 C1BC3A034F; Sun, 3 Oct 2021 11:47:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 436124116A; Sun, 3 Oct 2021 11:47:01 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mails.dpdk.org (Postfix) with ESMTP id 13AD04068E; Sun, 3 Oct 2021 11:46:57 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10125"; a="223912849" X-IronPort-AV: E=Sophos;i="5.85,343,1624345200"; d="scan'208";a="223912849" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Oct 2021 02:46:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,343,1624345200"; d="scan'208";a="522428990" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga008.fm.intel.com with ESMTP; 03 Oct 2021 02:46:56 -0700 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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.2242.12; Sun, 3 Oct 2021 02:46:56 -0700 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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.2242.12 via Frontend Transport; Sun, 3 Oct 2021 02:46:56 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.173) 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; Sun, 3 Oct 2021 02:46:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iJMrnmIh3wwRKiDkAPF6moBLydz3DrfeZXlaHZ2ONBJ8goFvXHOm2hzrgd4zCRPgIXCLkwS3QrUbhk9iRia2/QxLukX+RbQVFKPX4lplwnlagNiCxWn2CkDs/aqBZzTmAmv5Xr7taS0L0o1wm/7cXn5cJq8m+fGlQbc6+sGT92eO5JlhgT8gfBphWTVMD8uNF+pMUK4fO7r1IYRvXOhdea+PzWt7Iho114X1RHIx1GxZDsUot1oLctn15yNren0YLx1qVkoaAAJaJvWfUoOoS0Pr/4EhtA5+X2Qw+iquzBdcUJQPIfF6X65uL3F7RUzqz1wu2vn5fv1+ahf7UYTjEQ== 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=IJG7+NEHn1fCauP3PEW7smYAqQn/zZmiNBcwcNIhGOQ=; b=ckRhuunrHqzceiwB8Nxi5StZr4jChf2I+9CguIraVCJbWjYrH1LjSeA+OYnH+OReJdaDcj9IYotDUxdBK6riYkFPqynJJ738uPoOYZ6nOvniPUfDalg9J17i+1LpMblT3C281SEuY2lA+smDLLMeB7y0oMN6mkd0d3tHzLkc1rlhWxBXjFl4//ePVNV9lGvAu6qX82OXvoASySvkuhfVVFr2klR8BiYMvnn17kC8hQsoJafCe9SGnJjeCIYKtCESB1nS3nWy8RihSktgXCxlK0b3DRbrsf6tulwdTrlKZBePNjAdE0G2z0SC+KD3p/r+gDGSElxFxTXqYg3qXKl/oA== 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=IJG7+NEHn1fCauP3PEW7smYAqQn/zZmiNBcwcNIhGOQ=; b=B5v3UoPToQcRm3FVjWK8+enDRT3wOpr4A0822I4FFVtOTS6NmKR6B6shpJWYNT/S3YeJfQ7i/GX5TmrLOjG/RpvySyLeWbXlwKGKIDsn+qyRvP984Ug6zVC7a9BhiS9v0f3y3O+IfDKzwFNyeJL4WqVjMKwGNugKVXpiqmKE11g= Received: from PH0PR11MB4824.namprd11.prod.outlook.com (2603:10b6:510:38::13) by PH0PR11MB4902.namprd11.prod.outlook.com (2603:10b6:510:37::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.15; Sun, 3 Oct 2021 09:46:54 +0000 Received: from PH0PR11MB4824.namprd11.prod.outlook.com ([fe80::aca2:cce5:bef2:8a27]) by PH0PR11MB4824.namprd11.prod.outlook.com ([fe80::aca2:cce5:bef2:8a27%2]) with mapi id 15.20.4566.022; Sun, 3 Oct 2021 09:46:54 +0000 From: "Gujjar, Abhinandan S" To: Shijith Thotton , "dev@dpdk.org" CC: "stable@dpdk.org" , "jerinj@marvell.com" , "anoobj@marvell.com" Thread-Topic: [PATCH] test/event_crypto: fix event crypto metadata write Thread-Index: AQHXs7TbLXH3arw7SEuopYq4I9ORpKvBDyYQ Date: Sun, 3 Oct 2021 09:46:54 +0000 Message-ID: References: <2c543df71bc79ff363c1aa501e0bf5a88cb448a7.1632731708.git.sthotton@marvell.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: marvell.com; dkim=none (message not signed) header.d=none;marvell.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dd117124-a67c-4b87-19d0-08d98652bbc6 x-ms-traffictypediagnostic: PH0PR11MB4902: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:5516; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: +dxlavlluo5YmC6/6dv7iZ6Y4jrkqefGuYg6YHn1FnP90BdeUSmlRX0FDOoD+rMT0xibPYuCOaSpRta2zP2wY2VSAn357HbTpaFZ8bjGEThrPldLU7Snbxi1g69RK7/urcrrkg9tGKbI26Rv/BETQEMVwpUpEtON2T1V0ZR2bdk5GBXGc/CEbsYsU7UeX410rtEqKLo9yiKWaU7GylqQuWCz2CpFQ9TR8oMBaSqeIjq8k+ZJ+wCrkx90GdYaIcETMzcnpLGuaVjUpNf79+Vk9W6XFWskwz8j2v9fToHY9WK0priA+2Foyk4v8utMxTo9tRTkMWV1WCqG1N/aNPVxfX4LKTDOx6FiXvkHhQTi/pgVrwTyYTBxHO1fqNCBKDuTLkILP9Way6MTWL6/faRFRSkZ/AMZE5Ubun2U/ViKhEi3okUQg9u327NxO1h9d20Wwn5LAXTJWsOKVPZAiwBkxXPWonJzAFGJknW6vz2TyBXdRgF988Wwp5Y9oIJBA8FSVpPZVfmGno6GxedXIyEm051pwC5sJ4e+PKb1SIivQThCGpjAw7ZusJtynYasbqYG7h8nrvsq3p4wFdL2Y+jm8bhYlDkT/5l6c+I0oqR+hyonA07PaFUss5ajHfim/LiYJElXkG/SrSzEB8kjgbUSZNsQ7hB0+Hj0ZOj6cGV1+uOwICX8JfHSxxBLPgIaX8wIIby8phfyh2KENQCpus59GA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB4824.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(508600001)(66946007)(8676002)(55016002)(71200400001)(52536014)(122000001)(316002)(9686003)(5660300002)(66556008)(66476007)(64756008)(66446008)(8936002)(38100700002)(76116006)(110136005)(6506007)(26005)(53546011)(186003)(83380400001)(4326008)(7696005)(33656002)(86362001)(38070700005)(2906002)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?FFF+cBdG4mc1SCe7QmXm0oQiz3119WwncPHYjAVRpmdMSKjmT6rWLwjhUhsm?= =?us-ascii?Q?DGtth8uKGY1qJv9MbsCj1E6V6lzgl+QzlXGwgSe0rWlJWsYWtVzIaqqsrbXj?= =?us-ascii?Q?XF+R9HTjTrCGGh/htdlC13/tZfYhfnoKXwb07H0WCWJ6kJ6/Cc4aJC6kd1Ax?= =?us-ascii?Q?t4dZCeND2DUDMEcKfg9eYQjQjv2LxXGqbRZV/qc7S1lwVkZqt4l9a3ZQhezp?= =?us-ascii?Q?VHOA8TnCkkSo3jzygs2nja6OlIeeg9nfaiZpOtzqeucLoX05JyvA+R503VkX?= =?us-ascii?Q?yb0BV9ftoVMorkOQ4DpPPwtD/CjBAq9fIfwyQ5DKFic7pbZ/SObQ0eoAv15G?= =?us-ascii?Q?SZe5R30QEpw/Y/rDhmsjswT6BNjN3aXBioDo9vS7+aYSEFc7b9eZolYtHO15?= =?us-ascii?Q?a92LFSXkr1F3DhE8IUWG0YsXEYo9lb6kWEXJGVnWHXhm7LRR60NDKKyg89UG?= =?us-ascii?Q?JMopbGKoAFPb/SpHfuLQ7lC0Cb6f8jK7iW2YCf7bCUXdMq9Xun8eJOkx7dAy?= =?us-ascii?Q?G5I6VpmhJC9nuhcXX18Mz81JKxrwsLgYHJbdSZw0FXqV9NKioPQ5Bi182MHe?= =?us-ascii?Q?/0plfW5gMZLigENyxrlml77mWIesMhQi34f52Hz6hzW4ZbrSBjgmO38nAdnv?= =?us-ascii?Q?1h4m1XLJ2DQ9DcJpokipt1XEPd429Kl+MV8IE28sziud5KAB/tOjYIBOJp6z?= =?us-ascii?Q?CEuwUePoI2s1BeVDNB7lixrSfBykV1GWQ4Yieo5yZPls4X0umNz4w/9tK7JE?= =?us-ascii?Q?9w/ogx9pGj/8zbhIsx4Lnn1mkAsqsJhBhQm1frVeU9oip1jtZpksyzt0RRDd?= =?us-ascii?Q?ZnTRW5VrOIch1MNYpEIqnKJQUtPRMvhZF9yitU5gh5kRd+kSlch75DCgAVc0?= =?us-ascii?Q?tqlE9+ntHn0w3OaJOqCa9c3FvVc4BA9wnvE4YBMQTCGQwUcon3hDbrQYYR0R?= =?us-ascii?Q?QCL7ojK9qAg0Qn7Crtgny/4npRJv4D8SlqcKDaDBdSURtcE0+ifu61uuGwli?= =?us-ascii?Q?ipD9ng6XfSjUW49M2pAzKFz2V2sYaDqSfbNJKtWRqn/0FFDSBanYQoA2dttt?= =?us-ascii?Q?QyTx/FKFQRFTfDhiTBHP2NWBUIx57Pb6AOiRHL/hhTEg3w4dMb5i4zoHDHN4?= =?us-ascii?Q?XnYFCJanJDOZ+3DIah2R72vDGc3cpnaHRmYNIZ28hr6vSONwtk9+d/pg72zT?= =?us-ascii?Q?LqY5hghsM3RRqtdmG6PjFtBFffbQqnxCoX7PI2KZv5Gk9bhX+IG63lT6hWmK?= =?us-ascii?Q?AlYaxt6R9VapJqNyUuw0EqjIP+oxHbXBTUtWwF/a7o2WYMNQKSMz5JNcKAO4?= =?us-ascii?Q?P+bJfn6STNPrSCUu4qtEuHtX?= x-ms-exchange-transport-forked: True 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: PH0PR11MB4824.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd117124-a67c-4b87-19d0-08d98652bbc6 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2021 09:46:54.3805 (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: F8jFhOSK5ooNGyuE94epsXIU/mklXbi6ABe6aSiNpToYra+POXtJ5MxFvItaC95QiEqfUBRIfAUa8WGV3tjBy54Jw9wSUjFnokWnK/4V+XA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB4902 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH] test/event_crypto: fix event crypto metadata write 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 Sender: "dev" Acked-by: Abhinandan Gujjar > -----Original Message----- > From: Shijith Thotton > Sent: Monday, September 27, 2021 8:59 PM > To: dev@dpdk.org > Cc: stable@dpdk.org; Shijith Thotton ; > jerinj@marvell.com; anoobj@marvell.com; Gujjar, Abhinandan S > > Subject: [PATCH] test/event_crypto: fix event crypto metadata write >=20 > Using memcpy to update event crypto metadata fields (request/response) > will result in one overwriting the other. To avoid this, fields of each s= tructure > should be updated one by one. >=20 > Fixes: 3c2c535ecfc0 ("test: add event crypto adapter auto-test") >=20 > Signed-off-by: Shijith Thotton > --- > app/test/test_event_crypto_adapter.c | 21 +++++++++------------ > 1 file changed, 9 insertions(+), 12 deletions(-) >=20 > diff --git a/app/test/test_event_crypto_adapter.c > b/app/test/test_event_crypto_adapter.c > index 279aa3abf5..3d7e9fb93c 100644 > --- a/app/test/test_event_crypto_adapter.c > +++ b/app/test/test_event_crypto_adapter.c > @@ -212,10 +212,10 @@ test_op_forward_mode(uint8_t session_less) >=20 > if (cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { > /* Fill in private user data information */ > - rte_memcpy(&m_data.response_info, > &response_info, > - sizeof(response_info)); > - rte_memcpy(&m_data.request_info, &request_info, > - sizeof(request_info)); > + m_data.request_info.cdev_id =3D > request_info.cdev_id; > + m_data.request_info.queue_pair_id =3D > + request_info.queue_pair_id; > + m_data.response_info.event =3D > response_info.event; > rte_cryptodev_sym_session_set_user_data(sess, > &m_data, sizeof(m_data)); > } > @@ -231,10 +231,9 @@ test_op_forward_mode(uint8_t session_less) > uint32_t len =3D IV_OFFSET + MAXIMUM_IV_LENGTH; > op->private_data_offset =3D len; > /* Fill in private data information */ > - rte_memcpy(&m_data.response_info, &response_info, > - sizeof(response_info)); > - rte_memcpy(&m_data.request_info, &request_info, > - sizeof(request_info)); > + m_data.request_info.cdev_id =3D request_info.cdev_id; > + m_data.request_info.queue_pair_id =3D > request_info.queue_pair_id; > + m_data.response_info.event =3D response_info.event; > rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data)); > } >=20 > @@ -405,8 +404,7 @@ test_op_new_mode(uint8_t session_less) >=20 > if (cap & > RTE_EVENT_CRYPTO_ADAPTER_CAP_SESSION_PRIVATE_DATA) { > /* Fill in private user data information */ > - rte_memcpy(&m_data.response_info, > &response_info, > - sizeof(m_data)); > + m_data.response_info.event =3D > response_info.event; > rte_cryptodev_sym_session_set_user_data(sess, > &m_data, sizeof(m_data)); > } > @@ -425,8 +423,7 @@ test_op_new_mode(uint8_t session_less) > uint32_t len =3D IV_OFFSET + MAXIMUM_IV_LENGTH; > op->private_data_offset =3D len; > /* Fill in private data information */ > - rte_memcpy(&m_data.response_info, &response_info, > - sizeof(m_data)); > + m_data.response_info.event =3D response_info.event; > rte_memcpy((uint8_t *)op + len, &m_data, sizeof(m_data)); > } >=20 > -- > 2.25.1