From patchwork Mon Jul 12 12:26:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Khoje X-Patchwork-Id: 12370921 X-Patchwork-Delegate: jgg@ziepe.ca 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 9E942C07E9A for ; Mon, 12 Jul 2021 12:26:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FAE460FF3 for ; Mon, 12 Jul 2021 12:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232943AbhGLM3k (ORCPT ); Mon, 12 Jul 2021 08:29:40 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:42574 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232342AbhGLM3j (ORCPT ); Mon, 12 Jul 2021 08:29:39 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16CCNFXY027745; Mon, 12 Jul 2021 12:26:48 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=v3bg3YxFwnBDKbMXYaAbBRZlM1cz8e3lMy86gTPvvaU=; b=sRB0KGfWibn/+4jwAQG9ZAtnlJQlt/EKHKVbVo57eJpsmK0CWZE5e+pONVTjAgWw43uL wrA0uLSEVWefDS5RBtyYgXvJkT4qD78M5RF0B28eb8vkHL41Ukd/7eSMkJzTZjzZpbHl M/3iT0+552VmUv7jJ7GjzBdpZ0UFgcZTN11zoZ/2vN7rHLQGpU47bC3FBcOMdMseOVUk 3X3RjGj5UzlEoLizwShGxOEEMG3tOay9xGJ5gUiIvdodGsNtn6w/xb+WMkgUYS6EskMK APtMDdclHGGq4RXHp8zlPn6HIrfPZrUhiYJ/Cm0GgipMEi4Leojc/o5MB7GO5lrQfeqD 1g== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39r9hch0y5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16CCKmJU134677; Mon, 12 Jul 2021 12:26:47 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2105.outbound.protection.outlook.com [104.47.70.105]) by aserp3030.oracle.com with ESMTP id 39qycrhjsa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ipSaeiCyIkQKEGIhYcgSR6vCfzEm5HJLECgeDz7KoPuT/SxhUT1mgLB5/vJcJzmbqExXg+Pmq9yOQ4r6kLH9fR3wMg1mZ2wP6ddhKA/qz1viTJHZx95Y3pR1MLNHuQ1nPKmBGk6j7hFWnVxwc1/VWwcNRE5iYdqoN5RHyaYdmu3WKXHRTVXB/hEyK9zgopBd6Odn7Fka1bhk+lf8ku/ID39SIm3BJp5XCAN8T0qyq0me9Uuec0ClthboPeqmJrqVdzW6voVOfNfCakAkFKDoALJWbEdxIj8geSkh+KgUnRl4ccMwzSUuATjw1CwNr1U7gERuTbEogLMkBPjFXEq0Hw== 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=v3bg3YxFwnBDKbMXYaAbBRZlM1cz8e3lMy86gTPvvaU=; b=mr0zWhqKZtgq7aDa/1hDP+pRUxZpfuVpWSxxLcfvupKHO6hc9eaTPPSo0jkaEJPKZ3KTuuD7NzO6eoJUFwFa8XIjLfO5qIEckBLb6z6ktzsaoXiFXtLJ9wkCFr+LPWtUA6FweBvR2Ay6cKndIhum52bal0wnf1Kqi/pizIkS6GiFSUZs0RGPEyK1Y22Fslz5F0fGKOiNRDe6ocYKPOPe24tXYou0NweaYun67lIEmZzsHezden99RwQ0IVmEJQZx4ryy7CWvVXp/qWX26QFyW+WEuLya7mHAvoRmVFDQpbaroqXVT0nykMdkNkGS/UBU//IrYebsKQ6+EVx8iOWMuA== 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=v3bg3YxFwnBDKbMXYaAbBRZlM1cz8e3lMy86gTPvvaU=; b=fJWnrNz96o+JMbE3h3T9dkN38+9ZL11VKILIGtuMcnolMEzBka+JPisTwFRp58qTLL6WjOCf5iCF5iZd2rGvMef/nzTQzpIYSOI8dLdp2fZif4PeZUqS6sjYixnuG3LlqyTi2PBIRtL3GNZhPmxG3dFuNNx8VvPKZh5StyfmQmE= 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 CY4PR1001MB2309.namprd10.prod.outlook.com (2603:10b6:910:3f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Mon, 12 Jul 2021 12:26:43 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5%6]) with mapi id 15.20.4308.026; Mon, 12 Jul 2021 12:26:43 +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 v8 for-next 1/3] IB/core: Updating cache for subnet_prefix in config_non_roce_gid_cache() Date: Mon, 12 Jul 2021 17:56:23 +0530 Message-Id: <20210712122625.1147-2-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712122625.1147-1-anand.a.khoje@oracle.com> References: <20210712122625.1147-1-anand.a.khoje@oracle.com> X-ClientProxiedBy: TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) 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 (122.170.228.204) by TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 12:26:40 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: a8b69ea8-ae3a-4378-2302-08d945304e5b X-MS-TrafficTypeDiagnostic: CY4PR1001MB2309: 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: ntl2g8R7dyrHkHHb6os2NCLGBaOs703cdGZ6n58P0ETjAGmKb/klGBLVgiy71AD8oxnGWFndQUthcvVk53+6YIdgqcDArHgZkquBg0tcbS5KGFnnmsL06tlcdtb6qj12scHiMlb2dQhZZyIxi7Jm3P8QkHsTMgktWxirUR3wV3aAq9lvRZ9feD5oCK6bPgaqK0Q+Oclkhq/jc8Fm/9aeBznDQICUoPKFv1rTAq2300l4vPXJetrYZ+AJ20yIuHpwkDAvL2DIqw45KCotu+dx4hjxDkkY4VJu/vZWkQAJd+mVz6csv6vD9Xoagcvo3DSDdbkHhP9LgXRgbZ/EefouT8EqshoYT9lxGZLOgfTZMSPAenxXo/13nQv44xqFuu3wdfKgbJJbp90IsFOzTEJpnu14qYrxvgPRukYLk5u/R2rNyn3sBzRcaUEtuR5qGhmhdeVogwWttqEHOawxOkvJl9Aq2lcjZdbCVf9eBZW1PxUXafi7Qd/f6rnVJpmiaThP5tsOW+IHWkfPjGZYfNfKVGIEXONk37N0Mtgj3WefWaWCAA6dNa5wkzzJ2GG8qtYiUuRflAw/M0uw7VL6PHsDH02+kgszkjJcgwlRYN5ZZ3WssrrkhayoxoVw5VEv4D+awfTgmQr+14gIzNx7QlTVEoysO+a9NL7aEpjhRpwiZdUSor08zeCCyyfAFIjRFDzge/Egb4nD/ODPcb6J/4xNuA== 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:(396003)(366004)(136003)(39860400002)(376002)(346002)(6666004)(2906002)(36756003)(2616005)(66946007)(66556008)(1076003)(66476007)(86362001)(38350700002)(4326008)(6486002)(83380400001)(316002)(956004)(55236004)(186003)(38100700002)(8676002)(103116003)(7696005)(52116002)(478600001)(8936002)(5660300002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: O1tK6MBg/VkUKyWcY+8/u3DHumicvnwl6vJo1/4ddBIHnTv5cNFv16xFCQWUi/YkwO34bmqlhmoQxm9ndjFsptkBV6WMGvqurEXdLThX+MV4/mKiaRIw/By/k6cNdkE2KKEYzisRZr/QKvlOkzSIjZwQnfuM7d6cJiaL7AAGUjvjlaCZLPeSfLRppqAB7K/u/GEZNQ7pWUHj112Zsh/LX0VmoXbxIxVTPcFz5Ig2xhhlvDekifICJ2Fwktlo7pknoUAMwn7T9iUF2oIEh2aS7CCO2UndnBfsr0DgZWiKwNA/p94plckWAImMhS5iudIrJQa2Ssy5PaKs6Ksthf8iyd0Kjv+ZKWOvjThBKgaMIfEhq/0XXY6WUk0/VvUJ7UWgQn8zoejpoYJwV5L2LsK2uUvMB8/5JomzCYi2LmMyaJOhCHwH9MjwpDyshJmp3UZ1mRzogu5yTqUioxE3wzYHazYkZE/5svB2/Dw3Gd+THmvI2F0uqXRPaTwapKCtmCXsLyro3FJ3RIQbXZtKtgu0WtE8Q32VZSEw8q1pie2Y/0CrO5RDRiUuOk5rMknaZL9T3gXzcvrT3ggG4VrNHPWgJJscrXDeR1diN6zFJeKjG9tUrTM0jqCUWmXlHrSxamnRjtlKOl/qTsslVh70iHthlPmIm/6etkjEPVuSL1p4tL5byP3Vkby+uzcGkLS62DT0XikCvj+ncIF4qihNq49i8NT2zrWQNNAJ01i888C+RFEVia8gpBBg0+iPh2pfZUF/W5XKG7sD1rCuTyQ6RMafymK0hZxVvTqmpJ1a8FT56n9hxsTU9+XrbpUVAGe76Fj9lztk8iJ1kMsJ5AgjeV3Xb0iOIucZy4LSkEOS/4O6tizMy8vkrtDwwMcVZazAq4uXtr80oUWSdV83DUntGmNvIdb7PZ/2UE25rXhhXNC3ZThh8vNpi3I6B9Q5vC8XTfJVR5O2si+zmGQTQkZJZbJH+epUK02aMaysxWr1P7/axYmIn3JxJ+J92DXisrblFEk1YUSu9I5Almn0wTWNvaga0v4/RbGMVlLeF2Ke3HDGDxzRJKUq+frzxFoqcT/0j4zJzXxygKkaWsZRGXy6dyt/G4uDChhxbI//XXBjzfMW0f74MTxMoVlUSCLbvhdUWeWmsZkj92t6c1k7V6cB8FlPw9uoMb92fRDL8YaG7/Qi4HPppj+dwyLwHYxZhcXd5Mna0fvLcWlFpkOKJbYS/LPFz+ibqrs23VKM6vXTlvwEIsH8ED8k/riWBmdbQLyOHXvoD1aws+D37fCXlygp83nONtIwvZ8s84eZVwXxczD/tdoXYSyAWxMLYe6u+JYFn9Hc X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8b69ea8-ae3a-4378-2302-08d945304e5b X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2021 12:26:43.0624 (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: 0xXnix+dqgT/kPilaOYU6puqaQY0ccjaVtxqnQGBhAaEi3o6nVgaWz9G57tKKPEzHH8RgWKsPzNbp2pXoSXaEDUSo3hZ5wCP9ynPzauEnDc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2309 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10042 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107120097 X-Proofpoint-ORIG-GUID: NsrshBeXhEgk7YUcCionIesyfPoVtfyX X-Proofpoint-GUID: NsrshBeXhEgk7YUcCionIesyfPoVtfyX 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 Mon Jul 12 12:26:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Khoje X-Patchwork-Id: 12370919 X-Patchwork-Delegate: jgg@ziepe.ca 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 9F33DC07E9C for ; Mon, 12 Jul 2021 12:26:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8375C60FF3 for ; Mon, 12 Jul 2021 12:26:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231953AbhGLM3k (ORCPT ); Mon, 12 Jul 2021 08:29:40 -0400 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:22386 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231749AbhGLM3j (ORCPT ); Mon, 12 Jul 2021 08:29:39 -0400 Received: from pps.filterd (m0246632.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16CCNWFk002693; Mon, 12 Jul 2021 12:26:48 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=Z5Lf2T7XeyaI09CcvmHrub48Ljw+cYSwP1I4vkpRaTsKXNRGm3mc+fyOBf3GkDFmUomU l7swtFvy4I6K2S3t8fJ4kXBryTuEeMJsxh4QdMHaK+J3PmtKWu3ZrXNkQXZ0ATezXLZi NvZLinEZ+nrXdGyCBMsdnwqZD7HmEZTE+wUm3P5xfvbDwdoCChy18MnE46koquPOywtk K/P18V37d3QZftdG8B82KW7ljxdwaxGeurYv+NPIc8qnIa1nvBkmhXgBbcP/LY+UONnH 0wSTCitjLYZy05TlH/uYCWlQGD3tnVzQfHDvqI0napUdxd2MmVSC6Y7X1ERrnUcdwwfG Fg== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by mx0b-00069f02.pphosted.com with ESMTP id 39q35s2hve-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:48 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 16CCKmJV134677; Mon, 12 Jul 2021 12:26:47 GMT Received: from nam10-bn7-obe.outbound.protection.outlook.com (mail-bn7nam10lp2105.outbound.protection.outlook.com [104.47.70.105]) by aserp3030.oracle.com with ESMTP id 39qycrhjsa-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DZAAZWUt85vdiRUk+diKU/JWpnwNM90WoAd22z64N3nDVAZP/3xS2NrqJn2LLxjWtqxFsVPK/gwsJtdF2QLDXiHK1Yku5q6b3+fRu8EBl323fwcijJ5aBFErcoAh8a8b1/erqRXnEU/fXF9aufG8Ll8XujnEq5CSq18O6zVwIUVSBk+Go7/jmM+7TNST0dnIgWaJZm5YIWnAuqj2ih3D3BXXW7v4VKJ+RMfCm9RfpDRfsf58SjyTClYKhRmS1GinuN5pnOo81R87+EEh38zE1JRfzDnMY9A4RR7I6+SIvVquZJIxipgCgssuxM/sLuDYHOcFHq1fCispnRQV+TY68g== 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=O4H3qRhSMIhReRPEksEBhvnO9hdXWVS1DmGfkrLmSvB+toAljSKOUJmnYHkCn+x4UuAyKuhmbb2rNYzxIfH3WNWjurF6LgHw2rbGPjl1VA406F99J4a8WsZ3ntIMk4TBSBI7T4Zfw+FXtFYzpKLS3ISlBJbkuffVhXFmCIjEM4AkH0qKrAOJLzDHqf7d7xh6iWCCxCyKT2j2gZ2XKPBOH2PUgXnyFdrPpRX9wMDIqDb1Q014G70p2/g27O8BMLospdAea4mZaaRC3cwCtpIdGuHXAj+jTvG5Z3X3IO8BuqVewxZ/LL+2SPlili7uZdaj6pt2I+lZBjqf49oj78dvPw== 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=Kcnjxphyg3f32CiJD+sUDZsvNXpqlstSLoKgP7Vg4WNojaUOnjqV3Gqo6bupYWye5gByCgqLAz7eP/82DvF2KBWOeYaekXD1giM5lYUQRZtb/AdA4mr5xKHjGqoZK2iSKwOKVx3VHHb2xTyyntno2qD4GNiG+JMxpeHQFcTGgTI= 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 CY4PR1001MB2309.namprd10.prod.outlook.com (2603:10b6:910:3f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4219.24; Mon, 12 Jul 2021 12:26:45 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5%6]) with mapi id 15.20.4308.026; Mon, 12 Jul 2021 12:26:45 +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 v8 for-next 2/3] IB/core: Shifting initialization of device->cache_lock Date: Mon, 12 Jul 2021 17:56:24 +0530 Message-Id: <20210712122625.1147-3-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712122625.1147-1-anand.a.khoje@oracle.com> References: <20210712122625.1147-1-anand.a.khoje@oracle.com> X-ClientProxiedBy: TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) 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 (122.170.228.204) by TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 12:26:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9aebda85-b98a-4679-f4ba-08d94530502b X-MS-TrafficTypeDiagnostic: CY4PR1001MB2309: 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: 1vtfyKFfsI5DKDykDLARljsE421/hILQwsOFCQ+c4YU1g5ScIW+sKKMhfAc2SCYcDCDlgm4CARp2KZJnv2VpPr6oDifRBDwcJCdPmZ15AeW7nGyixLbisQnjvZoYkBvB7hM5lxHtg2KOJh+v3cwvR4Ju1Qmx8PMPz7Vk6ssEemUI7l0+htqJw/nl+xJl6PeoJ/UWbLvIIlgZxSgWchAcRGkbGqzCwQayEBHwjNaD/vIQ7nRXcHZsJcAu6YKyRh2qrcADLhn2CiNaktGonaqUfzl6/04f0/e+onZgR5F0QtFMyx1x8MyVY/HnUF4Me1XzVsFM47B6Nf3508XivGTlkCuz1/Q5g+zBwIA3M87VtoJioC5esTjXajZ1Hu7OmHSljITx7N0EWbrUSvdKXi0+uAZTFIiZ3YnKXbnfJCniey+BD/zX/dskS5aklypeSN72/oOiJrGv5cWZQWxfB931dhtAPJ5N2aIKHuXkqiOP7o8G8cb7YoG6O5/X1lB215thHT4pd6/ybSH9/CxavLeFkK3BpdGujeRwKGRR/MXlBPKG8pVQFq6O/nFH2MX6vJn0tdX0Sl5QP8u9VN/bsoHgpmuhZpVGJC4yTNVDCYtJm65oacotPfQ3jYoQcOCLmrur3Jd6jXbNN+ZLIQxefxdRQ1MOxVzAlvCmLWIdXvBMuAQlgeepadzvT8ExFQLji/4KRa4sMDCVztHhQ5xodAA64A== 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:(396003)(366004)(136003)(39860400002)(376002)(346002)(6666004)(2906002)(36756003)(2616005)(66946007)(66556008)(1076003)(66476007)(86362001)(38350700002)(4326008)(6486002)(83380400001)(316002)(956004)(55236004)(186003)(38100700002)(8676002)(103116003)(7696005)(52116002)(478600001)(8936002)(5660300002)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: J7GBPuiBzYwrqLjwyFbX2hEnSd6JrjDP7qD64yBXiVhyBgZt3Ar6Hgkcfo0sKZc1Vmew87b/Qu8ZsCMwFvZ8aphkulkrX/mnH8h3k1Eekk5VJxCAJKv1Yb8YAXU06ueg/dzqAB3WNoUH8qeMrsm+O0+P5z81hZ8d5O4smRI9IbIcX1JBiaa293SZy87tQRMoe1x83rWmk/YWaMKUEj+uSsud8hnCd8RhxoUYFhm6cYT+BaHSygoi8zBuS1w18K5mk5fb/XX7Gmtt1g+mw3ZqVXyPReZP+CYtx3LGocrVjUaJh+Q4NpH950N2gg23OQD1zjo0D7zkIQptT6lKrWDEldL8yKG1RmK6zvRW90BneUJCVzv09cGFbj4deD6nRjtUKq5keb+dfF9dViHOT3l6+cj+KIh/lSCmbCC7yOz960TykVw+QHNiSkWa7u3a238VB7/zbSSI7Few514dWcTEMLs8YXM0OJQuxRavIiIEUU0tDbYqYU2ou5lcmsYcNwQ+Pk41t7bIXUTYBsWkVXW0pJ/qIP+GBH4zT+6IiX8flqJ9vh+EtfJ/YsKvVEjD1swNkoXOMjYoH5QyXbJWlUeg3mo029OGwDX8JoH/9ZxjWxSZX+nTEb2XOdlORP1I6OLS9ZzO8kE/v8kkysbj2OOyUIHuatageV6xmcb4gLMXuiCbBLHWUZhoCcciCiNlxyWG7QrsAREewqxPN/MjrUf2N6yw8aBZlTnfdqunV1BJNyLHhbar25S+xPYjvpnc2PdWfzqvUOMqa/m2pPW9Z7oRs62WbhK6HPjrSPhIeadT6flZZ5bsO/QFokNRJsZ4LWCDCJ/37LbmW+jiQvv94Yw48CP8z+6PeRT8ckEfZbAFna6jy0uj1Qk3C7i77YOw1kVkKhKTNwFsy+Tz95ZLWOmRiNV6NfJpBVQStMYamDt+m8tPYnYiUqmuOzxuGQ359nm/NwlWI6S/NyoZnkuF9BCSskKeR79ge9i5h+N34yKBb9hn/wtLPjoEmIjXB/H/Z3GGno6tr9JXyHwL3etjakk2fMJJ/mlHlncBNfQjYbyyQnEgEmvO9BBvxsD6lKK0SqtvU0KnCfe1fxkkH07XhNH5RMUkpNv5K8b/J88rkU7LSTQXuqc3V6kesFVBz8Mbv7afh2PNVLvnvpPHScT/8338puCD4PCmbpMjmF1nMoJZnELjizCj4xX8OqkPtKImkKWv4erOCVvJjgrxs8mm+gAd1KoURS2jbCWaXsF6HUIdBbbFORheJEmN7E3//IVJxGyUBtw9W+0yuDsOhajuZbHaYz+ge/GQ5ZDe55a6BxX4iSEmQPDdAEZj8XavMrNHDjqp X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9aebda85-b98a-4679-f4ba-08d94530502b X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2021 12:26:45.7709 (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: MMgZVb2uPkqgvIcDRACg5CUGIrFxvt5A9MZ/XLVSm/hw3vBxFyDOwR/gKt1jDu8hKLJYnBbUL//sz+biZe/r61srAUCdqfwdmkhGh5L/B98= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2309 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10042 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107120097 X-Proofpoint-GUID: f9_f27Ticqkoiony8KGMuZWGIH7MHp9W X-Proofpoint-ORIG-GUID: f9_f27Ticqkoiony8KGMuZWGIH7MHp9W 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 Mon Jul 12 12:26:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anand Khoje X-Patchwork-Id: 12370923 X-Patchwork-Delegate: jgg@ziepe.ca 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 8D208C07E9C for ; Mon, 12 Jul 2021 12:26:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 76ACA60FF3 for ; Mon, 12 Jul 2021 12:26:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233400AbhGLM3n (ORCPT ); Mon, 12 Jul 2021 08:29:43 -0400 Received: from mx0a-00069f02.pphosted.com ([205.220.165.32]:47646 "EHLO mx0a-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233028AbhGLM3m (ORCPT ); Mon, 12 Jul 2021 08:29:42 -0400 Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 16CCNGJR027762; Mon, 12 Jul 2021 12:26:52 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=gl3nhTqZMWL/BIYKZocfIWXwQi5JAE9AAyS0rW/xrT+IsT1xlBKCGQqJYKrBQaMoF+SK P8DZN2vPErvCPqhTt71etuPYSMvCYQKqt3MudlnVe6adKARbKD1qTyXm8Vs09D95C9lF 7efTPZpx3aKfZ+W37kdPqg8+Ac2DIK79L5xMM2VB5EV+ADU6+5NijSt8pmNPaBjLlAsJ taUbD3kpv72GZ37o4pNx32dVou5ocE9eQOucIa9XnNLwU8B0cXHqTZHd6P52LN31+J+i FfXnEjnw/KNvSfCGi6NBi2XrmW9UjpKPMRgoi/WOsCt5+Qz5zBLzdzCH0CrI0cgNWe2m Og== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 39r9hch0y7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:51 +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 16CCKpGn028598; Mon, 12 Jul 2021 12:26:50 GMT Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2173.outbound.protection.outlook.com [104.47.58.173]) by userp3020.oracle.com with ESMTP id 39qnatuwy1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 12 Jul 2021 12:26:50 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ST2MhC0EzHWhfUwpSZOcX08vWlHqACl6Vcl1d+NxotRQg/YVpsFs5/GMRnGlioWjk0x1gICGTKobXLSOoUSYA3pL2pHFzzjQpwBzVYtJAjx9LxqWuqoeRRDFbF8inb+Ziab3xOXXt0MQxVxabxBchN0gvi/fbFgRsYrAAj29etyJ+dLvkyO/oE0qoCerzoDGVRf6gyyaaYdLi1yp/kUl9CEDAEvOLt1HWAc5eXBPt+abpE+uZcjQD2PFIHvjcuFdQa2knHqvwmYm9ApbFYXX5T+TlpKj8n2Xo8em1bGDHy4yX4xVnmK5RvfV1omYIozXkxiM371BSPAuQ6A0Y6UKgw== 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=Du5pA7ZHVGXfE/Nvqt6JXfroRcLASJRN3kvOLyM8XF/wTYj6ZPdYGecrgYwWKK3sUcEScydWeTNYz3dBn8hv1AcfzeUkOvGvKz5PaKepM9uy5XhcWNxOAhBag+BJDTF6PIytV/a4MHCamDABD2wvUuNS19uybJlbaTyJ2baVC+Ye4bf8At4ETYxYwUkcmlcYx9FJz6SW9SHbDmazqVRYqs8pAkSEqATp4FY4R8qoRfdvU2tYg8SkzNFEd1Htp66+SM7r6PYxLFqEXXYBZlB9Q7wl94P0h4nl181JxUBKw2yaw2t3a6z8FdlWyVPkInwJQ7B3nOd+vUEVcF/DXUM3rg== 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=RqWCEtpaGE3UWZMRi73yEdLmoATV+3zZ/C65SWWRDNqUnHLye4AJGwUnFTBr7sb+6g9jYL0gYI+uLzTP115XLukQ7FSWE04AVVROYB4TGGU1lUvjhVDl6yEQ7q74f7CpEva16Hwt2RDcyMAPIg0H0f6lJ3uT4qWA0lIEZqYMp4Q= 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 CY4PR1001MB2262.namprd10.prod.outlook.com (2603:10b6:910:42::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.22; Mon, 12 Jul 2021 12:26:48 +0000 Received: from CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5]) by CY4PR1001MB2086.namprd10.prod.outlook.com ([fe80::9dcb:26d6:7408:b4d5%6]) with mapi id 15.20.4308.026; Mon, 12 Jul 2021 12:26:48 +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 v8 for-next 3/3] IB/core: Read subnet_prefix in ib_query_port via cache. Date: Mon, 12 Jul 2021 17:56:25 +0530 Message-Id: <20210712122625.1147-4-anand.a.khoje@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210712122625.1147-1-anand.a.khoje@oracle.com> References: <20210712122625.1147-1-anand.a.khoje@oracle.com> X-ClientProxiedBy: TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) 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 (122.170.228.204) by TYAP286CA0005.JPNP286.PROD.OUTLOOK.COM (2603:1096:404:8015::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.20 via Frontend Transport; Mon, 12 Jul 2021 12:26:46 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ac9b8072-f781-435b-f5cb-08d9453051c4 X-MS-TrafficTypeDiagnostic: CY4PR1001MB2262: 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: O0fFlVNL3EkLSZTU4gJnonv1WLMzZwZjqiTAxdWSSPoGXEoW8c1hk1TTBUy5siRyGQE3GcFHsSO25WI/p7UIHlFP16//SdfgLTRCq+JLrOA1ocDs8bPAZRp/r/09lD9KoiNuGVwQYMfur1/AZ6yyqJWUgLudPB3WikXEhMMZGk4131sHrnMUA8ZG/wpxDWsG3vegYfBVHYPmdYPCHL+7LRfTcvlVcTwIhpiUTJYeWWye2feXmgZNvdqExWLRPNwTxJhPVKr3/NAy2uFJrVJXBKRiH8z9VGH/6dQYp9iZK4xZBb0a57T7z4u75UwaTZyK4x3s6VBy5usBhkVkx93IbE3tsp0X8O7dpWmZB5KxeZMCYK2ClngHiEOFvAVR+JdPDOWzRGfRfbuv96Xodqvg60GMRnsq1R6AoVl2RREiMv/F4LzX0i795Cminz6KTaelua1eQ/InoIoOPUNlpPcEDzfMycA7Oqy1hYRq7CaMxxFQDXfG/9ETYoz+WFfnGtuDCmcpe4xAPt9tphHUwacW5DGehr2u/bPB7casCV44E1fZ/u69xw2Fy93dwmBfqGLYYnp+VSFM2CBj23a4MqSoROygyIBKuOAUgYFsqriGJGBOzjharLXX1mRt3mtPOMiWqKgzgVxTXm34ke0pkSBKqX2+wCs/XfTMwzoHQ1ND4+D4l0rHDOqYhErgsj5g4gkDvsxeZCLrTwjZxj+8pY/ORA== 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:(366004)(39860400002)(396003)(346002)(136003)(376002)(38100700002)(38350700002)(5660300002)(83380400001)(66556008)(36756003)(6666004)(186003)(26005)(55236004)(52116002)(66476007)(478600001)(103116003)(1076003)(4326008)(956004)(2616005)(66946007)(8936002)(316002)(86362001)(8676002)(2906002)(7696005)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xhNeym7Aie8zZ2PBEukDQU1/edS0BBg/Dbcf5KYVJB9K6jsG6bubvySt/A2Zl9Te/6/2Gx8zjkVheCtI4H25PA+t3wdEjPsApHHQFNXI9Z6CYVeh2dCYhscRxSuBn+qn15rMWTofsxhUhsw0/ZmvmnH0Oy4jy9nWzFssYV/H8YteD/leqdiQ6iqiN6jsmkhiNrNipRuhJO3h9pci5de4Myn50RczPOVHMqKtAn+lkFQaVxTezcherx+0Lz4Hwv0A0SnL8SGzgjebwCxrjnp1OKZGCntgmVyrHtYxeHHQrbRdvnYgXEZXp5Sc3GGSG9Ed6vrPPxIlXoQ5vhIvRJYvltJBnNSgA5JDAnfyt3XiLQb9JKI7teklQpWBPbtTJZMtJzkiWuPk6FricQ4KW54y5z3u22F5t91/mROUdsaFiShUKnywOObRwEJcY+O89mfeZYuFh0PjfZqazZIwYIx8l28os0IBpfTAwFEBesevj9YZmF1yD/O8fpLN33tJmla1TzG6EnTd5KFejIAmlko2gpv0uXaP01c+lBSW6IX/Lke+p1PN4eOb5qOkUaqW8Y9b0j+tDuZbtUzg2bjvFjpLlx3NJL8ZeFTe5MenTVhY82hT0mr5HUJ9yr0XdaB7SDFnnHIn4Vtxovod90speO+gxg0kwtCeUi3eoGgwib/uap//VYTCEkzAwZ9NemqWx3uGtUmtNd27D4CO42y/GStLlko0UjwEbhRJuSQmejj9bxXwoI4w1Lz+XFlMwWrhyIbiuBjHRq/NYRIJMXLlf0v75J+BMWa8vrNvnUrE9ChIyCu/B1d5d05CwuX9kJA/g519Y7hTl1XdwzA02sjgiSmjjhpUDZPrDAbdeudu3VWtV7hYyhrBcBXXuHKcw5edYJkZFixI8G8sBNpFxEzB1mX5S2d66JhpxoD3xWGPvGoTsHwtgfCgf55jBOHjbgrARHuvjQ6XRZXKpEDm1aqLKRHu0dnQfpVfpaooASzd7BulWhhN8HCVphvLPUDQCwoCpbJEUEdLs2dKp3PfZ+r+741dR5SOica8ufBCLZ0BUVswrX1NnhXcVLrEyXaUlBEZ62lJZ7VaajogM29v72cFj7zYH0oXx4H7+iLWs/+oAWZKycnM+uPIQMIcFHLyqyULQG2+JlY/QKnSua4SBL+j7kMPSspz31bdK5m403hxbHJEZ1GeNflyhwMuyscI1s1nh0rRhBZ0hgMvGKq9iIzkvzr1qoLYd5CJtMYIx6+a+Xz16Z4f4CB3ZI5b9U7dOjw4ueT/qT7HTkodah6qySwbX0X7zIS6Xl/QkS05NQmkLpHuqTcuoZpVfNNyP/GW1TnJOji3 X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac9b8072-f781-435b-f5cb-08d9453051c4 X-MS-Exchange-CrossTenant-AuthSource: CY4PR1001MB2086.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jul 2021 12:26:48.6142 (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: AIJ4gfSzWXnOsZvQmDA2ycBDE9vVc9axYn5EAUqYKZDpBw/1PYUwwejmKEy+dZ2L9mqaROowzxbyybjpZiuOfLXY0J1BQDkwrNv8+6kvHiw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1001MB2262 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=10042 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2107120097 X-Proofpoint-ORIG-GUID: hEbnMwGRPH8gCnpSl3rTDWywQPOEzzlH X-Proofpoint-GUID: hEbnMwGRPH8gCnpSl3rTDWywQPOEzzlH 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; }