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 3F847A034F; Sat, 16 Oct 2021 10:08:45 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5C1D641109; Sat, 16 Oct 2021 10:08:42 +0200 (CEST) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2083.outbound.protection.outlook.com [40.107.243.83]) by mails.dpdk.org (Postfix) with ESMTP id 6E3E941168 for ; Sat, 16 Oct 2021 10:08:40 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fudzK7yMbkSQ1jWF1dGIy8Vg1UDHF7ux3HyzhEQbVTrir1ON3Ep2E0P5gBq/PriH8NUfiDGKYGBQyMpQ2ummk4R/rvpntpXGWAE+Gxew6dzFHERRueiUFnNSaAy69g96wVpeWSJC/Z/dovuxqDttHbnnUhR6HkRzAHmJnYeTpCuCR4ueZowVi2hynsaP7HLnZzji74hEIqokRnWb7gCMa2CJ3gVv/tmjRtXhk9FNQACYS4zNbfPB9eDcEQUTlof57Ae5fsbPcmrxUIEpq8J4RD7iD3x0eO2v0fskOvX42P4h+wcfCodApNwicfKLIbogDkO1YLcfdukO8Fy3Do4rEg== 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=HohoPshZdcV8oSfupBRSmjT0+dbwo1ahCAxThkWrVj4=; b=epaU0YSBi/TK+iKva6ESv0gKIioPWhk2ZfD9avAsDVa0IQQv+hrbTU8351FAboFaZvD7d1taft4hEi2dwGnpJlYL+XwUn/YiUaTbq3V2mIcaZ2yGGpp2Gz8CVitEU2IXeZjUJq7BoCZOYffP8sY5K9TQoRRyDrAgl1+fIsHwjT+QtFzNsCTonX4i+n0OebRszOfXYW/XtCASm/6bzQH6k6F79vWfEyJwiwIl8n9qLf5SAnKtkcjjr3+tk46yVLuSKL+L1Ljr7evTU/eNVQGtfoP0zXyky2ZfC7aPRahuDiv82dTGOeWlh7aM9Afl96tgIAfNLIOzFFex0nCgA8rOaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.34) smtp.rcpttodomain=dpdk.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=quarantine 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=HohoPshZdcV8oSfupBRSmjT0+dbwo1ahCAxThkWrVj4=; b=HyGuDrrr0y+Ur8le0GKUczBFTT0YXMxYj6PB2kT+INELQIVW4LX5U/N094DCO+677VR+sLZpQrYjhCvBBk68PWakseSlp1jtbKtQrxx3tM3EKeToZPURk9sNvUaHRaGEkv/7712+NDtXtU4mSkjm3kWBYSTGfF4f5pI+0Nkwwymgxn9YUPK+nPVzxBHhcxLGwkeEoFWv0s9xUUxUk6bW/3SGY0WaJvQlPn9KzTr+SCf5D8bNQpw4ZZ+DNYlbTdD64ZQtcODbWoKF6h9seXzY+iTQokU7e1PxVN9yS32lQsYDBCA/vkxbwIVwZytcBzJexiI4DB2XZ2hqyF7X/Jkemw== Received: from MW4PR04CA0274.namprd04.prod.outlook.com (2603:10b6:303:89::9) by MN2PR12MB4045.namprd12.prod.outlook.com (2603:10b6:208:1d6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.16; Sat, 16 Oct 2021 08:08:38 +0000 Received: from CO1NAM11FT017.eop-nam11.prod.protection.outlook.com (2603:10b6:303:89:cafe::ec) by MW4PR04CA0274.outlook.office365.com (2603:10b6:303:89::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.14 via Frontend Transport; Sat, 16 Oct 2021 08:08:37 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) smtp.mailfrom=nvidia.com; dpdk.org; dkim=none (message not signed) header.d=none;dpdk.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.34 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.34; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.34) by CO1NAM11FT017.mail.protection.outlook.com (10.13.175.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4608.15 via Frontend Transport; Sat, 16 Oct 2021 08:08:36 +0000 Received: from nvidia.com (172.20.187.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Sat, 16 Oct 2021 08:08:32 +0000 From: Xueming Li To: CC: , Viacheslav Ovsiienko , "Lior Margalit" , Matan Azrad , Dong Zhou Date: Sat, 16 Oct 2021 16:07:30 +0800 Message-ID: <20211016080732.1781622-7-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211016080732.1781622-1-xuemingl@nvidia.com> References: <20210927083256.337450-1-xuemingl@nvidia.com> <20211016080732.1781622-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 819b34c2-0068-455e-561f-08d9907c2800 X-MS-TrafficTypeDiagnostic: MN2PR12MB4045: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: RxJ7DPm9H/a2KCEXolWktmyMo/8y+r0NCzhXm4UdK355abeFuC80mCzEmBZZvyo8F3KHuedRWjhlDSyDkmhhEG8RCmz8thjZbnUfP74wkSbBCWfYRrThVoNqwGMZYmDnqdSbY1psrRxIOurr8JQOlQ/KElQEN6lSLvVsRk1uShiIixzbHNBMljFERaeWN8qd3pr3WwviLA4fpkx0XBdZAqfm3sVAYyqYa+0Ho6ihukzHlfvw5AJzRiEJKH56LMOjQt7aM4y4Esg5Vz8ZHteJFoH1mUjQ9Hel5jg3setWIjeEcGImoLPKC0IAWzpfEk5eXVrhSg64FmjGjAxonI6wh0gC9j1qHt8ugyvYz6yTi9N9RIflvSLvG1TUEVA9CsiUsWwyXKdIufPAkAd76aaMYa+3zZ0oXcLn96k+uqis4UqdsSBdq57+EnGecSAewHnd27k+IiiGkbR1ZvKNvt99rIHpDqXMpe84TXZdYQHyivFDZx0TuwC5UXD+gZLjcLlqJJt+HiXaliAoXCEM/WUuGzRv24Nfld30krG4aTLjNqDHXFAEZD9EePziRxiKw1Nc4YDX9u1lU40TqE48Yv4j0OuN0D0teSj8vwID/CaFNPUyOPd1PRt3P4HhaU2QNCl8cadEJKd14wB0wYWJusVEEUIcxcYJE+nHmViNpn10nmYPlgtbun8mE/4pjmMyvPMs2I5FEfv9FSgT4jHuU+Pyrg== X-Forefront-Antispam-Report: CIP:216.228.112.34; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:schybrid03.nvidia.com; CAT:NONE; SFS:(4636009)(36840700001)(46966006)(508600001)(4326008)(316002)(8676002)(70586007)(70206006)(6916009)(54906003)(7696005)(83380400001)(426003)(1076003)(36860700001)(336012)(2616005)(86362001)(47076005)(82310400003)(55016002)(26005)(186003)(16526019)(6286002)(107886003)(356005)(36756003)(2906002)(7636003)(5660300002)(8936002); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2021 08:08:36.6733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 819b34c2-0068-455e-561f-08d9907c2800 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.112.34]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT017.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR12MB4045 Subject: [dpdk-dev] [PATCH v2 6/8] net/mlx5: fix internal root table flow priroity 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" When creating internal transfer flow on root table with lowerest priority, the flow was created with max UINT32_MAX priority. It is wrong since the flow is created in kernel and max priority supported is 16. This patch fixes this by adding internal flow check. Fixes: 5f8ae44dd454 ("net/mlx5: enlarge maximal flow priority") Signed-off-by: Xueming Li --- drivers/net/mlx5/mlx5_flow.c | 7 ++++++- drivers/net/mlx5/mlx5_flow.h | 4 ++-- drivers/net/mlx5/mlx5_flow_dv.c | 3 ++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index c914a7120cc..b5232cd46ae 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -980,13 +980,15 @@ mlx5_get_lowest_priority(struct rte_eth_dev *dev, * Pointer to device flow rule attributes. * @param[in] subpriority * The priority based on the items. + * @param[in] external + * Flow is user flow. * @return * The matcher priority of the flow. */ uint16_t mlx5_get_matcher_priority(struct rte_eth_dev *dev, const struct rte_flow_attr *attr, - uint32_t subpriority) + uint32_t subpriority, bool external) { uint16_t priority = (uint16_t)attr->priority; struct mlx5_priv *priv = dev->data->dev_private; @@ -995,6 +997,9 @@ mlx5_get_matcher_priority(struct rte_eth_dev *dev, if (attr->priority == MLX5_FLOW_LOWEST_PRIO_INDICATOR) priority = priv->config.flow_prio - 1; return mlx5_os_flow_adjust_priority(dev, priority, subpriority); + } else if (!external && attr->transfer && attr->group == 0 && + attr->priority == MLX5_FLOW_LOWEST_PRIO_INDICATOR) { + return (priv->config.flow_prio - 1) * 3; } if (attr->priority == MLX5_FLOW_LOWEST_PRIO_INDICATOR) priority = MLX5_NON_ROOT_FLOW_MAX_PRIO; diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h index c25af8d9864..f1a83d537d0 100644 --- a/drivers/net/mlx5/mlx5_flow.h +++ b/drivers/net/mlx5/mlx5_flow.h @@ -1431,8 +1431,8 @@ uint32_t mlx5_flow_adjust_priority(struct rte_eth_dev *dev, int32_t priority, uint32_t mlx5_get_lowest_priority(struct rte_eth_dev *dev, const struct rte_flow_attr *attr); uint16_t mlx5_get_matcher_priority(struct rte_eth_dev *dev, - const struct rte_flow_attr *attr, - uint32_t subpriority); + const struct rte_flow_attr *attr, + uint32_t subpriority, bool external); int mlx5_flow_get_reg_id(struct rte_eth_dev *dev, enum mlx5_feature_name feature, uint32_t id, diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c index 4a17ca64a2e..ffc1fc8a05c 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -13646,7 +13646,8 @@ flow_dv_translate(struct rte_eth_dev *dev, matcher.crc = rte_raw_cksum((const void *)matcher.mask.buf, matcher.mask.size); matcher.priority = mlx5_get_matcher_priority(dev, attr, - matcher.priority); + matcher.priority, + dev_flow->external); /** * When creating meter drop flow in drop table, using original * 5-tuple match, the matcher priority should be lower than -- 2.33.0