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 7A9CBA034C; Wed, 22 Jun 2022 18:34:52 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1C23640A84; Wed, 22 Jun 2022 18:34:52 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 5C5DC4069F for ; Wed, 22 Jun 2022 18:34:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655915690; x=1687451690; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Vsu+HwLSd1bySsssXF5JkkrCP3dk6w/ZLoOlTi4gd2Q=; b=S4e5UFSNyvPz650whbjrG3CG9T4tgb3tCHW0m4N8ptjqRGtC4A2pp0yR JhgUFTGkdrXrr4x+e/gZXa9ZLofgN8bSvHm2jd42z6JpGlnK1T3vnxyQe /CmtIlanhacaot9gjfIjqQLwO6IJ+w0GVRaLmG/v8lScn+M9/M/qXnBF2 UJ9+dKgolMRnO0OATjTJTe5o93dyZhhOWo/2vR3+MgXoxo36nxsBA+Jp1 3gCJobGlVt4j4L3LteOmcrdrT3ReGgAK7PJatWg7cAgvvRHO+/KtP7UJl i5PUcA1enAZZDXZpomqtM5P61k28YMsioBx7VXpGSxtj1DOSeykdvnaB4 w==; X-IronPort-AV: E=McAfee;i="6400,9594,10386"; a="280515191" X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="280515191" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2022 09:34:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.92,212,1650956400"; d="scan'208";a="655744842" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga004.fm.intel.com with ESMTP; 22 Jun 2022 09:34:49 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 09:34:48 -0700 Received: from fmsmsx604.amr.corp.intel.com (10.18.126.84) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27; Wed, 22 Jun 2022 09:34:48 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.27 via Frontend Transport; Wed, 22 Jun 2022 09:34:48 -0700 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (104.47.55.173) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.27; Wed, 22 Jun 2022 09:34:48 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=L4YuDvoZgEwSnKtjWqSYI72ugWcUKw09VzyB4PnvE3lHW0nRZengwQGiavRej7TmgXDfo4rbiqlUNWl0PEJa5uvNyq6yOIxYE9spTXOKR+No8baEeVoJZCFEiERHBhgOrsToHKcEtjDH7LWLoFuMA1tyAwVTFIaB1r7ZswdDIJcMCkySNfnTVY9vp7wbNW68sbDoXm+2hZn3A9KNGCjur8YRhlh+zfhAtFGjPqdyrhVi3lblZaJO41wT0EsMsoL2WNFdJph4AbBwPmObB2Qw6k1q3Ci7aXRY+I2uLGT/zBmlU7PJKfqE4NV6/mX3r9xjw2vRo2kTsHy1tS8gGHG7Vw== 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=oFE30HB0+MWkcnZNFQ4TAY0HwqahG/XWSMotlIufjqE=; b=LhyiMsZa3OVH+ePsND36mkY3/WB3huyU2OyUlpf6i2Y+a2ucX0S4NxG2UkzC2PhuLcFLjnTAayq/MXotHiIP5mG20QTzc4NJnLzuUOZRX09JDKYZyDXU+0ZqhxbtvTu/glzDAHR74WmCLbXqSte3MU5UeThsElranAK3aI4hIotKIJ0R8qc6DycULqJpnKxgd+NPXipmxuGS8uTSqXDArf4Spjf23VzlLtOs+XACAS8ozG3XGp1NHAWbTiGsXOWqgiU7fkjT05kn0fe2M77Le+Vd5An/bFGnPmGiVYADbLaTiqeyRY0YCHLTR8/JqddOiO15zqmTd8MW+ejexLTP+A== 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 PH0PR11MB5901.namprd11.prod.outlook.com (2603:10b6:510:143::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5353.22; Wed, 22 Jun 2022 16:34:46 +0000 Received: from MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::6537:6de6:7337:1b87]) by MW5PR11MB5809.namprd11.prod.outlook.com ([fe80::6537:6de6:7337:1b87%6]) with mapi id 15.20.5353.016; Wed, 22 Jun 2022 16:34:46 +0000 From: "Zhang, Roy Fan" To: David Marchand , "dev@dpdk.org" CC: "Poczatek, Jakub" , Maxime Coquelin , "Xia, Chenbo" Subject: RE: [PATCH] vhost/crypto: fix descriptor processing Thread-Topic: [PATCH] vhost/crypto: fix descriptor processing Thread-Index: AQHYhk2zWgLX/t56gU+YGFQCNNb91K1bnzwQ Date: Wed, 22 Jun 2022 16:34:46 +0000 Message-ID: References: <20220622153020.2598037-1-david.marchand@redhat.com> In-Reply-To: <20220622153020.2598037-1-david.marchand@redhat.com> Accept-Language: zh-Hans-HK, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.500.17 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: 902d9bcc-2929-45ae-0cb5-08da546d1e3a x-ms-traffictypediagnostic: PH0PR11MB5901: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: de4L495xwPqH0x//w69YbwXqIjHZBMe68jsizSVIAK69QBiaWqYlq4BosD1oyYMA8yUt+IlS0TJ4R18QOg0QPUuJDEOlKlN0oZ5h6AYUH2ay5ySMqqLhdiTONRdMUame6MyFhl160ipMIi3bwDvAJSDcbQ5RCpzSfFBruBwaR1+4/Icbul82B3xaWRle08bHTQ+Y6sPTbJVQQTkU3mqZtHyBE+OaZdPZIiE8Op8VgwEzCS4PoJpZihzkKxXgc7lQSo6+ziDQm6Gr2TLrjIhoOxSLPvRuavmBKJx+f7aCUHluZLOrN38R1cyZXpLfCkvfmBiXFe/O1P1wEmHPDrVylTOC38TJzorDec/RtbEQ5rPMkYArJ96Cq5txhZTNcc26rSQGM4FzgrQR1SuQAqfsKg7kfFA+cMfTZKYHIpLQ6YUc2JEIHQ0fQLVhE31lOwbexDVIxj7WofyCyZ9C+tv8R+sQD/6QNpywAtEBEcVqyvZW+MohHMzdO62J04tN2yvIAMq4qBif0hgM8SVtp91p4YRP7uSEecNMleyyw4UyV5NDYvpOvpJx2s5A+vJbg36AsFg79Oa5XGE22oI9M2ztsR9U+DdFPwYcnHwq+d2enQokpcSwFx+r05mR9DUX2Crh986CVU6uWypMnj3H5Cru5pBRE/Xq0+dY5K7LjAKtb9vCeZcUGQtT+O3eVAQp6LeFI7ISm1AYzbBMMzEqzSUFtxg+AlFCkeViZRz+CsvpMtSvTxuko17FRgfWPLIDHiqITvGqEPJ2G2sYPmOKag9Frw== 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:(13230016)(39860400002)(346002)(396003)(376002)(136003)(366004)(52536014)(110136005)(66556008)(76116006)(64756008)(66946007)(86362001)(66476007)(4326008)(316002)(8676002)(66446008)(71200400001)(54906003)(82960400001)(122000001)(33656002)(38070700005)(38100700002)(8936002)(478600001)(107886003)(186003)(53546011)(7696005)(6506007)(9686003)(26005)(55016003)(83380400001)(41300700001)(5660300002)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?Windows-1252?Q?khVDSHvEP2mMgZdIXPPDe5//0Y76937T7aSl7d0V9YC1SreLdGHkS5m2?= =?Windows-1252?Q?pntcfMiJz4qC/S3LvAVNM6K5gx43Q0DYuX0W0r+idP0cgsKlB7Dr02ys?= =?Windows-1252?Q?+crZbM2RD3ylZ94oYw4TAoycTPYK1s1y5D2riE4UBXDFsk7EtIaoMmMO?= =?Windows-1252?Q?cWpptOm/6NlsR3y5jkjRl9ygLy/+rBpHUiD5NPmwpvGYzG9DscNHCU0u?= =?Windows-1252?Q?7rPxX6FUDNCzq3+lBV8GUDaPJVCpqh9Gu5CQcsP0uxc9egEMhDOUu2Zm?= =?Windows-1252?Q?rdavXcyv41MBjreAirU4ipT1h3+c1fHPBT83SKEVzwj4lrq2TkgNKnbX?= =?Windows-1252?Q?PJr1LB3lemeGfKylYTEIVgqX2MqrdDXrirfJbOkOA9sexrvNvRmcYNG7?= =?Windows-1252?Q?fKXambyHxKy5EICxF/Dis8BUscfWjWP2vRD3SYQKPqKos9BD3b3vLUzO?= =?Windows-1252?Q?cYM10y3pQRMkaErMRUDmVum4y9xahY5KBxlKRvarfJcW4L2Xf9renZrS?= =?Windows-1252?Q?QgUcDLEN6Q6IL2qZvxgke9TkiUAqGkqJqj4Z+/Jg6x83a0SnqazOc8Cv?= =?Windows-1252?Q?YP89Tja5xklMWmMCLh/By/WDRvRpYjDwI3xo+YV7tfQTY/TG898nggGK?= =?Windows-1252?Q?1Zi2Nno/BD2Ul88RK6zGfZX3QuSb4xGgixzxTrOl6QULqCcBc3/l8j5p?= =?Windows-1252?Q?9ZZwcN0/JpesT+P56aebyK0IjqZfYXgMKlvUzdm1vnhq+phfId7N021/?= =?Windows-1252?Q?LMdr3K5lKQIdp9lHqrDfK3g45xjyuGZPYOx6yIL2DYZ/NbBaKThQ3OEn?= =?Windows-1252?Q?TxsO0OalEOxyPnhbZm1fBrXhTxBvARlGF9LQvv7CvH0SJGHS49YGNMEG?= =?Windows-1252?Q?bwH8MAebw2uPsk6qanSk5e6vqWwdevmjMNNpGXyn/MA8zBP6Giz69DMe?= =?Windows-1252?Q?Bz2e0rXxId9KPzGBHb2KXYSoZ0r8G6MWCQfadz347wzxr6ZRw0pCTMgv?= =?Windows-1252?Q?FQke3Q10Ez7rY1mMEPyRGgWO1yau4o3M5qj+YokT5BDy08HVxGQM0x6M?= =?Windows-1252?Q?ebR4CLglxk+MwiTek9hQTJAorhM1nOp0eXORmfljNaFMqWS3g1Dpm7s1?= =?Windows-1252?Q?j9I1jNEtS+BElBaQmLKS0krN1F+52MuTnDpfzfoN9Mriwg6ONwoS/y8I?= =?Windows-1252?Q?CXRpZzOCPqVhsns/1xfuOnTBBDnMUNWjM5vu6K6YmBfa23kcd+THgbQR?= =?Windows-1252?Q?wAo2prREqS49bua9fdvXjyVgtGpwmlC1ElK7nwdh6Lv2AH4YW3SkyynV?= =?Windows-1252?Q?6rXm0bSUKfz6/tCAS/CT8iNLKpRTtxpOtDuXTJfwvkvgKGAfc/0C0J7E?= =?Windows-1252?Q?8JwSqR6ZHs1m68ZgYYd7Udqlkq8uBcb6Hm29WF2v99TFbiM0UgrPEtuB?= =?Windows-1252?Q?bQB5IfJW6UGbi8rAGoQTSfUEfJUlCC6Zh7rjEJ5+m1FQztqR0MHdcCbX?= =?Windows-1252?Q?e18TJl67eGdEcGlg6dqRB8e4V4q/uT5TAnYysRd7Kd8RoeIXbi3sFOBQ?= =?Windows-1252?Q?0JsuHq7v051AfjV/7K2Vx0emZMMe43a6Ppwf57pNzw1OxiqDyuiyp/hy?= =?Windows-1252?Q?v92lnILUa3HhxsBfaEGG3ijsYSTk3pm2C8t+BVpKuEFyhwQhUgifJAiE?= =?Windows-1252?Q?e2zCPqUS3qaC769VaKQwqFLefyCYckbT5vS0kkYbFF3NlaW2w4RPpVWS?= =?Windows-1252?Q?O8OO5+zufU/z1CmYZSwVBJFZ82J1ugE2YtYJv8gfIhS5G2n7ot4vsMZk?= =?Windows-1252?Q?LqZWVlEgvWli62AR8xkJzyhZwiwhzBe4xQ0DJqetQYSGjuEOUJ3P22jc?= =?Windows-1252?Q?j44OJIejUn1Xwg=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: 902d9bcc-2929-45ae-0cb5-08da546d1e3a X-MS-Exchange-CrossTenant-originalarrivaltime: 22 Jun 2022 16:34:46.1323 (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: 9C32QzkQBqWfOCx9Wyxk8HOj3odOv7pos1nvNmx+ZpxRdf++PlpwD8Y0DXt80PZ13fBuTJeJR5JXh+yewBkWAw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR11MB5901 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: David Marchand > Sent: Wednesday, June 22, 2022 4:30 PM > To: dev@dpdk.org > Cc: Zhang, Roy Fan ; Poczatek, Jakub > ; Maxime Coquelin > ; Xia, Chenbo > Subject: [PATCH] vhost/crypto: fix descriptor processing >=20 > copy_data was returning a pointer to an increased (off by one) descriptor= . > Subsequent calls to copy_data in the library were then failing. > Fix this by incrementing the descriptor only if there is some left data > to copy. >=20 > Fixes: 7287660a21e0 ("vhost/crypto: fix build with GCC 12") >=20 > Reported-by: Jakub Poczatek > Signed-off-by: David Marchand > --- > lib/vhost/vhost_crypto.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/lib/vhost/vhost_crypto.c b/lib/vhost/vhost_crypto.c > index 96ffb82a5d..54946f46d9 100644 > --- a/lib/vhost/vhost_crypto.c > +++ b/lib/vhost/vhost_crypto.c > @@ -610,8 +610,7 @@ copy_data(void *data, struct vhost_crypto_data_req > *vc_req, > return -1; > left -=3D copied; > data =3D RTE_PTR_ADD(data, copied); > - desc++; > - } while (desc < head + max_n_descs && left !=3D 0); > + } while (left !=3D 0 && ++desc < head + max_n_descs); >=20 > if (unlikely(left !=3D 0)) > return -1; > -- > 2.36.1 Thanks David.=20 Acked-by: Fan Zhang