From patchwork Tue Aug 4 05:53:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Brivio X-Patchwork-Id: 1340672 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=i+50HbGC; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 4BLP8R5X6fz9sRR for ; Tue, 4 Aug 2020 15:54:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729846AbgHDFyO (ORCPT ); Tue, 4 Aug 2020 01:54:14 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:37443 "EHLO us-smtp-delivery-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726398AbgHDFyO (ORCPT ); Tue, 4 Aug 2020 01:54:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596520453; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=VZ6YDJD55kpYQ33m1APvTAf4DIZYbqpLUJ1HTP7ssRA=; b=i+50HbGCnpIyczkT4mE53WBPVHzduzQfYAC4NPpSIaAA2e0P3+QvlSN83b23DrTUoqaQM3 tzocz1KvDQHwzpIbnT9fsBvpv2AQqqKz4ythkytK5qORFcpHrmpN945wCCzQKCto9AWD4i hCd8Nn9ryP77LSti2DCLpn5Ev4Lup7Q= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-345-WYat1sdqPD-Ww2Z6qu7cTQ-1; Tue, 04 Aug 2020 01:54:10 -0400 X-MC-Unique: WYat1sdqPD-Ww2Z6qu7cTQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 77D92106B24E; Tue, 4 Aug 2020 05:54:08 +0000 (UTC) Received: from epycfail.redhat.com (unknown [10.36.110.53]) by smtp.corp.redhat.com (Postfix) with ESMTP id A4B911001B2C; Tue, 4 Aug 2020 05:54:05 +0000 (UTC) From: Stefano Brivio To: "David S. Miller" Cc: Florian Westphal , David Ahern , Aaron Conole , Numan Siddique , Jakub Kicinski , Pravin B Shelar , Roopa Prabhu , Nikolay Aleksandrov , Lourdes Pedrajas , netdev@vger.kernel.org Subject: [PATCH net-next v2 0/6] Support PMTU discovery with bridged UDP tunnels Date: Tue, 4 Aug 2020 07:53:41 +0200 Message-Id: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Currently, PMTU discovery for UDP tunnels only works if packets are routed to the encapsulating interfaces, not bridged. This results from the fact that we generally don't have valid routes to the senders we can use to relay ICMP and ICMPv6 errors, and makes PMTU discovery completely non-functional for VXLAN and GENEVE ports of both regular bridges and Open vSwitch instances. If the sender is local, and packets are forwarded to the port by a regular bridge, all it takes is to generate a corresponding route exception on the encapsulating device. The bridge then finds the route exception carrying the PMTU value estimate as it forwards frames, and relays ICMP messages back to the socket of the local sender. Patch 1/6 fixes this case. If the sender resides on another node, we actually need to reply to IP and IPv6 packets ourselves and send these ICMP or ICMPv6 errors back, using the same encapsulating device. Patch 2/6, based on an original idea by Florian Westphal, adds the needed functionality, while patches 3/6 and 4/6 add matching support for VXLAN and GENEVE. Finally, 5/6 and 6/6 introduce selftests for all combinations of inner and outer IP versions, covering both VXLAN and GENEVE, with both regular bridges and Open vSwitch instances. v2: Add helper to check for any bridge port, skip oif check for PMTU routes for bridge ports only, split IPv4 and IPv6 helpers and functions (all suggested by David Ahern) Stefano Brivio (6): ipv4: route: Ignore output interface in FIB lookup for PMTU route tunnels: PMTU discovery support for directly bridged IP packets vxlan: Support for PMTU discovery on directly bridged links geneve: Support for PMTU discovery on directly bridged links selftests: pmtu.sh: Add tests for bridged UDP tunnels selftests: pmtu.sh: Add tests for UDP tunnels handled by Open vSwitch drivers/net/bareudp.c | 5 +- drivers/net/geneve.c | 55 ++++- drivers/net/vxlan.c | 47 +++- include/linux/netdevice.h | 5 + include/net/dst.h | 10 - include/net/ip_tunnels.h | 2 + net/ipv4/ip_tunnel_core.c | 244 +++++++++++++++++++ net/ipv4/route.c | 5 + tools/testing/selftests/net/pmtu.sh | 347 +++++++++++++++++++++++++++- 9 files changed, 691 insertions(+), 29 deletions(-)