From patchwork Fri May 4 11:49:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Evgenii Smirnov X-Patchwork-Id: 10380363 X-Patchwork-Delegate: dledford@redhat.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A64D96037D for ; Fri, 4 May 2018 11:50:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1B66293FA for ; Fri, 4 May 2018 11:50:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A019829413; Fri, 4 May 2018 11:50:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A329A29427 for ; Fri, 4 May 2018 11:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750866AbeEDLuL (ORCPT ); Fri, 4 May 2018 07:50:11 -0400 Received: from mail-wm0-f50.google.com ([74.125.82.50]:35195 "EHLO mail-wm0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750820AbeEDLuL (ORCPT ); Fri, 4 May 2018 07:50:11 -0400 Received: by mail-wm0-f50.google.com with SMTP id o78-v6so4289043wmg.0 for ; Fri, 04 May 2018 04:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=Lb6B9IeBH0Tz/oeYGwp7nzDIHRG/00Mw2HQClRTCRuw=; b=ZwOKU+1jrgIcJzZTAUoSosxQ1ZYqHOBTlPiktzqMVLo7xunmYgsngypMXgC2Il4zJG rFvjW6GhcjmyVAdDDaKEniUoEPqvs4REhZ7ROQV3H78DA6B4mXCGSL3hYqK4nTZvdWtk rrcyIB8o4mKTQw65BbxiVpb2G+VaGGkuJ6Zq7AZvpdqPaqowf9JuIX5SUV0/oOwINQZe 9kiLV3Jk71TwAcwSxnlPvjVxKRlMOkgioJNO1gokmEc3TTdLwI+lXoXuz4/8cdRQDVCw mugFNEXSUr5m1G+4fpBkxZiOafouZyvKtXhuvQjCoCSG/r2GvxRZPJFtKu6KtNQpvtUR 5kjA== 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=Lb6B9IeBH0Tz/oeYGwp7nzDIHRG/00Mw2HQClRTCRuw=; b=U4krFcdWxrRk+G4DJ7O7iOWIiKBUMqpDFuOFHVlghFErSkGL3KCAtAKKt3Jdzx0AcB pChx8TVjp4sRKcJe0eUb2GAPI9Lof23PQSIysZY1iBGB1L8dpFoqfNGGJLJs3J2Vvd1D iSkHFPsJPMSilwdSlKYgjGHQ5UDLDUBcTci+OI9zJRYE5Nk6llNLp2rNbaw4x5sAXgQT CesB6sAxzGKvvXcU0eHF6xgxrqh41b85YEdmDCGnPC49hkV2lYJLbIszqXhWkksMAOec OeDzqlqWTgKMVBbX+ZdUtOSimaqMTJX3Rip5H7C/+Fbqx2hVILfR3NK7ANcjnDRcy/ps x+9Q== X-Gm-Message-State: ALQs6tDTFuxn6qf2QCNsw7tnJLwwZpZeyuB37Zq9hnkjRSO5ysPo4EKt eoKKjHXJadztffJRfENdNb43LvLl X-Google-Smtp-Source: AB8JxZqt0rIAva5R2BQEs6S2Hna7lBONWN5t5C7IgOfr3NeumgyBrwizvpI8TTuiRfPZ8kxYXqoGjg== X-Received: by 10.28.106.13 with SMTP id f13mr16045657wmc.1.1525434609559; Fri, 04 May 2018 04:50:09 -0700 (PDT) Received: from smirnov-ws.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id d9-v6sm8964592wrn.71.2018.05.04.04.50.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 04:50:08 -0700 (PDT) From: Evgenii Smirnov To: linux-rdma@vger.kernel.org Cc: Doug Ledford , Jason Gunthorpe , Evgenii Smirnov Subject: [PATCH] IB/ipoib: check path validity on allocation of neigh struct Date: Fri, 4 May 2018 13:49:21 +0200 Message-Id: <20180504114921.16571-1-evgenii.smirnov@profitbricks.com> X-Mailer: git-send-email 2.17.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the validity of a path is checked only on unicast ARP transmission. If Subnet Manager switchover happens and some LIDs get reassigned, driver in a network that uses only IPv6 addresses will not try to renew the path records, despite them being marked as invalid. In connected mode, remote side LID change will cause send to fail, freeing the corresponding neigh struct. Subsequent packets to this destination will trigger allocation of a new neigh struct. With this patch allocation of new neigh struct will also check the validity of the associated path and renew it if necessary. This, however, will not help in datagram mode, if the host continuously sends data to the destination with invalid path. The neigh struct alive timer will be updated, thus preventing it from reallocation. Test setup consists of two target hosts and two initiator hosts, one of the initiators is with the patch. All hosts have only IPv6 addresses from the same subnet and initiators constantly ping targets. In connected mode swapping the LIDs of target hosts and switching over SM leads to the loss of connectivity for the initiator without the patch. Initiator with the patch recovers in ~3 sec. In datagram mode initiator with the patch is able to recover only if ping is stopped for neigh_obsolete time. Signed-off-by: Evgenii Smirnov Reviewed-by: Dennis Dalessandro --- drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 161ba8c76285..db5762d62aea 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c @@ -963,7 +963,7 @@ static struct ipoib_neigh *neigh_add_path(struct sk_buff *skb, u8 *daddr, list_add_tail(&neigh->list, &path->neigh_list); - if (path->ah) { + if (path->ah && path->valid) { kref_get(&path->ah->ref); neigh->ah = path->ah;