From patchwork Wed Dec 2 12:33:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Bonn X-Patchwork-Id: 11945915 X-Patchwork-Delegate: kuba@kernel.org 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 73325C64E8A for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2540E2222A for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727064AbgLBMeg (ORCPT ); Wed, 2 Dec 2020 07:34:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbgLBMeg (ORCPT ); Wed, 2 Dec 2020 07:34:36 -0500 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1362EC0613D4 for ; Wed, 2 Dec 2020 04:33:50 -0800 (PST) Received: by mail-lj1-x243.google.com with SMTP id f18so3424618ljg.9 for ; Wed, 02 Dec 2020 04:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norrbonn-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=WLizZ4UdUCyVcfP2HmrWjFnwcFxh8nxr6cVF2v4pr4U=; b=D3sDHiZnzEHBDFKUW6bO9d56LfBCoFAe5W1v71Tehnnjf6jS52tf+Qb0OoV1Ajfvsc iwREHxlJGfzh3ezdwnWNLRS+hUPXyH0vQyH+ukIQu4Ur3WHp1pn6NIoraM9zcD9SBuj8 ykf8LjG0kpEc+TNoAIb5hDDkvQzBuUW7lyie2yyxqu2km4HQkO8TXDBdgkMPfasn4bcv PpyJIAqAC7m2v/sK5XfuDYDNRWXPOvQ/xGyNB7y1bvKH/B9ZpKspNTd8HVxNvu6/fAxq LqT0p9IqHLyulFYOUTvg+kPNWHsLrqQ3QRSxVSTSIcnldFhL9PLv/yvWoPHb0/BDKtFD lkdA== 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:mime-version :content-transfer-encoding; bh=WLizZ4UdUCyVcfP2HmrWjFnwcFxh8nxr6cVF2v4pr4U=; b=or3N9TpOuE7ima/+Fr49sem1ptAOFz1OR/b9ihixwC3vyfEWQgiEENkjrhs67aROal ZHsU6dPwdIyeoRO7w4xodCw5adInaL+cAEwTTra2Lm2uVKTBwC2v6o8OSDv3nh6uzYhY fYGDO+bTUvjkA3pmL8Pwsx8VurH6zHOYADVZ4jQ1BmMt3AzGojz75qkTCBodLYfSaHmk kT593hm6aOtB5ZrbBUIZP/ReUEC4H38uLyaQvRLbRguIXdablTnlucrEc7OPpwecl9In w+ZoIkrO8fSNpz2H2cQT69hsNHRw26aZ5v/1oSXJjLMfZcI9qp3K3rK/ZTMyDKv5Y4Xu JiDg== X-Gm-Message-State: AOAM531ycNfyLhUSf55ODESMSVF+2iTTDyjQSM4SFzIdV2tF6RJ2kJt6 Z8E8mc8kswH+ahWBSyIpxq5liAwktA6mrA== X-Google-Smtp-Source: ABdhPJxaanSx6dq5qJsIXNfeAzNrKCk9kjCmC2y4smzebtoSSC625s2on1zm/fGqBjgpsz4CzZbq9Q== X-Received: by 2002:a2e:3012:: with SMTP id w18mr1079470ljw.380.1606912428441; Wed, 02 Dec 2020 04:33:48 -0800 (PST) Received: from mimer.lan (h-137-65.A159.priv.bahnhof.se. [81.170.137.65]) by smtp.gmail.com with ESMTPSA id m7sm439230ljb.8.2020.12.02.04.33.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 04:33:47 -0800 (PST) From: Jonas Bonn To: netdev@vger.kernel.org, pablo@netfilter.org Cc: laforge@gnumonks.org, Jonas Bonn Subject: [PATCH 1/5] gtp: set initial MTU Date: Wed, 2 Dec 2020 13:33:41 +0100 Message-Id: <20201202123345.565657-1-jonas@norrbonn.se> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The GTP link is brought up with a default MTU of zero. This can lead to some rather unexpected behaviour for users who are more accustomed to interfaces coming online with reasonable defaults. This patch sets an initial MTU for the GTP link of 1500 less worst-case tunnel overhead. Signed-off-by: Jonas Bonn --- drivers/net/gtp.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 4c04e271f184..5a048f050a9c 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -612,11 +612,16 @@ static const struct net_device_ops gtp_netdev_ops = { static void gtp_link_setup(struct net_device *dev) { + unsigned int max_gtp_header_len = sizeof(struct iphdr) + + sizeof(struct udphdr) + + sizeof(struct gtp0_header); + dev->netdev_ops = >p_netdev_ops; dev->needs_free_netdev = true; dev->hard_header_len = 0; dev->addr_len = 0; + dev->mtu = ETH_DATA_LEN - max_gtp_header_len; /* Zero header length. */ dev->type = ARPHRD_NONE; @@ -626,11 +631,7 @@ static void gtp_link_setup(struct net_device *dev) dev->features |= NETIF_F_LLTX; netif_keep_dst(dev); - /* Assume largest header, ie. GTPv0. */ - dev->needed_headroom = LL_MAX_HEADER + - sizeof(struct iphdr) + - sizeof(struct udphdr) + - sizeof(struct gtp0_header); + dev->needed_headroom = LL_MAX_HEADER + max_gtp_header_len; } static int gtp_hashtable_new(struct gtp_dev *gtp, int hsize); From patchwork Wed Dec 2 12:33:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Bonn X-Patchwork-Id: 11945919 X-Patchwork-Delegate: kuba@kernel.org 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 B293EC83012 for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B0B22222C for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727127AbgLBMei (ORCPT ); Wed, 2 Dec 2020 07:34:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53068 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726881AbgLBMeh (ORCPT ); Wed, 2 Dec 2020 07:34:37 -0500 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1171C0613D6 for ; Wed, 2 Dec 2020 04:33:50 -0800 (PST) Received: by mail-lf1-x144.google.com with SMTP id v14so4459345lfo.3 for ; Wed, 02 Dec 2020 04:33:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norrbonn-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FhG5NVwi3he/NHTo8tsbfZd2R/LsNay6u/YWj2xHQDs=; b=Hou5SRlyrB5ySUuzNXiysaseWuJkUJ6ooy/axOtgMXAYO/WIiDJWpYu59zG+64uM2x H4Vuw0623NIYCePybPwB10Y+hvJAJqiycLwBCeiK1Ljnkbrou6cuETCf/WLAB39KWYjv gDWKBI58teFBmTdihz3p5RnUIx59099cJeL5HPMUrg+D8BlnGdqeeG4Xj/mYSNekf98v qjPgjY2eXGc+gPwmGBxevtz4ZSdqQODiVHh1Kx+fB0FOQjhgKGm2O7YDpr7Ar1nH+8wU nvWJ2mC26bEU7aH7Lx2wO1pDJkaOKJmeA72OS8NIVZoCZ1IpNfbUanCp3JuDBR+yFI2E H4Ng== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=FhG5NVwi3he/NHTo8tsbfZd2R/LsNay6u/YWj2xHQDs=; b=FQkk5/xMMvEzL/C08CzG5qsgpl2dyK+8DDevuC1pn1N19Uu1clu1fZHifZhPS/62so pJ+ie4NP8/24CFKPgOoH/mOVi1D949j4S7G2MmuP1g+a+MLxyZky765jbF4OcMY+Xa1Y eHKqYeULJxpm+lDtqoURr2jJHe/NNAtnD3l4sdvE08QWIYTwyb5s1kBQRsD1Kh4gSlzq KXQt+yadSIMF37dpXJcFv9SATNYYG4LaVnRS74W8+XLfe4Rjaj8VnnIG4Q4et+YAgLSX HjcI7WUFD/6rQX0/xJdLgVyo8xOKq1V0afcT4C8YZYAr4GtYp2HgGQ/0RP3ULAm2TNk4 JIYw== X-Gm-Message-State: AOAM530U/cAmY+JD0nV/Jg3x7LcC1rwdpPhkJOsfMDIkjTYvPkIgzix/ cTzeLUw6sPgkS05y2iOYq4LhFOlG2K+AMw== X-Google-Smtp-Source: ABdhPJy7QgdZ5vSyBrUvJu7EHHuwsV9s7wHipndpyjuDxTF4IyDvs0zBQXvwXybHQhBkLPxemCOJ8A== X-Received: by 2002:ac2:5619:: with SMTP id v25mr1131978lfd.102.1606912429313; Wed, 02 Dec 2020 04:33:49 -0800 (PST) Received: from mimer.lan (h-137-65.A159.priv.bahnhof.se. [81.170.137.65]) by smtp.gmail.com with ESMTPSA id m7sm439230ljb.8.2020.12.02.04.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 04:33:48 -0800 (PST) From: Jonas Bonn To: netdev@vger.kernel.org, pablo@netfilter.org Cc: laforge@gnumonks.org, Jonas Bonn Subject: [PATCH 2/5] gtp: include role in link info Date: Wed, 2 Dec 2020 13:33:42 +0100 Message-Id: <20201202123345.565657-2-jonas@norrbonn.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201202123345.565657-1-jonas@norrbonn.se> References: <20201202123345.565657-1-jonas@norrbonn.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Querying link info for the GTP interface doesn't reveal in which "role" the device is set to operate. Include this information in the info query result. Signed-off-by: Jonas Bonn --- drivers/net/gtp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 5a048f050a9c..096aaf1c867e 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -728,7 +728,8 @@ static int gtp_validate(struct nlattr *tb[], struct nlattr *data[], static size_t gtp_get_size(const struct net_device *dev) { - return nla_total_size(sizeof(__u32)); /* IFLA_GTP_PDP_HASHSIZE */ + return nla_total_size(sizeof(__u32)) + /* IFLA_GTP_PDP_HASHSIZE */ + + nla_total_size(sizeof(__u32)); /* IFLA_GTP_ROLE */ } static int gtp_fill_info(struct sk_buff *skb, const struct net_device *dev) @@ -737,6 +738,8 @@ static int gtp_fill_info(struct sk_buff *skb, const struct net_device *dev) if (nla_put_u32(skb, IFLA_GTP_PDP_HASHSIZE, gtp->hash_size)) goto nla_put_failure; + if (nla_put_u32(skb, IFLA_GTP_ROLE, gtp->role)) + goto nla_put_failure; return 0; From patchwork Wed Dec 2 12:33:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Bonn X-Patchwork-Id: 11945917 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 F354BC64E7C for ; Wed, 2 Dec 2020 12:34:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9EDF1221FE for ; Wed, 2 Dec 2020 12:34:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726924AbgLBMed (ORCPT ); Wed, 2 Dec 2020 07:34:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726713AbgLBMec (ORCPT ); Wed, 2 Dec 2020 07:34:32 -0500 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6E72C0617A6 for ; Wed, 2 Dec 2020 04:33:51 -0800 (PST) Received: by mail-lj1-x242.google.com with SMTP id y7so3449129lji.8 for ; Wed, 02 Dec 2020 04:33:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norrbonn-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SVmt+GWAAS453za5ilhaeU0BZnA9BWz5PpoRw2DQf2Y=; b=Bgnn4URqfgQy/94ScHtMyRvU2rIAsuUSZqIDXFx88FqFFqB6fTFjyDJWiLF6jOfmU+ J8I845lpnN9Q9NbbCA0eP7s7tMyZjcNxlW53FOAdCMNscD3yXlJOZNj532hFjYQ/8rQM cGCgneJHsrwtanNY/gUROC8CnL6P1FQeHHp2GeSeqWqIBNOnvDScWJrKTP3wZCh5mgsU qYPYoPwK0xPlseEuqqX1s3Y5n22oBdE407b/5vL0J7oixM8/gE7mxYzccf99Og8zA+FE 61EUvffRxboYXIXtQC1nlhNVM7f/oR507POvL8OuAEw36yq5DYsC8PmuBL5ZWYUSncnM Ivqg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=SVmt+GWAAS453za5ilhaeU0BZnA9BWz5PpoRw2DQf2Y=; b=EK/fJbEpAs2XhpEW82VmFF4V4KcHUdp9NHOb/kFY7Ucg6VhwS/PSnA7rmP3CJaeJzB 1myjHtZw1s9Mw3liIxY5/OznG1cvG4j1kGyfc+V9GnyIyfMZ5HEFuCwTYQdCjGEJSwf8 0e/Z4JrK3jz6McU4aMtEqZJ3Gthg46bChgbIx2LS+SuFkg5LamTEQ2995LJBSsn1vSXn Lx5ZlGyXtXwfyjokGzmA6Tgg17M8xVMLuvWGSCn81KVAYM9Mg3q944DM8rTLh/n8Pccf MtDtNe3DqBU4aM7CXZ4xwiSrGtEFqCry6Jf16klxyY4Bmnudmo4AHgZ4Y4C1d6F1rD9/ 7SaA== X-Gm-Message-State: AOAM5329m8C7zePtyJqjhrsInCBDK/8tkXpEO3o+YOOpLu/tYWFKq+oo 8nYzWwb0K7RaBByZ39Q/KvRcABRyLa7V+A== X-Google-Smtp-Source: ABdhPJy8Lo8G4zb9qAziKdmKUVejyu5SF6n5pwYC3JUd41dLIOCnAQd34JzDpM8mlF3qgocZ1oTm9w== X-Received: by 2002:a2e:b0c8:: with SMTP id g8mr1093904ljl.331.1606912430296; Wed, 02 Dec 2020 04:33:50 -0800 (PST) Received: from mimer.lan (h-137-65.A159.priv.bahnhof.se. [81.170.137.65]) by smtp.gmail.com with ESMTPSA id m7sm439230ljb.8.2020.12.02.04.33.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 04:33:49 -0800 (PST) From: Jonas Bonn To: netdev@vger.kernel.org, pablo@netfilter.org Cc: laforge@gnumonks.org, Jonas Bonn Subject: [PATCH 3/5] gtp: really check namespaces before xmit Date: Wed, 2 Dec 2020 13:33:43 +0100 Message-Id: <20201202123345.565657-3-jonas@norrbonn.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201202123345.565657-1-jonas@norrbonn.se> References: <20201202123345.565657-1-jonas@norrbonn.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Blindly assuming that packet transmission crosses namespaces results in skb marks being lost in the single namespace case. Signed-off-by: Jonas Bonn --- drivers/net/gtp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index 096aaf1c867e..e053f86f43f3 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -592,7 +592,9 @@ static netdev_tx_t gtp_dev_xmit(struct sk_buff *skb, struct net_device *dev) ip4_dst_hoplimit(&pktinfo.rt->dst), 0, pktinfo.gtph_port, pktinfo.gtph_port, - true, false); + !net_eq(sock_net(pktinfo.pctx->sk), + dev_net(dev)), + false); break; } From patchwork Wed Dec 2 12:33:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Bonn X-Patchwork-Id: 11945921 X-Patchwork-Delegate: kuba@kernel.org 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=-16.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,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 DCA25C83014 for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8737622203 for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727181AbgLBMei (ORCPT ); Wed, 2 Dec 2020 07:34:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727066AbgLBMeh (ORCPT ); Wed, 2 Dec 2020 07:34:37 -0500 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 059DAC061A04 for ; Wed, 2 Dec 2020 04:33:53 -0800 (PST) Received: by mail-lf1-x143.google.com with SMTP id u18so4403877lfd.9 for ; Wed, 02 Dec 2020 04:33:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norrbonn-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bIEvPF6uAlOusLOWdiQWcOfYNoZoRxWo1vGs3pnAlms=; b=2Q++9XqvDTBERf9LkNlpoJl/3WuqkmpMNCoXi0WgBMUbA/vNyhv4PXUU17RflpO2wj GRjoi2SVrJ06bZ6NyaMEUoI3GNYzdLZ5xIo24m9X8Zda3S//96+BRdh4WOw3pT0mVtH/ q12DdWo5KICy8kVIwGLenFGZ+Sp+PF0DZ+NhnZeM3lpOQjeBPZDhW+SiODiBYH5iYMog /TOCGOs0RogQiTfmWcygxTPyGOP9m6kjUmM5CUlazS/TauRd6ElK2FIfzXwOEdDtMco9 nlTcUxV1y3HZIp3owP+LTDVG28M6UB6aDLcWDwJdM4Kh0Wbobdo+quUNwTx4Rbh9BgFQ GTSw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=bIEvPF6uAlOusLOWdiQWcOfYNoZoRxWo1vGs3pnAlms=; b=S3x+ik1lEZdOLyLUfxRn+RZZ00ILkMdyHLp3rMtBmRrmmA45UypWftcZLFlALV80eq DOrH6RjXBnis03lTkkAAPSrBvDG0vJmmYLmqZSkp8yBB8VEia2YSY54ACPPLHY5kYceg T/QDI8I5LhI8NvP74iQAFTnV2O6fiqvzRDT/RKRV1fzNzSzGPcx+JOwrtRjKWtggBTPd VsZnlZkbN4e0qEO+oWComgY0aP0YZgnA1e2PKm8Qlo5GMRvoN+Mr3jf3xaglv8TmrDXi IHwHI4G/M6MF0j/z0nStcduyNMZcJpuNN8lGIN4dgHidnu26ljKHWttXYkb/opSe384+ LLWQ== X-Gm-Message-State: AOAM532v0TQG2jjOlFmT++nwqFi+yw1kG+o+sKvZtkeQeYSVQ027AY1/ 1hmg+c4/aktboYQkbvlZkKe3Tls6u8Be6Q== X-Google-Smtp-Source: ABdhPJyON2nCljwXZjF2n1H3o+S0g8xcPtNo9IG9L4uNObeJpkYCk1hZlIoAxvQNq1eN7HMHwiq7HQ== X-Received: by 2002:a19:8883:: with SMTP id k125mr1094028lfd.10.1606912431420; Wed, 02 Dec 2020 04:33:51 -0800 (PST) Received: from mimer.lan (h-137-65.A159.priv.bahnhof.se. [81.170.137.65]) by smtp.gmail.com with ESMTPSA id m7sm439230ljb.8.2020.12.02.04.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 04:33:50 -0800 (PST) From: Jonas Bonn To: netdev@vger.kernel.org, pablo@netfilter.org Cc: laforge@gnumonks.org, Jonas Bonn Subject: [PATCH 4/5] gtp: drop unnecessary call to skb_dst_drop Date: Wed, 2 Dec 2020 13:33:44 +0100 Message-Id: <20201202123345.565657-4-jonas@norrbonn.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201202123345.565657-1-jonas@norrbonn.se> References: <20201202123345.565657-1-jonas@norrbonn.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org The call to skb_dst_drop() is already done as part of udp_tunnel_xmit(). Signed-off-by: Jonas Bonn --- drivers/net/gtp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index e053f86f43f3..c19465458187 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -515,8 +515,6 @@ static int gtp_build_skb_ip4(struct sk_buff *skb, struct net_device *dev, goto err_rt; } - skb_dst_drop(skb); - /* This is similar to tnl_update_pmtu(). */ df = iph->frag_off; if (df) { From patchwork Wed Dec 2 12:33:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonas Bonn X-Patchwork-Id: 11945923 X-Patchwork-Delegate: kuba@kernel.org 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=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 0EECDC83013 for ; Wed, 2 Dec 2020 12:34:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B50132222E for ; Wed, 2 Dec 2020 12:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727304AbgLBMek (ORCPT ); Wed, 2 Dec 2020 07:34:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbgLBMeh (ORCPT ); Wed, 2 Dec 2020 07:34:37 -0500 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB771C061A47 for ; Wed, 2 Dec 2020 04:33:53 -0800 (PST) Received: by mail-lf1-x141.google.com with SMTP id j205so4436738lfj.6 for ; Wed, 02 Dec 2020 04:33:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=norrbonn-se.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=teiV7Au9F3ql0miNmXw41Ar5KlhnBCmc6pHhmhDjjpQ=; b=J6e4caGaGq9dCvsewdbV2S/WWXvdKoHrkMDny9MJ4YC1O/6hftRELbR11ipgc0IXh2 hHeT9uV2YUr1LD8ixLl6di+tpvvIvOWfl4jNLaaOr0x8jv1clKVZ+FV45MVWaBIzkUqD YInJs+p3lIpez0NnSNPskGLgIlHMTjSlyoMtrQb2b3RcUEsRHV6KuzmyPNAcWBwSuGyS XpMzIoNGyPFjTeSPbyeqK92okeXhek9VjbwBKCZ4cChjxPb365eCFJZDuez1WsdzGvqH zFy+RPG3zagNcsoYaoftLY0ZRaqH0pzd8wKDWyV0yQnO+6Y7uNSvchNvcXO4x90eAHOs SNEA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=teiV7Au9F3ql0miNmXw41Ar5KlhnBCmc6pHhmhDjjpQ=; b=SplMiFyFs4SOysrhfm05Vo4AKVzF+cZi4wOV3nFacbTGHqqLsASzutP5zUxYAOnZIJ ELAKp4xPLjPxfFQ5j73eyp0KT/8/pAN/s3EMAyrlx7wr82Md2gdN4zHonjDPVo44qA9i rysw3ds39JdA9eYnYAJV5UUSEX848j/ikCZ7giJVd0mcoa9qDox3DuWZhWzRhjUS1m7s Obwd4j+hfnjjoegzQjl7I65cijuQ+/ZWTZvAv3K7lqK4UNlHO+xaa+oxl2iiHrRAGYoa /Xz/zWSZCm+6yM2w7ojUEdaRLm/Ycag6CV6SPpI5HneQ1DMQz45w+qTNHz/K+r3Duvyt c4xQ== X-Gm-Message-State: AOAM530irBMvb8CNm7x0BHCQkoN3Wes5MA0agVElhjib8ISN7KPylcu7 wkUyDS3BmRGe7LPF3FZ6qO9rnlEwPrtZ+A== X-Google-Smtp-Source: ABdhPJy+tFXmnHCAPSB6AVqlteqzGwUxo5Bk2QvrpdlDmROd8qw9y98fCJerZYJIHJ44y819YmfEXQ== X-Received: by 2002:a19:e059:: with SMTP id g25mr1177753lfj.584.1606912432263; Wed, 02 Dec 2020 04:33:52 -0800 (PST) Received: from mimer.lan (h-137-65.A159.priv.bahnhof.se. [81.170.137.65]) by smtp.gmail.com with ESMTPSA id m7sm439230ljb.8.2020.12.02.04.33.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Dec 2020 04:33:51 -0800 (PST) From: Jonas Bonn To: netdev@vger.kernel.org, pablo@netfilter.org Cc: laforge@gnumonks.org, Jonas Bonn Subject: [PATCH 5/5] gtp: set device type Date: Wed, 2 Dec 2020 13:33:45 +0100 Message-Id: <20201202123345.565657-5-jonas@norrbonn.se> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201202123345.565657-1-jonas@norrbonn.se> References: <20201202123345.565657-1-jonas@norrbonn.se> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Set the devtype to 'gtp' when setting up the link. Signed-off-by: Jonas Bonn --- drivers/net/gtp.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c index c19465458187..6de38e06588d 100644 --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -610,6 +610,10 @@ static const struct net_device_ops gtp_netdev_ops = { .ndo_get_stats64 = dev_get_tstats64, }; +static const struct device_type gtp_type = { + .name = "gtp", +}; + static void gtp_link_setup(struct net_device *dev) { unsigned int max_gtp_header_len = sizeof(struct iphdr) + @@ -618,6 +622,7 @@ static void gtp_link_setup(struct net_device *dev) dev->netdev_ops = >p_netdev_ops; dev->needs_free_netdev = true; + SET_NETDEV_DEVTYPE(dev, >p_type); dev->hard_header_len = 0; dev->addr_len = 0;