From patchwork Mon Jan 7 23:23:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 10751283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9829F1399 for ; Mon, 7 Jan 2019 23:23:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7FEBC28AB8 for ; Mon, 7 Jan 2019 23:23:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 73FFF28AD5; Mon, 7 Jan 2019 23:23:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F00F328AB8 for ; Mon, 7 Jan 2019 23:23:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727084AbfAGXXS (ORCPT ); Mon, 7 Jan 2019 18:23:18 -0500 Received: from mail-eopbgr770043.outbound.protection.outlook.com ([40.107.77.43]:38337 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726689AbfAGXXR (ORCPT ); Mon, 7 Jan 2019 18:23:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gOxyamyhSQ1EoTYfdRgLJwSYWzssXN+ZrMqIoSHU2R4=; b=PzxnzEVo3GmQrmYXv2Re0Xx0Jf9DOlTztHb6mmfwO2QIbsS2u6fLa6G8C3kuKcaIuKApJFkx8ABKm5Pc9eVFfiBAomtNJPEYuHZikGrRvkV1wdiNduBhCTro60ir7OlH3vPiWqP/5VY55V3ZVcM9ScLEGVOX4ubSILgP61bhd/4= Received: from MWHPR05MB3648.namprd05.prod.outlook.com (10.174.251.22) by MWHPR05MB3360.namprd05.prod.outlook.com (10.174.175.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1516.6; Mon, 7 Jan 2019 23:23:05 +0000 Received: from MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::2077:8b33:a166:25be]) by MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::2077:8b33:a166:25be%2]) with mapi id 15.20.1516.010; Mon, 7 Jan 2019 23:23:05 +0000 From: Adit Ranadive To: "jgg@mellanox.com" , "dledford@redhat.com" CC: Adit Ranadive , "linux-rdma@vger.kernel.org" , Pv-drivers , "stable@vger.kernel.org" Subject: [PATCH v1 for-rc] RDMA/vmw_pvrdma: Return the correct opcode when creating WR Thread-Topic: [PATCH v1 for-rc] RDMA/vmw_pvrdma: Return the correct opcode when creating WR Thread-Index: AQHUpt/xUtLtTnPzR0q4VG8iPXfWcw== Date: Mon, 7 Jan 2019 23:23:05 +0000 Message-ID: <1546903346-15461-1-git-send-email-aditr@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR07CA0039.namprd07.prod.outlook.com (2603:10b6:a03:60::16) To MWHPR05MB3648.namprd05.prod.outlook.com (2603:10b6:301:46::22) x-mailer: git-send-email 1.8.3.1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [66.170.99.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;MWHPR05MB3360;20:K/Vb/bQsEQ2l8DKLxkDz40SGTMeiO1WlXzeWHsJdGKiJW/DAN3Wk3J8rzafyLbp105rzLM33jR94wDI5nZtj6GEXIsMPHSgcDRT9PQiRWDaF5C4WdkfbBBsUFhN7jXIlxcFLhCLsfishkkhV8QlOMKtVP3g/uTAEJuTN0kE8/yY= x-ms-office365-filtering-correlation-id: ac6af2bf-be4b-4d0d-1ea4-08d674f71355 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(5600109)(711020)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020);SRVR:MWHPR05MB3360; x-ms-traffictypediagnostic: MWHPR05MB3360: x-ld-processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr x-microsoft-antispam-prvs: x-forefront-prvs: 0910AAF391 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(376002)(39860400002)(346002)(136003)(366004)(396003)(189003)(199004)(478600001)(6436002)(86362001)(6486002)(105586002)(305945005)(106356001)(7736002)(2501003)(71190400001)(71200400001)(110136005)(54906003)(14454004)(316002)(81156014)(8676002)(50226002)(8936002)(97736004)(81166006)(66066001)(36756003)(4326008)(53936002)(99286004)(6512007)(4720700003)(102836004)(2906002)(486006)(5660300001)(476003)(26005)(186003)(25786009)(3846002)(6116002)(386003)(68736007)(6506007)(52116002)(2616005)(256004);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR05MB3360;H:MWHPR05MB3648.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: 7IihdV3P0TsHv0RbXHHHstkmtld/+4lRdhJ/bcWUTh290lWh/mTupJ+6rrD/uUap3h783isAq1sZW7Mk2Rmi4wzxPucYrtBZyHbmXMmsi/v76S9laBcx9cRi/YeLD00nhpUf2zg+uJWZTKQux1gyr9hwQwjd9YcTiICDcBTbxVwVfOho1LHPT/sUABfsel9JZi2LPoGVutVoxSLi7PYp5Ji1X0oJjxDMeB1hJoPNSPXO3RIBL1Y+4JZqeWHMme6+1dmapNLr0aLDfF01yzh1R5dXAIUHAV2GeTLZmQ/7eTO/GF6bo5ILvssNpYxnOV0o spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac6af2bf-be4b-4d0d-1ea4-08d674f71355 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Jan 2019 23:23:05.3696 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB3360 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Adit Ranadive Since the IB_WR_REG_MR opcode value changed, let's set the PVRDMA device opcodes explicitly. Reported-by: Ruishuang Wang Fixes: 9a59739bd01f ("IB/rxe: Revise the ib_wr_opcode enum") Cc: stable@vger.kernel.org Reviewed-by: Bryan Tan Reviewed-by: Ruishuang Wang Reviewed-by: Vishnu Dasa Signed-off-by: Adit Ranadive --- drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 43 +++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h index 42b8685c997e..a85d7ba96d55 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h @@ -427,6 +427,49 @@ static inline enum ib_qp_state pvrdma_qp_state_to_ib(enum pvrdma_qp_state state) static inline enum pvrdma_wr_opcode ib_wr_opcode_to_pvrdma(enum ib_wr_opcode op) { + switch (op) { + case IB_WR_RDMA_WRITE: + return PVRDMA_WR_RDMA_WRITE; + case IB_WR_RDMA_WRITE_WITH_IMM: + return PVRDMA_WR_RDMA_WRITE_WITH_IMM; + case IB_WR_SEND: + return PVRDMA_WR_SEND; + case IB_WR_SEND_WITH_IMM: + return PVRDMA_WR_SEND_WITH_IMM; + case IB_WR_RDMA_READ: + return PVRDMA_WR_RDMA_READ; + case IB_WR_ATOMIC_CMP_AND_SWP: + return PVRDMA_WR_ATOMIC_CMP_AND_SWP; + case IB_WR_ATOMIC_FETCH_AND_ADD: + return PVRDMA_WR_ATOMIC_FETCH_AND_ADD; + case IB_WR_LSO: + return PVRDMA_WR_LSO; + case IB_WR_SEND_WITH_INV: + return PVRDMA_WR_SEND_WITH_INV; + case IB_WR_RDMA_READ_WITH_INV: + return PVRDMA_WR_RDMA_READ_WITH_INV; + case IB_WR_LOCAL_INV: + return PVRDMA_WR_LOCAL_INV; + case IB_WR_REG_MR: + return PVRDMA_WR_FAST_REG_MR; + case IB_WR_MASKED_ATOMIC_CMP_AND_SWP: + return PVRDMA_WR_MASKED_ATOMIC_CMP_AND_SWP; + case IB_WR_MASKED_ATOMIC_FETCH_AND_ADD: + return PVRDMA_WR_MASKED_ATOMIC_FETCH_AND_ADD; + case IB_WR_REG_SIG_MR: + return PVRDMA_WR_REG_SIG_MR; + case IB_WR_RESERVED1: + case IB_WR_RESERVED2: + case IB_WR_RESERVED3: + case IB_WR_RESERVED4: + case IB_WR_RESERVED5: + case IB_WR_RESERVED6: + case IB_WR_RESERVED7: + case IB_WR_RESERVED8: + case IB_WR_RESERVED9: + case IB_WR_RESERVED10: + return (enum pvrdma_wr_opcode)op; + } return (enum pvrdma_wr_opcode)op; }