From patchwork Tue May 22 06:48:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Neelakantam Gaddam X-Patchwork-Id: 918026 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="IVie4VME"; 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 40qmT32V1vz9s4q for ; Tue, 22 May 2018 16:48:54 +1000 (AEST) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id D345CCBB; Tue, 22 May 2018 06:48:51 +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 4FDB3C7B for ; Tue, 22 May 2018 06:48:50 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.7.6 Received: from mail-pg0-f67.google.com (mail-pg0-f67.google.com [74.125.83.67]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 0517D177 for ; Tue, 22 May 2018 06:48:49 +0000 (UTC) Received: by mail-pg0-f67.google.com with SMTP id a3-v6so2491693pgt.13 for ; Mon, 21 May 2018 23:48:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id; bh=55d9p2DiBhE7ndY9wTaZE3NXK4pPCKZdr7RqUdeO1Sw=; b=IVie4VMEx1saR32YnNSsfm0wcWsZl/DcRP78oCyb/mSeG2PmpY9HIpDqYfjC6wOiq0 qV2jAaYUYDNBIdxYa4ZqC/CMAEz7IfcevrWgsieYTmBbSJJHaIbBFFqDLniezdql7olK hR893PCofDNNm3nhX6VynfG8f+TYRSkNahVZqwazk0Z8eisUWtQHdKHVokzPXMbgI/rV GY5Lof4h5o7Kf6jLeutaJN5gunezfQmaZX2zzKXYXH70gAG+FMqO37DQO3qdtTIY0ses olFZGkdFjst0iF/QsOx22eWrEfcGkrcpQPHgjsh/pIFj0g5Yn/DIJvU8sHKtxaven1x2 2OXA== 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=55d9p2DiBhE7ndY9wTaZE3NXK4pPCKZdr7RqUdeO1Sw=; b=JnjYniGQgRihPfvZunsnkzyTHR07Fgdsn85bq5cQXmZizJglh37+I2ueUMF5rZYl/Q t9X3r7AkaxGEfW1IWzju+/MXC9rtoXWbX1rKlV1/1dGnfPpEp6IEM7kyLLyhBk2ATzK5 bOtjLICd/s006zAMuWAkKC/pf55bYaQh4aMllpVJl2c08AvdAj7cpnx4+Cf0kA5coFmU fw+a4w/Y2wsmsigahUlpDprdMCY/40YK0wQel4az+iV+Tqg1HJwtSfGsbU5fXOg5JrMW yLUmRqA18+77PEowJ6E2BI0vLpPboGScrirvc1h+9ZFHrDqzv2Z3uYQi4I8MRsWW+UuJ OPdw== X-Gm-Message-State: ALKqPwcHI3H01smiKQ/uL6xEcZyRYyN1ZWRfK9zLv5/vd5ebNXvhECMh MOe5PnG8Wty6uDm5RVXauMIzX8F/ X-Google-Smtp-Source: AB8JxZpBTlxq684rCcKuhQ/cLqtyPGjlF48GWowPdMZxfaqbYwi9WkiN4H4DOBWmlOpEFRjMwC9nIw== X-Received: by 2002:a62:ac14:: with SMTP id v20-v6mr23250616pfe.101.1526971729217; Mon, 21 May 2018 23:48:49 -0700 (PDT) Received: from hyd1lio550.in.caveonetworks.com ([115.113.156.2]) by smtp.gmail.com with ESMTPSA id q62-v6sm36867392pfd.172.2018.05.21.23.48.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 May 2018 23:48:48 -0700 (PDT) From: Neelakantam Gaddam To: dev@openvswitch.org Date: Tue, 22 May 2018 12:18:39 +0530 Message-Id: <1526971719-3715-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] compat: 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 Tested-by: Greg Rose Reviewed-by: Greg Rose --- 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 d27a5e2..0f4034f 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);