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 5B66FA034E for ; Mon, 7 Mar 2022 03:11:24 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4D99C4114B; Mon, 7 Mar 2022 03:11:24 +0100 (CET) Received: from NAM02-DM3-obe.outbound.protection.outlook.com (mail-dm3nam07on2059.outbound.protection.outlook.com [40.107.95.59]) by mails.dpdk.org (Postfix) with ESMTP id 34E4E4068A; Mon, 7 Mar 2022 03:11:22 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e4uAmSj62Pv0ucCt6s3Y93WB2Uq4kUBcJRfLY5+pUblEAUHJweRsTafiGeYLjYOyJHuOIXyVBhM2ZfGlHRl00BeeNUDtx5rdNKzvZplhZMe5ihc8Dnj9vT8CKVD74BphSfY1vvzTSZb/QLN9Q+xWdlpA+lHrvAaeSVhNSscPXn4/htUQmy2yQJUgJZGz0EXxxEFE7GWUzV5giq0+yR3egs2hs8QNM+sKs2XMZ+8bLhPDSCRu9t8Awx56Tz4v292NojzZ3vmGhVKeC4PgBegeL51ZjTiQHq6GFT2XQtAUUuGPz7h9ViEKjr2qsSctpG1pHUqzTvXuPJlEjhpWBMIS9w== 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=k+trTHuk+OISXJxFkZqlILNuwD1yR+SDfwUE0UOH0PY=; b=JNWCapHvGFbiIF9OkPoZNfiDmVxbnmdbOW/EjyScnipn6uLmSF4NTQgACdFH1wZO4Ssxi3ZP2wnKQrxvLxvdhHgZ9vvY2HRBsNCcx+BKh5u0FEDwxLqc2IDmqaelEzf3DQF6hnFSdcdSvuseRK5lQKY+q21r7ABMRzhP9Z6wx1HIyemBlii13zPnOkYe/Kh6HhfmPy4kBEFHSoE9PhoOY58Z/MwS6QbqfW9KXV5IonGyWpsLJIhfWhSNJhddMJUyMMpNiBTHqSDzxRKTSGhmygG3qtWH5PvREisUWWZ4ggrKsfVC4KK4fKZjh3Luo3XmOc0cUe9eOTcAA/BLfAgqNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=k+trTHuk+OISXJxFkZqlILNuwD1yR+SDfwUE0UOH0PY=; b=jFGSj0wTHMhRhjobbryh8MWcM/QxuwHpIgsBaQVgJpSiHoHiW4xRmoVCdr/otVPNYxy/SP0reZ2tjmc9J1MDMnlUKx1WQR/+PxIyGaXQAotcJ54k4+au6z2+RRhZDm9CcXOp/I5xZe4QbZijmMR1tuFcBVb3OG9cVavgVTiIKFOfXnqrym+wRPocCKSRMGbMz0oCDpcQoZQuPMw0tst1UliJNeGfc9jhP5bte+zOlSfL1Cj2mASLu/YjD2FnCVbpdOBqUZbMZrrOMnHk13PLhG2AjAyaOEYxhH2zt2ZEIvsJO7XSiMQo3nKI5B8u+759UnPUd3hyz9oYGHV2aj1uPQ== Received: from DM6PR10CA0013.namprd10.prod.outlook.com (2603:10b6:5:60::26) by BYAPR12MB3446.namprd12.prod.outlook.com (2603:10b6:a03:d7::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.17; Mon, 7 Mar 2022 02:11:19 +0000 Received: from DM6NAM11FT057.eop-nam11.prod.protection.outlook.com (2603:10b6:5:60:cafe::8) by DM6PR10CA0013.outlook.office365.com (2603:10b6:5:60::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.14 via Frontend Transport; Mon, 7 Mar 2022 02:11:19 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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 12.22.5.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by DM6NAM11FT057.mail.protection.outlook.com (10.13.172.252) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.5038.14 via Frontend Transport; Mon, 7 Mar 2022 02:11:19 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 7 Mar 2022 02:11:00 +0000 Received: from nvidia.com (10.126.230.35) 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.9; Sun, 6 Mar 2022 18:10:58 -0800 From: Jiawei Wang To: , , CC: , , Subject: [PATCH] net/mlx5: fix the port match in sample flow Date: Mon, 7 Mar 2022 04:10:42 +0200 Message-ID: <20220307021042.4088-1-jiaweiw@nvidia.com> X-Mailer: git-send-email 2.18.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.126.230.35] 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-Office365-Filtering-Correlation-Id: 8d33da67-d74b-4d15-d2ff-08d9ffdfc4ad X-MS-TrafficTypeDiagnostic: BYAPR12MB3446:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tSr+0D5dlx2f7NaEPZZVpwYQGMD9gULXZrh/UAU7Yte/FAIlvDYlXFg8wneEOwQh61W0/Pd+9hKl4I/SoF0CEM8UiWcSITajg66nhNjjWch/55N41wrBNtznL/wYDuVHemm5SktLRE5ul64K3zIiUz2jzv4NnL85ZUe8J8MUEPLb5xhoIFxJlTSqbo1/kdPod/yn75mMlBrQpB/Mf6F77aeH2GjfUr0QGpX/RZYMwWvObXi96qTVbx9c3jOil8b2h2u24wndtPAV2ZxW1/tD44Iw66F/1TRWrZ97PxwUMO3nd2uF9BdV036u2pFpg6C23WpHsZ8zjsXDy3B19vdfCOL2NsL3iyQ3ho73AyNeWb61C79tP/wat7L5W2UevdL+sXs8FXOMpjZ/2FrLrL9rSNhkbniVxd8/ECP6iceR2X/UUxF82Eofth/YbnJd3Etw2AWF5qS9wi1wSqlL89wfxfCuvD1rddukWX50gq0aqmJliVj4eFSX05LbdihFmiAiyKAJF6UsgV8+NlzrUjBIH4skb3e+NWXQIEOuZ6aIerO4Epek44wFX5mPujut+YeTYX8vQUN6wmkYgWH06l/MFhvE2LaHlM1WlQ4ZBLLU5AvGEmkqEw7QRXf8qz+b+MohSqvQ2iWbgLn4mL2pgnI5EArs9Gok6ons4ITmRhoM52L1Z3XbW0n32xv+dBZvRMXra4Y6ZUdfzAL37HCTDp6pSA== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(46966006)(40470700004)(36840700001)(83380400001)(82310400004)(36756003)(16526019)(2616005)(316002)(1076003)(54906003)(426003)(336012)(186003)(26005)(110136005)(6636002)(86362001)(2906002)(81166007)(5660300002)(55016003)(36860700001)(6286002)(4326008)(6666004)(40460700003)(7696005)(356005)(8936002)(8676002)(508600001)(47076005)(70586007)(70206006)(450100002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Mar 2022 02:11:19.0589 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8d33da67-d74b-4d15-d2ff-08d9ffdfc4ad X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM11FT057.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3446 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 If there are an explicit port match and sample action in the same flow, mlx5 PMD pushes the explicit port match in the prefix subflow, and uses the tag item match in the suffix subflow. The explicit port match was translated into source vport match so the sample suffix subflow lost this match after flow split. This patch copies the explicit port match to the sample suffix subflow, and the latter gets the correct source vport value in the flow matcher. Fixes: b4c0ddbfcc58 ("net/mlx5: split sample flow into two sub-flows") Cc: stable@dpdk.org Signed-off-by: Jiawei Wang --- drivers/net/mlx5/mlx5_flow.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c index 179cc3b303..34b8f97a14 100644 --- a/drivers/net/mlx5/mlx5_flow.c +++ b/drivers/net/mlx5/mlx5_flow.c @@ -5543,7 +5543,7 @@ flow_check_match_action(const struct rte_flow_action actions[], return flag ? actions_n + 1 : 0; } -#define SAMPLE_SUFFIX_ITEM 2 +#define SAMPLE_SUFFIX_ITEM 3 /** * Split the sample flow. @@ -5584,6 +5584,7 @@ flow_check_match_action(const struct rte_flow_action actions[], static int flow_sample_split_prep(struct rte_eth_dev *dev, int add_tag, + const struct rte_flow_item items[], struct rte_flow_item sfx_items[], const struct rte_flow_action actions[], struct rte_flow_action actions_sfx[], @@ -5650,6 +5651,12 @@ flow_sample_split_prep(struct rte_eth_dev *dev, .data = tag_id, }; /* Prepare the suffix subflow items. */ + for (; items->type != RTE_FLOW_ITEM_TYPE_END; items++) { + if (items->type == RTE_FLOW_ITEM_TYPE_PORT_ID) { + memcpy(sfx_items, items, sizeof(*sfx_items)); + sfx_items++; + } + } tag_spec = (void *)(sfx_items + SAMPLE_SUFFIX_ITEM); tag_spec->data = tag_id; tag_spec->id = set_tag->id; @@ -6257,7 +6264,7 @@ flow_create_split_sample(struct rte_eth_dev *dev, jump_table = attr->group * MLX5_FLOW_TABLE_FACTOR + next_ft_step; pre_actions = sfx_actions + actions_n; - tag_id = flow_sample_split_prep(dev, add_tag, sfx_items, + tag_id = flow_sample_split_prep(dev, add_tag, items, sfx_items, actions, sfx_actions, pre_actions, actions_n, sample_action_pos, -- 2.18.1