From patchwork Thu Dec 21 19:33:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Herbert X-Patchwork-Id: 852083 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=quantonium-net.20150623.gappssmtp.com header.i=@quantonium-net.20150623.gappssmtp.com header.b="y1jeZKSt"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z2hdv0YzSz9s84 for ; Fri, 22 Dec 2017 06:33:55 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755162AbdLUTdx (ORCPT ); Thu, 21 Dec 2017 14:33:53 -0500 Received: from mail-pg0-f50.google.com ([74.125.83.50]:35981 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752732AbdLUTdv (ORCPT ); Thu, 21 Dec 2017 14:33:51 -0500 Received: by mail-pg0-f50.google.com with SMTP id k134so13615999pga.3 for ; Thu, 21 Dec 2017 11:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantonium-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=DeqmauJxdDv2jFB7Xqpxv2fszC6qne0nzCi8cXJWIuI=; b=y1jeZKStzGYyui8iXQgBh29OMKhoPxyHSp9qLI5ZqSQmflq8mJQyzYhVDtamHr3s/5 0H8p+VNAna9x5i7r+NvnRsVMxJlpi0b7swyDI2nxtsrIVG6Cxp8Ge609JCop39SH/WL9 TNHC+hbxxXXt8wpEHjQiyCrprM7XFzad6DsRzl2ISjpOQMLufOBrhwkumpy4u8IEECwa ScSY0ogb7OweOYeFhgRmxCFiUT2UTBoqjWAF6ZAgmafWvLmc4GudZvxy20Lj/yAi6IEQ dgGhrCImkOAtWx5klg6sp7hyiONFNptVWrtXVDleZ9y9i287St/6sVgE2MERhEDXnwf9 /pyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=DeqmauJxdDv2jFB7Xqpxv2fszC6qne0nzCi8cXJWIuI=; b=YEUelJMS6tOp/mPNX3lJki9OVeP46FhAHHdTVdMKcTZGYs6aV7e0zOYwfDsraAGV55 yrc5i7j9A8R6XyKN11qU9I27g0ZMZKFbpcnuQJyBubAV7vgOh218gS+2FoXEHsXd0V1O e8NEj/K2P8M4vrKUT9cSCNGryxf5+LaZqnGmE1ObXM0hocn/NER8Gi/Wdk6pqjc/CQcX lpvYpQ/jpJz15Dc9RAa6gbaxGuid4p3stKtnHJjSXnhQHsui5Fh8vraQssOZhcUO5+jU Cn+segX47XaI+LP6WukF500ZSUVVNCTmIBpfsEaG6M3L52oubKQSelErnnY0/AEQ+PVH SnVw== X-Gm-Message-State: AKGB3mKYdyJ4E25o2Ml+wpUGBpwFmUxu84WZAOhW1Nnxf0hkjjmqqwNq IGDxKj0QmJ7S0lMKAoC1AESTDQ== X-Google-Smtp-Source: ACJfBotYwoYgwG4YBi97nMd0WuIe0SDlWoaz3XIh7KgkQ2KgH6cUde8n5VPN0lIF+VkZ+A20xoe8aA== X-Received: by 10.98.74.148 with SMTP id c20mr11533029pfj.200.1513884830858; Thu, 21 Dec 2017 11:33:50 -0800 (PST) Received: from localhost.localdomain (c-73-162-13-107.hsd1.ca.comcast.net. [73.162.13.107]) by smtp.gmail.com with ESMTPSA id p126sm35384464pga.58.2017.12.21.11.33.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 21 Dec 2017 11:33:49 -0800 (PST) From: Tom Herbert To: davem@davemloft.net Cc: netdev@vger.kernel.org, roopa@cumulusnetworks.com, rohit@quantonium.net, Tom Herbert Subject: [PATCH v5 net-next 0/7] net: ILA notification mechanism and fixes Date: Thu, 21 Dec 2017 11:33:25 -0800 Message-Id: <20171221193332.15303-1-tom@quantonium.net> 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 This patch set adds support to get netlink notifications for ILA routes when a route is used. This patch set contains: - General infrastructure for route notifications - The ILA route notification mechanism - Add net to ila build_state - Add flush command to ila_xlat - Fix use of rhashtable for latest fixes Route notifications will be used in conjunction with populating ILA forwarding caches. There are three methods described in the ILA Mapping Protocol. These are redirects, request/reply, and push. The ILA route mechanism is relevant to the first two methods. - ILA router secure redirect mechanism-- This is used on an ILA router where a notification is sent when an ILA host route is used. The purpose of this notification is to send an ILA redirect towards the ILA forwarding node of a source to inform it of a direct ILA route. When the forwarding node receives the redirect it can populate its cache so that subsequent packets take the direct path. This is the RECOMMENDED method. - Cache address resolution-- This used to perform request/reply address resolution on a route. As noted on netdev list, a request/reply mechanism is susceptible to DOS attacks. For this reason, this method is not NOT RECOMMENDED as the primary means to populate an ILA cache. ILAMP is described in https://www.ietf.org/internet-drafts/draft-herbert-ila-ilamp-00.txt Tested: Ran ILA traffic, set up ILA notify routes and observed correct routing message via ip monitor. v5: - Fix some compiler and sparse warnings - Generalize route notify with RTM_NOTIFYROUTE, RTNLGRP_ROUTE_NOTIFY (suggested by Roopa) v4: - Remove front end cache per davem feedback - Eliminate separate LWT type just use ILA LWT already in place v3: - Removed rhashtable changes to their own patch set - Restructure ILA code to be more amenable to changes - Remove extra call back functions in resolution interface Changes from initial RFC: - Added net argument to LWT build_state - Made resolve timeout an attribute of the LWT encap route - Changed ILA notifications to be regular routing messages of event RTM_ADDR_RESOLVE, family RTNL_FAMILY_ILA, and group RTNLGRP_ILA_NOTIFY Tom Herbert (7): lwt: Add net to build_state argument rtnetlink: Add notify route message types ila: Fix use of rhashtable walk in ila_xlat.c ila: Call library function alloc_bucket_locks ila: Create main ila source file ila: Flush netlink command to clear xlat table ila: Route notify include/net/lwtunnel.h | 6 +- include/uapi/linux/ila.h | 3 + include/uapi/linux/rtnetlink.h | 6 + net/core/lwt_bpf.c | 2 +- net/core/lwtunnel.c | 4 +- net/ipv4/fib_semantics.c | 13 +- net/ipv4/ip_tunnel_core.c | 4 +- net/ipv6/ila/Makefile | 2 +- net/ipv6/ila/ila.h | 27 +++- net/ipv6/ila/ila_common.c | 30 ----- net/ipv6/ila/ila_lwt.c | 275 ++++++++++++++++++++++++++------------ net/ipv6/ila/ila_main.c | 121 +++++++++++++++++ net/ipv6/ila/ila_xlat.c | 290 ++++++++++++++++++++--------------------- net/ipv6/route.c | 2 +- net/ipv6/seg6_iptunnel.c | 2 +- net/ipv6/seg6_local.c | 5 +- net/mpls/mpls_iptunnel.c | 2 +- 17 files changed, 511 insertions(+), 283 deletions(-) create mode 100644 net/ipv6/ila/ila_main.c