Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3288565pxk; Mon, 21 Sep 2020 09:46:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/pLcdU0/61/AnWSq1V1mbykfiPJ5uCspFgCLj5yTldZNHPhIT8BzsNfHcwVjzjFBzxXwh X-Received: by 2002:a50:875c:: with SMTP id 28mr593502edv.20.1600706801277; Mon, 21 Sep 2020 09:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600706801; cv=none; d=google.com; s=arc-20160816; b=qBqntEWI762KbWZiW1UTo4vasH7uoz0YfBt5BlLomb+/16m0YCIH7RGwkVpYF2QiEs DtmWCHoBudmn/6Rj3qve9BvBadtL8hnKhYPKPqEAZXU8h2Flwk134npTX958JsI+oa4+ PMd9AWwx+NVHb3dq5Q60d+N7jXGuoJR89Lhyo+u8s+/1iHXzKoLSwKYDfDp1MkAYno07 /9ZSGP2i5SUfGkDlWzlUBl2w8/Y1GLcRYGZdPEJzi8DvemNufqIaxcGAWgysxzfI59bc WBCQi2lkVn8vD8H4+iOD/ZqaoHKXIzMAvyBP6+i6N0nNeQzy8O0+XEFDP0if+pROYQta 2DrQ== 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=8fJvhRhmqqregIbcEMhrLuPXxD03wFtqewt3B3OVqr4=; b=s11GRqQfVWNxPeUDPPd6zAKxTelrIZ5U6yrMl9kh1hTxO4WHxnSst2z5kbo48cVKbV AVhSw4GayCKeo4Dgbndd1G5BmiffAlDsKU7k461dm4j+bwTfK8ukcZZ1wal41ee/9YKX 88LoQriLkph/Nharww12jMOSafgC0ceXnT0PKXx5mTd756MPaL2+qBADx8n35B4rE51P LUh3PNh1rKf3EFVNUipKl1RmMPRNuwrUovwD2cwuCSja0ag98VJCo5VhIIimtCV9YMUt SWBhBvKBL3hhO3tt9/aofap+0LJfxfY1/ewaAbV6xyqiB0Sbh+TU++9ZUA07nNonuxeO 1XqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dZqHidjb; 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=fail (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 s7si8454995edj.515.2020.09.21.09.46.17; Mon, 21 Sep 2020 09:46:41 -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=@kernel.org header.s=default header.b=dZqHidjb; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729544AbgIUQnB (ORCPT + 99 others); Mon, 21 Sep 2020 12:43:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:47310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729169AbgIUQm5 (ORCPT ); Mon, 21 Sep 2020 12:42:57 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 39ED4238E6; Mon, 21 Sep 2020 16:42:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600706576; bh=+KGwCmVccMHAM3qXfrLpi2iExufsVGAzg4nfM0m77TU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dZqHidjbExz1JfeTwMPkEK0TZ9zPQhbwH0orutWmCK57x2U+JDxwQhsrqXBsWaYXI T62uhtTcdV7JjIm6ZRT57TEkyblOB1MzZAjKnfCEGqdf+d+4o9K6pR7fc1rfi1Qd7t Py22MJE/DlcrV4LVdSVCG2vK6BF+NG6lEQXfUteQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Naresh Kumar PBS , Selvin Xavier , Jason Gunthorpe Subject: [PATCH 5.8 001/118] RDMA/bnxt_re: Restrict the max_gids to 256 Date: Mon, 21 Sep 2020 18:26:53 +0200 Message-Id: <20200921162036.402185134@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200921162036.324813383@linuxfoundation.org> References: <20200921162036.324813383@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore 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: Naresh Kumar PBS commit 847b97887ed4569968d5b9a740f2334abca9f99a upstream. Some adapters report more than 256 gid entries. Restrict it to 256 for now. Fixes: 1ac5a4047975("RDMA/bnxt_re: Add bnxt_re RoCE driver") Link: https://lore.kernel.org/r/1598292876-26529-6-git-send-email-selvin.xavier@broadcom.com Signed-off-by: Naresh Kumar PBS Signed-off-by: Selvin Xavier Signed-off-by: Jason Gunthorpe Signed-off-by: Greg Kroah-Hartman --- drivers/infiniband/hw/bnxt_re/qplib_sp.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_sp.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.c +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.c @@ -149,7 +149,7 @@ int bnxt_qplib_get_dev_attr(struct bnxt_ attr->max_inline_data = le32_to_cpu(sb->max_inline_data); attr->l2_db_size = (sb->l2_db_space_size + 1) * (0x01 << RCFW_DBR_BASE_PAGE_SHIFT); - attr->max_sgid = le32_to_cpu(sb->max_gid); + attr->max_sgid = BNXT_QPLIB_NUM_GIDS_SUPPORTED; bnxt_qplib_query_version(rcfw, attr->fw_ver); --- a/drivers/infiniband/hw/bnxt_re/qplib_sp.h +++ b/drivers/infiniband/hw/bnxt_re/qplib_sp.h @@ -47,6 +47,7 @@ struct bnxt_qplib_dev_attr { #define FW_VER_ARR_LEN 4 u8 fw_ver[FW_VER_ARR_LEN]; +#define BNXT_QPLIB_NUM_GIDS_SUPPORTED 256 u16 max_sgid; u16 max_mrw; u32 max_qp;