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 C0966428F8 for ; Sun, 9 Apr 2023 17:36:23 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BAF3442D0D; Sun, 9 Apr 2023 17:36:23 +0200 (CEST) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2073.outbound.protection.outlook.com [40.107.244.73]) by mails.dpdk.org (Postfix) with ESMTP id 9A2DB427EE for ; Sun, 9 Apr 2023 17:36:22 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UsKrReDlMM3VJc4pW9sl888ubV97CeF8ue+pHBKKN7GjA+qBbHltqEpAPDe/U4oaZWocT5cVQz9eOEaUaTFagrwhBCAqABWM+T5yevxgKkFLwCaeomSqRDdkicTEIInqDdR4DFmnb63ZJBkZbcEW5stRJX8I26bGn1x2XeE0qwhZmlIgFp5Y/1F0cOOK7Id4jhXHCO1bd+mfq04E1NvRYpniY37y6sTw9BIbuk2da0/oLmIm7BTjVxSBYWEwmGlot/tPOS+/tYy/gVIRge9g5dBLIWuDHPOr36TT+84mFy5eevwrxeWOrVdbt8tK5uTlpGS6PZIomx63mhGotGo3OA== 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=NLVATS/YoLfp59/nrA/uDKyBm6tnaAYVr2PidyBEt2k=; b=Mod5dZsGv8IL/pDZDPvJixrh1fmXMA7fJryCf0ws/SgMR7n0INMOC74BvNyYFL16IaeqgYuwe0pJwlLwZj1emKDp36S9gDCpabaNs/rvfAlVAWnvwm5/pOk6oXmM3j0Uib/C4frED2Y5nfBEld7C05TyoceeAJpJhzqtVwB+p4x3CpPtRAw0Ef5GkO0YpurIAwoUJpRD/ftV39/e89iQUkgphdXyvIzQxNASwKPveq5pn3FxZ7rb/LIiwhA3NR9Ftz6uagHmUhEXfhCs90Yd5Cv1+LAVgmNNvPmCbT/eKW0sqXMzGW9V9Z7uMyaDMTbiVlUufWPxWgwVT2aQYEJbqw== 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=NLVATS/YoLfp59/nrA/uDKyBm6tnaAYVr2PidyBEt2k=; b=G9LPVO9pLcOyNo4MC8b/84HFgPBFBswgQQ7PDoIYg85UPt2J0DvegkqJugD4rb3O3COKO8WP+1gBn5PubGk2ipFqpA0ihhAA0WTosip5U3Vixz4xQSf3n5NX04HfvYwWiKTr3H+yqBdebMZjGoZ+JWid0U38aXc6Zjmpum9x5ZWypuufpEkSkwX2+AowzAx0NrbFpm0Rsl8Biw12iH5Ozb5cVuBoC8LpVyK6RFY90yao8pKN2TlzgzJBpTZqepX74yENcmb740ZVRZadfSp3hX4ichMtwTIY5XuI022QCVFhBBUa4K/TG6utPYxoUhei7fFrHEqOk+aqVHkiP7b3kQ== Received: from BN9PR03CA0267.namprd03.prod.outlook.com (2603:10b6:408:ff::32) by BY5PR12MB4115.namprd12.prod.outlook.com (2603:10b6:a03:20f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.36; Sun, 9 Apr 2023 15:36:18 +0000 Received: from BN8NAM11FT089.eop-nam11.prod.protection.outlook.com (2603:10b6:408:ff:cafe::43) by BN9PR03CA0267.outlook.office365.com (2603:10b6:408:ff::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.39 via Frontend Transport; Sun, 9 Apr 2023 15:36:18 +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 BN8NAM11FT089.mail.protection.outlook.com (10.13.176.105) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.20 via Frontend Transport; Sun, 9 Apr 2023 15:36:17 +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.5; Sun, 9 Apr 2023 08:36:07 -0700 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, 9 Apr 2023 08:36:05 -0700 From: Xueming Li To: Dariusz Sosnowski CC: Ori Kam , Suanming Mou , "Matan Azrad" , dpdk stable Subject: patch 'net/mlx5: fix isolated mode if no representor matching' has been queued to stable release 22.11.2 Date: Sun, 9 Apr 2023 23:25:11 +0800 Message-ID: <20230409152529.5308-124-xuemingl@nvidia.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230409152529.5308-1-xuemingl@nvidia.com> References: <20230227062349.13764-1-xuemingl@nvidia.com> <20230409152529.5308-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: rnnvmail203.nvidia.com (10.129.68.9) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT089:EE_|BY5PR12MB4115:EE_ X-MS-Office365-Filtering-Correlation-Id: 0fd4e556-2ab1-41fd-1ff0-08db39102983 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j3HgITG7lsemb6U1iaIT0VbIY6juQSs27WcN5AA8S40+vYp7bydMEjAUgaEkE5UZWlRmiOCLRFIYHRTLpVPKir75jQiss1jxoNyTSyVILGCD/dFydOTx1+CFNoxdD0smCRmjnbBqNrgS8RkZwJEs7c6TMVim/nD9JAcTjrpvkZgQJvJiB0twWwkG1Yl0Y6/Oc3bzpEQKmS0OdtSPhcVM1Yvjns3XXWpOPr5ol0j+Kqb5RNyWwlwid7Tdj31H2yi5gEQwpcUvfNMWfMY3CeIrhRlh2+3PBqUwn5GACLAoZ6eyFJzarmkQE/ewDYxN+caRj2B4nStuvinaOMz1bFfA19orF0+jP7dJHWZSQlYrocwyDHXBactdnHV29O7R2BcQM1jWs8OFaTsJIOfQEboXkWbbVtQWQRua2D3DDZL0BzDwgNEsYT6iTTIlp9bIbfUn/Goi7xkRLeb/+K5lcDWQ0yEH0jrc9ABdnUzXHDf2sBRKXmdf+q0haPDSUW0OSmWxMA/Bgq50jcGdAc2I80mkRuFdVzK9F7zIkLTZnoQQpIHH3Gn9CuA6Rjvc7HGCt2kDfQMChKHySCz3Bu4ifLgGPTXDVVSvhwyzgrNsB+sHtUXKSWC4A93Gvuf5heYyhiJ4aNf2hVKDvXk9xiRiAEspSzEpuR9eWkEpy2gLv75RWrwdvfzvofIuNVj2pby2WokS28DtbnyazLEXtPTlidU5BZARd+CBaHdT6WMJj5wYNlyIbCzZliLrDbjLM419SPVR9lGTLUmQh3Kk8r1lDGWXobUJ8rdkn6wqFx+N1sDrhQcd3Lv4PmgcvgJRzMNXQhAAnCQ4soIOZqJGZxESLdACmQ== 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:(13230028)(4636009)(136003)(396003)(346002)(39850400004)(376002)(451199021)(36840700001)(46966006)(70206006)(8676002)(6636002)(966005)(4326008)(54906003)(478600001)(7696005)(70586007)(41300700001)(37006003)(316002)(86362001)(36756003)(83380400001)(47076005)(2616005)(426003)(336012)(1076003)(26005)(6666004)(53546011)(8936002)(2906002)(5660300002)(82310400005)(55016003)(6862004)(40480700001)(82740400003)(356005)(7636003)(186003)(6286002)(16526019)(36860700001)(309714004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2023 15:36:17.9901 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0fd4e556-2ab1-41fd-1ff0-08db39102983 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: BN8NAM11FT089.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR12MB4115 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 04/11/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/log/?h=22.11-staging/commit/0680a33bc76cc4d1e5a5835d1d491191feee9ecb Thanks. Xueming Li --- >From 0680a33bc76cc4d1e5a5835d1d491191feee9ecb Mon Sep 17 00:00:00 2001 From: Dariusz Sosnowski Date: Sat, 25 Feb 2023 20:18:10 +0000 Subject: [PATCH] net/mlx5: fix isolated mode if no representor matching Cc: Xueming Li [ upstream commit 042f52ddd71926afacc67209c02486e76ec12fb5 ] In HW steering mode, when running on an E-Switch setup, mlx5 PMD provides an ability to enable or disable representor matching (through `repr_matching_en` device argument). If representor matching is enabled, any ingress or egress flow rule, created on any port representor will match traffic related to that specific port. If it is disabled, flow rule created on one of the ports, will match traffic related to all ports. As a result, when representor matching is disabled, PMD cannot correctly create control flow rules for receiving default traffic according to port configuration. Since each port representor in the same switch domain, can have different port configuration and flow rules do not differentiate between ports, these flow rules cannot be correctly applied. In that case, each port works in de facto isolated mode. This patch makes sure that if representor matching is disabled, port is forced into isolated mode. Disabling flow isolated is forbidden. Fixes: 483181f7b6dd ("net/mlx5: support device control of representor matching") Signed-off-by: Dariusz Sosnowski Acked-by: Ori Kam Acked-by: Suanming Mou Acked-by: Matan Azrad --- doc/guides/nics/mlx5.rst | 3 +++ drivers/net/mlx5/linux/mlx5_os.c | 16 ++++++++++++++++ drivers/net/mlx5/mlx5_flow.c | 4 ++++ 3 files changed, 23 insertions(+) diff --git a/doc/guides/nics/mlx5.rst b/doc/guides/nics/mlx5.rst index 51f51259e3..75ac2f19b4 100644 --- a/doc/guides/nics/mlx5.rst +++ b/doc/guides/nics/mlx5.rst @@ -1121,6 +1121,9 @@ for an additional list of options shared with other mlx5 drivers. - 0. If representor matching is disabled, then there will be no implicit item added. As a result, ingress flow rules will match traffic coming to any port, not only the port on which flow rule is created. + Because of that, default flow rules for ingress traffic cannot be created + and port starts in isolated mode by default. Port cannot be switched back + to non-isolated mode. - 1. If representor matching is enabled (default setting), then each ingress pattern template has an implicit REPRESENTED_PORT diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index a71474c90a..2cce0a7f0f 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -1613,6 +1613,22 @@ err_secondary: err = EINVAL; goto error; } + /* + * If representor matching is disabled, PMD cannot create default flow rules + * to receive traffic for all ports, since implicit source port match is not added. + * Isolated mode is forced. + */ + if (priv->sh->config.dv_esw_en && !priv->sh->config.repr_matching) { + err = mlx5_flow_isolate(eth_dev, 1, NULL); + if (err < 0) { + err = -err; + goto error; + } + DRV_LOG(WARNING, "port %u ingress traffic is restricted to defined " + "flow rules (isolated mode) since representor " + "matching is disabled", + eth_dev->data->port_id); + } return eth_dev; #else DRV_LOG(ERR, "DV support is missing for HWS."); diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 1768ec3cdb..fd57eafe3a 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -7972,6 +7972,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, "port must be stopped first"); return -rte_errno; } + if (!enable && !priv->sh->config.repr_matching) + return rte_flow_error_set(error, ENOTSUP, RTE_FLOW_ERROR_TYPE_UNSPECIFIED, NULL, + "isolated mode cannot be disabled when " + "representor matching is disabled"); priv->isolated = !!enable; if (enable) dev->dev_ops = &mlx5_dev_ops_isolate; -- 2.25.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2023-04-09 21:45:41.916309700 +0800 +++ 0123-net-mlx5-fix-isolated-mode-if-no-representor-matchin.patch 2023-04-09 21:45:38.799042200 +0800 @@ -1 +1 @@ -From 042f52ddd71926afacc67209c02486e76ec12fb5 Mon Sep 17 00:00:00 2001 +From 0680a33bc76cc4d1e5a5835d1d491191feee9ecb Mon Sep 17 00:00:00 2001 @@ -4,0 +5,3 @@ +Cc: Xueming Li + +[ upstream commit 042f52ddd71926afacc67209c02486e76ec12fb5 ] @@ -28 +30,0 @@ -Cc: stable@dpdk.org @@ -41 +43 @@ -index ddb33d814c..7960a42e9c 100644 +index 51f51259e3..75ac2f19b4 100644 @@ -44 +46 @@ -@@ -1166,6 +1166,9 @@ for an additional list of options shared with other mlx5 drivers. +@@ -1121,6 +1121,9 @@ for an additional list of options shared with other mlx5 drivers. @@ -55 +57 @@ -index 569565c727..980234e2ac 100644 +index a71474c90a..2cce0a7f0f 100644 @@ -58 +60 @@ -@@ -1622,6 +1622,22 @@ err_secondary: +@@ -1613,6 +1613,22 @@ err_secondary: @@ -82 +84 @@ -index 2514b33332..19f7f92717 100644 +index 1768ec3cdb..fd57eafe3a 100644 @@ -85 +87 @@ -@@ -8395,6 +8395,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev, +@@ -7972,6 +7972,10 @@ mlx5_flow_isolate(struct rte_eth_dev *dev,