From patchwork Fri Oct 21 13:45:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiao Yang X-Patchwork-Id: 13014859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4096CC433FE for ; Fri, 21 Oct 2022 13:45:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230430AbiJUNpg (ORCPT ); Fri, 21 Oct 2022 09:45:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230514AbiJUNpd (ORCPT ); Fri, 21 Oct 2022 09:45:33 -0400 Received: from esa5.fujitsucc.c3s2.iphmx.com (esa5.fujitsucc.c3s2.iphmx.com [68.232.159.76]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFD4B14C53E for ; Fri, 21 Oct 2022 06:45:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=fujitsu.com; i=@fujitsu.com; q=dns/txt; s=fj1; t=1666359924; x=1697895924; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=yWWne4g6PHif5zZ6F03BhPx0zTULEGk1qy3d2EKENdA=; b=uKGNPGjbl9qisJDt9zgHiN+SvGPGJo0JCgQAnuwiwyKBoAKWcdaYhZqm b7q4OaRvXnz/UGLAo8Peo1xHnPl1OgOy0wtB/RhrM8hY9AKf5ydNZShVd YTN+soFsqRoAkxWaFjamVRM2p5ZI9E/JxI1F/+dkPqhen+/hqsCx1bVjn yFXO+0n/ReX4eQGBCHgb1tYoKIJorEso0uU7F5ZaF5sjKpRNrOsMTv7MH HMXZzZbFkhGBM0fueFZHWbZXbcj9t3N5ZqMjzUumiMdfgunJ8X4kxL7WA ea9aLbi4TkdKV0r8/fYPCSdX3OLL1uL/C3m/tJoL1D4xKs3kdxOMXGtun g==; X-IronPort-AV: E=McAfee;i="6500,9779,10507"; a="68299332" X-IronPort-AV: E=Sophos;i="5.95,200,1661785200"; d="scan'208";a="68299332" Received: from mail-tycjpn01lp2170.outbound.protection.outlook.com (HELO JPN01-TYC-obe.outbound.protection.outlook.com) ([104.47.23.170]) by ob1.fujitsucc.c3s2.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Oct 2022 22:45:20 +0900 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z2wb/Jaw4SQ+CONGmNTI1MHpS/uyTEL+DdKgORJ9peUmkJ1TJ7JHTmhXUjx3SfDY2BiAQNhzXhikmHZ7O7Xiz5SPGgmaychy6SxJRnz41BPxh066zLXudxGzdgA2o3or4DvQfRgyJGRJ94Fgjp6PiRkAqC+Y91yp7Xr17+spp7P3vqiriNY6lCYX79gTO3l8LEo1rwSuR/V/SKqZ/jdqN8IHu4tjfl1qzPzMLqprYZUmnoPgpmjvsNe6Hh/NJBUwEnGp741EJ8UZ0o7wH6bal5x6IyqjQ39tJbgG04ng0gpyOCkc+9yE33zP6YDpOESBySrTBxX/W3moNaxpy23GEw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yWWne4g6PHif5zZ6F03BhPx0zTULEGk1qy3d2EKENdA=; b=e1Mi5pjFvFE3za9H0az4zKjgnWcOLsBI8GaURMhkJPCuykUtE+caAU4z1EGi9o6sWESqNwO51mi8HC5A7KFD6kIUfjHkahP/zb7ICnBa5YuyL14kYEV7NUitWfE7fE3xNp36a2PIqx03MDk9kaXcoscn+WHrGCLfy5TrvmUixqgRakZCQOthfFJUnDdnsdofQrzlgr3S0L/VvF9UVS0/Qzmmm8DV5p6BCA3BluZWqfBpI/xmTGsuRd5L5rgJMvlEqv4VLytuEkW9CHBxfeTzPgiCFEBRxOrwrtF1IXuh1kFpAgO0iQn3JIP2MJICSsjSL4Hfrx2jMeN/O9LvW3+INA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=fujitsu.com; dmarc=pass action=none header.from=fujitsu.com; dkim=pass header.d=fujitsu.com; arc=none Received: from OS3PR01MB9499.jpnprd01.prod.outlook.com (2603:1096:604:1c8::5) by OSZPR01MB9376.jpnprd01.prod.outlook.com (2603:1096:604:1d0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5723.33; Fri, 21 Oct 2022 13:45:18 +0000 Received: from OS3PR01MB9499.jpnprd01.prod.outlook.com ([fe80::339e:88a3:a24c:5f68]) by OS3PR01MB9499.jpnprd01.prod.outlook.com ([fe80::339e:88a3:a24c:5f68%7]) with mapi id 15.20.5723.034; Fri, 21 Oct 2022 13:45:18 +0000 From: "yangx.jy@fujitsu.com" To: "linux-rdma@vger.kernel.org" CC: "leon@kernel.org" , "jgg@ziepe.ca" , "yangx.jy@fujitsu.com" Subject: [PATCH] RDMA/rxe: Remove the member 'type' of struct rxe_mr Thread-Topic: [PATCH] RDMA/rxe: Remove the member 'type' of struct rxe_mr Thread-Index: AQHY5VNb0lyLutnGB0iW4dRclsGMfw== Date: Fri, 21 Oct 2022 13:45:17 +0000 Message-ID: <20221021134513.17730-1-yangx.jy@fujitsu.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-mailer: git-send-email 2.34.1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=fujitsu.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: OS3PR01MB9499:EE_|OSZPR01MB9376:EE_ x-ms-office365-filtering-correlation-id: 6081cc13-b603-4ec7-05bf-08dab36a7d90 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DgGfyQB0ZmWO05zX8ZYKZ3qnv2JaBxvXNlceJ97DtqhQ88WK4AkXdEwjE/FtpYexXwvZnjFzNn1jrseJi1NnzuPx743fMiT9LYB8x2xq4lZglvcl6gVVEvK8HjaB4ofwJlIQmkul4v1a8R4PbN0kNomXFworIqCRmRG4ZtaZvghWG5oZ8kxZ/ne9TTW8/eNGlplXTtaV0ySNrA+9P1b1N+t5p2MmXcLfkg9CaI1plSaSBIqZLIY5PhETEdeF6q53ETQZU4gP1PqrnUMrSzQ54P20E5/nKe2CF/S90cZGhmaOYFeHV7uo4FH+2APMlguqO1L7hXuWOzfYEval+nt8ID7O6XfEmpU9pqQIVdxlljq2lys0f63aklpz8+/scfGdV5XZa800Lwsud2rSRjUF6gvJJU+vFh9Jrh7gjXJhswHe7gpC7aNdE414U1LwvLY273ppkkhwrVYUNLbJs6FYVy6P4gZQAqDaNbiHMnbvKeZ04tsMI75cjsDt1PENnd8XkPepp8k1TyG6uL/n3J9+f5X6mSOiecsr3g6fSFuU/cNnl1JpgVl8zAAde6qBTOa63N8WrV4ZVVp4MaXOpmrkDYO9ORzzjcKW1FqhCPybmieoCCgBGFZ3v2VH1UcdB45Fnz8v5JDtn9doiwFuqQeLkIRXGelXy4ANB0kNSjJ5hC6EF53lU4yMJDSikrqtXnnY8CwkSbZWBcBqHCXsyDFms+m5Ylkbkd6c69PGPIUWcYDIJsbPwfeFkVM4YX0xB/eIgTOiude8Etoakk8/tcHlS2KjkS2nRSDShawm17Ibu5I= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS3PR01MB9499.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(346002)(366004)(396003)(39860400002)(376002)(451199015)(1590799012)(85182001)(83380400001)(8676002)(91956017)(4326008)(64756008)(36756003)(66946007)(66556008)(66476007)(76116006)(41300700001)(38100700002)(122000001)(66446008)(478600001)(6506007)(6512007)(26005)(71200400001)(316002)(107886003)(6486002)(54906003)(6916009)(1076003)(86362001)(2616005)(186003)(1580799009)(82960400001)(8936002)(5660300002)(38070700005)(2906002);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?eucgb2312_cn?b?NU9FbzFENFRaRVBwbjlTTVNH?= =?eucgb2312_cn?b?VkRCNjZrN3EyMmhCd203OXNpZU5MWm5mMjFOcmhuZDNjU0NyQlkzRzlXRFl5SExB?= =?eucgb2312_cn?b?bXBLK0lGamh2eTllTm1CTXJvMk90cERYeWFrRnpCelozUHExNWtOQVlLQWM4WDU5?= =?eucgb2312_cn?b?ZlBuTWdBMVFWZis3ejhVZ0xUSkp1eUpBQjJBWVlwcnpVOTdTRlI0eU5RcHhNYkdq?= =?eucgb2312_cn?b?OHpGWjMrc0srRDR5ck0ycURqUEpBTFhIS053MzV3NVF5U2Uvc3ppc3dZM3F2Wjg2?= =?eucgb2312_cn?b?N3c2ZXFCVTVRMWJpcU5oTGxMVTlwS0NsYytoNmcxRTlHbVpXd3JjcjFvZjRZS0I0?= =?eucgb2312_cn?b?VGlSVDBENXQrNVVBcmw1NFRJQ1ZqTDk3Tnc0K2dHQTlyYkNSRHNyaWc0bC9mMnJT?= =?eucgb2312_cn?b?aDZERGxDbFUzUXlrRlJyK015aDFVUCtzTCtuM0Z3QVU4TUJtYkc1a1ZSaGFOZFRN?= =?eucgb2312_cn?b?ZjQySkVWbzVJcXFJOFhGOTV2ZUdpa2M1YUFQMUwrU0VBOUxGODN4QlhneGlvcmYy?= =?eucgb2312_cn?b?NHc3Sk1qa3RTdVc3cERGanYzSjBxNUhSYk5NSlBtejRuMWVnYzhUVUdua015OTdk?= =?eucg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?eucgb2312_cn?b?U2h0U3IyMzRZZ2t0ZTNKTmlHRzJDMzA5V0ZqWXBlUDN5YTRQU1FtYmFrT2pEcXpk?= =?eucgb2312_cn?b?TXhlcHdmVmt4QWNMTStseVg2dS9nZW1ObUgxZ1dSOURxZUxUUzhOc1dkcjlKdjR3?= =?eucgb2312_cn?b?cWVaU0tQb0JXUTZIT1p6bWh4cjB3ZzloRm1mYkw3UHc5c0lCcnIwWnlJcStOdDJQ?= =?eucgb2312_cn?b?WXZjR1NmbjNMQWdDZnM0TWFyd0xzV3E1N2xBeG12aUZ4VC94emZRYndFenhuMkt0?= =?eucgb2312_cn?b?WFBPV2FRTVFEbXRjekN1RTlrKzFmd2VoUWRjSXpqVWdVNnVUdC9PaVpsak5FUnFJ?= =?eucgb2312_cn?b?dFFOVDZwU3cyVDhSVU9kcVVkcjhMZXJwNXZVbkd3Z0gxK25KVW9KcDBQSy9HcU53?= =?eucgb2312_cn?b?cXVDM2F1ZU1tei9EZFI3VFJWZ283QTFicmhvUUkvK2E1NkgzR01YR3dib3oxdVRW?= =?eucgb2312_cn?b?aVdUUFVWendqNjc4cVI1UmNZekhyc2JoNzFqZnFhV253bkt5cTI2aEw5YnpiVUV0?= =?eucgb2312_cn?b?S3VvVEJrM0JFbXNieDZVRHdTUG50SDF4WkFUNm1BMVZoREpYSk9uNDBPazNYaU1X?= =?eucgb2312_cn?b?VEdqL2U5WE5QemVZZ2ZSYm5QLzk0YVJEMlJWWk1QREQxTFhwbStROTgvVlVEZ2Nj?= =?eucgb2312_cn?b?cm1jYmtRYXRlMXgwWE5MRlFmNWozUGhDNlRGUC9IakNHbGpxU0k0bUpPRUVzRFNM?= =?eucgb2312_cn?b?VE4yeTNFUGs5L01acHpSaEpteUE9PQ==?= MIME-Version: 1.0 X-OriginatorOrg: fujitsu.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: OS3PR01MB9499.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6081cc13-b603-4ec7-05bf-08dab36a7d90 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Oct 2022 13:45:18.0373 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a19f121d-81e1-4858-a9d8-736e267fd4c7 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +C2qiVTAk9VksJlWOrSlnxISiPanykz0Q6IK8EjE/hunb+dxppjQ5yHzbr9R2jFQ77e3JBN7Flz6H6nBBbfDpg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: OSZPR01MB9376 Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org The member 'type' is included in both struct rxe_mr and struct ib_mr so remove the duplicate one of struct rxe_mr. Signed-off-by: Xiao Yang Reviewed-by: Bob Pearson --- drivers/infiniband/sw/rxe/rxe_mr.c | 16 ++++++++-------- drivers/infiniband/sw/rxe/rxe_verbs.h | 1 - 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c b/drivers/infiniband/sw/rxe/rxe_mr.c index 502e9ada99b3..d4f10c2d1aa7 100644 --- a/drivers/infiniband/sw/rxe/rxe_mr.c +++ b/drivers/infiniband/sw/rxe/rxe_mr.c @@ -26,7 +26,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length) { - switch (mr->type) { + switch (mr->ibmr.type) { case IB_MR_TYPE_DMA: return 0; @@ -39,7 +39,7 @@ int mr_check_range(struct rxe_mr *mr, u64 iova, size_t length) default: pr_warn("%s: mr type (%d) not supported\n", - __func__, mr->type); + __func__, mr->ibmr.type); return -EFAULT; } } @@ -109,7 +109,7 @@ void rxe_mr_init_dma(int access, struct rxe_mr *mr) mr->access = access; mr->state = RXE_MR_STATE_VALID; - mr->type = IB_MR_TYPE_DMA; + mr->ibmr.type = IB_MR_TYPE_DMA; } int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova, @@ -178,7 +178,7 @@ int rxe_mr_init_user(struct rxe_dev *rxe, u64 start, u64 length, u64 iova, mr->access = access; mr->offset = ib_umem_offset(umem); mr->state = RXE_MR_STATE_VALID; - mr->type = IB_MR_TYPE_USER; + mr->ibmr.type = IB_MR_TYPE_USER; return 0; @@ -205,7 +205,7 @@ int rxe_mr_init_fast(int max_pages, struct rxe_mr *mr) mr->max_buf = max_pages; mr->state = RXE_MR_STATE_FREE; - mr->type = IB_MR_TYPE_MEM_REG; + mr->ibmr.type = IB_MR_TYPE_MEM_REG; return 0; @@ -304,7 +304,7 @@ int rxe_mr_copy(struct rxe_mr *mr, u64 iova, void *addr, int length, if (length == 0) return 0; - if (mr->type == IB_MR_TYPE_DMA) { + if (mr->ibmr.type == IB_MR_TYPE_DMA) { u8 *src, *dest; src = (dir == RXE_TO_MR_OBJ) ? addr : ((void *)(uintptr_t)iova); @@ -547,8 +547,8 @@ int rxe_invalidate_mr(struct rxe_qp *qp, u32 key) goto err_drop_ref; } - if (unlikely(mr->type != IB_MR_TYPE_MEM_REG)) { - pr_warn("%s: mr->type (%d) is wrong type\n", __func__, mr->type); + if (unlikely(mr->ibmr.type != IB_MR_TYPE_MEM_REG)) { + pr_warn("%s: mr type (%d) is wrong\n", __func__, mr->ibmr.type); ret = -EINVAL; goto err_drop_ref; } diff --git a/drivers/infiniband/sw/rxe/rxe_verbs.h b/drivers/infiniband/sw/rxe/rxe_verbs.h index 5f5cbfcb3569..22a299b0a9f0 100644 --- a/drivers/infiniband/sw/rxe/rxe_verbs.h +++ b/drivers/infiniband/sw/rxe/rxe_verbs.h @@ -304,7 +304,6 @@ struct rxe_mr { u32 lkey; u32 rkey; enum rxe_mr_state state; - enum ib_mr_type type; u32 offset; int access;