Received: by 10.213.65.68 with SMTP id h4csp235953imn; Fri, 23 Mar 2018 03:34:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELslAgmFXbEuspNlYQ2Jk7/2BPxjuB+Y5HQDPzxrsUCiQeD2TJTPEoW3zKdFJxumsWrWCgtx X-Received: by 2002:a17:902:7081:: with SMTP id z1-v6mr23675016plk.333.1521801286927; Fri, 23 Mar 2018 03:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801286; cv=none; d=google.com; s=arc-20160816; b=LU2gae0QUytnhZC+lTXxsP25OuvN+FGtMuXQBB0oerF0QSZFG/hcudSCKpdJSTc8Es OnF3vEzi7m5HPZPRckrdG8ZJMWfH8NbX3jJyssDKTgKD08oOHPA1vTdIpYH12hCLcG7x 0TmiQlYkXDo5/y1CpyQEvbZYaLtJWru377vjGfldXK9zUrN0rDzPoHHbAu+VXAFXqUc/ RlVuUufpcst5dtkMaS257Cw6F1MJe/ebi1IDttpmCLlTsm5h23zNJeJtbhXRTjBBYhMy kUB7K4C0yjMgJNCfVqN5UWuyoR/IXAGc7LVaNorIcHwY10K7vkOM1MHsx1gCEGnU71IK y5SQ== 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=k1DBlTqSGAI97IHIDsSAvvW3gzDJ4JQ62RTSjgJlG78=; b=alO7L3decYwhsAiN80LNOzkNHJSXMslZsz1e++6kf6TH6vlis77vq7jF8xud8XobnA TExHfVmdF/U3232GMVpoSywDEyx+ssmddk+vq7uR22NE0uDN+u7gfVdi6mSGGpwDqDLj y1X1aV9JeJx4DLZhXi6fOlh4sbrzQp3pP6VYy2fakmHXpbrqxV80/S0i6oHpt3ZGtxI/ JbojN4GdZjETM2T48M1xWkPKhOcoz4EFwDbYdAuWHGl6bQdQh2Rmo9YD26ZcteqtIYA8 CeaoH57nYflgYqtZy6u2FNLzBG+axu80P8JyMR1drjqycediBni2E9fS2aXksmehmH9G KbEw== 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 m185si6523995pfc.361.2018.03.23.03.34.32; Fri, 23 Mar 2018 03:34:46 -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 S1756084AbeCWKSP (ORCPT + 99 others); Fri, 23 Mar 2018 06:18:15 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47524 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756000AbeCWKSM (ORCPT ); Fri, 23 Mar 2018 06:18:12 -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 26359F12; Fri, 23 Mar 2018 10:18:11 +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 3.18 17/47] IB/ipoib: Update broadcast object if PKey value was changed in index 0 Date: Fri, 23 Mar 2018 10:55:08 +0100 Message-Id: <20180323094248.865327702@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094248.117679641@linuxfoundation.org> References: <20180323094248.117679641@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 3.18-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 @@ -955,6 +955,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; }