From patchwork Thu Jan 23 18:06:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Varghese X-Patchwork-Id: 1228392 Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) 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; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=M6N3NVHJ; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 483VZY2ky3z9s1x for ; Fri, 24 Jan 2020 05:06:13 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728981AbgAWSGL (ORCPT ); Thu, 23 Jan 2020 13:06:11 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:45693 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728853AbgAWSGL (ORCPT ); Thu, 23 Jan 2020 13:06:11 -0500 Received: by mail-pl1-f195.google.com with SMTP id b22so1659982pls.12 for ; Thu, 23 Jan 2020 10:06:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=yxDbVma/IiAiec5rslu2trOgPultWipHN/bEQHgHXAE=; b=M6N3NVHJCGW0E9haUH2bg9HTH9mgGFLBHmTTdXRJl99UAvnykk0haxaUE1jITrxlpr /MRjxogyBc+hO00HAhINOBBriw9UQ14kJIG7a5MYjYtbjgn4MCvz0mPEdj23SjrXLIgC zZGMt3nttHNSWDvPe8xVHRloK+xhkoSA9XZdra5gOyzw4kNXXtkQZSq/AgL5jd+pmwKn q8v3LHWQQqh4PfBZefh9mZOpoaFQuwZ9pwB/ZbWbU1ZKumBc+FxOecrKrZ87j+31GJdN vOhxOuNekVW7b7QyRJKI+axuZTM9w44XSGecL/l+c0JQMsORbj5TIVPfMkmb+I4mWMIz yaUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=yxDbVma/IiAiec5rslu2trOgPultWipHN/bEQHgHXAE=; b=Ol3IEZK2HBO2Y+cUcKG/Szs6BEWAtqFWM0kFhnHwtoGA5aJUx/YjJU1isZC8eqsJUn gDOhnoT6YzNFf5acQWHGE1zlokFT4piMzjFpGkRlYC1aznCFVZaLbjz6RTckwwDPmXfb zu9Orm8h7ZdEMtV/NWfjnchBjbwkNr5CNLcE89VtClCQJShuNiW4JBf325JxnZSCYIsx G2nulQFQ20r0K1qo1zkzHpUviNLVpFK+cYv5zcUgvYUzS/idRMULHarVawXCWbG2qNRt Wx8R6t8qiRPS26eE+dT1ySuDvMJ+D7gc6e2NxmvMxVY5Z2XhDtg/wo/fWh5K+A8sxPs8 FSDQ== X-Gm-Message-State: APjAAAUYWk+ohDESfmVLA1Xmg0JTAS1RN33KWjfu79TAeUR1/yfuj9fD qe6WLh8HqMCxBz9Q4cl2FGK1Ky4/ X-Google-Smtp-Source: APXvYqxG6n3YqwtrSxrlteorg9yVMjxbhc7KhncpJUijL7s34VGh0OSw5UsjKlHJJ47qwB6JlMBLmw== X-Received: by 2002:a17:90a:ba91:: with SMTP id t17mr6017450pjr.74.1579802770928; Thu, 23 Jan 2020 10:06:10 -0800 (PST) Received: from martin-VirtualBox.dlink.router ([122.178.219.138]) by smtp.gmail.com with ESMTPSA id r3sm3402869pfg.145.2020.01.23.10.06.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 23 Jan 2020 10:06:10 -0800 (PST) From: Martin Varghese To: netdev@vger.kernel.org, stephen@networkplumber.org, scott.drennan@nokia.com, jbenc@redhat.com, martin.varghese@nokia.com Subject: [PATCH net-next v5 0/1] Bareudp Device Support Date: Thu, 23 Jan 2020 23:36:04 +0530 Message-Id: X-Mailer: git-send-email 1.9.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Martin Varghese There are various L3 encapsulation standards using UDP being discussed to leverage the UDP based load balancing capability of different networks. MPLSoUDP (__ https://tools.ietf.org/html/rfc7510) is one among them. The Bareudp tunnel module provides a generic L3 encapsulation tunnelling support for tunnelling different L3 protocols like MPLS, IP, NSH etc. inside a UDP tunnel. Special Handling ---------------- The bareudp device supports special handling for MPLS & IP as they can have multiple ethertypes. MPLS procotcol can have ethertypes ETH_P_MPLS_UC (unicast) & ETH_P_MPLS_MC (multicast). IP protocol can have ethertypes ETH_P_IP (v4) & ETH_P_IPV6 (v6). This special handling can be enabled only for ethertypes ETH_P_IP & ETH_P_MPLS_UC with a flag called multiproto mode. Usage ------ 1) Device creation & deletion a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype 0x8847. This creates a bareudp tunnel device which tunnels L3 traffic with ethertype 0x8847 (MPLS traffic). The destination port of the UDP header will be set to 6635.The device will listen on UDP port 6635 to receive traffic. b) ip link delete bareudp0 2) Device creation with multiple proto mode enabled There are two ways to create a bareudp device for MPLS & IP with multiproto mode enabled. a) ip link add dev bareudp0 type bareudp dstport 6635 ethertype 0x8847 multiproto b) ip link add dev bareudp0 type bareudp dstport 6635 ethertype mpls 3) Device Usage The bareudp device could be used along with OVS or flower filter in TC. The OVS or TC flower layer must set the tunnel information in SKB dst field before sending packet buffer to the bareudp device for transmission. On reception the bareudp device extracts and stores the tunnel information in SKB dst field before passing the packet buffer to the network stack. Martin Varghese (1): Bareudp device support include/uapi/linux/if_link.h | 12 ++++ ip/Makefile | 2 +- ip/iplink.c | 2 +- ip/iplink_bareudp.c | 157 +++++++++++++++++++++++++++++++++++++++++++ man/man8/ip-link.8.in | 38 +++++++++++ 5 files changed, 209 insertions(+), 2 deletions(-) create mode 100644 ip/iplink_bareudp.c