From patchwork Thu Aug 27 06:49:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 261863 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=-12.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 306BCC433E1 for ; Thu, 27 Aug 2020 06:50:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 117F522B4D for ; Thu, 27 Aug 2020 06:50:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727929AbgH0Gt6 (ORCPT ); Thu, 27 Aug 2020 02:49:58 -0400 Received: from mailrelay116.isp.belgacom.be ([195.238.20.143]:45520 "EHLO mailrelay116.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbgH0Gtz (ORCPT ); Thu, 27 Aug 2020 02:49:55 -0400 IronPort-SDR: s3e3tqtdf6ANvBmo3WwYoKxkWBArPy7z+/fQimz9HHrwKmDWcz8HAHWwsLpp8X2hpe3GLv2UYO 1UjC/EZK/YC/oM6/0x9DuY1HK52x8sNKbCasrsE+1ffcjM0hTyzAsHFOAB8zIqG/IFMBvX6mVP 5M025jt+yiZuY7cbeUiUvSxF7QZsH+uzpXKsUVXdzUlxn9vRypGwseyMlgrbnY/HGuQmDfjppl LPOjFOq4NoWtfFeTTqSfhcNStdMRipu1Lhww4SldRze3eDnC/7uRLMOb/jnFU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q6uXtjXAng18de7em3Z8NZHC/BPRmLF2TYWDwjdcZDWcKog0+QfTsiFKcTT5cemi9X7wn6zElB4KpE53DSpqugLOfxie7GINZZmRcBlCLC3foeJ2OW+0QZyKKPs9hjjsEWKClS48g0xGuqQD7x6NkLuXK4C0Ys4zs1Nxu6u3NmhE96yZ0A96e026TVWF0mH0HRzss0KB4u0x9xU+J0bJkjPxACdxT+/RJXx80NZHG1ON6Bcv/WhnCftaJTlapXMmmDSsqQd0vkJcyZBNxEsuvizjP1jSnBrsSmaDNApEoturfwnL4D8Vw0XDL0O8mlVZ1bNFIMDiIj6R+/g6bKZTEn0iDlq2pPfAS1STD3HyA3GyDoAdSXVgjAu3+QXkDax6O/pzC7UTYQur2BA== X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A2AwBAD4Vkdf/xCltltfgRCBQ4EeglBfjTiSS5AFgX0LAQEBAQEBAQEBNAECBAEBhEyCOyU2Bw4CAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpsxozhBCBQ4NFgUKBOIgnhRmBQT+BEYNOijQEmhmcOYJtgwyEXJI2DyGgRJJLoU0OgXxNIBiDJFAZDY4rF44mQjA3AgYKAQEDCVcBPQGQEwEB X-IPAS-Result: A2AwBAD4Vkdf/xCltltfgRCBQ4EeglBfjTiSS5AFgX0LAQEBAQEBAQEBNAECBAEBhEyCOyU2Bw4CAwEBAQMCBQEBBgEBAQEBAQUEAYYPRYI3IoNHCwEjI4E/EoMmglgpsxozhBCBQ4NFgUKBOIgnhRmBQT+BEYNOijQEmhmcOYJtgwyEXJI2DyGgRJJLoU0OgXxNIBiDJFAZDY4rF44mQjA3AgYKAQEDCVcBPQGQEwEB Received: from 16.165-182-91.adsl-dyn.isp.belgacom.be (HELO localhost.localdomain) ([91.182.165.16]) by relay.skynet.be with ESMTP; 27 Aug 2020 08:49:54 +0200 From: Fabian Frederick To: davem@davemloft.net, kuba@kernel.org Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Fabian Frederick Subject: [PATCH 3/7 net-next] vxlan: move encapsulation warning Date: Thu, 27 Aug 2020 08:49:36 +0200 Message-Id: <20200827064936.5682-1-fabf@skynet.be> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org vxlan_xmit_one() was only called from vxlan_xmit() without rdst and info was already tested. Emit warning in that function instead Signed-off-by: Fabian Frederick --- drivers/net/vxlan.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c index cc904f003f158..14f903d09c010 100644 --- a/drivers/net/vxlan.c +++ b/drivers/net/vxlan.c @@ -2650,11 +2650,6 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, udp_sum = !(flags & VXLAN_F_UDP_ZERO_CSUM6_TX); label = vxlan->cfg.label; } else { - if (!info) { - WARN_ONCE(1, "%s: Missing encapsulation instructions\n", - dev->name); - goto drop; - } remote_ip.sa.sa_family = ip_tunnel_info_af(info); if (remote_ip.sa.sa_family == AF_INET) { remote_ip.sin.sin_addr.s_addr = info->key.u.ipv4.dst; @@ -2889,6 +2884,10 @@ static netdev_tx_t vxlan_xmit(struct sk_buff *skb, struct net_device *dev) info->mode & IP_TUNNEL_INFO_TX) { vni = tunnel_id_to_key32(info->key.tun_id); } else { + if (!info) + WARN_ONCE(1, "%s: Missing encapsulation instructions\n", + dev->name); + if (info && info->mode & IP_TUNNEL_INFO_TX) vxlan_xmit_one(skb, dev, vni, NULL, false); else