All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@kernel.org>
To: davem@davemloft.net, netdev@vger.kernel.org
Cc: idosch@mellanox.com, jiri@mellanox.com, David Ahern <dsahern@gmail.com>
Subject: [PATCH net-next 00/18] ipv4: Enable support for IPv6 gateway with IPv4 routes
Date: Thu,  4 Apr 2019 10:49:49 -0700	[thread overview]
Message-ID: <20190404175007.8150-1-dsahern@kernel.org> (raw)

From: David Ahern <dsahern@gmail.com>

Last set of three with the end goal of enabling IPv6 gateways with IPv4
routes.

This set adds fib6_nh_init and release to the IPv6 stubs, and adds neighbor
helpers that IPv4 code invokes to resolve an IPv6 address. When using
an IPv6 neighbor entry the hh_cache is bypassed as it contains the wrong
ethernet header for an IPv4 packet.

The nh_common nhc_has_gw was a temporary field used to convert existing
code from fib{6}_nh to fib_nh_common. That field is now converted to
nhc_gw_family to differentiate the address family of the gateway entry
as opposed to the address family of the container of fib_nh_common.

Existing code for rtable and fib_config is refactored to prepare
for a v6 address and then support is added. From there various
miscellaneous functions are updated to handle a v6 gateway - from
validating the v6 address to lookups in bpf code to verifying the
nexthop state.

Offload drivers - mlxsw and rocker - are modified to detect the v6
gateway and reject the route as 'unsupported'. e.g.,

    $ ip ro add 172.16.101.0/24 via inet6 fe80::202:ff:fe00:b dev swp1s0
    Error: mlxsw_spectrum: IPv6 gateway with IPv4 route is not supported.

This can be removed in time once support is added to each.

With the infrastructure changes in place, patch 17 enables it by adding
support for RTA_VIA to IPv4. RTA_VIA can be used for IPv4 addresses as
well. Only one of RTA_VIA and RTA_GATEWAY can be passed in a request.

Patch 18 adds a few test cases to fib_tests.sh.

David Ahern (18):
  ipv6: Add fib6_nh_init and release to stubs
  ipv6: Add neighbor helpers that use the ipv6 stub
  net: Replace nhc_has_gw with nhc_gw_family
  ipv4: Prepare rtable for IPv6 gateway
  ipv4: Prepare fib_config for IPv6 gateway
  ipv4: Add support to rtable for ipv6 gateway
  ipv4: Add support to fib_config for IPv6 gateway
  ipv4: Refactor fib_check_nh
  ipv4: Add fib_check_nh_v6_gw
  neighbor: Add skip_cache argument to neigh_output
  ipv4: Add helpers for neigh lookup for nexthop
  bpf: Handle ipv6 gateway in bpf_ipv4_fib_lookup
  ipv4: Handle ipv6 gateway in ipv4_confirm_neigh
  ipv4: Handle ipv6 gateway in fib_detect_death
  ipv4: Handle ipv6 gateway in fib_good_nh
  ipv4: Flag fib_info with a fib_nh using IPv6 gateway
  ipv4: Allow ipv6 gateway with ipv4 routes
  selftests: fib_tests: Add tests for ipv6 gateway with ipv4 route

 drivers/infiniband/core/addr.c                     |   2 +-
 drivers/infiniband/hw/nes/nes_cm.c                 |   2 +-
 drivers/net/appletalk/ipddp.c                      |   6 +-
 .../net/ethernet/mellanox/mlx5/core/en/tc_tun.c    |   2 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_router.c  |  12 +-
 .../net/ethernet/mellanox/mlxsw/spectrum_span.c    |   6 +-
 drivers/net/ethernet/rocker/rocker_main.c          |   9 +
 drivers/net/vrf.c                                  |  12 +-
 include/net/ip6_route.h                            |   2 +-
 include/net/ip_fib.h                               |  16 +-
 include/net/ipv6_stubs.h                           |   6 +
 include/net/ndisc.h                                |  40 ++
 include/net/neighbour.h                            |   5 +-
 include/net/route.h                                |  43 +-
 include/trace/events/fib.h                         |   4 +-
 net/atm/clip.c                                     |   4 +-
 net/core/filter.c                                  |  25 +-
 net/ipv4/fib_frontend.c                            |  68 +++-
 net/ipv4/fib_semantics.c                           | 432 ++++++++++++++-------
 net/ipv4/inet_connection_sock.c                    |   4 +-
 net/ipv4/ip_forward.c                              |   2 +-
 net/ipv4/ip_output.c                               |  13 +-
 net/ipv4/route.c                                   | 112 ++++--
 net/ipv4/xfrm4_policy.c                            |   7 +-
 net/ipv6/addrconf.c                                |   2 +-
 net/ipv6/addrconf_core.c                           |   9 +
 net/ipv6/af_inet6.c                                |   2 +
 net/ipv6/ip6_fib.c                                 |   2 +-
 net/ipv6/ip6_output.c                              |   2 +-
 net/ipv6/route.c                                   |  18 +-
 net/mpls/mpls_iptunnel.c                           |  12 +-
 tools/testing/selftests/net/fib_tests.sh           |  70 +++-
 32 files changed, 695 insertions(+), 256 deletions(-)

-- 
2.11.0


             reply	other threads:[~2019-04-04 17:50 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04 17:49 David Ahern [this message]
2019-04-04 17:49 ` [PATCH net-next 01/18] ipv6: Add fib6_nh_init and release to stubs David Ahern
2019-04-05 12:46   ` Ido Schimmel
2019-04-05 14:49     ` David Ahern
2019-04-04 17:49 ` [PATCH net-next 02/18] ipv6: Add neighbor helpers that use the ipv6 stub David Ahern
2019-04-05 12:53   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 03/18] net: Replace nhc_has_gw with nhc_gw_family David Ahern
2019-04-05 13:04   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 04/18] ipv4: Prepare rtable for IPv6 gateway David Ahern
2019-04-05 13:13   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 05/18] ipv4: Prepare fib_config " David Ahern
2019-04-05 13:38   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 06/18] ipv4: Add support to rtable for ipv6 gateway David Ahern
2019-04-05 13:48   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 07/18] ipv4: Add support to fib_config for IPv6 gateway David Ahern
2019-04-05 14:00   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 08/18] ipv4: Refactor fib_check_nh David Ahern
2019-04-05 14:11   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 09/18] ipv4: Add fib_check_nh_v6_gw David Ahern
2019-04-05 14:18   ` Ido Schimmel
2019-04-04 17:49 ` [PATCH net-next 10/18] neighbor: Add skip_cache argument to neigh_output David Ahern
2019-04-04 17:50 ` [PATCH net-next 11/18] ipv4: Add helpers for neigh lookup for nexthop David Ahern
2019-04-05 14:48   ` Ido Schimmel
2019-04-04 17:50 ` [PATCH net-next 12/18] bpf: Handle ipv6 gateway in bpf_ipv4_fib_lookup David Ahern
2019-04-04 17:50 ` [PATCH net-next 13/18] ipv4: Handle ipv6 gateway in ipv4_confirm_neigh David Ahern
2019-04-04 17:50 ` [PATCH net-next 14/18] ipv4: Handle ipv6 gateway in fib_detect_death David Ahern
2019-04-04 17:50 ` [PATCH net-next 15/18] ipv4: Handle ipv6 gateway in fib_good_nh David Ahern
2019-04-04 17:50 ` [PATCH net-next 16/18] ipv4: Flag fib_info with a fib_nh using IPv6 gateway David Ahern
2019-04-05 14:54   ` Ido Schimmel
2019-04-04 17:50 ` [PATCH net-next 17/18] ipv4: Allow ipv6 gateway with ipv4 routes David Ahern
2019-04-04 17:50 ` [PATCH net-next 18/18] selftests: fib_tests: Add tests for ipv6 gateway with ipv4 route David Ahern
2019-04-05 15:56 ` [PATCH net-next 00/18] ipv4: Enable support for IPv6 gateway with IPv4 routes Ido Schimmel
2019-04-05 23:38   ` David Ahern

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190404175007.8150-1-dsahern@kernel.org \
    --to=dsahern@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dsahern@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.