Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1549423pxb; Thu, 16 Sep 2021 09:42:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbrrIDMZ4+/8O32Cc9r5FqkYOW2cJnfSHUhiQjEG6fnt+MrB4j4XxeVAw3c3BRQuFtzms/ X-Received: by 2002:a92:ce05:: with SMTP id b5mr4774267ilo.194.1631810551375; Thu, 16 Sep 2021 09:42:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631810551; cv=none; d=google.com; s=arc-20160816; b=aZ/RiT3i5uRzmbo+Q3S6yw44QdO6VcJ5uQzVDbUBjqgcqCJlGjNZ5/ShyOFwNJyeob k20zDufTPbA7Iwp15fwIwQyn5livVMoQHeTKR/0xGy/8B3jZUcY4l8oabTe/xANX7yu8 Or8H6jhRJ/ohkboEJRKUsaUlNBymct2aqvcCMxvwd/kfX5iEcMLTnDnz3CZKE/CN7GxV gMwo32Nvxjlh1C3OTAbuRvipnlzdkZBjziSvVNGwB+Voqn4sLRvgzCyTMS+FB7tJ0PLo cEqIQEBLCG3qd+4l29w3s2F+q2dWiTLmZdSSfRsPi0p4bCiSmjmFZ4Nz3A+SW9cw1JkS xjPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=V7SVu1BhAyUMP0B53cfxyXHHMRc91wI3h+hEbhakhTI=; b=TE8lL2xmpAeHIXJjZtqZE9NZVInXslU7uM0hFwO/HVY8cylmkdksAORB1hZE+wcJqj 8B6daSgAYzvsFosmguRxeiswk6DfiqWzsrZK4fu6e157clGhQeEBK/cx+jkXFSDkXvQh Dx01fEVot/oz3NUtc5fv0lXTb1JUfcwVXkBrsxRog27iPy4TPRU0rMr2rY3Q0LN6S3Py pHgakEy1fIbrKQGUCOh0BurAFPcIWIhYKvRnNT7eBuhhJuQBdRcawDlTzoEs+BlW+dA4 +UJsxHPgqPLINxnmskNKWi+g+nEkZ+6614mKpfoFvyFk/uQhUBwMxhrIjFjip19Coprg JnwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cv+VTpI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y28si3102526iot.48.2021.09.16.09.42.19; Thu, 16 Sep 2021 09:42:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Cv+VTpI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242210AbhIPQm3 (ORCPT + 99 others); Thu, 16 Sep 2021 12:42:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:45402 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243416AbhIPQgJ (ORCPT ); Thu, 16 Sep 2021 12:36:09 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6FC08619E1; Thu, 16 Sep 2021 16:21:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631809307; bh=t4n26Y1K3/SNvUAHV343Kcz3CavNNWuHO99XDkSQo/M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cv+VTpI1VqO3ZSLFcoL98f8Nv6WUBclNDe4E+5lgfkqFPylkO9U5W52yovB3ObN8T We+bVqG+MDC8E0T+oMulDc/g+0lGKDLg1pm6X9De4f/JJPOYejyF5LuBXLw7E717U8 CMB9yPP0+3uU5Zv8TplU28RNskRFh0+7zEJqrx68= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Josh Collier , Mike Marciniszyn , Dennis Dalessandro , Jason Gunthorpe , Sasha Levin Subject: [PATCH 5.13 074/380] IB/hfi1: Adjust pkey entry in index 0 Date: Thu, 16 Sep 2021 17:57:11 +0200 Message-Id: <20210916155806.525546437@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210916155803.966362085@linuxfoundation.org> References: <20210916155803.966362085@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Marciniszyn [ Upstream commit 62004871e1fa7f9a60797595c03477af5b5ec36f ] It is possible for the primary IPoIB network device associated with any RDMA device to fail to join certain multicast groups preventing IPv6 neighbor discovery and possibly other network ULPs from working correctly. The IPv4 broadcast group is not affected as the IPoIB network device handles joining that multicast group directly. This is because the primary IPoIB network device uses the pkey at ndex 0 in the associated RDMA device's pkey table. Anytime the pkey value of index 0 changes, the primary IPoIB network device automatically modifies it's broadcast address (i.e. /sys/class/net/[ib0]/broadcast), since the broadcast address includes the pkey value, and then bounces carrier. This includes initial pkey assignment, such as when the pkey at index 0 transitions from the opa default of invalid (0x0000) to some value such as the OPA default pkey for Virtual Fabric 0: 0x8001 or when the fabric manager is restarted with a configuration change causing the pkey at index 0 to change. Many network ULPs are not sensitive to the carrier bounce and are not expecting the broadcast address to change including the linux IPv6 stack. This problem does not affect IPoIB child network devices as their pkey value is constant for all time. To mitigate this issue, change the default pkey in at index 0 to 0x8001 to cover the predominant case and avoid issues as ipoib comes up and the FM sweeps. At some point, ipoib multicast support should automatically fix non-broadcast addresses as it does with the primary broadcast address. Fixes: 7724105686e7 ("IB/hfi1: add driver files") Link: https://lore.kernel.org/r/20210715160445.142451.47651.stgit@awfm-01.cornelisnetworks.com Suggested-by: Josh Collier Signed-off-by: Mike Marciniszyn Signed-off-by: Dennis Dalessandro Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/hw/hfi1/init.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/infiniband/hw/hfi1/init.c b/drivers/infiniband/hw/hfi1/init.c index e3a8a420c045..c076eed9c3b7 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -650,12 +650,7 @@ void hfi1_init_pportdata(struct pci_dev *pdev, struct hfi1_pportdata *ppd, ppd->pkeys[default_pkey_idx] = DEFAULT_P_KEY; ppd->part_enforce |= HFI1_PART_ENFORCE_IN; - - if (loopback) { - dd_dev_err(dd, "Faking data partition 0x8001 in idx %u\n", - !default_pkey_idx); - ppd->pkeys[!default_pkey_idx] = 0x8001; - } + ppd->pkeys[0] = 0x8001; INIT_WORK(&ppd->link_vc_work, handle_verify_cap); INIT_WORK(&ppd->link_up_work, handle_link_up); -- 2.30.2