From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 72343C169C4 for ; Fri, 8 Feb 2019 07:34:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3309F21924 for ; Fri, 8 Feb 2019 07:34:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="oEGx1/S8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727141AbfBHHeR (ORCPT ); Fri, 8 Feb 2019 02:34:17 -0500 Received: from mail-eopbgr130072.outbound.protection.outlook.com ([40.107.13.72]:18491 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726211AbfBHHeQ (ORCPT ); Fri, 8 Feb 2019 02:34:16 -0500 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:X-MS-Exchange-SenderADCheck; bh=pLLCEJEtjQ9UFc+M5n84YsJAEXwntn2gjdi4i0zUWEw=; b=oEGx1/S8utidsIMUMpujhL6SUgR73X7uX2Z8e6LwgUE7scGgVpjO8Il8GLfbYyrMuEGgKqJ5tKxXZGHh5sGmnrbTN8fD0+DmqdUgEFxX4SnrPO08jOwe8BbAEPGhr1Ex9GZMV/wVoOWAOa4rzDIvS6NsUW7BbFjfQjjugN7aW1k= Received: from AM6PR05MB5240.eurprd05.prod.outlook.com (20.177.196.214) by AM6PR05MB5080.eurprd05.prod.outlook.com (20.177.36.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1601.17; Fri, 8 Feb 2019 07:34:10 +0000 Received: from AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866]) by AM6PR05MB5240.eurprd05.prod.outlook.com ([fe80::3542:889c:3a85:3866%5]) with mapi id 15.20.1601.016; Fri, 8 Feb 2019 07:34:10 +0000 From: Ido Schimmel To: David Ahern CC: "netdev@vger.kernel.org" , "davem@davemloft.net" , Jiri Pirko , Alexander Petrovskiy , mlxsw Subject: Re: [PATCH net-next 1/2] mlxsw: spectrum_router: Offload blackhole routes Thread-Topic: [PATCH net-next 1/2] mlxsw: spectrum_router: Offload blackhole routes Thread-Index: AQHUvlQHCZauNWxOVk+h4tbYThYSFKXVEQmAgABzqAA= Date: Fri, 8 Feb 2019 07:34:10 +0000 Message-ID: <20190208073408.GA26396@splinter> References: <20190206194140.18606-1-idosch@mellanox.com> <20190206194140.18606-2-idosch@mellanox.com> <18da8b4d-5966-e851-46d6-e389e40b865e@gmail.com> In-Reply-To: <18da8b4d-5966-e851-46d6-e389e40b865e@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0502CA0038.eurprd05.prod.outlook.com (2603:10a6:20b:56::15) To AM6PR05MB5240.eurprd05.prod.outlook.com (2603:10a6:20b:64::22) authentication-results: spf=none (sender IP is ) smtp.mailfrom=idosch@mellanox.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [109.67.26.132] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AM6PR05MB5080;6:YET2uzBQpb0OEKbleI3AiCWg3s/Q7LBJvPghL9jgei0nFA+3wgmVkwUWpuMRY1cUcog4eas091suEKkbtr+BGKikQtpabMbYYZmCtkE0ts2tJOcxqMVeCkItXeH8LtDzuvgGRIfOztYwcAG5lhxY96WUDdRi3pXrGMe/uMTaZXa3aigRfRxmGm56TPOLcRJEc6QvPsyV6CXrmxJw5PhDmt6kt/o7CvfmctONqzGksxdvhlntmkcrBy3EkHUHAkH2Pj0ISGO31J775ysriPyElmIDv8g6/arlnTM0yV6OAoxLxWY21P0QmQZHZBcLeNK383fNylXvLk+LRiD8LkfmZIjR57WnwKUI0RlYH+02Cg2W99iYk7C5x5Ztrh0sfS1S1SIHr+D2Fyy6DEcb9NNB8zhUJC1+LJ9OlNDXfURmlVIW/qja92sBqIsLjGkalZkugOMnmM0DYv2VwRuLUeumLQ==;5:kK2xAeeYhCEzWr36Wsw6H8Bmlm1aJOuPvUxtlDYo8GXECv2ZGyMKDfj2o86dQWx7VfMneLj1YnjUWuOHeSOGam+5QWo/PKJw/gkzjyV9ZvcrEplnZPZuA84KQfZBAsjKJoWsxfH3G9nIpFak5DTCXv6oTau2j2mFdDoNMQKMNwNq3YG3+oCCFIpMkP6I8/F2RXKiFBCaybL0bhZKWDkw5A==;7:AurfBZcucvoBSQhrnaBrnMKMXUzxy1TfWjvjd+bN7Hr198/ZVgmKq+SJ/WonCw/zq6fMn0VrwIbqIMBk3oUz1YXAwbE2twShGPhqUh7PaOONFVxvOsxn7SzF/ok4KNMF2lmi4GLO94yj90YAGW3i0A== x-ms-office365-filtering-correlation-id: 9c93e653-c916-4d65-bf7f-08d68d97d0ec x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600110)(711020)(4605077)(4618075)(2017052603328)(7153060)(7193020);SRVR:AM6PR05MB5080; x-ms-traffictypediagnostic: AM6PR05MB5080: x-microsoft-antispam-prvs: x-forefront-prvs: 094213BFEA x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(7916004)(136003)(366004)(39860400002)(376002)(346002)(396003)(199004)(189003)(6916009)(68736007)(97736004)(6436002)(71190400001)(71200400001)(106356001)(6512007)(9686003)(105586002)(229853002)(478600001)(14454004)(86362001)(6486002)(66574012)(1076003)(53936002)(1411001)(107886003)(11346002)(2906002)(305945005)(99286004)(446003)(6246003)(33896004)(486006)(7736002)(256004)(14444005)(476003)(102836004)(8936002)(26005)(3846002)(6116002)(186003)(316002)(33716001)(4326008)(76176011)(52116002)(33656002)(66066001)(25786009)(53546011)(386003)(6506007)(8676002)(81166006)(81156014)(54906003);DIR:OUT;SFP:1101;SCL:1;SRVR:AM6PR05MB5080;H:AM6PR05MB5240.eurprd05.prod.outlook.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-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 2aN6UgnxXiJk9M06WpgsPoKqnws3ewtf+5UnVNJcsDHpJ1pijjOMxpL0JFQCwLAShN+DOhphnZT8vNLISdw0ZZmGKNlry/GBQznKErKTyrZLqtlv+JKl8j3YDsD+5EdEQPxr7yydTt457HIx+uXLZHXypIYIPLJGOu+u3hHtD6V2aCjwmU3kG8oe8YdbNpo00z5m24RibJqmvxIu0E87issrvd3sMo0ozLLj2bS0eyien//5Bpf8Bh87mLEtJtoOaH45VzOMDwModPw5T1K212ucqx4DEucgR7lUVViT+1kBuP/n2OyK8fOowGRD/eeF2Jx0LoW0ORIiVRyRffKyb5I+gxKsAipjvMsQjeRrjTHHb907isCIu26g/Eq99UuBYhrMHYro0gkCFLnFFVZdAWes9I+wjEDCz+lP85iwTlg= Content-Type: text/plain; charset="us-ascii" Content-ID: <65997559880E3F44897CE4203A34D9F7@eurprd05.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c93e653-c916-4d65-bf7f-08d68d97d0ec X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Feb 2019 07:34:10.1156 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR05MB5080 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Feb 07, 2019 at 04:40:11PM -0800, David Ahern wrote: > On 2/6/19 11:42 AM, Ido Schimmel wrote: > > Create a new FIB entry type for blackhole routes and set it in case the > > type of the notified route is 'RTN_BLACKHOLE'. > >=20 > > Program such routes with a discard action and mark them as offloaded > > since the device is dropping the packets instead of the kernel. > >=20 > > Signed-off-by: Ido Schimmel > > Acked-by: Jiri Pirko > > --- > > .../ethernet/mellanox/mlxsw/spectrum_router.c | 27 +++++++++++++++++-- > > 1 file changed, 25 insertions(+), 2 deletions(-) > >=20 >=20 > One of the feature requests from the FRR team (and a feature I have > implemented) is a blackhole nexthop. The idea is that prefixes are > installed pointing to nexthop id N. That nexthop definition can be > atomically updated to go between a device / gateway and a blackhole. >=20 >=20 > [ prefix ] --> [ nhid 1 ] --> [ dev1 / gateway1 ] >=20 >=20 > [ prefix ] --> [ nhid 1 ] --> [ blackhole ] >=20 >=20 > [ prefix ] --> [ nhid 1 ] --> [ dev2 / gateway2 ] >=20 > Do you see this working ok with mlxsw without having to update the > prefix entries (which can be numerous) directly? Yes. This patch configures the route itself to drop packets, but we can instead configure it as a remote route and configure the adjacency entry to drop packets. If you later want to change X routes using this blackhole nexthop to a different one, then create the new one and tell the hardware to do the switch in a single operation. It will basically grep over all configured routes and do: s/blackhole_adjacency_index/new_adjacency_index/ s/black_ecmp_size/new_ecmp_size/ See RALEU in drivers/net/ethernet/mellanox/mlxsw/reg.h I assume that user can't put blackhole and normal nexthops in the same group?