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 29A21A0C43; Fri, 22 Oct 2021 11:12:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 14F7441198; Fri, 22 Oct 2021 11:12:49 +0200 (CEST) Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2059.outbound.protection.outlook.com [40.107.94.59]) by mails.dpdk.org (Postfix) with ESMTP id 06DD141167; Fri, 22 Oct 2021 11:12:45 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZpbuFWpMLTuUHDMCzmSqWMhRWDHO57tMjDv+N2FLO+uLtWErpPdzAMQWsJeva8UWLMwHgi9rFjztjw86qlKXjl63+xz9Gn6EZIF0ZSbjVpxhWbYJxXpEzj/WC1CVwUZfer5GyqZZs85ThU3cEEOuiIGvoU+6oC72yyif2902x10O3zpqsuCR5+zLfqSEojv5gzy26pbnB9iVVBzhtY+N8NfvhOe/RvQJ+oT0qYkXYp3fsd73WJ4ghUmafFt6WUbMPXkmOL2fYZDMJl4bCSVdlaVajIBxL4BAomyC43aYGFV07NyCV1DZkk4EPQVt3NAfwB+8L1QfgG5vZ7SxxER4Pg== 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=mM/py4RCGj+KkBOFqq7titE1MHYuZGQYgkMrYrR3od4=; b=NF7D5thSnqQMZl05SpIpJd+Ci51i+hAC4J7RDljbB9a6D33K39rHc80san/S1B+ONDFFA693nZ1VtCLpfCpslHqOSrE5qfuj/eigfg8lvV4K4y5slE1ViLDzr90UNyd/yr09Ue5qUye0+4j2ViRU1U7Wmo/tLDnw+JaKCAXH8PTFtY805iq1/WgDlJu9cMxhcPxVjnAe+2Qwvf0DPJ1AbsBFQ3KGHnm6tyNILoyXlrnmid5HuS76J78HOnhTJ4uGS8RZ1rT+0Nxb8e7anTjfTZhnyUWUexp1fYkEVN0FGFqIM3rCBfU/W0Jbf5Mt84pq2RfEyp1VwLJvdyRNwWyYMQ== 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=mM/py4RCGj+KkBOFqq7titE1MHYuZGQYgkMrYrR3od4=; b=PMrRtEIXnkidgF8ZUVZddkfBjEBuXyEV0JG/oDSXUopnBR56yeNqubb7gyOIQwb1rKig7ClYo+jJDGcfNvT9+WuXv3kVqeTI/spbPr7DiwP/EJ6TP4JxGr6xe9XdEod+18EFXVYenOGAF28p37t+s5mP6ERF6k1PSRP6AVLo0VEiBuPVCuu1/rZETJArf3xNADN6J7WCFEKrltPeqop8eiqfbaruAm4ZyAUTOAq17gIHSbdUvW/zHzh996JbzG122krrGnoOWLUi3NCpprb7F9wcPshBjrHHH3MuPTGzoSh9EH+lzIdTzVIvn2nNS7TZWfiPvIx92v7xRzS6lakcZA== Received: from MW4PR03CA0174.namprd03.prod.outlook.com (2603:10b6:303:8d::29) by DM6PR12MB4650.namprd12.prod.outlook.com (2603:10b6:5:1fd::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.18; Fri, 22 Oct 2021 09:12:41 +0000 Received: from CO1NAM11FT005.eop-nam11.prod.protection.outlook.com (2603:10b6:303:8d:cafe::de) by MW4PR03CA0174.outlook.office365.com (2603:10b6:303:8d::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4628.16 via Frontend Transport; Fri, 22 Oct 2021 09:12:41 +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 CO1NAM11FT005.mail.protection.outlook.com (10.13.174.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4628.18 via Frontend Transport; Fri, 22 Oct 2021 09:12:41 +0000 Received: from nvidia.com (172.20.187.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 22 Oct 2021 09:12:38 +0000 From: Xueming Li To: CC: , Viacheslav Ovsiienko , Lior Margalit , , Matan Azrad , Dong Zhou Date: Fri, 22 Oct 2021 17:11:40 +0800 Message-ID: <20211022091142.51397-7-xuemingl@nvidia.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211022091142.51397-1-xuemingl@nvidia.com> References: <20210927083256.337450-1-xuemingl@nvidia.com> <20211022091142.51397-1-xuemingl@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 08e67aa4-d8c0-465e-57a3-08d9953c1a10 X-MS-TrafficTypeDiagnostic: DM6PR12MB4650: 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: Gl9KzutoCrfxTbL6+iPkUVvgbGZ5QPf8JjGqqUsgvIgvpuT1kBFnEkILpAL14D4JVq35ZP3sWcznY3QMUxPkOWLtyj+qNdpoMnj8EgkY5VEygXQceV1XuLzfHjK4Hf7wLqAc6rtUpQnKOnRyeNLFmWlKyEt8RSObuxytioQ6SIs/0Y5ZD8PHSk1JgxSAeWNfA351HR6O3OJ6jtzGe5/i++Xsh8N6fvzDhIJsWw0AWT0FrQn8AbOJhoz+24M4ycqSuWs7MuZDt4321CGD5SrdJtT5nRizKqdULCGwc1Fe0rml4pHDJUQ8sg92xq0hUEuG16dTEyHYhDIXrYGH6SkEQNb3px+MnfUZDWEMUJszIOVMwl4Bc/AVwOqlM1vg5jfvrw7+3SsNO9Zi7aVNFIHB0U+mCcz+xKTMxJPTK+5G2hB0ieWIZxDiTqiY1nCPt7Fe/aOiJlCtscWTUWNGJjTHIpIcGJLq//b1tDSc6cQ65qnbeDZxfw19kz/dUDX208T6vNYf0r45cvCEQ3f1SQUSB7DxWNfuio9890kdhqZwgBGhv0rwV+ILzDe0n+Rj3Fz2waNJNn8/h6h+A2NMfV8/hhMAb0yd3aRIXjUTWe5/sqmhyYWaMZ9kPMkagwJ+UDR3aulY8DW4tYRBmvqCY9orKzuCezcw04wTqpCjTuUQcwWrobMchgMAn1ojcaLni9aXsEvphbLGYV5qylAUyf5gPw== 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)(8676002)(6916009)(16526019)(186003)(1076003)(8936002)(54906003)(26005)(36860700001)(86362001)(36756003)(7696005)(6666004)(55016002)(316002)(508600001)(336012)(2616005)(70206006)(5660300002)(47076005)(107886003)(6286002)(82310400003)(2906002)(4326008)(70586007)(7636003)(450100002)(356005)(83380400001)(426003)(36906005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Oct 2021 09:12:41.6421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08e67aa4-d8c0-465e-57a3-08d9953c1a10 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: CO1NAM11FT005.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4650 Subject: [dpdk-dev] [PATCH v4 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") Cc: stable@dpdk.org Signed-off-by: Xueming Li Acked-by: Viacheslav Ovsiienko --- 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 ffcc031bff3..4abeae8ce2d 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -1003,13 +1003,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; @@ -1018,6 +1020,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 e505cdbb0f7..6413b45d8d3 100644 --- a/drivers/net/mlx5/mlx5_flow_dv.c +++ b/drivers/net/mlx5/mlx5_flow_dv.c @@ -13556,7 +13556,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