From patchwork Wed May 20 15:21:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Fedorenko X-Patchwork-Id: 218892 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 4A4C8C433E1 for ; Wed, 20 May 2020 15:21:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0658520708 for ; Wed, 20 May 2020 15:21:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=novek.ru header.i=@novek.ru header.b="QSOKF2BX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726840AbgETPV6 (ORCPT ); Wed, 20 May 2020 11:21:58 -0400 Received: from novek.ru ([213.148.174.62]:60446 "EHLO novek.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726812AbgETPV4 (ORCPT ); Wed, 20 May 2020 11:21:56 -0400 Received: from nat1.ooonet.ru (gw.zelenaya.net [91.207.137.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by novek.ru (Postfix) with ESMTPSA id D503A50297C; Wed, 20 May 2020 18:21:50 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 novek.ru D503A50297C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=novek.ru; s=mail; t=1589988111; bh=koLO4TISG4gY89/5vPvgGSwyjXwmtufqW8yuetn79g4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QSOKF2BXivokcrvKm/QW9dlRkcRZZcdvMzI6FKfslXcoQrjGWq3ZpoALGe2EWtXCI MgXDZeGV5Hn1oz416idJ0W5sc7InYe5VtHjUh/5F89cMld1uok7x4cEV2vHqOgnRnA IuJBWe7mZqcod54Z+0wiXTJnARrAcAeIcml9g41E= From: Vadim Fedorenko To: "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI Cc: Jakub Kicinski , netdev@vger.kernel.org, Vadim Fedorenko Subject: [net-next v2 2/5] ip6_tunnel: add MPLS transmit support Date: Wed, 20 May 2020 18:21:36 +0300 Message-Id: <1589988099-13095-3-git-send-email-vfedorenko@novek.ru> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1589988099-13095-1-git-send-email-vfedorenko@novek.ru> References: <1589988099-13095-1-git-send-email-vfedorenko@novek.ru> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add ETH_P_MPLS_UC as supported protocol. Signed-off-by: Vadim Fedorenko --- net/ipv6/ip6_tunnel.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index dae6f71..6b94c87 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c @@ -1232,6 +1232,8 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, ipv6_push_frag_opts(skb, &opt.ops, &proto); } + skb_set_inner_ipproto(skb, proto); + skb_push(skb, sizeof(struct ipv6hdr)); skb_reset_network_header(skb); ipv6h = ipv6_hdr(skb); @@ -1348,6 +1350,7 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, fl6.flowlabel |= ip6_flowlabel(ipv6h); break; default: + orig_dsfield = dsfield = ip6_tclass(t->parms.flowinfo); break; } } @@ -1358,8 +1361,6 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, if (iptunnel_handle_offloads(skb, SKB_GSO_IPXIP6)) return -1; - skb_set_inner_ipproto(skb, protocol); - err = ip6_tnl_xmit(skb, dev, dsfield, &fl6, encap_limit, &mtu, protocol); if (err != 0) { @@ -1402,6 +1403,9 @@ int ip6_tnl_xmit(struct sk_buff *skb, struct net_device *dev, __u8 dsfield, goto tx_err; ipproto = IPPROTO_IPV6; break; + case htons(ETH_P_MPLS_UC): + ipproto = IPPROTO_MPLS; + break; default: goto tx_err; } From patchwork Wed May 20 15:21:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadim Fedorenko X-Patchwork-Id: 218891 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=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 C3F6BC433DF for ; Wed, 20 May 2020 15:22:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E66E206F1 for ; Wed, 20 May 2020 15:22:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=novek.ru header.i=@novek.ru header.b="zY3poZ5B" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726847AbgETPWA (ORCPT ); Wed, 20 May 2020 11:22:00 -0400 Received: from novek.ru ([213.148.174.62]:60482 "EHLO novek.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbgETPV5 (ORCPT ); Wed, 20 May 2020 11:21:57 -0400 Received: from nat1.ooonet.ru (gw.zelenaya.net [91.207.137.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by novek.ru (Postfix) with ESMTPSA id 39D4150297F; Wed, 20 May 2020 18:21:53 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 novek.ru 39D4150297F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=novek.ru; s=mail; t=1589988113; bh=VtUyf6hsuINjN+T0FznwgIS6kg1fzlFz9pd2k+X/wk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zY3poZ5BD0Y7aTberAfGydUscLwg2CCVTBbBimk6nUut8Se3B93qzjpyF1lCfIFpN HKzcr+AJOx1BCk8pf1xAXDwbxutb3okAKiUhNCp/7B6F+UDKcf1HmVO6gVXXtTgpe8 gOtieAlud9idpuGpw82KKbmcq1duSIXl5DGc9tqI= From: Vadim Fedorenko To: "David S. Miller" , Alexey Kuznetsov , Hideaki YOSHIFUJI Cc: Jakub Kicinski , netdev@vger.kernel.org, Vadim Fedorenko Subject: [net-next v2 5/5] mpls: Add support for IPv6 tunnels Date: Wed, 20 May 2020 18:21:39 +0300 Message-Id: <1589988099-13095-6-git-send-email-vfedorenko@novek.ru> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1589988099-13095-1-git-send-email-vfedorenko@novek.ru> References: <1589988099-13095-1-git-send-email-vfedorenko@novek.ru> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Add support for IPv6 tunnel devices in AF_MPLS. Signed-off-by: Vadim Fedorenko --- net/mpls/af_mpls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/mpls/af_mpls.c b/net/mpls/af_mpls.c index a42e4ed..fd30ea6 100644 --- a/net/mpls/af_mpls.c +++ b/net/mpls/af_mpls.c @@ -1593,7 +1593,8 @@ static int mpls_dev_notify(struct notifier_block *this, unsigned long event, dev->type == ARPHRD_IPGRE || dev->type == ARPHRD_IP6GRE || dev->type == ARPHRD_SIT || - dev->type == ARPHRD_TUNNEL) { + dev->type == ARPHRD_TUNNEL || + dev->type == ARPHRD_TUNNEL6) { mdev = mpls_add_dev(dev); if (IS_ERR(mdev)) return notifier_from_errno(PTR_ERR(mdev));