Received: by 10.213.65.68 with SMTP id h4csp274880imn; Fri, 23 Mar 2018 04:30:15 -0700 (PDT) X-Google-Smtp-Source: AG47ELsUkpyx7COlkeePl/+RZjeXHo5hqEtvB/q/kwtSiXCbSHudq/Z+ZL2JxmMPPiVKS1TgH7am X-Received: by 2002:a17:902:6547:: with SMTP id d7-v6mr25484636pln.253.1521804615614; Fri, 23 Mar 2018 04:30:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521804615; cv=none; d=google.com; s=arc-20160816; b=r3V+Cr3iwf5URQksv5YHr7eIRCa4jsqJrb8CFgLqIFmZxdrwdLbgEf4yV/2X7uyuQ9 HO0yWIsueX83IJ/qcuzQ4PMNlrX9inphvG8hG1oYkTAlg3fPjL1L/KsgMmzZu98BgLfj 5R++7BhNeqMlH+LpydWg8WZ3kefpwWyovIBthTm1BAQ+laJz/ebBJN9b/q5G7BtInsaJ GsQQsSI8wFpP15S29W/SFvstl3uSRg7vtjicCOvUndUXBQAUx+FX3uw73mGzDkI3WbR3 oBe6+Xl3/5g+t1xM5WHfIGVlo+PW/eieLz8Ucx7Kt6g5hdH4Xmnet5CW1eyx46PC8PPj fFuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PquaHfza/vkRR94BDgZbOtyBrruQlp024VV7JwFTwJc=; b=s0/QdDdFGY7xNIybG9lHdQVemieX6zzp7mAcli57H2kj9uWcXT0mGz4RkaqKtVkqt1 XKpFTHkS6oKtj1gzXEG56AE4yGeAobTLQnJiQWNWtrQRrAhs0EHFZG8t3oJkB/0UOIXn /f8iBiDnnY1UbVaZTKmFEXHAIKvVOMhlhBSweDQsLYaEkh4+8hEmQLSgB8pGU5eGO/G0 9NP4bUYBvQr82cGtFQUG6/C0mIvbWzQlNz7NSA5GZsDdbNsNlgSxlApFvYB5RStruRr1 1lBYB/9AEoxdhfWMvtKc383yh+7G4I06hmqkawqh8QTqRzxgQ5NcsFvd4y/ri9+4NzxZ aDqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a90-v6si8320691plc.329.2018.03.23.04.30.01; Fri, 23 Mar 2018 04:30:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932117AbeCWKGl (ORCPT + 99 others); Fri, 23 Mar 2018 06:06:41 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:40872 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755260AbeCWKGe (ORCPT ); Fri, 23 Mar 2018 06:06:34 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 25D70C04; Fri, 23 Mar 2018 10:06:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Feras Daoud , Erez Shitrit , Alex Vesker , Leon Romanovsky , Doug Ledford , Sasha Levin Subject: [PATCH 4.9 045/177] IB/ipoib: Update broadcast object if PKey value was changed in index 0 Date: Fri, 23 Mar 2018 10:52:53 +0100 Message-Id: <20180323094207.269972686@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094205.090519271@linuxfoundation.org> References: <20180323094205.090519271@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Feras Daoud [ Upstream commit 9a9b8112699d78e7f317019b37f377e90023f3ed ] Update the broadcast address in the priv->broadcast object when the Pkey value changes in index 0, otherwise the multicast GID value will keep the previous value of the PKey, and will not be updated. This leads to interface state down because the interface will keep the old PKey value. For example, in SR-IOV environment, if the PF changes the value of PKey index 0 for one of the VFs, then the VF receives PKey change event that triggers heavy flush. This flush calls update_parent_pkey that update the broadcast object and its relevant members. If in this case the multicast GID will not be updated, the interface state will be down. Fixes: c2904141696e ("IPoIB: Fix pkey change flow for virtualization environments") Signed-off-by: Feras Daoud Signed-off-by: Erez Shitrit Reviewed-by: Alex Vesker Signed-off-by: Leon Romanovsky Signed-off-by: Doug Ledford Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/ulp/ipoib/ipoib_ib.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c @@ -974,6 +974,19 @@ static inline int update_parent_pkey(str */ priv->dev->broadcast[8] = priv->pkey >> 8; priv->dev->broadcast[9] = priv->pkey & 0xff; + + /* + * Update the broadcast address in the priv->broadcast object, + * in case it already exists, otherwise no one will do that. + */ + if (priv->broadcast) { + spin_lock_irq(&priv->lock); + memcpy(priv->broadcast->mcmember.mgid.raw, + priv->dev->broadcast + 4, + sizeof(union ib_gid)); + spin_unlock_irq(&priv->lock); + } + return 0; }