From patchwork Wed Jun 30 09:46:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Khoje X-Patchwork-Id: 12351759 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EAD97C11F68 for ; Wed, 30 Jun 2021 09:46:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D04AC61D08 for ; Wed, 30 Jun 2021 09:46:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233943AbhF3JtJ (ORCPT ); Wed, 30 Jun 2021 05:49:09 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:45688 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233541AbhF3JtI (ORCPT ); Wed, 30 Jun 2021 05:49:08 -0400 Received: from pps.filterd (m0246630.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15U9b1eM024391; Wed, 30 Jun 2021 09:46:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=2jc2HTXzMepww3QH2bWX+3YpvCGaGqs+ihG1ComwaOg=; b=zccrbRF2QPat26ftPaYwydg6sEv1KDOy3JrxB3006Bv8bKyF8DaiOKF3NIjLOXClgzTF IBG5laSHkUOOh1TBldJZBDCwMAJPxB5BtTN7wrwiuo1K32t6L9l4G5THQHVIqBz1/s67 vBSXTf5NP8qGjATF/onvfvgqwGJdNZA05KueRZ5Q3bTfNCWQ7QumwZifdOCqhbrOIwjl Z37x5V+UEj23BkFxZBiTuyxSWWc5dpkTwItHMtqUtUyrexRiNSA7Pn60aNMtwP39SsCz trbbOwBwLiHvfwYmA0KhAEtDQlF7Q8/2iDFGrCKtmj9Dlvjz1bBfvrwFHEIGO5Ybonww HA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by mx0b-00069f02.pphosted.com with ESMTP id 39gguq0kpc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jun 2021 09:46:37 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 15U9jtm6109781; Wed, 30 Jun 2021 09:46:36 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2171.outbound.protection.outlook.com [104.47.56.171]) by aserp3020.oracle.com with ESMTP id 39dv27m88k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jun 2021 09:46:36 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rbl2yY59IjpQcIRp0W2317OnEZOcjoUwZnDRlscDgCwZj+NYpXwKRs8CVjYDNkZeDdVkDCmHU5rv0pyvw8c83J5Bzr5eopL+33pUAAcOffz3nsXcqHSmcwbmo7rxm67RKAJfOMsWy5y5j3qB4NRPMGShXwpHLSgVr20Ws5QzIZ3okR1u65NPThbKFDPuMJng97gIEZbr2Ij/ZhjjjOqqcAIN8CNU0F4TFxdvrJOiR+U++GiQ727IJ87CwhoiaG4V/KCv7y06G1kEfN/0K49tiI8ZqeLcDKGBQwd9BLB+kL8jHXwQBaNu4rHOZpNer92tEzoa4HfoKZYN0T03ylxDKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2jc2HTXzMepww3QH2bWX+3YpvCGaGqs+ihG1ComwaOg=; b=baFY4nR49Ju4E7hhxYrvdGb48IjP4MuXnwZ2PUGUsNoBIwJyLnxZmC+uV3DyPE0y+T68Bay+e/Lko3ZqQUDcLUUb9gznetuT9Xppnf2y1MkVdRN88/LOx6/UH5JFnig9SP5ytqMd+EyIAbUF65sgRF03NHVJJV1zNMrMz1rI4SU00QCUITO9ZyAqbBFPwUniCve8PkOvjPlXlIrQ+Bpv2CE8Yq3kYvaOI8+KFSnm71dxiCFdRrf/LgdD35visiIxiUGs5svFxA8UU+JTH9YBp4FCbjLI/kMjJKQBopd+eaWXEPjmUb6g00L4TP7254/fku/it+3YgpCR/C5ABCLy/A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2jc2HTXzMepww3QH2bWX+3YpvCGaGqs+ihG1ComwaOg=; b=cwVPHxZfRY4fZCYIFD2aDLBsbb3DVL2z0aSwzGBFbCPLUDL4DdnDIDphKKqm3npOwHuiDcUExpgBQjMykE/84aagybg2KqaWJXPScJVbdDQk27SqMhN/LxNgHCSN5qMfRCNL7ZEEpJNKyKvzkwMNIEI4RqWt1fth83P0c/fJz9g= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) by CY4PR10MB1557.namprd10.prod.outlook.com (2603:10b6:903:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Wed, 30 Jun 2021 09:46:34 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::19cf:f38f:51e0:a5f4]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::19cf:f38f:51e0:a5f4%5]) with mapi id 15.20.4264.026; Wed, 30 Jun 2021 09:46:34 +0000 From: Anand Khoje To: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca, haakon.bugge@oracle.com, leon@kernel.org Subject: [PATCH v7 for-next 1/3] IB/core: Updating cache for subnet_prefix in config_non_roce_gid_cache() Date: Wed, 30 Jun 2021 15:16:13 +0530 Message-Id: <20210630094615.808-2-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210630094615.808-1-anand.a.khoje@oracle.com> References: <20210630094615.808-1-anand.a.khoje@oracle.com> X-Originating-IP: [49.36.45.114] X-ClientProxiedBy: TYAPR01CA0007.jpnprd01.prod.outlook.com (2603:1096:404::19) To CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from AAKHOJE-T480.in.oracle.com (49.36.45.114) by TYAPR01CA0007.jpnprd01.prod.outlook.com (2603:1096:404::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Wed, 30 Jun 2021 09:46:31 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5358733d-92bb-42ec-c146-08d93babf248 X-MS-TrafficTypeDiagnostic: CY4PR10MB1557: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: naTRi1UAI9pJ7CVMfR95ma5Oj56nCCN1EGB5IsV3iEyyfN1HNAJwBpUmQsvYcwz/lNepcZPZuJH+vOFfUMf5gzeTF5GaHJz+H/xUdhVYGExL4jgyd21yaw7AeZP8F7o0EdS+LHylgnAUj8eLtsG5p13rlqyYWvFXdUoO75bnyBGWybpkChpiXXoyZ9BRxmqMxWQRSIHckF3kmdSWXvZgSQnm7z3fj0m7hBjTKdjr/r+I1/CKWP5YnnAFv2bmG6u7cx+n7fsJbaxXiUVkbV1olcBVM6lknQlzZi8ec7ipr59kHofLrfBeL6s8B3hQKvvUcErEYQF0KR16j8FNSb5uOUSrEoDTxWWP1SC0dtp1trC1bUE5L0NJDgbsC6Sb4YUfkRZQBd/ai44McrRT8PXY1PbBWWHpaQoKh46MNLpCR0WyGXk4qEMUj/HXU/8RlSnNvW1dTy9xPpLt2ONB3ndqYqgJAP8OLYUhNOQhywiUstswkUb4H5my2F+r9/Tom3s2xN4GtFR5tuYOoV2e3+5b3RfhLewXCecJcbuIqlk221uE42ptOQlXel0hKdQPwZrU7+FBZWgSyoiNIJvTzcKVWK4sEVLWA2J2+nTV+pt8G9z1UqbWnG+qRDDfFPqSWCQPOuBGldqKPPUr/mDqMqdydq8i34zFL8hzP6qTrDKN7fUhU+krVN7HvuWGP9nA+OgSw0wl3Vf4MxsTOLsLK7WEjw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1001MB2086.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(396003)(366004)(136003)(376002)(346002)(66946007)(66556008)(66476007)(1076003)(16526019)(186003)(1006002)(6486002)(6666004)(36756003)(83380400001)(26005)(8936002)(8676002)(52116002)(478600001)(38100700002)(38350700002)(5660300002)(103116003)(2906002)(4326008)(86362001)(956004)(2616005)(7696005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: UI6i3aWEmWkDHHHeUTU+QG0XUtQK2XQqY33jdwlBA6fXEEIuV3pnUtiGOWch9AWshw3PLVqvNcaxGPnMkJLMZs0XMz20s6XQaMwl+RcXxFBUk+bpTxfbWpcaq6L4CJhrlAOzldlZS7Ovi6BH6gXMvMzcQF0gIN0c8TYHli2diFiOz3GmwHyhH2SarniMMXkWqRgZoXCgiY3FFlfybVKSs2NtIyQX/N8zFR+q5DoQjrN5DqtiD7YLbxqcP+F+xBDQ4Yjn5iW/OkKEEHqpDCybk3OqwFVK1AI3Nk1Dy7HsRdPiV4oOVevgyIW1DD5IgXbnsY8v8uIkdfKe9FiSct2m8dyOrN7cM+iAZg/VR/QWqsbyBGbHp5kwbjQHt+CKiPrdZlYO9JaWE/OfiCNwaTL5PtHiO+k/8OUmvoY7a7LTNS3n52p6POE0AKiAX4qugDjW3OjE2iz1Q5s5e8ph4uCDDTpFg2a8VCDxDapaE3fd6YDodILRjB8sN6bIZgfG/iYAMMsjvKhaCpbz7XijT4cqHr93aEGDRm6RBQ8lTyH8Al4pNP4iJn3/WWOU8lTsqeCeSaGmymksBMnKtOGQI68L0ST7mIC5nsoa3qDnk6hMWu2DMpOJYslXFSFN+3lmPBVj6khTGMTInJx1UOOQ/B6LZ6uJoKJqenM+XcWPNe9kTS73KI6lJuDplwN+Dv1oJJxpyYtL69sPhTa0C9RzD+qMjYXiQ3dgIIvy21lb16TFSypn6yc9leLwB37jqxhPzvu1Jq4rtFNcqTs38+eBN9JmVdx4yzIgsvJgiSAsiNAEaJ/1V3WNotMLJGTqEmLhz6vzkUR47TxZI5WT0SEYGQtZQsflAtxZCmymrFL8InMNU8vGCZykcsMm9Nhg6QDzIw4OAqFtGR0kgcZ9aR99Vs6TaTH10NCrlqNO8/7Xgn4wMJBTxfQgtArfHa87PLDwTTqL7DaoWqZPNYC6YWkGWZ2SmAHWVCBLj4+sK6PQFvebHl9yQ0dE7mYvLoz4Yoy+E+5nnW3PkRlXR6QFvI9CHDB0ye5zK/Ru0IS6LJClCWc+zdyn+3wo0pnZ7IyPTFjJyC8y+ccLQzpGv9U9/c4EO0p3lInZqII7WGLF1x+X64zgjh4/WnvsLcI5mLPxKT+5p/VTrPr7Kaj+qwyhswYLQ1EJkJYNnX45ILiip7TmR6qCRdYAwKWsfsoVIMAx3G93ycP0cnLcKc3fh/qGhQwxui2X4h1hMJziPdDBeA5NT/fIwKIi2Jfq+BlWbbFS25lcR1lDnRG38+PUNWu/Qb2seeFnohOH0y6pMH3CV0u9ig3tosOtiJyebVeK17n8/p6wdG1J X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5358733d-92bb-42ec-c146-08d93babf248 X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2021 09:46:34.4284 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jU7hYh2ZRrEGukNjWoR8NaoQGti3NDsJF392zznJugHi5dDA/tMZhnZtWiQBAVX1AOI1lSuRA8y4UbLFt6lVhUV91Mi843+ehRpYyCWIBLo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1557 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10030 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 spamscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 suspectscore=0 phishscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106300063 X-Proofpoint-ORIG-GUID: rOWHF9UpKBu6rZ-LQyyDY-lV121ztVRz X-Proofpoint-GUID: rOWHF9UpKBu6rZ-LQyyDY-lV121ztVRz Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org Currently cache for subnet_prefix was getting updated by reading port attributes via ib_query_port. ib_query_port() calls ops.query_gid() to get subnet_prefix and returns it via port_attr. In ib_cache_update(), config_non_roce_gid_cache() obtains GIDs by calling ops.query_gid(). We utilize this to store subnet_prefix in cache. Suggested-by: Jason Gunthorpe Suggested-by: Aru Kolappan Signed-off-by: Anand Khoje Signed-off-by: Haakon Bugge --- drivers/infiniband/core/cache.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index c9e9fc8..929399e 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1429,7 +1429,7 @@ int rdma_read_gid_l2_fields(const struct ib_gid_attr *attr, EXPORT_SYMBOL(rdma_read_gid_l2_fields); static int config_non_roce_gid_cache(struct ib_device *device, - u32 port, int gid_tbl_len) + u32 port, struct ib_port_attr *tprops) { struct ib_gid_attr gid_attr = {}; struct ib_gid_table *table; @@ -1441,7 +1441,7 @@ static int config_non_roce_gid_cache(struct ib_device *device, table = rdma_gid_table(device, port); mutex_lock(&table->lock); - for (i = 0; i < gid_tbl_len; ++i) { + for (i = 0; i < tprops->gid_tbl_len; ++i) { if (!device->ops.query_gid) continue; ret = device->ops.query_gid(device, port, i, &gid_attr.gid); @@ -1452,6 +1452,8 @@ static int config_non_roce_gid_cache(struct ib_device *device, goto err; } gid_attr.index = i; + tprops->subnet_prefix = + be64_to_cpu(gid_attr.gid.global.subnet_prefix); add_modify_gid(table, &gid_attr); } err: @@ -1484,7 +1486,7 @@ static int config_non_roce_gid_cache(struct ib_device *device, if (!rdma_protocol_roce(device, port) && update_gids) { ret = config_non_roce_gid_cache(device, port, - tprops->gid_tbl_len); + tprops); if (ret) goto err; } From patchwork Wed Jun 30 09:46:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Khoje X-Patchwork-Id: 12351761 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C640AC11F6A for ; Wed, 30 Jun 2021 09:46:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A947B61D10 for ; Wed, 30 Jun 2021 09:46:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234059AbhF3JtM (ORCPT ); Wed, 30 Jun 2021 05:49:12 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:52310 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234017AbhF3JtL (ORCPT ); Wed, 30 Jun 2021 05:49:11 -0400 Received: from pps.filterd (m0246629.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15U9kKFf020202; Wed, 30 Jun 2021 09:46:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=ofNyg0XRC6Jd1DLjMtZ+RFa7IIQEWl0HJ2iuxpb+U8HaY1yTrVU0ywa/vpUnjSfOwNNO 6E5Se5DslKYCaNsifChRKNTO7OtxYvnrcCYOqn48zAPKSz/ELYPdMHj9j2TQbfoOfjuu T8ubB0eIZgPZcH6J53NPrOn6xs6mYlF4CkSbRO/RLJgF5ibpEqZa3lZ2baen2t468sMD Bwq+VeaQ062Jz/CReTAJuq/mcLM3t+xsfzwAhl7QCIKM+wBhbYmdPyrmw5lw1kg+4BG+ iicKQHb4MSFO/X7qNmkQA7iSR2nKEiZyaFuH1oBapEXjVgc4NslLU6g5AWVWk66B518r qA== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 39gjrwgeuf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jun 2021 09:46:40 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 15U9k2tP039504; Wed, 30 Jun 2021 09:46:39 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by userp3020.oracle.com with ESMTP id 39ee0wvps6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jun 2021 09:46:39 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Mw5t6OmHA1ACa/xE3TWPfkkk5HOu7wcqBvnVOYrWCu58IHLmn5qFsBktPuSN9fU70vVsnMSkYMTlwM19lbxLVnuVemohoPE58EEMBpMUh+Z9imieuorJbxY+l1t0lc+olARNSllNMrXSVt6FGTt0EHojtRJO6N6TaA4tHy9uNpANVL29yqKlVXyqFdzwUKz07cYBbiI+sapAPzXIbkXiBuw8KALuRfvBLAyvg2CGaWiE6lO+L9RIA4vReh4fZMtESSd0f5JVI4wCpAzxKwZMQZy8rQI3N2MfKJVG3/ZgAbeMhlZSkntSu4+TjHV9DMu2dFn20eHSSoFgKE3JMtw0Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=Enj1CSLCNT74vaHxD70dyYC+Y+pAzQ8EaAocZxVH41NChuhl/74qeCvkWaQ3xT3rY9Qx8RF7Z/+Xj8v6rEW1C5U5xixDT87y6Hq2M674SNchjnU5xQhPqJffDoQYV2GApvwBDo6d5TCn6Im7gcbJV4z8y0jGTA8QD4lvcIhOr7qRFeJ++6+Lw+YIRoq8rqbebGL0nUyNFqczOFjZOIXt/R3fuwkDJ9Mo1LLD4bzZHofNz6HDTgb3iGQlNd6U1H6oWLgPcrxNsZvOeNk9Uazv2COGCxrUxPU14ZdWsOw0OXXUATrn4x4yCbR5kvJEMFiStaGcGJ/J2d8kmjL3Gm0khQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h686Og7nWQgIy2F8Ldwi3r/IKqxjRlyyk0G5ijPDQc4=; b=QOeG5sCf8HORmTUankMJ+I5DCvAnPuLXdLy6itEsrcfbyBncmHLFweOqvzPU/EhLMpTqxgJUknHc2JRGlVdrDobhJy+YQp0dsidPyS8gwOpgtw7mZzsAhA9/d/h9SBpQaOsEWKH2OiwqKicxyqQEOE4apZabacyCsKgEW3jbPXs= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) by CY4PR10MB1557.namprd10.prod.outlook.com (2603:10b6:903:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Wed, 30 Jun 2021 09:46:37 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::19cf:f38f:51e0:a5f4]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::19cf:f38f:51e0:a5f4%5]) with mapi id 15.20.4264.026; Wed, 30 Jun 2021 09:46:37 +0000 From: Anand Khoje To: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca, haakon.bugge@oracle.com, leon@kernel.org Subject: [PATCH v7 for-next 2/3] IB/core: Shifting initialization of device->cache_lock. Date: Wed, 30 Jun 2021 15:16:14 +0530 Message-Id: <20210630094615.808-3-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210630094615.808-1-anand.a.khoje@oracle.com> References: <20210630094615.808-1-anand.a.khoje@oracle.com> X-Originating-IP: [49.36.45.114] X-ClientProxiedBy: TYAPR01CA0007.jpnprd01.prod.outlook.com (2603:1096:404::19) To CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from AAKHOJE-T480.in.oracle.com (49.36.45.114) by TYAPR01CA0007.jpnprd01.prod.outlook.com (2603:1096:404::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Wed, 30 Jun 2021 09:46:34 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 203465ce-2058-4a73-e06a-08d93babf422 X-MS-TrafficTypeDiagnostic: CY4PR10MB1557: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3631; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zoKM41vpEG0nWLaDH/XXUIlwmZDkvyaXKtDxOFRmNRFiOVq6Pj8Pb0+zu0e96rLwVTDytDXX4EtjegCsxpDZP6RFrA+lV/yDB9RGEI0mtoj3jK9ASmdGGREkl9nLjfrUJPV8DruzTZDKDTGbWQWnamPDlsoslHoA/cPOsr8oJpmhwZRfTKJnsydXai3urxWGE2rC2qdRD1IwF6htvtMlcLD4Zzi7HevCfjIqNvqr0u1RqI6dOxMx5eASrNRQQ/sYfV7J06kHvtMuzou3V4dETwNA8F/CxXMq5kWpYyT8Y8ADX6WtM5t9S1ug+wi6C4J8xZJFgWsVdrGXB/0lDi+PRi5aZ5GXYDzfLkOreUmOT3JKS9YJcnsPVKUoGg+O3agsCvdVUWgjqwVQ9VRQFURn7P846qgT4KklNRgTiigLQUtpuFsw42gducWF4+5wZNSGIClFFiOrslSPEQr1GM9iHnb4wx8KD/qYrS4S09tCHATh2O8ZETsHN+nBxBYG/0/NBGXVYkL7w7AXeRBrVTDvBawEMv43qbvepOB2AyxAPIYGOK6FpiXBSMVGf6ygnC+zEaS5ry9tgQxMKBNCTF+Le1YMUU+k3bfmKIGTRbaxboYiMEEV4B7J/5DM7dBU2ejVSnm2KYal0kwILRAnOYti6nCO1Ne88VME+sYIy2xWwEPgqB3om3yZosT5P6Y1NllbVVv0ZvPYWVd6c6EC0bsdyg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1001MB2086.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(396003)(366004)(136003)(376002)(346002)(66946007)(66556008)(66476007)(1076003)(16526019)(186003)(1006002)(6486002)(6666004)(36756003)(83380400001)(26005)(8936002)(8676002)(52116002)(478600001)(38100700002)(38350700002)(5660300002)(103116003)(2906002)(4326008)(86362001)(956004)(2616005)(7696005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: eJZfMdLpMgYkuJs5vjH/v5HX/gtb/4XuWO2aQWt/t2gVR0PhN2EJXoUiMS5Y02D9uRHjnJiFBm5/M9XtqU99i5kktPCre3XeAhcIYRp1logkPN4K+wTIBxnPifNpH6xZhfQcdeZ3/A2SjU7yMSt3bQJ6f3cxMEGs3g0+w7vjOatrT3hyxZTVFsKoemPBFkExXs83oJefNdtWjadj9oeV7B/RMwW56wxgcNjU9Gcx3J2N2qD82k8yMdjZNstxhNMt4tSydRomMelRKpz6AsNG4YAUy5x4GbNeVoK9dlPCEx077GrtsqSporTkc58oViu5CmpQ5aUTuG4SVgcQG3bzuq+ErrvwjTwERQNFCQ5l5vnS6vUTu5Z0Us54iSaunrVUp4qiGW0X7LJ+501Wx1HX5Fu8iXCTqGpyZI99gXTelH4WUChUTkAucuaamB8CS87i3TB5oS0kqXza16MQFThuAJyLIYjfDUWJZPQTT9mW3cTbDJJtyBsM5thWAQMXNj+l9SpFIi/0OAj+R1v7/gtnM7tK41Ije+X32pxkCUlCgK07FTD8c/eQzNkpJsPF0bhP+QchkoXNEUAlVP1400vuPnvn70qprfIAbAjDaAroiSxRUujb1FGZfmChb6jA++Hf4hUuyCD/wRQUPmfMnsk8Tb/BetkbO8efwSopJRViddtbdgvtKV44Vxjl5GtNkfgLi7qwr+RbRWGxMdk7ClrCPDKlqidsZK49TvlmCZH1otF0jWATDYfhVVUghqEr4Awbd3oAEqxfVo2CRB7YAKrnN2l1VP+jh2vZEt7MQc8Wp6l5PwRf0dSdyw6HatqgqzyFazywBrAtJK4nXcCKzzfspXS5D1Sr4tVk9O2irkdwxWNeDc1K8dXYl1DkTCNkthW/6IHj0Tp+7ISFtlCdjCQLRcKBHTnTmns62hVsj7KnMWcxqpFqhcVFJiTdaibL6X5ozewv4wLr4AsTQlDo0j2M7dddFdDphRJhTMZVJWfyj4d8/uY/qD/3akfGJdKkAp5NEvS77zDeXjM/MXQycJqXJI3EctPd+os/cR7OjYpaLfGTpDCotvhwPFLBQ4UHm5z1nwQfr7cgA4DQhEhpR0nbGYcpAQWJrfvDS66LhtfTDXyIul0mYyqDpn2kTfITFyUvtKViTw92QwuLtOpZCWIeR6MZM2i1n1AQwuv42zTAtZvEqarPMgtooqMtp7IwSCjz6tamQAxMcVIHH+Iyc2c5RApk446CRqFEt3CXHiRYne8YMsNCgLddH/CRS3uD+paB5MNxMWNJTO9KSF1edvU5KVmIIUmCA2rKoMhcZpqXVsIE9AzHHZUBLVmlmUacfD4J X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 203465ce-2058-4a73-e06a-08d93babf422 X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2021 09:46:37.5376 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vcmF63CJWMn3NdMXTmnM/9cFRD5D2IcoFvBkpp99FPAkZI3QvEeOL0FCok7QjN/QPWB33QDWBnhuYvOO7RYW5j3XInzPbZaHGt8PYOh2JmY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1557 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10030 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 bulkscore=0 spamscore=0 suspectscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106300063 X-Proofpoint-ORIG-GUID: Pq4LlqN6mSkcWFDqdxhtS5UXL3wJ8n0o X-Proofpoint-GUID: Pq4LlqN6mSkcWFDqdxhtS5UXL3wJ8n0o Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The lock cache_lock of struct ib_device is initialized in function ib_cache_setup_one(). This is much later than the device initialization in _ib_alloc_device(). This change shifts initialization of cache_lock in _ib_alloc_device(). Suggested-by: Haakon Bugge Signed-off-by: Anand Khoje --- drivers/infiniband/core/cache.c | 2 -- drivers/infiniband/core/device.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache.c index 929399e..0c98dd3 100644 --- a/drivers/infiniband/core/cache.c +++ b/drivers/infiniband/core/cache.c @@ -1621,8 +1621,6 @@ int ib_cache_setup_one(struct ib_device *device) u32 p; int err; - rwlock_init(&device->cache_lock); - err = gid_table_setup_one(device); if (err) return err; diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index fa20b18..ba0ad72 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -607,6 +607,8 @@ struct ib_device *_ib_alloc_device(size_t size) for (i = 0; i < ARRAY_SIZE(device->cq_pools); i++) INIT_LIST_HEAD(&device->cq_pools[i]); + rwlock_init(&device->cache_lock); + device->uverbs_cmd_mask = BIT_ULL(IB_USER_VERBS_CMD_ALLOC_MW) | BIT_ULL(IB_USER_VERBS_CMD_ALLOC_PD) | From patchwork Wed Jun 30 09:46:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Khoje X-Patchwork-Id: 12351763 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C125CC11F65 for ; Wed, 30 Jun 2021 09:46:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9D6DE61D08 for ; Wed, 30 Jun 2021 09:46:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234070AbhF3JtU (ORCPT ); Wed, 30 Jun 2021 05:49:20 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:51248 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234095AbhF3JtQ (ORCPT ); Wed, 30 Jun 2021 05:49:16 -0400 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 15U9kXch025724; Wed, 30 Jun 2021 09:46:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2020-01-29; bh=nPL9GAXtRlfciMoN/+AWdGirYzSQ3Lj5Ad3nP/ubmeA=; b=rPBo+7igBEfEpirzVUXw6FkHtprJ1TU9AXjyVabaIGNI6DmnWLaXuAoil4QbGO7rUfgu qAYuNbDlDFybiEIqpO5dTjVrWcKTshenDcIzn7fAKt9NgNpsncUeTCusml5km/4xrw95 H5KYHhWpwpnCx9GkNS7sLkaVnAPxErF7I1BkzlqHWjMraoaU4+qWVDxnFKlZnr0l0ZKW z/VVh0Wnoa3X9GEksNkCU93bhUIhaeettU99Bo0Y+QU5C+XvVfkRIEugjOTFdUCwAoYO uvKHhtZ0X51DoHqOa2jWjpHzH6/7i+X3c1v5i9n+mZtFhXPdKzNmfMQihXLgL/4MLzKV VA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by mx0b-00069f02.pphosted.com with ESMTP id 39gb2t11tr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jun 2021 09:46:44 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 15U9jgNK137336; Wed, 30 Jun 2021 09:46:42 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by userp3030.oracle.com with ESMTP id 39dsc10gys-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 30 Jun 2021 09:46:42 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hAAVoKHnc+FoMhkO/TqbVsm1UEbebUX3JKGjiN5k7cUi4WH97uzs7IOfSK77cjtxg9rdVGf1SsG3JHpaT+wZRXBpEYDLhP85dJ5gnPs5PNgoLm0vwdYFA4EzhxuXI11mqnz0VKrdBwSR7WvybaXBQWb0H9FDQXBYEC5qkgIRprn8YtyQdRtwgvA+vTUjlbaNFXxHmCzXvOkbesaMn/pa9ayS/2EevwHKikJ2qg82iRyDyKGsrztrcvs/akRrzkowkPu8epjegtajDVGSi6pxo+HpLn4sefDoqSe8nptumpFdAfVM5gBvycPPDCFhPcPS18bSVmjVhcDILFBNKAwZcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nPL9GAXtRlfciMoN/+AWdGirYzSQ3Lj5Ad3nP/ubmeA=; b=evSe5JfQOo8VDczZLBYsUvFLBOrwCZ+fbaVf2J3m6YrplDE9Bz4CNbo7FQfkHKk3xEho+yV8GEhTZ6V4XDQVe+tKWu8jDNC97YApJBMh0UhAckd/J3pmGeH4z2apY9EhxlCj2kpVARkdFE73TkUhp84WfgoUdVGCKLT7/RCU9s+OO1TMXF5NpkkZpvEMFwth6gjyw+/VdQ6dSPbRYMRJ0miz38jln6ScEw8jWsXxD7RoIyIUUe+L4R03Fgnx7YorWGw5IlIv5XeBQYt+nLoA6Bwj3dSGfVZ2Z4SGsWpTkp0sLVgZ5Au7vTtv7HLgR4O8t2tSqImVxZw/8UkDYlcHQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nPL9GAXtRlfciMoN/+AWdGirYzSQ3Lj5Ad3nP/ubmeA=; b=aZbFaSzrr/Pvnm395Rc2LbIKgg1ZMSp+uuziK5cdotuqa3OXEq1kUJNodUHWy+IX3pnsUkUo9v/eCZEB8ZPFZaqcGYFLJr55y+80Pp6RwOTxKIUmIxkD0fI+ryN0ySf1fCH2VGfpPXdOS7war2CzaVAQFKg7r/FvCoCWKkYIcTs= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=oracle.com; Received: from CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) by CY4PR10MB1557.namprd10.prod.outlook.com (2603:10b6:903:23::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.23; Wed, 30 Jun 2021 09:46:40 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::19cf:f38f:51e0:a5f4]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::19cf:f38f:51e0:a5f4%5]) with mapi id 15.20.4264.026; Wed, 30 Jun 2021 09:46:40 +0000 From: Anand Khoje To: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca, haakon.bugge@oracle.com, leon@kernel.org Subject: [PATCH v7 for-next 3/3] IB/core: Read subnet_prefix in ib_query_port via cache. Date: Wed, 30 Jun 2021 15:16:15 +0530 Message-Id: <20210630094615.808-4-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210630094615.808-1-anand.a.khoje@oracle.com> References: <20210630094615.808-1-anand.a.khoje@oracle.com> X-Originating-IP: [49.36.45.114] X-ClientProxiedBy: TYAPR01CA0007.jpnprd01.prod.outlook.com (2603:1096:404::19) To CY4PR1001MB2086.namprd10.prod.outlook.com (2603:10b6:910:49::39) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from AAKHOJE-T480.in.oracle.com (49.36.45.114) by TYAPR01CA0007.jpnprd01.prod.outlook.com (2603:1096:404::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.22 via Frontend Transport; Wed, 30 Jun 2021 09:46:37 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1042402b-5502-4a4c-c738-08d93babf5fb X-MS-TrafficTypeDiagnostic: CY4PR10MB1557: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7691; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5D0y+IvSz85q1kzvSKOu3IH3666gIE44d1pgk7XD7SR3i80VSvh4boFtc5qUga4I/N5MTtBniHbWI66ZmkDbDoehKZv4mvX4fOagSBZpnJGF0bTWRvc9G4dU4R14hKXMl4dCgelENELOC/aXdY0h0Y20HqxT+6mOpc985VNrSD+BYbn6Bbpbl3UHGjP4zo43knMvIWlwRtqs11l7Utz/3EcooRfLrFLoGjcJy34T1OyWaWU2JMe1TrRU8OS8Wk2reIJAPYZ0lTp9fiDsVuYY/jrolC0bMfb9w3hBe2++P8x3hZ3cwMIE/LUvpwkG3rzJ2q0wExyFxwW2LPv9O3to7kTpTF9Vv5LQ96WHBWCVkwS6rI/ia/LLG2CBAz5eIUz3GPzDOkUBkkNGHFfMszXn3wUSZvMyXgW7D0o9Iuhgt+1or6M7djpgBa0xq5RgdCNMC8wUACXJQp51QiZGKspycT4T4jCEIQSP3dcCNOgCsDwz2kUbnIhvRFnOLF1SCpXDFBoc7yXAK7RtreC1TxBbzvpxNpneMn1H4KtvgysBCQuovCoan42aw68pmNqBARILKrZXDJJ9pZ7oYfdvNV2zkP4/3PiimL6vUkdXPheT33JHlNGwIGqdzOuo+n8pvwvK9F6yicGlQMisNnMLWsXPfPj5HdSTNcV0PscSzfrsev1X/3ZMYeSa1vWg2sLf4x7vPqEOWF+AkGPWoLPjpLamPA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CY4PR1001MB2086.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(39860400002)(396003)(366004)(136003)(376002)(346002)(66946007)(66556008)(66476007)(1076003)(16526019)(186003)(1006002)(6486002)(6666004)(36756003)(83380400001)(26005)(8936002)(8676002)(52116002)(478600001)(38100700002)(38350700002)(5660300002)(103116003)(2906002)(4326008)(86362001)(956004)(2616005)(7696005)(316002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NvILkm9jncy+iSQ2fC0PnESyZl3qfE6cLRp8ff3a5Fp6O7rhIEVk2WOc8Wq+yKuhqgvMzeAdFM5PRMee5fn1IGA+Z9y3ZKgwgZ21xhO0otpsnlhN/E9mw0DRBcHLvTz/E1SX2smvZ/+f527M84XRlINkFVbwtu4yulbqi/LOzRB5esP6bZUqhhn/MxZDQ+Vq4tWUz/eqIHfS+YKekY+b3btL8JSkICfWT9JrlOLVDBN9lk5jCsaMAxdBSX3lu+/g0s3MVhI+l53hEvWR4UBfqVn/0jRSSF3WWdVGcLf4W95f+DBaGUUDSbKZ/Uo8/MLfrT8EyHb1mR/p85DSXlWfVlFYWAXhYnn4iBG5FSnTxM1YT8t22RMm3grL/eEU7rvs/QHNzC3Pt1v8dZN4MGEJoN4v9VTfcLj7N/2dbvIJkchGu7ydcgrb3XJwEkq8dKRVE1QAKnxwxF+jkltx8A1ZIwANGnB+sT0QuAaf2Q5+mzL7/ho5SulXVvcBM3ywkgTNiwNObSG/T8+9WCQE1wb/HsItUcvQS/GBFz0DAHXq3q4uj/OuLohdPVSO3HR/wxaynq2RtG08a0E6buz/9BuPkwR1hJajrG+Ld+hH7DvZKXHXPRy9AcdbXEySEd7xSN7QUx1lToF8lQvLVBCgLyq9mvWjdHP99hJ51uc63yequS7g4SeA2WuP1eJxQrem6nUmmGM4S7pyesFN7ccoLJV8EYcVymUGcOGFQvzaaxwY0D65DODdWz0sYCqP242FN7EzrRxz25zBSPLcT0vL4/0pJIkpzuulWicJ8HA4TXmU6Bbvz7oPlQId1o8KKNlwAdkveYLrqFbvOHEb24CFSVZgYJyIz9NIH0uACdxI+AzahdBAdBJ9CxFQg5rfNaWf8AXyRv/nt/ewNMz2soQR1Y/AZ3iv5yjQyVPvG4Iwbg//VX5Br8Rb0VlYYQQSh13gBAw+Afn8GMmsIVfYA3Iy157XQXQpxb7cVO6RQlD7LAwvuUULVxx0+wdF2WMHGRailj42y2+h2nO9xFBKl0pbb8t96l2JcPel5sAOdOTIaCMb54ueXSpEx1Bz1mRrYav8pgi90vV7Ota/X64nCaw/k9vq+yAqcgDT75ElXU2ZXl6YDDKQEH2gfD/JKnIxUfsp7dIRRnHjhZ5fD4khhRrmWgo0XwGmYzeakClMNopOcWinH3A8RxVMXGsiiUGWkoYnXJsc4m7XJ3LpsFqAbElt4PaSmCsZ6dNwBFkzDgjZERjLWt0FgGTTIweA5TH4RjBQgEhvUTHiXGCSqht5DBYBtB1vgKS/6PVkoT2CeXM2pVVZLg1J/JnQMht/R8RHdK2/9Enk X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1042402b-5502-4a4c-c738-08d93babf5fb X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jun 2021 09:46:40.6118 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 5bA7ZNLEWNX/aP2z5/YnWqmPC6grspkG9bUHdX6uzl1RMgJ2O1jc5+HT+hv4/Svwq699rgEckEyOkz2P4aPSPiA0uPkmufRkj3dJ4bE084U= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR10MB1557 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10030 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 malwarescore=0 spamscore=0 mlxlogscore=999 suspectscore=0 phishscore=0 bulkscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2106300063 X-Proofpoint-GUID: kijO3yl_-Ilh4LQvGkNF2yU7VfEG7uEV X-Proofpoint-ORIG-GUID: kijO3yl_-Ilh4LQvGkNF2yU7VfEG7uEV Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org ib_query_port() calls device->ops.query_port() to get the port attributes. The method of querying is device driver specific. The same function calls device->ops.query_gid() to get the GID and extract the subnet_prefix (gid_prefix). The GID and subnet_prefix are stored in a cache. But they do not get read from the cache if the device is an Infiniband device. The following change takes advantage of the cached subnet_prefix. Testing with RDBMS has shown a significant improvement in performance with this change. Fixes: fad61ad ("IB/core: Add subnet prefix to port info") Signed-off-by: Anand Khoje Signed-off-by: Haakon Bugge --- drivers/infiniband/core/device.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c index ba0ad72..9056f48 100644 --- a/drivers/infiniband/core/device.c +++ b/drivers/infiniband/core/device.c @@ -2052,7 +2052,6 @@ static int __ib_query_port(struct ib_device *device, u32 port_num, struct ib_port_attr *port_attr) { - union ib_gid gid = {}; int err; memset(port_attr, 0, sizeof(*port_attr)); @@ -2065,11 +2064,8 @@ static int __ib_query_port(struct ib_device *device, IB_LINK_LAYER_INFINIBAND) return 0; - err = device->ops.query_gid(device, port_num, 0, &gid); - if (err) - return err; - - port_attr->subnet_prefix = be64_to_cpu(gid.global.subnet_prefix); + ib_get_cached_subnet_prefix(device, port_num, + &port_attr->subnet_prefix); return 0; }