Received: by 2002:a05:6520:4d:b0:139:a872:a4c9 with SMTP id i13csp2564896lkm; Mon, 20 Sep 2021 18:50:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCaIJjgodI+pYtohvX90m4kzYhs4h/U+Tn9Zr/021kJOd07eZpIjY3phix/dBplRUQwxQz X-Received: by 2002:a5d:94c4:: with SMTP id y4mr9096641ior.131.1632189049809; Mon, 20 Sep 2021 18:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632189049; cv=none; d=google.com; s=arc-20160816; b=rqh/uYe1h4UY//eygbfVC7i6l0rbdUudHe8AA2LHZnZCt+RlNZhg458NLWOyAqOk6t GMUJ27Tj1/L53Ks/Z8WOarYYBsSjlw/T7TJ0RMAtsGmC+fpA6QdAboZaGf85Ofn8JNht Ombxl4hn+IwrdfLjvFfE0Qm1rmP31XnmKowWTHtWVCSz8RW6ME+O0rMqFSx+lqtG7nOk lUfmBtC4ZnYcDfptABuUteVS/CgYP6QrdavK+/xZNOyAFo47K1u60AOvqZXpAGI7Fdv9 drc25ecp5L3z/JI94tMmZrGEjM1Irwd/oLDXRwAgrGjiqlMHlbdtDEgpae4Q+pOKdhE7 58Qw== 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=hQRKNSv7ljIX+GB9CHx9JZlkAXP2skTy0trexruqUqY=; b=BKxyseAov70LBOzKO5dQwm9kB09GmyLXxuoAqKYYLi2UhXACTrv/q5UKfPQ6iCgWxH pX6wl89FURGb3BzNeO4EZuEN9RyWFRskCBNoQheOPGR6jeJgBL6gSnzFOpAb9W24zAor CDoFKH4HJf78hchu3Kd6I4L4qEx7V9n9/ER762BkanMIuEc+SWoP+j6IJ5wS3uzUFA7C NSxYmLU+pFTYJX1SpLRmWyRMQORhLtMLW2UuRz/5nTrTnSHqtSB6k7EVMaukvs+HDA0M 0DqfSQA/54mdSx/FAoZiNuTUn//sUv2mC/ix+D+IDUW05115MNpSY11Wl8Ji8RQ0wwGK 7RwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1kZH2yza; 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 k26si7881915ioh.55.2021.09.20.18.50.38; Mon, 20 Sep 2021 18:50:49 -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=1kZH2yza; 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 S1359163AbhITSJS (ORCPT + 99 others); Mon, 20 Sep 2021 14:09:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:58164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356954AbhITSCd (ORCPT ); Mon, 20 Sep 2021 14:02:33 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 38AEB6322D; Mon, 20 Sep 2021 17:16:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632158184; bh=RVsQENPII5gI9SJod3iH8WlFbUt+eBnULnZfSW+HNqk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1kZH2yzaOIEB/+sVdtgZCDFS++HaJcRvgIc+gbX3gRYfBrKb95Gd4iZTzoK8PonjH JFOK0PvYdJfqUFULoOEJX7Tlc6jgOabMmrOBKT3p2aFHpeH3sV7OnXoencEVGGgiMQ 4WjqFZyXMc/eH+Ymq+rhCO1f2K48d7WEoI4UuT5Q= 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.4 039/260] IB/hfi1: Adjust pkey entry in index 0 Date: Mon, 20 Sep 2021 18:40:57 +0200 Message-Id: <20210920163932.447480767@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163931.123590023@linuxfoundation.org> References: <20210920163931.123590023@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 fbff6b2f00e7..1256dbd5b2ef 100644 --- a/drivers/infiniband/hw/hfi1/init.c +++ b/drivers/infiniband/hw/hfi1/init.c @@ -664,12 +664,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