From patchwork Tue Apr 24 14:17:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10360119 X-Patchwork-Delegate: idosch@idosch.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 633E760225 for ; Tue, 24 Apr 2018 14:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53DC428D15 for ; Tue, 24 Apr 2018 14:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 48C0528D23; Tue, 24 Apr 2018 14:20:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 98AAF28D16 for ; Tue, 24 Apr 2018 14:20:24 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 40Vlpt6jjHzF25d for ; Wed, 25 Apr 2018 00:20:22 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="Z8H0IimR"; dkim-atps=neutral X-Original-To: linux-mlxsw@lists.ozlabs.org Delivered-To: linux-mlxsw@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=mellanox.com (client-ip=2a01:111:f400:fe02::622; helo=eur01-db5-obe.outbound.protection.outlook.com; envelope-from=idosch@mellanox.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=mellanox.com Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=Mellanox.com header.i=@Mellanox.com header.b="Z8H0IimR"; dkim-atps=neutral Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0622.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::622]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40VlmM6hyFzF1Rv for ; Wed, 25 Apr 2018 00:18:11 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=J1sby4BsdykPN866ewhHPJHIWQEPFzWa1kdMbrvu9QM=; b=Z8H0IimRB2U7oQ2ZnkI3ZKDLeHtE7PmZE7GrOH2UUTX4lVcOixhT4fQmE/O36Bvi3mbbIuGQ0rNWBmB2w5+WIQpFXeFOW/t2xN56lD355BLeeNVAB2qoe3g5Oxabo69A0a5/I4xg9MVehXd1BaNXIbrHD3unxxpfN07dca2w0to= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; Received: from splinter.mtl.com (193.47.165.251) by HE1PR0501MB2330.eurprd05.prod.outlook.com (2603:10a6:3:27::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.14; Tue, 24 Apr 2018 14:18:02 +0000 From: Ido Schimmel To: linux-mlxsw@lists.ozlabs.org, linux-internal@mellanox.com Subject: [PATCH net-next internal 2/2] mlxsw: spectrum_router: Return an error for routes added after abort Date: Tue, 24 Apr 2018 17:17:44 +0300 Message-Id: <20180424141744.9147-3-idosch@mellanox.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180424141744.9147-1-idosch@mellanox.com> References: <20180424141744.9147-1-idosch@mellanox.com> MIME-Version: 1.0 X-Originating-IP: [193.47.165.251] X-ClientProxiedBy: VI1PR08CA0240.eurprd08.prod.outlook.com (2603:10a6:802:15::49) To HE1PR0501MB2330.eurprd05.prod.outlook.com (2603:10a6:3:27::23) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(48565401081)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:HE1PR0501MB2330; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2330; 3:EyGII0zU9AgirFZJhMm7NSgFj/9jZyp57gKzrPZbb4VT3fu/zvzSb+05DGIMHHKD51naAr5apSkJqsoOsc2kjMQlVcuvWOZYedVrYB2ZujtDFm9wCpOD3I3Cu9JhPoT5JOSNTUHSsZsgNwWZ+KH6Fo3djLSf3xRKD4TD9NvU3WIh3JuOOPHZclwS6FNnBlH/CdjhMlAoyCF+DGA3nMnianWFJWxeCCEbpps8VaqYbkBXJu2YUp4/atlE8k2KKxE8; 25:+0OEpratG/s1tw6cJbTzghSoVyYmyvj1OxopP0/BlNzlqzFIpg0T1op5XROBHXPx78tcxfceJ8K6EJn9t5ypYZTgvGwL3ha5sLiO13rdzVoIqo6UMMKS9fhht7XLa+xr9Ft82DSzI6IWwHMONmisoCKblFIaLE/oZ62FrecfSzoFp/MFjCqAPGHd8TK0FPGgfDfFiFlNnuvxabgSQ2iW+caGWm/WTW7bdtjACTMiOzNmWJXPPvBlAv6NI5VYYzHPNltoPI/E3xKESxPU5Gilro9sRXUnFNmvWGss+bAcpnS5EuVWFYm5ReC6pEYgQy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ZeeU3nJVCDWU0lBQ5vxcWonqoMVhss6D1hFncOr+24E25i88Dq8YGjWn1VQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(93006095)(93001095)(3231232)(944501410)(52105095)(6055026)(6041310)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011); SRVR:HE1PR0501MB2330; BCL:0; PCL:0; RULEID:; SRVR:HE1PR0501MB2330; X-Forefront-PRVS: 0652EA5565 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(366004)(376002)(39860400002)(39380400002)(346002)(199004)(189003)(52116002)(51416003)(476003)(6636002)(6486002)(956004)(6666003)(48376002)(6512007)(446003)(76176011)(50466002)(6506007)(59450400001)(386003)(2616005)(4326008)(478600001)(5660300001)(106356001)(25786009)(486006)(11346002)(53936002)(7736002)(2906002)(107886003)(81156014)(86362001)(36756003)(81166006)(8676002)(316002)(16586007)(47776003)(97736004)(16526019)(68736007)(186003)(305945005)(50226002)(66066001)(26005)(105586002)(53416004)(1076002)(8936002)(6116002)(3846002); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR0501MB2330; H:splinter.mtl.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR0501MB2330; 23:vADJnlQXMeXZWXwKEvIBD2OJG43n/cJaNRLTCwY?= =?us-ascii?Q?d2h/IOO76pSCGZ+FCcP8NDNJU3YV4xovyAlEVaj01LUsuJQSoY/GLlM/AjJq?= =?us-ascii?Q?WQ0JrAftR8Pj04E0yhRAsP09M63IpHRPpkOmKYVh3qLmY2By822I7lITgjcA?= =?us-ascii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Q98QkPB5g3bauWUm8kt0YOSX6R06QAkZ55/5f+XMw7Njdx7UC33SLAPgqlT6cc0sxaYfUQfXMb41lPUHNqOcO/0nRIKDVNwV8aIxVG87vuJluzqIhfLptOo3ss3bimTanJp+jPnDx8g5zQ+0g=; 24:IX9mNpIL7yZRx+lay/lnj7+y/10J7tXLzw/SZPNEHyxo1W1ZVDuqHMLjLp93g0z3R82AEd8E1TVcOaYumbV8VFzKhzs9PptQ2fkcH/7QLPg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2330; 7:KbqQfdRuJuBq70p2EUOHhOreF4I2aJ/0G+oZMDc5RxX9DIsioM5l247LYmAhfaSqEM95LJydy9cEsacaQyIkFAWAQEcaRCBzKFguPlaVAjHWcLUqmuyCHMsXgG4qbikKFu/jBp1RISQWj/f5v49eWYWIcjjiofj4VwfRpUK8o1qiqtr8+8lVYTr7UuDudYw7GpLDwed1mqOE4eBweI7srbarPod6xhhkJDwTy0N13jWclqGXLXDoEXJM4zp4H71Z X-MS-Office365-Filtering-Correlation-Id: 2e255524-8f77-4a6f-9636-08d5a9ee30be X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 14:18:02.2431 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e255524-8f77-4a6f-9636-08d5a9ee30be X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0501MB2330 X-BeenThere: linux-mlxsw@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: mlxsw driver development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-mlxsw-bounces+patchwork-linux-mlxsw=patchwork.kernel.org@lists.ozlabs.org Sender: "Linux-mlxsw" X-Virus-Scanned: ClamAV using ClamSMTP We currently do not perform accounting in the driver and thus can't reject routes before resources are exceeded. However, in order to make users aware of the fact that routes are no longer offloaded we can return an error for routes configured after the abort mechanism was triggered. Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index baea97560029..c9fce669cee4 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -5928,6 +5928,13 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, router->mlxsw_sp); if (!err || info->extack) return notifier_from_errno(err); + break; + case FIB_EVENT_ENTRY_ADD: + if (router->aborted) { + NL_SET_ERR_MSG_MOD(info->extack, "FIB offload was aborted. Not configuring route"); + return notifier_from_errno(-EINVAL); + } + break; } fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);