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 CE9D0A0C45; Fri, 19 Nov 2021 14:02:27 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5984440143; Fri, 19 Nov 2021 14:02:27 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2068.outbound.protection.outlook.com [40.107.92.68]) by mails.dpdk.org (Postfix) with ESMTP id D1C7A40140; Fri, 19 Nov 2021 14:02:25 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f/kE6NQpx6KCw54orA71jBynfq41ZiXsrjFVOYAQLvaEVLsEIIiY/HAKtgTUVP7nmzBWKQQCowiXQWnpNsbn3TGqNSRfDAB4DLC88uBPebeAKDQt8G0w2NsaPA4KeNe6pnrwEGoQAWUqd32gMTpLV3Vhm7IZT+YZhTsbUKFLR2A5iuQb8DduWe+Gzk4uYxDgM5El37abTDSZuJDrzvFAFHTnE4VAR0k+LHf4pa0hTkkfS9OK/Zu4tLALmjBrEo4aLl5vkWko0G10iqgzGTO3PuoWDhh1jPaPzdDk7WwyWc29XbjNA9rI1C1mAqQpkfrvn0pBN8ecv4XbaSkmuoAv0Q== 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=97wJHn/lQxOjogfez0WVrA/zxc5lAHL7MGu3rIZBjQc=; b=JmkWwHeqHcvCqT0vAotRStm+xJ2KVFo1PzYnUPuo60rMgzGQ8xJ/bJWrKJ4u1fmOz+J93wNtgOX33Jm9mfUOgnZAhOoAcrPnKEl09ECUU7l4PuKf5YQIm0C0fPdxM+q8cbDP3+KPaGVC4G20p/o/GzJ4q1T1tXUqntcfAn6u1pxw5WUPlq7IDMWK8KlDhMo2nczsz1oZf6tMbr0EXHXr409kDFXAiPCMP5SknmWRYchWfPmorfLmAz4poa+PlQTqBuW4Klb4Msd/wFykFq7kC7/c7XYwfm7kAkvK2B8QrXRjXRN99flLUBSf6Mkv0Y98D/p+AbWKJ16NR0fSuscP9w== 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=97wJHn/lQxOjogfez0WVrA/zxc5lAHL7MGu3rIZBjQc=; b=ldL46+QIYEZas9lLJj6oI6KwIKl2e/FNwAFml6AM6jCjUs2zwxW0WYXCWXtPMR8NlZv1p7E2j7VApTly57M4bxL5ki+lwjSIheE2H5U6iZmvPmEQUSDreboRAE1/YuRnvDaVq6G3HAd9Qd4BfhaaWJgsKhgkSzDCYNLmaHKKHAT64Zk2HbUwHMs02fRwyuRrDBSiqrc9uEGnQOjszTb6CwdAQz9LptLBXj15+5Ms2uNXcxKSZ+mi7xgNjYyaSc9FvM2zVESvsO/a9hFH6wNa+FmIg4c0wnBkq5+wM4Is/RAnqUGEf5Q8H/l+WScbGO866WsJ1BhCY70kYWF3/6o1DA== Received: from DM6PR13CA0040.namprd13.prod.outlook.com (2603:10b6:5:134::17) by CH2PR12MB3703.namprd12.prod.outlook.com (2603:10b6:610:2d::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4713.19; Fri, 19 Nov 2021 13:02:23 +0000 Received: from DM6NAM11FT054.eop-nam11.prod.protection.outlook.com (2603:10b6:5:134:cafe::c) by DM6PR13CA0040.outlook.office365.com (2603:10b6:5:134::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4734.11 via Frontend Transport; Fri, 19 Nov 2021 13:02:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.34) 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.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 DM6NAM11FT054.mail.protection.outlook.com (10.13.173.95) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4713.20 via Frontend Transport; Fri, 19 Nov 2021 13:02:22 +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, 19 Nov 2021 13:02:17 +0000 From: Jiawei Wang To: , , , "Suanming Mou" CC: , , Subject: [PATCH 1/2] net/mlx5: fix metadata and meter split shared tag Date: Fri, 19 Nov 2021 15:02:00 +0200 Message-ID: <20211119130201.14217-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9fc0aa79-c31b-4500-3188-08d9ab5cd3c1 X-MS-TrafficTypeDiagnostic: CH2PR12MB3703: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a9eHoggGLvseGTCbuWKMNEOHowfx0kIQv3v9SRCIeyEskLP6toPZquRSjFTxuQd4eOza23pY0ITKWdVWnJh8F+ale94WOHfbPH0FTevjBm4P14QHhmJOyQ2alc+riMjh/9aOk5REgV9uzQbs5JcjDCxKKVzoBV3RV5LackyriCi5slLscLCX1aksCCSFfxiZBKt5iYfnystkHhSmW3A8lTtxG6LKTLRpSyzBXAGSbb55g0Ci7KVRsEi5xJmquW5qqbcOLy97OZZv4TD/orboLk7nuV/OdQ+BvaxpC4wxzq52U+peKov6S95ex2a9fec9JlWmao7eK7gNUpFtn2/kr1FdsFuZJDVLydmN8MOjPhsJteyo2Jjmh159QlLoKSEoAjTnQRx3oL8VI83mgVz37im0RShzfmyXK+Mb4ygyHtCLW1Ajpk18y9bkhmcwIqpIm/lN5wDRzLBDyPFSzMr4cJ/qtMSHKgQ9cQDyPAh6imsuXx42Qc6PlbkmEo0P41hugHKfg3fbqnDx+tN6KD/wtkJkLsRi4imHfOi6NrmN0tmsLU/0bxcC3OCGMxi3CNcKWJfbFC1v5/dBMjkGgN0ONuHO0yD2Y0uvyYPG7C8qTn8YbRQO1+z8Tb4pA2ylf20zi4491rlMvgGIifeN3AwYrsrUq4PFoq0jfmYf/taxuoLYDfL2/UhBAe1qJS8v0gSImYtZiWjp8VN1/9qtLhvs+A== 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)(2616005)(36756003)(1076003)(7636003)(82310400003)(356005)(508600001)(426003)(110136005)(8936002)(54906003)(36906005)(316002)(47076005)(6666004)(450100002)(86362001)(26005)(6286002)(2906002)(70586007)(5660300002)(83380400001)(4326008)(55016002)(186003)(16526019)(8676002)(70206006)(336012)(36860700001)(7696005); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Nov 2021 13:02:22.6081 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9fc0aa79-c31b-4500-3188-08d9ab5cd3c1 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: DM6NAM11FT054.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3703 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 In the metadata flow split, PMD created the prefix subflow with removed Queue or RSS action and appended the set tag and copy table jump actions. If the flow being split for metadata was the meter prefix subflow, the driver supposed to share the same meter split tag action for the metadata split flow. There was the wrong check for preceding meter split tag action, causing append with metadata split set tag action and resulting the meter suffix subflow was missed due to tag value mismatch. This patch adds the checking before copying into extend action list, to make sure the correct shared tag is used. Fixes: 8d72fa668964 ("net/mlx5: share tag between meter and metadata") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang Acked-by: Viacheslav Ovsiienko --- drivers/net/mlx5/mlx5_flow.c | 35 +++++++++++++++++------------------ 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 43598f92ee..84e6f3048c 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5251,6 +5251,8 @@ flow_meter_split_prep(struct rte_eth_dev *dev, * Pointer to the Q/RSS action. * @param[in] actions_n * Number of original actions. + * @param[in] mtr_sfx + * Check if it is in meter suffix table. * @param[out] error * Perform verbose error reporting if not NULL. * @@ -5263,7 +5265,8 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, struct rte_flow_action *split_actions, const struct rte_flow_action *actions, const struct rte_flow_action *qrss, - int actions_n, struct rte_flow_error *error) + int actions_n, int mtr_sfx, + struct rte_flow_error *error) { struct mlx5_priv *priv = dev->data->dev_private; struct mlx5_rte_flow_action_set_tag *set_tag; @@ -5278,15 +5281,15 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, * - Add jump to mreg CP_TBL. * As a result, there will be one more action. */ - ++actions_n; memcpy(split_actions, actions, sizeof(*split_actions) * actions_n); + /* Count MLX5_RTE_FLOW_ACTION_TYPE_TAG. */ + ++actions_n; set_tag = (void *)(split_actions + actions_n); /* - * If tag action is not set to void(it means we are not the meter - * suffix flow), add the tag action. Since meter suffix flow already - * has the tag added. + * If we are not the meter suffix flow, add the tag action. + * Since meter suffix flow already has the tag added. */ - if (split_actions[qrss_idx].type != RTE_FLOW_ACTION_TYPE_VOID) { + if (!mtr_sfx) { /* * Allocate the new subflow ID. This one is unique within * device and not shared with representors. Otherwise, @@ -5319,6 +5322,12 @@ flow_mreg_split_qrss_prep(struct rte_eth_dev *dev, MLX5_RTE_FLOW_ACTION_TYPE_TAG, .conf = set_tag, }; + } else { + /* + * If we are the suffix flow of meter, tag already exist. + * Set the QUEUE/RSS action to void. + */ + split_actions[qrss_idx].type = RTE_FLOW_ACTION_TYPE_VOID; } /* JUMP action to jump to mreg copy table (CP_TBL). */ jump = (void *)(set_tag + 1); @@ -5773,17 +5782,6 @@ flow_create_split_metadata(struct rte_eth_dev *dev, RTE_FLOW_ERROR_TYPE_ACTION, NULL, "no memory to split " "metadata flow"); - /* - * If we are the suffix flow of meter, tag already exist. - * Set the tag action to void. - */ - if (mtr_sfx) - ext_actions[qrss - actions].type = - RTE_FLOW_ACTION_TYPE_VOID; - else - ext_actions[qrss - actions].type = - (enum rte_flow_action_type) - MLX5_RTE_FLOW_ACTION_TYPE_TAG; /* * Create the new actions list with removed Q/RSS action * and appended set tag and jump to register copy table @@ -5791,7 +5789,8 @@ flow_create_split_metadata(struct rte_eth_dev *dev, * in advance, because it is needed for set tag action. */ qrss_id = flow_mreg_split_qrss_prep(dev, ext_actions, actions, - qrss, actions_n, error); + qrss, actions_n, + mtr_sfx, error); if (!mtr_sfx && !qrss_id) { ret = -rte_errno; goto exit; -- 2.18.1