From patchwork Tue Apr 24 14:17:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ido Schimmel X-Patchwork-Id: 10360117 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 0B7B9601D3 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 F054E28D15 for ; Tue, 24 Apr 2018 14:20:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E4EE728D3E; Tue, 24 Apr 2018 14:20:24 +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 413D828D15 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 40Vlpt2RsHzF25M 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="ha/B4BBP"; 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="ha/B4BBP"; 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 40VlmL1r25zF1Rl for ; Wed, 25 Apr 2018 00:18:10 +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=Xarj5r/hpwuC7/9yJP2x5le58/jIG+VAKSwlllzrvf8=; b=ha/B4BBPXHnkC7tWA1UuayULNG6xAnZ8VsxJyfIR6QKQyaWjon8Gamy7m5SX9dwrkny4tMoOA6lyBMcAkrgQ69qkbDPXargEmxakzS5gqOMuIy/TP1osuPOhesD/7kPm/2oKSzqV7B0tMX+ottrxQmq3xpREhgABVZAoeWiKuks= 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:01 +0000 From: Ido Schimmel To: linux-mlxsw@lists.ozlabs.org, linux-internal@mellanox.com Subject: [PATCH net-next internal 1/2] mlxsw: spectrum_router: Return an error for non-default FIB rules Date: Tue, 24 Apr 2018 17:17:43 +0300 Message-Id: <20180424141744.9147-2-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:bEZ8A4ZWKFh/UcvceBWt4eEGJZ0FqzxPs9f/fzTsnY86sG6AgXQuu3i8LwCwMKKCoVNh2hnQDzYJjnrKoOqJxpHCNrlJbTWjdccEZG5E7Dr4GdUF0a6d/bvMRuL9Q2GVoxAu2tv4SnSHGWFXJTXQ8d64PpVrf9Phuz7iEhzb16dtEADBj0KaBRopst3mUq05lI2gtfPKadsSly4xgizQcNj0wWptpQd+Z0bJnZzAzEH/5OCE5k06aWx/eFjjDdaQ; 25:a4MFJ3JohIs6S0z+/3QOtXp948xY9KIXEMKsWObQb5zVwRyy/zT0+2S9QicPFPrH59R0D/0EqsqIEntX0toJpDjJekzcxpRa+QmAoHwPq2up6ipLLjpsOj1xmX9yFNhlxV3St6FCSYQ8TCVueyp9t7J9dveuAqNuIU8jFXLbeSDxXwnUbogzBUFW1DJaWpcUwTfDe7Sf8jmK0Zzt62S3It6vDSFOoCygDkNRzI3qVxh1voVQmt3eL9SvHzoE33U+EsTT2/WAPCHeiYXpiKLs5C604KkofJv3d7lbgNl3ApGdsEwIe3mXn5W7qw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7bgrstzvFs8oV7K5gD/fDhatrp37+By3c+/+KRvdWmVb7bxAwqMCw== 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)(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:/LlZqAgx4pjPf88NgUT6OQAJDA7NNVjzy/cDrJ8?= =?us-ascii?Q?kWAENaQwUsBImQzOaLzcFLYiWIVcgZRtr9twDG2MJRRUwu8BmNLeYeB45heT?= =?us-ascii?Q?YJcXe+o5DU420TxyAcbK4dQUiTMQpSxWNXyUVd9IXjlQ9HSN6H+fXI/Egkdt?= =?us-ascii?Q?c/8D6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Ud7x9uFl79FwH7G4XooaVDY6Jn42adXSzV0q1RmYj02aMYMGc1PDuOAjx7SeknYkSKJeb7HWdMcUtPOZ6aAgZL7ddN8TzTk=; 24:T3bafGU6VLvIn2vYVfIRfxw6tW1LgYKg0E5ndUGXucRnLjjgXW7KRMoErjEPfNs9AnDrF1sT/7CkgXsusWHjXJXD15rGNm0zG/hFifAqZF0= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0501MB2330; 7:DeN89MMt1jBlosMRnS2GpyXXHG8MhpnYmL9toD9UOuUF6CnKu8Aqh8xNIJl+1QZeQYOQFlyqXDdgWBE2blss1Gg2jk67TaEGLtVQMEkWIEWYP4TP+2Q/vkBVIDAPXvg1lwtNThSvRJ6M38pUjvoBXOTzwBBYk877EqA5eoHcFxqomuvSpiyEer7lj1YutQN1LMf3yf3bI8er6yDvaOu5GA1CagIrezZgikp8g/56myCY/TsTwo/la5Zr8EjHHn1G X-MS-Office365-Filtering-Correlation-Id: 8a8e7bef-8b84-439a-af47-08d5a9ee3036 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Apr 2018 14:18:01.3525 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8a8e7bef-8b84-439a-af47-08d5a9ee3036 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 Since commit 9776d32537d2 ("net: Move call_fib_rule_notifiers up in fib_nl_newrule") it is possible to forbid the installation of unsupported FIB rules. Have mlxsw return an error for non-default FIB rules in addition to the existing extack message. Example: # ip rule add from 198.51.100.1 table 10 Error: mlxsw_spectrum: FIB rules not supported. Note that offload is only aborted when non-default FIB rules are already installed and merely replayed during module initialization. Signed-off-by: Ido Schimmel --- drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c index 8e4edb634b11..baea97560029 100644 --- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c +++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c @@ -5899,7 +5899,7 @@ static int mlxsw_sp_router_fib_rule_event(unsigned long event, } if (err < 0) - NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported. Aborting offload"); + NL_SET_ERR_MSG_MOD(extack, "FIB rules not supported"); return err; } @@ -5926,8 +5926,8 @@ static int mlxsw_sp_router_fib_event(struct notifier_block *nb, case FIB_EVENT_RULE_DEL: err = mlxsw_sp_router_fib_rule_event(event, info, router->mlxsw_sp); - if (!err) - return NOTIFY_DONE; + if (!err || info->extack) + return notifier_from_errno(err); } fib_work = kzalloc(sizeof(*fib_work), GFP_ATOMIC);