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 B9F99A00C5 for ; Thu, 29 Sep 2022 08:51:38 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AC2294114E; Thu, 29 Sep 2022 08:51:38 +0200 (CEST) Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00060.outbound.protection.outlook.com [40.107.0.60]) by mails.dpdk.org (Postfix) with ESMTP id 7112340E5A; Thu, 29 Sep 2022 08:51:36 +0200 (CEST) ARC-Seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=heMgxv6aIrX4je9vWNC75QJoLmCWdpgQsXU5d1M7Tbyn4pcVw1xgMJdpZaObLfaT8AafcQ+TbpyrRKIjSeoPnJZ3Ipc5b5p1aJGngpPE37cAGjICOOzofv5oUMWtJACugZ6xucGDT8wPMifeJdAa6/26mBPL9Te7uSm8XrT/mVHNetkHZiDikdw02Yq4mWtN58/Xs2D8jzgy36Xkq+vcgaYO3EGVU92O2rJl2+fzSkkWa99DtULV04nsviU/5UFnZrKr3uv/Ipf5TXbpWrlviVzeJ1rbzcWfGDYoimm/9YFIP1jhRFX63NU8mvEdnVNXFRQSO9tJM4xNOXHVDW1V4Q== ARC-Message-Signature: i=2; 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=hBrJn0jDU0V+zQZnzu2ZxBexoFjkByTCeNwjT3ilhDs=; b=ZNqK8VoQ/4bEkvscOtOxro8bxKxoSgaY+7nCYvQ49rqLbxyDOP5SnyD/c6B7jQPcNoqSoBBgWZdMGxlO5lsww9EyExyD/FvNGeKkrA08TbVUyvXc7ptWVji9ssZZpIo+SyqlNDyCvm8OoSazQKR4ngE5wHds+27+4qzAE5zxhLeGDjkmTFLiWF5VTHZve3CIo5ACjM8Qbe++R2RQioJSBhKh0PerNOmnDZghZPwAK2XZNEM9OWMLz165DvvzHYDSQWIhDoAKMg9qtWMUEsb5ISDu+/Nf8Bc3c0zELvuBmqQSwBWyjlefOlRd861IPPXeMIjsn/ogEpcTH5fuSyZg+w== ARC-Authentication-Results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=dpdk.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com]) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hBrJn0jDU0V+zQZnzu2ZxBexoFjkByTCeNwjT3ilhDs=; b=s8QF1uBL+TNHxRmn7ESvkwq9WlMf+VjMMBTxSjwMqSjwCjSElkkz0TGBhJSc55WIgXc9bAsEUo1hye5rixBspi1y2f7WPwjwv8+z0r51qU82ltSI4fw/6ZQY+4RYeDgjRyGbnhNcHbMZUwVcK2sIpPTGpjwzSZJaNVQO4GX/jdE= Received: from AS8P189CA0058.EURP189.PROD.OUTLOOK.COM (2603:10a6:20b:458::20) by PAWPR08MB9471.eurprd08.prod.outlook.com (2603:10a6:102:2e5::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 06:51:34 +0000 Received: from VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:458:cafe::44) by AS8P189CA0058.outlook.office365.com (2603:10a6:20b:458::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.20 via Frontend Transport; Thu, 29 Sep 2022 06:51:34 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by VE1EUR03FT009.mail.protection.outlook.com (10.152.18.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.17 via Frontend Transport; Thu, 29 Sep 2022 06:51:33 +0000 Received: ("Tessian outbound 99ee3885c6d5:v128"); Thu, 29 Sep 2022 06:51:33 +0000 X-CR-MTA-TID: 64aa7808 Received: from 24a8a1445acc.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 620D8C09-3C13-457C-9905-05D1ED78626B.1; Thu, 29 Sep 2022 06:51:22 +0000 Received: from EUR03-DBA-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 24a8a1445acc.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Thu, 29 Sep 2022 06:51:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M+kXOMgC0znHTIGZFZI4JF7erwrfRYyvmt9XxlvijUEbiyUOOhkfmCAPZ5/FHlZfc7nAVikvxRaoUM+cM65TXfQeBEKYGYZ9OoFuZSzFduazxOCYspOqZ0g0H9uVI0QMfKyn0nXs5Oab6bhzDGX0A3HQdETMvdMB8QqH8rxZKBY22FG68LTs/SK3Z6d+oy3eqk+BPgCGprY/jRbnzv59ypXuPGDzRRBHfXnRt7/7Dytz/Nyjx4foTgYb/1jA39ITHK7F65Fo0l8nEwFj/vDHCp4dfgagYVQKUwd/uJirIOrsQGufXo4ImB8kzRwy65ypJAYs2kBBjoUGxdQbZv6qIA== 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=hBrJn0jDU0V+zQZnzu2ZxBexoFjkByTCeNwjT3ilhDs=; b=oNAe0GPWqmWeKt9LTGaq0X3qMFharYwgQbh73toez+5FE9Cvmoj7xxn+PbOOdhOjFP4Q+2PcbUSXGk7VlAqNTz38+2qfhU+uyoguWW34Kvjz9/81MPnDQw0H5S0BETGgV9r4wvsJrahZiWyvQaQfLyQgDMugJF55IJiFDRvmk3RIMpvoIXOH5wXnWsEeTvsKqR0Lxgi8zT+/uCTXi4gz5ONl2sdE2mw8aJiIgrrg72UA7wIuL940WdMR8vyqLConrVKf4hpFSIRA14XEv5HQIKGyEdCC/uZTV/FHko1TEDYf8VA30FA4/nYEQ8USgQyJ/Bq19igbYj1JwcuKEXr/cA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hBrJn0jDU0V+zQZnzu2ZxBexoFjkByTCeNwjT3ilhDs=; b=s8QF1uBL+TNHxRmn7ESvkwq9WlMf+VjMMBTxSjwMqSjwCjSElkkz0TGBhJSc55WIgXc9bAsEUo1hye5rixBspi1y2f7WPwjwv8+z0r51qU82ltSI4fw/6ZQY+4RYeDgjRyGbnhNcHbMZUwVcK2sIpPTGpjwzSZJaNVQO4GX/jdE= Received: from AS8PR08MB7080.eurprd08.prod.outlook.com (2603:10a6:20b:401::19) by PAWPR08MB9759.eurprd08.prod.outlook.com (2603:10a6:102:2ee::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5654.26; Thu, 29 Sep 2022 06:51:20 +0000 Received: from AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::28d3:f7d7:b8bd:1a31]) by AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::28d3:f7d7:b8bd:1a31%5]) with mapi id 15.20.5676.019; Thu, 29 Sep 2022 06:51:20 +0000 From: Ruifeng Wang To: Slava Ovsiienko , Ali Alnubani , Matan Azrad CC: "dev@dpdk.org" , Honnappa Nagarahalli , "stable@dpdk.org" , nd , nd Subject: RE: [PATCH] net/mlx5: fix risk in Rx descriptor read in NEON vector path Thread-Topic: [PATCH] net/mlx5: fix risk in Rx descriptor read in NEON vector path Thread-Index: AQHYARdiJ1WjU7kZ9EOdjp3QpWhpI60nHvMAgDGupQCAC1VTAIAC9gwAgAA2mFCAkE0mcA== Date: Thu, 29 Sep 2022 06:51:20 +0000 Message-ID: References: <20220104030056.268974-1-ruifeng.wang@arm.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 09BD8C62AF0EF2458148A2704539E415.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AS8PR08MB7080:EE_|PAWPR08MB9759:EE_|VE1EUR03FT009:EE_|PAWPR08MB9471:EE_ X-MS-Office365-Filtering-Correlation-Id: 340cb987-db03-4090-ad75-08daa1e70c2e x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 4M9JTZPLut3RGxDComXs0WYqrphPiPS8RkfQWAZWVIISABimik/pE/LOZTIHwIkhuBHzz/gROuHpNG+B0foKGpfLvKFYC031iVe5qFZEBEcovcjldfpdtIw1dAFOnXLpVDu5vgHv7r/nLK50h0PucjnQN33K/yeCciFuAKoMneNB9kT7ouQRp8M8YbiPstPtRGxsnCcVVu05o/fzCxCpRPO8RI7VTjix2ikvcYT5cU55MX2tOdnQ1yzj91RHB0U4V0Fx9KZ6L8LWFa8aGBwl8cgYDPaZ5PNdb1lHFzDCRzxqINX7BgcyU7xBBk2g1rmZlsbyMIBPXw8uJYxEuJ43ZKXUWMFshRpnbFg3vIPlJIOB4JDzSNg2sdpGTjgkdhia6L2JcIiNvT+qVmzdj8m/D0Yu/xQhmb5Ym1Gd6YqCPCODxt/6S7Sv+QXzlfviUY2hHiLmLcnO5NNrShKmL6T/XFF7eCuphlw2HldHWxuJ8i5ZXW1cI2YtCKWWPiIERC8XxVcZTo9s3S3PUiNoYQOqHTdCgO8VRoHE3ohBfg+n39vLGYs/oYK9N8RVyu8gaIERI4hsg9QK8gC+Y2WGzRnqbBLlsmLMA6yAQDBhMKhMdw7H6dQXVE9E7XzqfYaXHyyKCaMi89AuK6/Dr0Ln8vkB5/MCbN2+UX10ZdvedlAiVPI3wXYXzAIbwkPSDRaBGYmy8RC4xblybJXnCDvJaHqoZ/6w7+K3oVSTO8RnVPeNdkuK00Ny8L+u1x1Nd2F91najPPuQ1Z+PC1MPmrCYZAtBcA== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7080.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(346002)(366004)(376002)(396003)(136003)(39860400002)(451199015)(478600001)(55016003)(41300700001)(6506007)(9686003)(26005)(53546011)(7696005)(122000001)(54906003)(38100700002)(316002)(110136005)(83380400001)(8676002)(86362001)(186003)(64756008)(2906002)(71200400001)(66946007)(4326008)(76116006)(33656002)(66556008)(66476007)(5660300002)(8936002)(38070700005)(52536014)(66446008); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9759 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 387d0a0c-705f-4bf7-a6c7-08daa1e70432 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: c0KR2ss8knwQEko78TrH2fvPfpu/N9rC37ASIDAgEFBsl80H8m+VjVrhCpkS74sHC9mw2H+HRI1bdcRzlGuzVMuUTCWGSRUzXMDgrIVqn/vqrdm+hN44SmMWwVYPZq2NPY1yZXTjbR7BxdOXlzJXr35kUn9vbwRay0oZtxs2IwM19pJXskWXJdXE555Qyo3mEM0NE5HjagV00S7UGoa/okoCHl4gcVgZJm8Z+Ld50h9nZWd438G3L1X00cU7I2W4l6On604ydtf/HyWCUXs5+ljf54L7hTHPqo2gOmiDuByShxPzxwSht4qWwNOr0BOmfLsS4sVP2A17aGnGb6bLOnMqoOlljcYnD2pwsuOaEaJ1k9L3tzOsXFrtExTGwBFB0sapJZUSBExN9540Qn7Z8pf5QQtsbzT/6/XszFvN6oTeTnUaCDzGed6/gdVrLZrZenwYAg8qbEZ/vwDbzpIuV7PrxKe2osXFW46zJz0eTI/r0H/8f0wlbSGFDkdMCklo+yKIAyhnGtBZpW0QDod3vTk6CrdAcQ7enqSqqySoeQNlg1Noz0AVN4SaubeT6o9dXja4Ddq1MJZptl6poaoiJgNxAMS0r1bcbypK6z1PYS81B77Zok7vaWNn1b6M2WxiOPRzoB7D0GHASxjKKSIKav9fpSZne3C3aPlblMTXg1EOgngvFY4S++a4sHCBF6iQJhVTsmLGk0fg6g5si72ZZTMjT4e/OczxCqbECcYaLtZHewdSBhu1cT4+WbvKACa6vbOAS8u/KpeSkZg94Wj2Bw== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230022)(4636009)(136003)(376002)(346002)(39860400002)(396003)(451199015)(36840700001)(40470700004)(46966006)(110136005)(4326008)(54906003)(316002)(40480700001)(70206006)(86362001)(450100002)(70586007)(55016003)(8676002)(82310400005)(5660300002)(52536014)(6506007)(8936002)(53546011)(26005)(83380400001)(47076005)(9686003)(36860700001)(7696005)(40460700003)(41300700001)(82740400003)(81166007)(186003)(478600001)(33656002)(2906002)(336012)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2022 06:51:33.8843 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 340cb987-db03-4090-ad75-08daa1e70c2e X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: VE1EUR03FT009.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR08MB9471 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org > -----Original Message----- > From: Ruifeng Wang > Sent: Wednesday, June 29, 2022 7:41 PM > To: Slava Ovsiienko ; Ali Alnubani ; Matan > Azrad > Cc: dev@dpdk.org; Honnappa Nagarahalli ; st= able@dpdk.org; nd > ; nd ; nd > Subject: RE: [PATCH] net/mlx5: fix risk in Rx descriptor read in NEON vec= tor path >=20 > > -----Original Message----- > > From: Slava Ovsiienko > > Sent: Wednesday, June 29, 2022 3:55 PM > > To: Ruifeng Wang ; Ali Alnubani > > ; Matan Azrad > > Cc: dev@dpdk.org; Honnappa Nagarahalli ; > > stable@dpdk.org; nd ; nd > > Subject: RE: [PATCH] net/mlx5: fix risk in Rx descriptor read in NEON > > vector path > > > > Hi, Ruifeng > > > > > -----Original Message----- > > > From: Ruifeng Wang > > > Sent: Monday, June 27, 2022 14:08 > > > To: Slava Ovsiienko ; Ali Alnubani > > > ; Matan Azrad > > > Cc: dev@dpdk.org; Honnappa Nagarahalli > > ; > > > stable@dpdk.org; nd ; nd > > > Subject: RE: [PATCH] net/mlx5: fix risk in Rx descriptor read in > > > NEON vector path > > > > > > > -----Original Message----- > > > > From: Slava Ovsiienko > > > > Sent: Monday, June 20, 2022 1:38 PM > > > > To: Ali Alnubani ; Ruifeng Wang > > > > ; Matan Azrad > > > > Cc: dev@dpdk.org; Honnappa Nagarahalli > > > > ; stable@dpdk.org; nd > > > > Subject: RE: [PATCH] net/mlx5: fix risk in Rx descriptor read in > > > > NEON vector path > > > > > > > > Hi, Ruifeng > > > > > > Hi Slava, > > > > > > Thanks for your review. > > > > > > > > My apologies for review delay. > > > > > > Apologies too. I was on something else. > > > > > > > As far I understand the hypothetical problem scenario is: > > > > - CPU core reorders reading of qwords of 16B vector > > > > - core reads the second 8B of CQE (old CQE values) > > > > - CQE update > > > > - core reads the first 8B of CQE (new CQE values) > > > > > > Yes, This is the problem. > > > > > > > > How the re-reading of CQEs can resolve the issue? > > > > This wrong scenario might happen on the second read and we would > > > > run into the same issue. > > > > > > Here we are trying to ordering reading of a 16B vector (8B with > > > op_own > > > - high, and 8B without op_own - low). > > > The first read will load 16B. The second read will load and update > > > low 8B (no op_own). > > OK, I got the point, thank you for the explanations. > > Can we avoid the first reading of low 8B (no containing CQE owning fiel= d)? > > > > I mean to update this part to read only upper 8Bs: > > /* B.0 (CQE 3) load a block having op_own. */ > > c3 =3D vld1q_u64((uint64_t *)(p3 + 48)); > > /* B.0 (CQE 2) load a block having op_own. */ > > c2 =3D vld1q_u64((uint64_t *)(p2 + 48)); > > /* B.0 (CQE 1) load a block having op_own. */ > > c1 =3D vld1q_u64((uint64_t *)(p1 + 48)); > > /* B.0 (CQE 0) load a block having op_own. */ > > c0 =3D vld1q_u64((uint64_t *)(p0 + 48)); > > /* Synchronize for loading the rest of blocks. */ > > rte_io_rmb(); > > > > Because lower 8Bs will be overlapped with the second read (in your > > patch) and barrier ensures the correct order. >=20 > Hi Slava, >=20 > Yes, your suggestion is valid. > Actually, I tried that approach: load higher 8B + barrier + load lower 8B= + combine the > two 8Bs into a vector. > It also has no observable performance impact but generates more instructi= ons compared to > the current patch (the 'combine' operation). > So I followed current approach. >=20 > Thanks. > > Hi Slava, Are there any further comments? Thanks, Ruifeng