From patchwork Wed May 23 05:16:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neelakantam Gaddam X-Patchwork-Id: 918740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=openvswitch.org (client-ip=140.211.169.12; helo=mail.linuxfoundation.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PNc1xz9k"; dkim-atps=neutral Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40rLNB0J0Pz9s16 for ; Wed, 23 May 2018 15:16:41 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 21D0598C; Wed, 23 May 2018 05:16:38 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 6511A950 for ; Wed, 23 May 2018 05:16:36 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pl0-f68.google.com (mail-pl0-f68.google.com [209.85.160.68]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 1295E177 for ; Wed, 23 May 2018 05:16:36 +0000 (UTC) Received: by mail-pl0-f68.google.com with SMTP id w19-v6so12270943plq.4 for ; Tue, 22 May 2018 22:16:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=1yNztXN/tTdJ/bkOHMaSR3w9+8TDJAHZqP8IwtKktkg=; b=PNc1xz9kJcJXkoZqHCCSBkhcZCi2NPZSFhh3TVYKKeWwdR5B5rbj2Hu31YEqMp0EfO TKdFbNd9Neg+SB3KArNPFvtP/mrqntgKXF1Aa3HpI5u/QmN8lygtt5PDh/JZinO+jKHd ZzfSCX3lH/PIJjHGOJl1acbUI67GhW5yqJkxhN6lPJzppoi+NHH4mciUtcCgj2BiMjhb 3Cubl8aLhOtbjYIgM/zggpy5bMvcPV9wA2cKb4sqNUVJ6O/K48xVRZIl2RcCSSTZ7DZx aBO+fxw8HS3Fk+QLZoeBMvS9Z1tXBEestI7syuAsUCeDfbv/22gmrK3jlf4SQn/KUNIf 9lQw== 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; bh=1yNztXN/tTdJ/bkOHMaSR3w9+8TDJAHZqP8IwtKktkg=; b=XSF4evvNPJ9RCC3rSr9dgut0sLn64runEWnhvBojfbKpyHVgiQoJXOFSoQdcq4XBVd /B88IegJh+e0PPjJbC633aTuYAEC8dCie6SlGZDOeAKpQqddc4pI6V89c4w9Wtlj72qk r0FMD2BnvzyuvbsfDis+gs8a7hhOxuN+omqFprjgGEbIV18Zd/u95XYtHvOuvOgAAB87 uVAlWWBMDmf5V0CELZBC/WkMw9z35aT8c/SbL8cCFSWsJqnK3hGZasMxH+7in8AQB8AK gVCdnqK839TMf9jwQT34sL+oMQqwpc92nGC3VmAtH8bST9Uz0VfHw8P5+s3lKQdl34UB rvhw== X-Gm-Message-State: ALKqPwfH2IV7V+KmWoevdlD3AoLEVL/G9/3+pJ6Nn1I3HwB0fNJlEMM+ 8Qhno6xrfrEVEwWB/Zoy2JLaxeTl X-Google-Smtp-Source: AB8JxZoCRMLBBiIToiJpzjuySE/hlq7C7JwW1HgsclHaEb+3pEd+7ePay5SWmtcnfYJ6cMLsOoMxWQ== X-Received: by 2002:a17:902:2006:: with SMTP id n6-v6mr1449315pla.125.1527052595264; Tue, 22 May 2018 22:16:35 -0700 (PDT) Received: from hyd1lio550.in.caveonetworks.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id f189-v6sm8831544pgc.51.2018.05.22.22.16.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 May 2018 22:16:34 -0700 (PDT) From: Neelakantam Gaddam To: dev@openvswitch.org Date: Wed, 23 May 2018 10:46:25 +0530 Message-Id: <1527052585-29211-1-git-send-email-neelugaddam@gmail.com> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org Subject: [ovs-dev] [PATCH] vxlan: Fix for the packet loop issue in vxlan X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org This patch fixes the kernel soft lockup issue with vxlan configuration where the tunneled packet is sent on the same bridge where vxlan port is attched to. It detects the loop in vxlan xmit functionb and drops if loop is detected. Signed-off-by: Neelakantam Gaddam --- datapath/linux/compat/vxlan.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/datapath/linux/compat/vxlan.c b/datapath/linux/compat/vxlan.c index 287dad2..00562fa 100644 --- a/datapath/linux/compat/vxlan.c +++ b/datapath/linux/compat/vxlan.c @@ -1115,7 +1115,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, goto tx_error; } - if (rt->dst.dev == dev) { + if ((rt->dst.dev == dev) || + (OVS_CB(skb)->input_vport->dev == rt->dst.dev)) { netdev_dbg(dev, "circular route to %pI4\n", &dst->sin.sin_addr.s_addr); dev->stats.collisions++; @@ -1174,7 +1175,8 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev, goto tx_error; } - if (ndst->dev == dev) { + if ((ndst->dev == dev) || + (OVS_CB(skb)->input_vport->dev == ndst->dev)) { netdev_dbg(dev, "circular route to %pI6\n", &dst->sin6.sin6_addr); dst_release(ndst);