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 91EA341D8D for ; Mon, 27 Feb 2023 08:14:07 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D59541148; Mon, 27 Feb 2023 08:14:07 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 1AEDF40A84 for ; Mon, 27 Feb 2023 08:14:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MVOqf6930pwNAvOOqqfJjBqJRVXFyGMYlLN9ZNLSi0zZWw15tEcWF6BJOSb8LhSK0n0ZTbpj/MudM4ppgkzmeydNhbvjNIMnmD16s0rv8V/RC9/lGKifyInjTEcvjxjN97D18jCKInIppw/yVktE6UR4roO+rfbp36XVexQyVpvnaPTqOSekuFF/QJKp0P94cQJobZ31+kjKgpyQdQ3ItAteZRZTJiehhvX7dbgeMPVWVNZKISvxuwrJnNERiptAtoO7cO1RDiwZ0fwR83Hki6/rQ4Ou8dsSeTsd4+vP/9nTB6Tmr7eSpfh9TGvS/tHx9s0zSGourzSQYFEuy7/ViQ== 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=0KOBguz3TQOOGhu7hhe0XbYHVQTxU47cfBJbDaovMts=; b=KB+fKQX0UiRYR1Ilpg8au/iG5G9x9grupOLpT43nMj/csI7/p4dU2JYOCeF0XZafltoKNB2TYnlDM3eccvv+bMeif/TjKu/XaZvu+Q3k+3wiYheEim7RdvdoH9LtaX/xM76DGpW2WnClYhSPqsgPuUgbFIcYb2A4X7TFWH65z1F235KPzQ5NHCjm8mNjy47cFYiNltGLMpCfRghExi35GJf50B4acSKZ0H2QJjFq123O5rZndmzW4DQKQRTNzYz69JrdjlZWKeq4LJpxQTylfrEFDHhX14iAYpc1lR7o+MVFOngWL3sQsa4H74SGPI6N3uapRXy5albnQHiUjp7hHA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.161) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=0KOBguz3TQOOGhu7hhe0XbYHVQTxU47cfBJbDaovMts=; b=ikzTdHUlPE7aHjEl+QEuN9/p50Y+YKOlgsZhxSVUgB3tR/uKCo+9uEDPtM+TkexUZWKSIb3y8UuDUhS3wry41T+Af3UJqdf2BfMd+yxbZlZFpdoI+sCEz4vGxsxa/e1U2Lr+1xRFr1kaZjiYAnGKPtmmpQ+aKFfDZBfUGRSM7XzAfOoem37XL8DsolISzX/oAH0Xty23j4rUgcyMyNbKPt8HWKhLgUxGRXFHlxlxMESvZNXJfeWOdZbLPZ9ETx/n8qa3HLan58v79D/zWHyJiFAcBQxBY+HOpEbGZOYzMQ4LIVcuDafEmvs01tCq8ACtJVj7XrzscwTRp8RtNJPZBw== Received: from DM6PR12CA0013.namprd12.prod.outlook.com (2603:10b6:5:1c0::26) by MN2PR12MB4077.namprd12.prod.outlook.com (2603:10b6:208:1da::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.27; Mon, 27 Feb 2023 07:14:03 +0000 Received: from DM6NAM11FT016.eop-nam11.prod.protection.outlook.com (2603:10b6:5:1c0:cafe::e0) by DM6PR12CA0013.outlook.office365.com (2603:10b6:5:1c0::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.29 via Frontend Transport; Mon, 27 Feb 2023 07:14:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.161) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.117.161 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.161; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.161) by DM6NAM11FT016.mail.protection.outlook.com (10.13.173.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6156.16 via Frontend Transport; Mon, 27 Feb 2023 07:14:02 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.67) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.36; Sun, 26 Feb 2023 23:13:53 -0800 Received: from nvidia.com (10.126.230.37) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.37; Sun, 26 Feb 2023 23:13:50 -0800 From: Xueming Li To: Dariusz Sosnowski CC: Bing Zhao , Ori Kam , dpdk stable Subject: patch 'net/mlx5: fix available tag registers calculation for HWS' has been queued to stable release 22.11.2 Date: Mon, 27 Feb 2023 15:00:26 +0800 Message-ID: <20230227070107.15664-118-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230227070107.15664-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230227070107.15664-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.37] X-ClientProxiedBy: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DM6NAM11FT016:EE_|MN2PR12MB4077:EE_ X-MS-Office365-Filtering-Correlation-Id: b8090180-88d1-4ca7-0673-08db189234b0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0lkrUQzugSPpllHqIQkstLg0+yzoPCjxVB3GdWILnMl3ecogyK/T6lKmgvJer6/dqkePAOzgCAjSdl70oXcn84y+YKqqq9aqSM4ZY5DUVWb3U6v/p5HJmcmPc+f3R70PmcBRgjoacLt+t0ImNKHgJjMboXjLAv0fcQTvRnG9rre6lCXQxVMCkhlEm2j/brZo3+H9UOlf16EJKRFwY0K/QVXYjViL3PotUnIpb3JQ4CYrZ0GxvPlPBzLL0fQge2QOVo8Ovn2BmBAZeyfs6VJs9Q0qg5yr6OQRHxQfpWLaQCrs1KVHZcmfYbZWrN+3wGIh0WR9bOBLuqXdkohUb2IxVNNp04Ia75C5JXziJ7VrgdFT6d2Qxwb+tO2irruzq2Po3dkkOa1abXBqx2RARs5pykitKJzjumxvQ4qHQEENzrCfMdtJNqPYACz1fogRY11lAQUM5vjBjMkLzBYDkU/KckbZR2aYSz947/X67cquj2FBSMKJqfBkS3Nk+WuwQqzkPMhBixJ0lTZZ+jgstk2ljtljBEcd5mr4qpBsl08tX6Pu00dNfUq9nSdnZU7FJtR/1tWnXW9HpRVmn1ihkpPd18ItE/+2nIpdEaj4Qupn/xM6QakxJCKxlsvTxSYgM4TQWn7oR0o65mRqKHJztwRwzTisej9kdN3ejsE3L4DXN2cgxFNYjViggUb8yL2aj7Czumi6+3ZUFcVrKn1pRL4Mz7jktsU/eO6WEiCuTgmY1byBdZ4DzH+zl3tytxhU72WUxdBPqy4CJesvU7qeFDg3UlpbyJuP+zCkwIs6pU9WaymQagjTSvZH5KU8qYaLbmGgITmbFPReEE253n6cQXhKIZ3WjYAb6h9BedbNSIJhQkk= X-Forefront-Antispam-Report: CIP:216.228.117.161; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge2.nvidia.com; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(396003)(136003)(376002)(346002)(451199018)(36840700001)(40470700004)(46966006)(70586007)(70206006)(4326008)(83380400001)(34020700004)(47076005)(41300700001)(36860700001)(426003)(82740400003)(54906003)(316002)(6286002)(36756003)(16526019)(8676002)(336012)(37006003)(6636002)(6862004)(7636003)(8936002)(5660300002)(2616005)(356005)(7696005)(86362001)(2906002)(966005)(478600001)(53546011)(186003)(26005)(40460700003)(82310400005)(55016003)(40480700001)(1076003)(6666004)(131093003); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 07:14:02.9737 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8090180-88d1-4ca7-0673-08db189234b0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.161]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT016.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4077 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 Hi, FYI, your patch has been queued to stable release 22.11.2 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/01/23. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging This queued commit can be viewed at: https://git.dpdk.org/dpdk-stable/commit/?h=22.11-staging&id=dcb16c48e0bda0839c1cc1ad6e955a290614d69b Thanks. Xueming Li --- >From dcb16c48e0bda0839c1cc1ad6e955a290614d69b Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Tue, 22 Nov 2022 12:53:20 +0000 Subject: [PATCH] net/mlx5: fix available tag registers calculation for HWS Cc: Xueming Li [ upstream commit 1888b455dfe2b31d09fbce61e671507313ed451e ] Before this patch, if two ports in separate switch domains were probed by an application, the shared array of available TAG registers was calculated incorrectly. When the intersection of supported REG_C registers and available TAG registers was calculated, capabilities were checked against an index of the TAG array, not the register stored under that index. This patch fixes this behavior by comparing capabilities mask against registers stored in the TAG array. Available TAG registers calculation is also refactored to simplify the code. Fixes: 8a89038f40ca ("net/mlx5: provide available tag registers") Signed-off-by: Dariusz Sosnowski Reviewed-by: Bing Zhao Acked-by: Ori Kam --- drivers/net/mlx5/mlx5_flow_hw.c | 46 +++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow_hw.c b/drivers/net/mlx5/mlx5_flow_hw.c index a3c8056515..20c71ff7f0 100644 --- a/drivers/net/mlx5/mlx5_flow_hw.c +++ b/drivers/net/mlx5/mlx5_flow_hw.c @@ -7178,9 +7178,9 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev) uint32_t meta_mode = priv->sh->config.dv_xmeta_en; uint8_t masks = (uint8_t)priv->sh->cdev->config.hca_attr.set_reg_c; uint32_t i, j; - enum modify_reg copy[MLX5_FLOW_HW_TAGS_MAX] = {REG_NON}; + uint8_t reg_off; uint8_t unset = 0; - uint8_t copy_masks = 0; + uint8_t common_masks = 0; /* * The CAPA is global for common device but only used in net. @@ -7195,29 +7195,35 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev) if (meta_mode == MLX5_XMETA_MODE_META32_HWS) unset |= 1 << (REG_C_1 - REG_C_0); masks &= ~unset; + /* + * If available tag registers were previously calculated, + * calculate a bitmask with an intersection of sets of: + * - registers supported by current port, + * - previously calculated available tag registers. + */ if (mlx5_flow_hw_avl_tags_init_cnt) { MLX5_ASSERT(mlx5_flow_hw_aso_tag == priv->mtr_color_reg); for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) { - if (mlx5_flow_hw_avl_tags[i] != REG_NON && !!((1 << i) & masks)) { - copy[mlx5_flow_hw_avl_tags[i] - REG_C_0] = - mlx5_flow_hw_avl_tags[i]; - copy_masks |= (1 << (mlx5_flow_hw_avl_tags[i] - REG_C_0)); - } - } - if (copy_masks != masks) { - j = 0; - for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) - if (!!((1 << i) & copy_masks)) - mlx5_flow_hw_avl_tags[j++] = copy[i]; - } - } else { - j = 0; - for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) { - if (!!((1 << i) & masks)) - mlx5_flow_hw_avl_tags[j++] = - (enum modify_reg)(i + (uint32_t)REG_C_0); + if (mlx5_flow_hw_avl_tags[i] == REG_NON) + continue; + reg_off = mlx5_flow_hw_avl_tags[i] - REG_C_0; + if ((1 << reg_off) & masks) + common_masks |= (1 << reg_off); } + if (common_masks != masks) + masks = common_masks; + else + goto after_avl_tags; + } + j = 0; + for (i = 0; i < MLX5_FLOW_HW_TAGS_MAX; i++) { + if ((1 << i) & masks) + mlx5_flow_hw_avl_tags[j++] = (enum modify_reg)(i + (uint32_t)REG_C_0); } + /* Clear the rest of unusable tag indexes. */ + for (; j < MLX5_FLOW_HW_TAGS_MAX; j++) + mlx5_flow_hw_avl_tags[j] = REG_NON; +after_avl_tags: priv->sh->hws_tags = 1; mlx5_flow_hw_aso_tag = (enum modify_reg)priv->mtr_color_reg; mlx5_flow_hw_avl_tags_init_cnt++; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-02-27 14:08:44.688866200 +0800 +++ 0119-net-mlx5-fix-available-tag-registers-calculation-for.patch 2023-02-27 14:08:40.879237000 +0800 @@ -1 +1 @@ -From 1888b455dfe2b31d09fbce61e671507313ed451e Mon Sep 17 00:00:00 2001 +From dcb16c48e0bda0839c1cc1ad6e955a290614d69b Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 1888b455dfe2b31d09fbce61e671507313ed451e ] @@ -21 +23,0 @@ -Cc: stable@dpdk.org @@ -31 +33 @@ -index 6893431011..2930f3b0b9 100644 +index a3c8056515..20c71ff7f0 100644 @@ -34 +36 @@ -@@ -7180,9 +7180,9 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev) +@@ -7178,9 +7178,9 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev) @@ -46 +48 @@ -@@ -7197,29 +7197,35 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev) +@@ -7195,29 +7195,35 @@ void flow_hw_init_tags_set(struct rte_eth_dev *dev)