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=-3.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_DKIMWL_WL_HIGH, USER_AGENT_GIT 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 6EB8EC04AB6 for ; Mon, 3 Jun 2019 04:08:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3BF8B27B41 for ; Mon, 3 Jun 2019 04:08:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559534901; bh=ajG/F0kP1NlQuljlN6U/Olvuz7yQqibG3MWLzLB49p8=; h=From:To:Cc:Subject:Date:List-ID:From; b=CjJLpadAxQcfEeBBsMiEm7UXsBZcHUB797p6zO1dYGXdJJ3cvpH5BAT47j0J7q8ue LUwnwdbKAmnNVp7IjoNnGF/MkXCy4Rpnx3Q1FcdKfcuuTeAveM458bPDRapkOfuf9h mxkSvrFWz1+irIrtpRSmGjVpjWPrYVyGY3KA98W4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726315AbfFCEIU (ORCPT ); Mon, 3 Jun 2019 00:08:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:42374 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725818AbfFCEIT (ORCPT ); Mon, 3 Jun 2019 00:08:19 -0400 Received: from kenny.it.cumulusnetworks.com. (fw.cumulusnetworks.com [216.129.126.126]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C7A9027B30; Mon, 3 Jun 2019 04:08:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559534899; bh=ajG/F0kP1NlQuljlN6U/Olvuz7yQqibG3MWLzLB49p8=; h=From:To:Cc:Subject:Date:From; b=bH76ofwqQq+qXCdWWQcDOrH4yMn/Xy5JvHiUgEidFTWfL5BFXvCG5Exwex06ipDUh 5D3ynKai4X6QOCQJmkxJ02ZNc8W7KI8gLlXKNXLzqkEpZi3r9nCm1EslXosxrAL9q/ j1mFtMW4uOaBf3KiZoj9xeWTjzI5FM6eXB4l+u3I= From: David Ahern To: davem@davemloft.net, netdev@vger.kernel.org Cc: idosch@mellanox.com, saeedm@mellanox.com, kafai@fb.com, weiwan@google.com, David Ahern Subject: [PATCH v2 net-next 0/7] net: add struct nexthop to fib{6}_info Date: Sun, 2 Jun 2019 21:08:10 -0700 Message-Id: <20190603040817.4825-1-dsahern@kernel.org> X-Mailer: git-send-email 2.11.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: David Ahern This sets adds 'struct nexthop' to fib_info and fib6_info. IPv4 already handles multiple fib_nh entries in a single fib_info, so the conversion to use a nexthop struct is fairly mechanical. IPv6 using a nexthop struct with a fib6_info impacts a lot of core logic which is built around the assumption of a single, builtin fib6_nh per fib6_info. To make this easier to review, this set adds nexthop to fib6_info and adds checks in most places fib6_info is used. The next set finishes the IPv6 conversion, walking through the places that need to consider all fib6_nh within a nexthop struct. Offload drivers - mlx5, mlxsw and rocker - are changed to fail FIB entries using nexthop objects. That limitation can be removed once the drivers are updated to properly support separate nexthops. This set starts by adding accessors for fib_nh and fib_nhs in a fib_info. This makes it easier to extract the number of nexthops in the fib entry and a specific fib_nh once the entry references a struct nexthop. Patch 2 converts more of IPv4 code to use fib_nh_common allowing a struct nexthop to use a fib6_nh with an IPv4 entry. Patches 3 and 4 add 'struct nexthop' to fib{6}_info and update references to both take a different path when it is set. New exported functions are added to the nexthop code to validate a nexthop struct when configured for use with a fib entry. IPv4 is allowed to use a nexthop with either v4 or v6 entries. IPv6 is limited to v6 entries only. In both cases list_heads track the fib entries using a nexthop struct for fast correlation on events (e.g., device events or nexthop events like delete or replace). The last 3 patches add hooks to drivers listening for FIB notificationas. All 3 of them reject the routes as unsupported, returning an error message to the user via extack. For mlxsw at least this is a stop gap measure until the driver is updated for proper support. Functional tests for nexthops have already been committed. Those tests will be active after the next patch set which makes the code paths created by this set and the next one live. Existing code paths moved to the else branch of 'if (f{6}i->nh)' checks are covered by existing tests under selftests/net. v2 - no code changes from v1 - commit messages for first 4 patches updated David Ahern (7): ipv4: Use accessors for fib_info nexthop data ipv4: Prepare for fib6_nh from a nexthop object ipv4: Plumb support for nexthop object in a fib_info ipv6: Plumb support for nexthop object in a fib6_info mlxsw: Fail attempts to use routes with nexthop objects mlx5: Fail attempts to use routes with nexthop objects rocker: Fail attempts to use routes with nexthop objects drivers/net/ethernet/mellanox/mlx5/core/lag_mp.c | 33 ++- .../net/ethernet/mellanox/mlxsw/spectrum_router.c | 33 ++- drivers/net/ethernet/rocker/rocker_main.c | 4 + drivers/net/ethernet/rocker/rocker_ofdpa.c | 25 +- include/net/ip6_fib.h | 11 +- include/net/ip6_route.h | 13 +- include/net/ip_fib.h | 25 +- include/net/nexthop.h | 113 +++++++++ net/core/filter.c | 3 +- net/ipv4/fib_frontend.c | 15 +- net/ipv4/fib_lookup.h | 1 + net/ipv4/fib_rules.c | 8 +- net/ipv4/fib_semantics.c | 257 ++++++++++++++------- net/ipv4/fib_trie.c | 38 ++- net/ipv4/nexthop.c | 111 ++++++++- net/ipv4/route.c | 5 +- net/ipv6/addrconf.c | 5 + net/ipv6/ip6_fib.c | 22 +- net/ipv6/ndisc.c | 3 +- net/ipv6/route.c | 156 +++++++++++-- 20 files changed, 706 insertions(+), 175 deletions(-) -- 2.11.0