Received: by 10.213.65.68 with SMTP id h4csp243969imn; Fri, 23 Mar 2018 03:47:04 -0700 (PDT) X-Google-Smtp-Source: AG47ELub45o4UDh34HoEL9WCYXCVyi1ADXN47jkOoguQbFALmllfzC75gS7d3sy+p6m6UAxqLUu6 X-Received: by 2002:a17:902:5814:: with SMTP id m20-v6mr27728315pli.311.1521802024902; Fri, 23 Mar 2018 03:47:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521802024; cv=none; d=google.com; s=arc-20160816; b=vHiBGHfsX4V2MH7ZbFfMuDHQQ1ZWFLhogKF8HajQgvJ8gbwiq0jlV92W/SkNGQl2l9 7FEuVRzY6cMqY7fI0TkZYKp1hLq54jKoqqq10Q/8yodWsdXJUhJrLsPdcvVDQooiwyg2 c4UVej0V79AtMu9eMP2fp2IoN0mBzZhRCvPltTl/m6+BFZRVis4RwYScvQbO9G5cJOX7 d5hn2Ld97tRGCNNCzgImeEnKR49leHLIwUBj3/CyUqoD890XceXAcasyR+Ph5F4tI6bn A92esOAmSJI96WGo+X7O/CejJFbrAPPl0SdgaojaB4JFLaBxXELMnFzX9lRHcZXlx8D+ ZlMA== 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=SHquMumQ9GXe0RqCKUPM1aoV+4yN50NkyLrqv7tTRFU=; b=OJ6TdqHsmF6EH3FVilMhr6J6oRNZnlyBGrKBHOh+tRZJ9tN/GnqYAp09BZxn7tznSr tofciMleONu0yeCDs8jhGdHZehfol4Eg8AZXAF1oAjjqpj/3Pjky50ObDA7M7O5ghP// an4yNKg7Xy26nyOOu9Ygc1ve/LPhumrMTiEWoenPQLOi0o4rsX645K4swcMeTSFWzF0L isFLAASshg6tNH1pF3e8kCrhVhHLf7ANtKJo7i9Oig07f2zxeSwQDeAWG+aRr+TKlggS ANMORbmvq178uKGJBfe++OZJRGqT/pXs2bnaLNoaMirI3ohufW07zkKihEZncu9KgUEd EJ+w== 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 bi10-v6si8042229plb.105.2018.03.23.03.46.50; Fri, 23 Mar 2018 03:47:04 -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 S1756062AbeCWKP3 (ORCPT + 99 others); Fri, 23 Mar 2018 06:15:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45628 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933466AbeCWKPY (ORCPT ); Fri, 23 Mar 2018 06:15:24 -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 450071287; Fri, 23 Mar 2018 10:15:23 +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.4 32/97] IB/ipoib: Update broadcast object if PKey value was changed in index 0 Date: Fri, 23 Mar 2018 10:54:19 +0100 Message-Id: <20180323094159.466111317@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@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.4-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 @@ -945,6 +945,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; }