From patchwork Tue Aug 6 12:57:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tariq Toukan X-Patchwork-Id: 13754906 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-MW2-obe.outbound.protection.outlook.com (mail-mw2nam04on2051.outbound.protection.outlook.com [40.107.101.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB2F31E7A5A for ; Tue, 6 Aug 2024 13:50:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.101.51 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722952233; cv=fail; b=FQAl75SHIuOhIZJ18AB9iJ09hCgakrIspu5ggTRSRXsOJGquuMDwrB9VZJcRaqNYAgkXK/7RG+ia0As5pum2tG1HrNBwMecxy9a2aQjHNkVUtPaSp3aXL7ayBE4qSV9X6gBZ/7jCS8kTOzbdxURNsE3EdnaPJ2+11cyPEIvuZLY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722952233; c=relaxed/simple; bh=14Mfjx2KYmGcKHUeF6uAMhKJStDDKIhRsIkub5fbIis=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=KfN5b5/PGgc/tIy39T6ib9ZaClD4bCXhtWDakYUmHexDFurmOdQplQjLKVw6289VjPP51bNwf8WWuz5rfAN7Wfb4Qr47U9mSrGe9CDSeSr99pe/afjQQuLsJJpjC4K/mlmEpTF3RlMjHxSdEcILTsttxgIDeTrSsqniFYuh6bvA= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=cLzuFqOi; arc=fail smtp.client-ip=40.107.101.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="cLzuFqOi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=DEbv+816GZjDqCo95pPGZI6aLFKRvcqER7/b1Mmg0ie3sd2a0Hau/jqQI8o1VnzQYFGSDh5PJum7UX+wkX5PUtYHZtUHX57TaNI0nFVPMw9XpWlf2c+54R/GU84Xl/16hqwyTQWkHv9sEcCCQmAv5w1CykezMMGODy3SK0R932aq19MsFVteET+FdQ0xlsQkDEsaJPQopbwrJMO/6fhYv17GbCpq7fzdygA0NG2KPLBwcLylZeKUQNJW8XfDLiG6tyoSsp58OJsPCAl5jP7G2lA9Nq/al6m6FkNcrn7vg0d6PbagsdYDLkcq3KEzSjRI8LuldBKSrRAneWi7SbtFGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=0HgOyTCRBIFb8iH+CNAlb69+yaguk3+v+7d8wvveXdI=; b=gcpx7g0oLiESkWV54MAk9s1Vzl51/LOh6OZjt732w7CdSZGAD7400wXoD5Z1N/AqIYgJxaSxdnqqSLs63LKOZi0Jrvb+SeqH2x+PfMeJraCZKQXpFdG1omMV51SMDj2CKBZfVc2uCCE1pPovM5qIs/5G731WZlr5lVoNdv1rUisQm1OefAfIUtcSvu7oHHre0DgBMDu/avFnEZTH2gYMPmODSWQ3lBGR6uzFrqSFOZHReq18StJXSS7+J5c+nSG2BzewSa0MrCwvKsckMAuUGatkvZ6El1ssE+omrKeffJaLLNbbSjaQsNb2wsBQhVJEbXE3Uyo43To0pdtVmty+pQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=davemloft.net 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=0HgOyTCRBIFb8iH+CNAlb69+yaguk3+v+7d8wvveXdI=; b=cLzuFqOiFNDxSewUlblBfmj/uFH7HyfxgoTghhYen/WGchgPaygmIXGYsLTFhSYZkbDFtVG8PAq+WnjskCyiGEJKdWfcFjW/s4/XJ6lb2dWTPmA3oCI3BTbPvLj/rL3bzltFkJ+J2Am0LVVXEDw3VpbzeAtl2p79nl+Q9fwn1Uxtb/P5WTPhuofjHrSQQGCK0QAs2B5VMWl3g0+8Gfq+XWUmHh39CZgFz2wrRZ55C8bKPX9xkR5Ip5XT0dCNqAemuiF6qMP9Xzzbm+j3/ApQY/pS6Q5rbXHctm4hcjrlQixu1G1EgbHWN31ivszaDoUHYNDENlA3V1Mx0zX5HESUVA== Received: from CH0PR03CA0055.namprd03.prod.outlook.com (2603:10b6:610:b3::30) by SN7PR12MB6743.namprd12.prod.outlook.com (2603:10b6:806:26d::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.21; Tue, 6 Aug 2024 13:50:28 +0000 Received: from CH2PEPF0000009B.namprd02.prod.outlook.com (2603:10b6:610:b3:cafe::27) by CH0PR03CA0055.outlook.office365.com (2603:10b6:610:b3::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7828.29 via Frontend Transport; Tue, 6 Aug 2024 13:50:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) 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.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CH2PEPF0000009B.mail.protection.outlook.com (10.167.244.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.8 via Frontend Transport; Tue, 6 Aug 2024 13:50:27 +0000 Received: from drhqmail201.nvidia.com (10.126.190.180) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 6 Aug 2024 05:59:43 -0700 Received: from drhqmail202.nvidia.com (10.126.190.181) by drhqmail201.nvidia.com (10.126.190.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 6 Aug 2024 05:59:42 -0700 Received: from vdi.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.181) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 6 Aug 2024 05:59:39 -0700 From: Tariq Toukan To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet CC: , Saeed Mahameed , Gal Pressman , Leon Romanovsky , Jianbo Liu , Tariq Toukan Subject: [PATCH net-next 02/11] net/mlx5e: Enable remove flow for hard packet limit Date: Tue, 6 Aug 2024 15:57:55 +0300 Message-ID: <20240806125804.2048753-3-tariqt@nvidia.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240806125804.2048753-1-tariqt@nvidia.com> References: <20240806125804.2048753-1-tariqt@nvidia.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF0000009B:EE_|SN7PR12MB6743:EE_ X-MS-Office365-Filtering-Correlation-Id: 7619f6e3-bc1a-4af8-aa50-08dcb61ebac0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|36860700013|376014|1800799024; X-Microsoft-Antispam-Message-Info: K9/+HnHxEwJE0Kmt6jIAUzVBE9whnno+oorCurndCqpy1yJNPmGq7ZAUW4Aa07CTkiG3NerP2zuBU9O/D2v5gTpmmqntCtgH3j4rHd94sz2dq96WljCCh+UJ6ab46+u9ZREOt4SW7gOSrCsOQ1yRUBHkjyE5ORrYZjwe+HE2cnGhMyRMpYGL3C07R+xuYerk6QrMQIWRNW4ydWNTz/OSMQ2JBFgfP/QYrU6PsWPcHF+tHJts5aNq5nl+j8RbYhH9GP3BWgQPy5knJ/QLDnyzduhFeOwvVbP7aJ/6V9yLZ4iBI0M5M4grzgPwzUHthBZrKeMIMk7zqKS6b9PNqub2qI7ekrTatfxCZi2oSxaCyni/Y7EYfxifUr1dGxylYO0StQJnzkFOH/YZPDORvxhPfpcht8XEZGejMNa7WT5KxQ4FlKNAkCsYmj7/N7NRAMQz4P6fjHJZp2yNw1lhrhDRejbdU+tOf10D6BoQQYXSPS9u/fwPs8IeuJlDC0rBbWKS7GYvYQr6Rk7gCA0k/heEwp+YYngPaRBvcyPXEZkuqk/w0ZywWg0zrrLJFdYcdEgWXSRUi28cyLmLWgwPJtzD8A2UTCqxpFvuLrowFUrplEMQN2RJIPsqml7FF8gqV/qzQyhQu/ltF1NzFKRjETdoeyjkwkVC3134mKh1SlkpBSzwlCgbFt6G1C0RNPCuQOZaBX91EaFtxC8h0zlLlWJD4w+sTWeuHFfU5BbRJPTYRZVi+EI1ZdngHe8+8M5AUTiiXgcBgjxokqvOyHufuCKjBygpwTiS2cewGoBPGErOzMqtnDcWpe8PJxKZnnY/Vd/NjUlR4kJsjFXl9nzCM3PfOSzGuYxI+JhUBU2eHuxDYIN+ogzvEW8tR0M7/1cdhHr7+DmhGvWoFNqM7Q0nop3X2AtnVUM7Is35Gii8BHBgIbVJWSg4ZF9IIwyvWh40JHdVtNJNlEE3ycNUq/Ycy92k4CSpujoAn1xL0g8xa5xnZzUftAR7v5Y4zSu2NkFSLWjQOIQEbR6d3ksMgIrGkAu9DnXccrPU6o0sYTMN0oVr3To96KgFwUz8SYquL+LcbR3FPy9IvyCyXZSSBfGELwntmOy/eYTHgd5Uo9WBVzF2yY61jz6vQyEamAIPdGUe2nTOeuCvzM2GWcH/uUX69BDWS0a8EwdsQP0tZIHS8tfgSupGxlLmRtJf+92glvMkGJIqqETwWkgQEoK3mFS0GPWSFaHsKg4G7pQlxnEHBeap0j4BzJHzujCglZOHaAavT3Z2Mmerl1Y8ZPNJVwC5uaXfV81u9JCmUtTdmCJWfXW7MFepoC1Cx3zbNrEAkmWglxYIlQnCY+dW7KK0rWKa8KipSWjB8zS1AwNJS+6ZoWySLIoYWo+prsd4+2HrniJaDVmzvab4iPscVxW8/0utF1oaJYi9an2nDmeMfLof8YVnBJYQi3uFmh0yCtoFkl+XJuEj X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230040)(82310400026)(36860700013)(376014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Aug 2024 13:50:27.6668 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7619f6e3-bc1a-4af8-aa50-08dcb61ebac0 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF0000009B.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB6743 X-Patchwork-Delegate: kuba@kernel.org From: Jianbo Liu In the commit a2a73ea14b1a ("net/mlx5e: Don't listen to remove flows event"), remove_flow_enable event is removed, and the hard limit usually relies on software mechanism added in commit b2f7b01d36a9 ("net/mlx5e: Simulate missing IPsec TX limits hardware functionality"). But the delayed work is rescheduled every one second, which is slow for fast traffic. As a result, traffic can't be blocked even reaches the hard limit, which usually happens when soft and hard limits are very close. In reality it won't happen because soft limit is much lower than hard limit. But, as an optimization for RX to block traffic when reaching hard limit, need to set remove_flow_enable. When remove flow is enabled, IPSEC HARD_LIFETIME ASO syndrome will be set in the metadata defined in the ASO return register if packets reach hard lifetime threshold. And those packets are dropped immediately by the steering table. Signed-off-by: Jianbo Liu Reviewed-by: Leon Romanovsky Signed-off-by: Tariq Toukan --- drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c index 797db853de36..53cfa39188cb 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec_offload.c @@ -127,6 +127,7 @@ static void mlx5e_ipsec_packet_setup(void *obj, u32 pdn, MLX5_SET(ipsec_aso, aso_ctx, remove_flow_pkt_cnt, attrs->lft.hard_packet_limit); MLX5_SET(ipsec_aso, aso_ctx, hard_lft_arm, 1); + MLX5_SET(ipsec_aso, aso_ctx, remove_flow_enable, 1); } if (attrs->lft.soft_packet_limit != XFRM_INF) {