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 AF72243C5A for ; Wed, 6 Mar 2024 21:23:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9CA442E94; Wed, 6 Mar 2024 21:23:09 +0100 (CET) Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2057.outbound.protection.outlook.com [40.107.100.57]) by mails.dpdk.org (Postfix) with ESMTP id E35B442DC3; Wed, 6 Mar 2024 21:23:06 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kj7kuJIZ9++cHiZ9qtOMUtp18LLM98xvLjY0fkq0nDS7zBcyPDlhNSRneVK9JWc4FrEG/Nd5CC+MVK+JRb7dWjMVi5pg1/aPRZ9+MIoVqppzOD7Rg1CAxlEm5c/oOTirNghJZQKDjxbceMOa8hGWFsafHmYZSRjPuxSDYa+qPRkYbd2bXTdd6L3jagZNaJJ/2iVOBcuYYGgh0A5naTKQ9EArlkZYYKI7iWx6kBapTZeBm2tvAtXlbSWv+7TvL61wbTdwN2HKHU6YREvPFwrt5E4/TYT8F+3HnOe3DfC/Ww9nTAHlmABf3ApKJM+bK5hrkQTQ8FsUoHBNGFmw4FAdQw== 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=L/Kxcvr3plEsgLBwUQfS/4YJM34SeVvcmvXaPqy7qeU=; b=JJ29bpgRHRu+tepRctw7q5HzAkUB3jh3VQCywIsy7WF7LdzfRRQGyfTXjQH/QhV8tJrcuAQrjOapfkFZOl8VCh+mySp+hKMXgmih9jkGd7h2ItMvUEDwaBYc3/GQnuR6oP0Bxn8oQjK5ycxG8rg8sDH5JkBbJ/RZbYabRXRaXXeqtlnc1TA1+y4zUvKfgaL7g9HuFqkchjPWtxpLKjgWHV77AmzF48cSNNwO/zauGFZBIUbyq4dqexAk29fuuZzrTH5XZ52xzYXhC9RqtUNtLm5cUa2mpZs852fs3bBTq+J3lXz7xZNytH9Vli6TUdDQDVRsXETFT7zgkdz7A+Xk+g== 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 (0) 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=L/Kxcvr3plEsgLBwUQfS/4YJM34SeVvcmvXaPqy7qeU=; b=NcFZW8Ph684Y9/kOt6tSPUJPGk4Pfn0wN2B2SnT5/eJSGR787FPMzOQ9U39DJUZ4M3vsQb++X6u2nInRfwr4/OM3S4ID8hV1exXqwJBUTLlr0ePXHZzoVUfdVOlahMdWVQy87GInXl2RzRnfaAnAqryoR07Sq3K9wZdvsHRXBUZCa+Wf1r3OePMfXZd7VVgm/9NDkCodXo7vkTFgHMTtLgaqBFbboH9ldFS2Wswg3nuv1kNL9lvGTnQt6TicEKpxClOELkUXIvdf8f7h+Dc0tVji+d7jSheRcvAkrqP+RE/wWgYpawnVS4O+g2ajsmebfWa0mvMeXi1G/WSyOaPRSQ== Received: from DM6PR12CA0027.namprd12.prod.outlook.com (2603:10b6:5:1c0::40) by SA1PR12MB6680.namprd12.prod.outlook.com (2603:10b6:806:253::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.34; Wed, 6 Mar 2024 20:23:04 +0000 Received: from CY4PEPF0000FCBE.namprd03.prod.outlook.com (2603:10b6:5:1c0:cafe::a4) by DM6PR12CA0027.outlook.office365.com (2603:10b6:5:1c0::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7339.39 via Frontend Transport; Wed, 6 Mar 2024 20:23:04 +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 CY4PEPF0000FCBE.mail.protection.outlook.com (10.167.242.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7362.11 via Frontend Transport; Wed, 6 Mar 2024 20:23:04 +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.41; Wed, 6 Mar 2024 12:22:50 -0800 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.1258.12; Wed, 6 Mar 2024 12:22:48 -0800 From: Dariusz Sosnowski To: Viacheslav Ovsiienko , Ori Kam , Suanming Mou , Matan Azrad , "Yevgeny Kliteynik" CC: , Alex Vesker , Subject: [PATCH 1/4] net/mlx5/hws: fix direct index insert on dep wqe Date: Wed, 6 Mar 2024 21:21:47 +0100 Message-ID: <20240306202150.79577-1-dsosnowski@nvidia.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.230.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY4PEPF0000FCBE:EE_|SA1PR12MB6680:EE_ X-MS-Office365-Filtering-Correlation-Id: 1fd2d668-e85f-411f-78d2-08dc3e1b3a47 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 9iZtGXIoPo1Ldm1j3qlsy/Ru+EvXHWF7lzSblgthVlbfFkpMr/bmK4tiBxX23ptfjIBuLF/jCE+JDSaJnD3czogRIEraoM20n/bpANo8wxZQheK/nBg2Jm+LISUqy4hikp5iYZjuBlu9xmFQjdDX+ok0E7pwNavs23gDmhhRFWFL6dy5JCZ93D+YSlhTOCo12yqlH0DmCV7wxgTEUhMslFJzynpHiGporhPpxAd5S4ueftq6NVtWG8RQk2UbYTr7ttBMeIjRbiYMCauaoy8/Al+kVuj71VcqhL2eG334FBWoJiydhSAk7cxVFLNaRtycsfKeO5/ABP6HZSK/90LQIcSD8VssX72ZoojHPKSMkYQr+G63zs+bSfUeAvb1pJRi/TmMb+EPflZcNcIlKV3RIU0qnQP6iQV2pjJeL8dA5hCD0hzTUsrs/wQIxuAiK1sPAAX5To1rciXgqfD0nto0r3D9j3buuD/3SeGinO4kpmUvFtODirYBg5wYdbtoAdm2/pEb5b/7qJTPSTGAW6khk/MI7vm9TMxwtcTuQxorYMCFEGoa6LQLPM9/87VXqEYlL3lzyHPLoQpRs5xhfvnj5ZnmhdIVGtrWnMuuFHknqb6HABguFVeTO0TKQVXmP1Cr9xHQIwy9UuOIgjZJ3+03lresUDlcxqb5TdZA5R2XTPxkY+IZOmpvOB0kTafq/myzI2cx6x4giY6VCy1+rT/Ms0Ss3n5hpH0zA30uvUdlysQ0VNgAheusB86MudlJFc4r 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:(13230031)(36860700004)(376005)(82310400014); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Mar 2024 20:23:04.1631 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1fd2d668-e85f-411f-78d2-08dc3e1b3a47 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: CY4PEPF0000FCBE.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6680 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 From: Alex Vesker In case a depend WQE was required and direct index was needed we would not set the direct index on the dep_wqe. This leads to incorrect insertion to index zero. Fixes: 38b5bf6452a6 ("net/mlx5/hws: support insert/distribute RTC properties") Cc: stable@dpdk.org Signed-off-by: Alex Vesker Acked-by: Dariusz Sosnowski --- drivers/net/mlx5/hws/mlx5dr_rule.c | 15 ++++++++------- drivers/net/mlx5/hws/mlx5dr_send.c | 1 + drivers/net/mlx5/hws/mlx5dr_send.h | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/net/mlx5/hws/mlx5dr_rule.c b/drivers/net/mlx5/hws/mlx5dr_rule.c index aa00c54e53..f14e1e6ecd 100644 --- a/drivers/net/mlx5/hws/mlx5dr_rule.c +++ b/drivers/net/mlx5/hws/mlx5dr_rule.c @@ -58,14 +58,16 @@ static void mlx5dr_rule_init_dep_wqe(struct mlx5dr_send_ring_dep_wqe *dep_wqe, struct mlx5dr_rule *rule, const struct rte_flow_item *items, struct mlx5dr_match_template *mt, - void *user_data) + struct mlx5dr_rule_attr *attr) { struct mlx5dr_matcher *matcher = rule->matcher; struct mlx5dr_table *tbl = matcher->tbl; bool skip_rx, skip_tx; dep_wqe->rule = rule; - dep_wqe->user_data = user_data; + dep_wqe->user_data = attr->user_data; + dep_wqe->direct_index = mlx5dr_matcher_is_insert_by_idx(matcher) ? + attr->rule_idx : 0; if (!items) { /* rule update */ dep_wqe->rtc_0 = rule->rtc_0; @@ -374,8 +376,8 @@ static int mlx5dr_rule_create_hws_fw_wqe(struct mlx5dr_rule *rule, } mlx5dr_rule_create_init(rule, &ste_attr, &apply, false); - mlx5dr_rule_init_dep_wqe(&match_wqe, rule, items, mt, attr->user_data); - mlx5dr_rule_init_dep_wqe(&range_wqe, rule, items, mt, attr->user_data); + mlx5dr_rule_init_dep_wqe(&match_wqe, rule, items, mt, attr); + mlx5dr_rule_init_dep_wqe(&range_wqe, rule, items, mt, attr); ste_attr.direct_index = 0; ste_attr.rtc_0 = match_wqe.rtc_0; @@ -482,7 +484,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule, * dep_wqe buffers (ctrl, data) are also reused for all STE writes. */ dep_wqe = mlx5dr_send_add_new_dep_wqe(queue); - mlx5dr_rule_init_dep_wqe(dep_wqe, rule, items, mt, attr->user_data); + mlx5dr_rule_init_dep_wqe(dep_wqe, rule, items, mt, attr); ste_attr.wqe_ctrl = &dep_wqe->wqe_ctrl; ste_attr.wqe_data = &dep_wqe->wqe_data; @@ -544,8 +546,7 @@ static int mlx5dr_rule_create_hws(struct mlx5dr_rule *rule, ste_attr.used_id_rtc_1 = &rule->rtc_1; ste_attr.retry_rtc_0 = dep_wqe->retry_rtc_0; ste_attr.retry_rtc_1 = dep_wqe->retry_rtc_1; - ste_attr.direct_index = mlx5dr_matcher_is_insert_by_idx(matcher) ? - attr->rule_idx : 0; + ste_attr.direct_index = dep_wqe->direct_index; } else { apply.next_direct_idx = --ste_attr.direct_index; } diff --git a/drivers/net/mlx5/hws/mlx5dr_send.c b/drivers/net/mlx5/hws/mlx5dr_send.c index 64138279a1..f749401c6f 100644 --- a/drivers/net/mlx5/hws/mlx5dr_send.c +++ b/drivers/net/mlx5/hws/mlx5dr_send.c @@ -50,6 +50,7 @@ void mlx5dr_send_all_dep_wqe(struct mlx5dr_send_engine *queue) ste_attr.used_id_rtc_1 = &dep_wqe->rule->rtc_1; ste_attr.wqe_ctrl = &dep_wqe->wqe_ctrl; ste_attr.wqe_data = &dep_wqe->wqe_data; + ste_attr.direct_index = dep_wqe->direct_index; mlx5dr_send_ste(queue, &ste_attr); diff --git a/drivers/net/mlx5/hws/mlx5dr_send.h b/drivers/net/mlx5/hws/mlx5dr_send.h index c1e8616f7e..c4eaea52ab 100644 --- a/drivers/net/mlx5/hws/mlx5dr_send.h +++ b/drivers/net/mlx5/hws/mlx5dr_send.h @@ -106,6 +106,7 @@ struct mlx5dr_send_ring_dep_wqe { uint32_t rtc_1; uint32_t retry_rtc_0; uint32_t retry_rtc_1; + uint32_t direct_index; void *user_data; }; -- 2.39.2