From patchwork Tue Jul 4 10:35:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Amrani, Ram" X-Patchwork-Id: 9824511 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C0981602F0 for ; Tue, 4 Jul 2017 10:36:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF68A280FC for ; Tue, 4 Jul 2017 10:36:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A385B28464; Tue, 4 Jul 2017 10:36:15 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 6778D280FC for ; Tue, 4 Jul 2017 10:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752189AbdGDKgN (ORCPT ); Tue, 4 Jul 2017 06:36:13 -0400 Received: from mail-by2nam01on0088.outbound.protection.outlook.com ([104.47.34.88]:24428 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752183AbdGDKgM (ORCPT ); Tue, 4 Jul 2017 06:36:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=l3P6FIZCdTl8W/rX4tmUfE4hN2zJ2zOcNaz4JCkBZ2w=; b=HmBN/mkgSFN2fe3MHPS4rQip0Tl1AzRnh7VBdRD5WVFd6/o+A/gmJ6h0LbRP5lGengIZBVk76Np2AUYQRGBbQuxlePj50ovQd57YqGHbMauqybN71F4IRZlBe5Ly832VQFVvwC55fDpTJU7Hg04/mUmfQcj7Aum+hle+P0erHj8= Received: from CO2PR07CA0067.namprd07.prod.outlook.com (10.174.192.35) by CY1PR0701MB1113.namprd07.prod.outlook.com (10.160.145.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11; Tue, 4 Jul 2017 10:36:09 +0000 Received: from BY2FFO11FD024.protection.gbl (2a01:111:f400:7c0c::120) by CO2PR07CA0067.outlook.office365.com (2603:10b6:100::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1220.11 via Frontend Transport; Tue, 4 Jul 2017 10:36:09 +0000 Authentication-Results: spf=none (sender IP is 50.232.66.26) smtp.mailfrom=cavium.com; obsidianresearch.com; dkim=none (message not signed) header.d=none;obsidianresearch.com; dmarc=none action=none header.from=cavium.com; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) Received: from CAEXCH02.caveonetworks.com (50.232.66.26) by BY2FFO11FD024.mail.protection.outlook.com (10.1.15.213) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.1199.9 via Frontend Transport; Tue, 4 Jul 2017 10:36:09 +0000 Received: from lb-tlvb-ramrani.il.qlogic.org (10.185.6.119) by CAEXCH02.caveonetworks.com (10.17.4.29) with Microsoft SMTP Server id 14.2.347.0; Tue, 4 Jul 2017 03:36:06 -0700 From: Ram Amrani To: , , CC: , , , Ram Amrani Subject: [PATCH rdma-core 1/2] libqedr: fix sparse warnings Date: Tue, 4 Jul 2017 13:35:53 +0300 Message-ID: <1499164554-28552-2-git-send-email-Ram.Amrani@cavium.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1499164554-28552-1-git-send-email-Ram.Amrani@cavium.com> References: <1499164554-28552-1-git-send-email-Ram.Amrani@cavium.com> MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:50.232.66.26; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(39400400002)(39410400002)(39840400002)(39850400002)(39450400003)(2980300002)(428002)(199003)(189002)(9170700003)(101416001)(6666003)(54906002)(305945005)(76176999)(50986999)(105586002)(2950100002)(106466001)(2201001)(107886003)(38730400002)(8676002)(72206003)(81166006)(8936002)(104016004)(36756003)(50466002)(2906002)(47776003)(189998001)(50226002)(478600001)(356003)(626005)(86362001)(5003940100001)(5660300001)(4326008)(77096006); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR0701MB1113; H:CAEXCH02.caveonetworks.com; FPR:; SPF:None; MLV:sfv; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD024; 1:Xpnppye3tkxhF4QF92Kymf0N0mwdTdIM9A4I/+si4k/ewAqkuHlkiSs/Q92b1aKDJ5X7cKZUR1KCwwboNYWhiSjDLH0ks+ojLiioAPTqbWoly31xuNPQfufkSV/eCWnVvaVbcO4sLQe0CSji6sjvpq5ITnF2zlhART/QU+MYlaEGdkKlstMKDF5ixdRBk9/K4eqjzGRxaR72gCmPB+mFoqgtJrKV/n4s0RjBulvE8xrNXCeEiV6Elq9J0tWGDzpjJGwY+qoGEB0hIghbvEOsUy8lu6XFRws2gNLbRalPmB/DQlIgl74bkfppGSask2zjqF7sZ/Ig/J3t85F6TqDc0IDJXjP3ZyD2bGvpZRIlNvHKkR7XYt9dAMkTacTEf0L3MIiZwpKqgJjbdVsjnsQVO15S8K8IRbmJRBTMo0tFm6iPcK/ChzRdlHq/Lz0PwpplDQpZVj8GCrPdNlGW5XjMF1HLITzrKYj3srv5IMerQvHiuDW/dO1RBsa5DlHptI0QZJJjOHeX6LT7bk1kKtGFudFf7TzYjDCQPayMoip5UUTc/LWEQfYBzzZEDAULPg/zYzAxLBQeqryic1WFhwW3dBlH7A2hI79H4DaWnMCjbZSDP5mu4HRZ+30DFYB0fkwSVjrevXD7NOW49f2uG890fKi1ZohDWOUnAUcjbqExDBSZEvEYzwsWaiJaJikzOxpykMQuJq8jrXwu13BQvMj75gXrUwaCXPWDjm0WNWh00saHDFW7F/3Nn9wjWdnn5YzHyrfAp3DeqVh3pZGLn2iQtDSKthcu+tsd5JlThfJciKfWltTSpScYVsw1/C7ke5WjbKxlG9D6Uxb6/lOrsGqXYOhnG2VHDdmKk/cDOUpxpuw= X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 354bfc6d-5848-48d5-edec-08d4c2c87bdc X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:CY1PR0701MB1113; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1113; 3:0JaKltShtE/JFQOL7b4OrV1TwsEXlBXzpHSWI/8g61u9Wo9zjI8kq7JzfGLg1zuPyGu/d6F3XdRjLSJvEY8bUdAqIrPNWWSe2+6H3fPAcZC0s+rBTeKl1zsNJRxY2WD0pp5XkwLwVnhk9yQy3r5l/0MICW6Q2TqQh/C9eb12HIUlc4FK/zv5ZKAA65fp9zKI1nU5QcI/bBITqwDTUnOtwCbFO44FrQuOcHlU+nDX6Ley/0WLK5UY1wOYrVT0dYPl5xEkuiqNgTQ/ggnbPRAu6Mbj569JEZljH1xg2QCeswg86i4zvqg/pw8/poOfjFk7VrBerm97xcpmrALSxpSzgDfP4+nCpouHGXxNOc1X7+JUKaSHLvHoJGg0mcdtZJwfdOKbXZUCDGsmE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hQ3PWT65g3/X+IM2HDOFvvNJBsksMy+D/m+5tePnhQMJxCwXssHiC4qKibU11VlXWgXL/CganVWvXxejenfk6DEuChT5HMtgIAnDycyPu8l4kpJDMUbb9GKpPSdlP/XuWh+eYJ8+NHsoiUKBwttQ== X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1113; 20:nQXD1qyNiYfjVqMDSXBAwDhdWgiTA0BLU0Qwa8sin/cgn7JHc8n+ETm18/ykZRIuWVaogDBMcduvlr32Ds07abVlJ0H+VNIZQDXX3aZp63gscvpkDMOluV6hZzKPQyFoO74s0CriXa0RCuby3ZZioaG8oNXKNurilQKPbKeD9gzYJqPxQkCY8lcsO/ZWkS4k9qFmjVFpXyAXkDiu46I7UIrj5Sr0M5Fa/aA7znbt8FpQUFNA6OREzr1TBx8higMoKBJC31Q87A4EQYTaJlnxrFO9XgXreUy7eHGzM65IPKcxxpY3xfIQxPoFHhQ91dzV596cbXjMCxhK8KJyOjRR/Ol8ibv6Kf/BunTaplkTyauPbTW/smqxniYRlsQxeWcfIu6g+P+d5wXyiwLPC7bP8wLBMPeHqhhZsSXC1R0WUlFAwlDF7nf3p6k0WVfQYwi487DLtHnBmGTAkKJSI1Ai6UBo4+/5CmkWKyr0mA1bOCNZJowwPQjCb7PbuaadOOvj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(167848164394848); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(13018025)(8121501046)(5005006)(13016025)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6041248)(20161123562025)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY1PR0701MB1113; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY1PR0701MB1113; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1113; 4:93xjvaaQbVKQZPgYWqcxXm+0MerbBTN/8ruFpsTq?= =?us-ascii?Q?nIhaPbqTDvowhapEe27lxsnE+9n1MCRIPcv0d55fF0WuR+rtnV3LwZ4VqI4b?= =?us-ascii?Q?RP2DAtNSCrQ7c0tVPAvYMe3yHt6gsx+4PpLQzfX3UC0DSjtfKV2LJOa3H55d?= =?us-ascii?Q?TouhitCNK6Vy5VYHGM80rBfTLoECR9ZhGEW9RezWjka6dB2kxzEq8/t64vt7?= =?us-ascii?Q?fhS34vDvdXNSNNr4PCYfnzAFSRaWRHL1cESndyk7rligLu4HmU3A/ya6MJz6?= =?us-ascii?Q?n7b42VHhA3s/Uy7KbzNfhO5v4x1RWpF8nNrk7AjCO17Ge6h6y3AfZ11qV6xI?= =?us-ascii?Q?PrSM8sy8kQMYm/tTOn/WhXKyruzAg/WJDGXC+xaUKtQ34YZLGMxb+ZimUWzN?= =?us-ascii?Q?Z+M1CZR2pk1MsjiC0J7uS/fNf6KKBycA6AuSXLBSM+nu4scZ4fURj3h+FMwU?= =?us-ascii?Q?7mUdsLWkymsRDLqS62AmcNecEgJoUZ8zlb/tw+R6+G15jtuimL2r27Drh0XW?= =?us-ascii?Q?dSGFXDP6XU7IPyDzeHkuMGiGKeYcC/uaK+2xbEJgjbclwOtM2f6FBFLGq7Nv?= =?us-ascii?Q?gzelOJT/ZwCeX3MKsJQS8+ufoeNB9h/kyfTLPmNItPycP2UMQQaT/Hp7INz8?= =?us-ascii?Q?/AHXVIRIop/MWjiRU/PJeIILzCW8iyaS/BTFNrQUYwXqJAbB8GkheDQxBpFh?= =?us-ascii?Q?32OrR+9swirXqciNlkxf7wquOGwja5rDSpt/JrljaN1zwHNG10xFajzkBo56?= =?us-ascii?Q?apB9T571X88xFnMfYSq1vAWTl1lr9mRv+uUjVJheD2WTAtaSvoXoPmxr9M3X?= =?us-ascii?Q?7B3koSsGlLjlYtBQBPoK+5dGx63/cbcHYmxLVI1UhHAlurgEQQithG/PIV5m?= =?us-ascii?Q?BPBMy8eohC5B3LmVNGShOksaNs6uyy45n2EKQOYYS4xPYwsRRf6JULknuvjs?= =?us-ascii?Q?JXKKz+XyqUMc2S7bDCtAltHiMISWEaFGjD+JoveTZSiUYdscUngTd5kwNr2x?= =?us-ascii?Q?sbaaICJasqkDVZQrbX51+NaLv78MyQBSRrUNup2v5yZUtW8ATDhsFsWtE+I/?= =?us-ascii?Q?qHXw4+B0654/PqTDIYI9c/y1CRJ6C8Zq5sk3XAOplVW8PdmJtMADfAQzLYL6?= =?us-ascii?Q?YdOV5D8Ca63e1fokwV5O5X14atrxW7IffYjVh7bu64jztEgyol1sEfGNJkjA?= =?us-ascii?Q?13cREdslEnRgX+22QDgxVnCg5b2wjxL/JFIH9atAK/Fru988cJU+kpilVFuM?= =?us-ascii?Q?8TyYrWgOFUN2BtVnWw6pPU8O6YN5TReblDddTqeO?= X-Forefront-PRVS: 0358535363 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0701MB1113; 23:ugM/2Err9YsjsOO7t6WpfmShGWF5nJ8nYVqo0CM?= =?us-ascii?Q?q1KkFjybXoLABt4O6Mpiht2SsLOY0uQuJpAiVVpVsIzPBoA6TPFcJvGgsU4Y?= =?us-ascii?Q?1gKE58UBri6YvOcDFP5WRJWvjh6e/O8XQP2TpuEA2ojnQvgs+LmwdYZzOhKG?= =?us-ascii?Q?bCIBg35yhZgIXFe3+54i/SecbfgBU5cI2Di0hxSmlxXtTmygWAKTf5If/heR?= =?us-ascii?Q?6gccfiMWFsJL2OBYnmAmx4x4RyaNBFuYW+F6yllZkoNu5lFVtmr9pTVoceVP?= =?us-ascii?Q?DtkTGQDNrydfGajD+OqFv0iCHA4FLk3gpO3l8v0qBanF5/ERYlf8sIvHefUI?= =?us-ascii?Q?R+glq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2TtLNzSQc0UK02ViMHQbH0LIJQ4?= =?us-ascii?Q?5b0=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1113; 5:Nx0mymGVw3nZIrwjfSPAS86TEpRPWdpdbJxoK6f4qp6Roy6qxTsO7z46OnqM5DhQcP/n26AueMKp9c2VzQtpzU+LQfhJhWYHqmzSJJO/MXT1lWJpEU98nsKvIEOwIVEj8KkFUiurcUP/VjJIHfAo1xU5vN2QKgOOJSqqxPy39occRhJmhm+QLAn6teTuQpDxUf5yYO4JYhZX/NPOn10H41YQugHNhndJWUk/eWK0RdInk0w5zRhOwkvxioePIwj8PHywb1o8h94vdvqwYU/XgZnRgReMB9OWzYKegBP2ucYIVql5VgbONbqcyoZdtUH4jgWA7pkE9ARiHZlqFfYBAI4635+j4TQDN/+Z2av6CKVPVxLfRKrb9PVosqtNRBiTJS+oGXhDdrp/vsxcW1eqKh2m1zS0DvkRK8AvbpP+MvY3qoiQyC86jJNZWT2UYQSli5GtfLFkEng0NNFaA79CCwqZzhbHlSpWyJZhFUcMO9SF4FHjQnNCwm9uUwbYLYoN; 24:O7uev7f4s5f9E2pDTXO4mDIZfdPimt0iOMee2wHUKtMdJPPwEMbWZpnljQZKrpNblhSFO30ckbxd/hYh1iwNk+AWOZosQWRb9slOAtzqWw4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR0701MB1113; 7:i0177MFHAqZ+TFvWuX20eTz2PYVoZsPlQxg9sDzqUtpG90p2USnlmBI/GPyw6tSmj5Se7f3ZAVTD51+6Ai2859frsoCn71G7LNuFtkdcFQpx8oqiF3VmwERNu6fp7sB6byE9dXAJ4dRuXic8agJJ2KYDfx0KLuuO31Vqenqdu/GM3cdn+aVWjIDCNmFVwxUVZRMGgSiP2SxUW4UeHkm/4/Ml7c5rr6ICl8CXtwBHq/fnEx0hmtb2BYPm9KWlhUQzHaMNTsG6rfbuSTS4nbY7j1VZ8Hc9p/mgJe45oQ0P5AClBTDr4ec3+ctRgtYHRfyicdoM1a7eACnrW7ZTF9Ktaq5Inbr2AOyC3+MNbUpTqFw+qpACQSMnzS+jdHjN3abhziSArSLNOlyLqn65wpy6AfMyIJ3F05H82gO9Nk/O1BwPmhDv97EE6QvBgKrJ7kNN/G3dPJ9DUoCXMc2YH6enkSS6egz1948HXLdEbPK6CUEIm9FURuXfBxKuAhomf5ha/JCBOYLrcIP/9r7zU4drGFm4MI6kmf1+ZrIUJaOn3zTI7/zo2D/DUZfHcKbvW/moRjspsac687qCL6sjhOP69XU5A9KQ3XxKwix7WSI3rhu0J/TSUoNc0T/Ssh9T7lqSfHtC89yaez01oC6BteMg11z1aWKYyf3/Y/YxB4XHxqyVMVe5n/1fIvIJbRj5/PgXSOcOcM9ifQ6X8YAl9peiFZ2QtsobJhBV++X8/1OCJTqrN7UhF9vXWliJ6v/oO38HP6NSCXAfMoThwe2Mx+YEfbIPXwO/B1pX+s6wxIiMwQY= X-OriginatorOrg: cavium.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jul 2017 10:36:09.0442 (UTC) X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=711e4ccf-2e9b-4bcf-a551-4094005b6194; Ip=[50.232.66.26]; Helo=[CAEXCH02.caveonetworks.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0701MB1113 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 Properly use __be and __le types and their conversions. Do not use values stored in firmware structures as they are __le and not host by nature. This avoids conversion back to host. Signed-off-by: Ram Amrani Signed-off-by: Ariel Elior --- providers/qedr/qelr.h | 6 +- providers/qedr/qelr_verbs.c | 174 +++++++++++++++++++++++++------------------- 2 files changed, 102 insertions(+), 78 deletions(-) diff --git a/providers/qedr/qelr.h b/providers/qedr/qelr.h index 1a1032e..b093509 100644 --- a/providers/qedr/qelr.h +++ b/providers/qedr/qelr.h @@ -197,9 +197,9 @@ struct qelr_qp_hwq_info { }; struct qelr_rdma_ext { - uint64_t remote_va; - uint32_t remote_key; - uint32_t dma_length; + __be64 remote_va; + __be32 remote_key; + __be32 dma_length; }; /* rdma extension, invalidate / immediate data + padding, inline data... */ diff --git a/providers/qedr/qelr_verbs.c b/providers/qedr/qelr_verbs.c index 451f633..fc4afdb 100644 --- a/providers/qedr/qelr_verbs.c +++ b/providers/qedr/qelr_verbs.c @@ -44,6 +44,7 @@ #include #include #include +#include #include "qelr.h" #include "qelr_abi.h" @@ -856,10 +857,11 @@ static int sge_data_len(struct ibv_sge *sg_list, int num_sge) static void swap_wqe_data64(uint64_t *p) { + __be64 *bep=(__be64 *)p; int i; for (i = 0; i < ROCE_WQE_ELEM_SIZE / sizeof(uint64_t); i++, p++) - *p = htobe64(htole64(*p)); + *bep = htobe64(*p); } static inline void qelr_init_dpm_info(struct qelr_devctx *cxt, @@ -893,32 +895,26 @@ static inline void qelr_edpm_set_msg_data(struct qelr_qp *qp, uint8_t se, uint8_t comp) { - uint32_t wqe_size, dpm_size; + uint32_t wqe_size, dpm_size, params; + + params = 0; wqe_size = length + (QELR_IS_IMM(opcode)? sizeof(uint32_t) : 0); dpm_size = wqe_size + sizeof(struct db_roce_dpm_data); - SET_FIELD(dpm->msg.data.params.params, DB_ROCE_DPM_PARAMS_SIZE, + SET_FIELD(params, DB_ROCE_DPM_PARAMS_DPM_TYPE, DPM_ROCE); + SET_FIELD(params, DB_ROCE_DPM_PARAMS_OPCODE, opcode); + SET_FIELD(params, DB_ROCE_DPM_PARAMS_WQE_SIZE, wqe_size); + SET_FIELD(params, DB_ROCE_DPM_PARAMS_COMPLETION_FLG, comp ? 1 : 0); + SET_FIELD(params, DB_ROCE_DPM_PARAMS_S_FLG, se ? 1 : 0); + SET_FIELD(params, DB_ROCE_DPM_PARAMS_SIZE, (dpm_size + sizeof(uint64_t) - 1) / sizeof(uint64_t)); - SET_FIELD(dpm->msg.data.params.params, DB_ROCE_DPM_PARAMS_DPM_TYPE, - DPM_ROCE); - - SET_FIELD(dpm->msg.data.params.params, DB_ROCE_DPM_PARAMS_OPCODE, - opcode); - - SET_FIELD(dpm->msg.data.params.params, DB_ROCE_DPM_PARAMS_WQE_SIZE, - wqe_size); - - SET_FIELD(dpm->msg.data.params.params, - DB_ROCE_DPM_PARAMS_COMPLETION_FLG, comp ? 1 : 0); - - SET_FIELD(dpm->msg.data.params.params, DB_ROCE_DPM_PARAMS_S_FLG, - se ? 1 : 0); + dpm->msg.data.params.params = htole32(params); } static inline void qelr_edpm_set_inv_imm(struct qelr_qp *qp, struct qelr_dpm *dpm, - uint32_t data) + __be32 data) { memcpy(&dpm->payload[dpm->payload_offset], &data, sizeof(data)); @@ -1036,16 +1032,19 @@ static void qelr_prepare_sq_sges(struct qelr_qp *qp, *wqe_size += wr->num_sge; } -static void qelr_prepare_sq_rdma_data(struct qelr_qp *qp, - struct qelr_dpm *dpm, - int data_size, - struct rdma_sq_rdma_wqe_1st *rwqe, - struct rdma_sq_rdma_wqe_2nd *rwqe2, - struct ibv_send_wr *wr) +static uint32_t qelr_prepare_sq_rdma_data(struct qelr_qp *qp, + struct qelr_dpm *dpm, + int data_size, + uint8_t wqe_size, + struct rdma_sq_rdma_wqe_1st *rwqe, + struct rdma_sq_rdma_wqe_2nd *rwqe2, + struct ibv_send_wr *wr, + bool is_imm) { memset(rwqe2, 0, sizeof(*rwqe2)); rwqe2->r_key = htole32(wr->wr.rdma.rkey); TYPEPTR_ADDR_SET(rwqe2, remote_va, wr->wr.rdma.remote_addr); + rwqe->wqe_size = wqe_size; if (wr->send_flags & IBV_SEND_INLINE && (wr->opcode == IBV_WR_RDMA_WRITE_WITH_IMM || @@ -1059,17 +1058,27 @@ static void qelr_prepare_sq_rdma_data(struct qelr_qp *qp, } else { qelr_prepare_sq_sges(qp, dpm, &rwqe->wqe_size, wr); } + rwqe->length = htole32(data_size); + + if (is_imm) + rwqe->imm_data = htole32(be32toh(wr->imm_data)); + + return data_size; } -static void qelr_prepare_sq_send_data(struct qelr_qp *qp, - struct qelr_dpm *dpm, - int data_size, - struct rdma_sq_send_wqe_1st *swqe, - struct rdma_sq_send_wqe_2st *swqe2, - struct ibv_send_wr *wr) +static uint32_t qelr_prepare_sq_send_data(struct qelr_qp *qp, + struct qelr_dpm *dpm, + int data_size, + uint8_t wqe_size, + struct rdma_sq_send_wqe_1st *swqe, + struct rdma_sq_send_wqe_2st *swqe2, + struct ibv_send_wr *wr, + bool is_imm) { memset(swqe2, 0, sizeof(*swqe2)); + swqe->wqe_size = wqe_size; + if (wr->send_flags & IBV_SEND_INLINE) { uint8_t flags = 0; @@ -1082,6 +1091,11 @@ static void qelr_prepare_sq_send_data(struct qelr_qp *qp, } swqe->length = htole32(data_size); + + if (is_imm) + swqe->inv_key_or_imm_data = htole32(be32toh(wr->imm_data)); + + return data_size; } static enum ibv_wc_opcode qelr_ibv_to_wc_opcode(enum ibv_wr_opcode opcode) @@ -1218,6 +1232,8 @@ static int __qelr_post_send(struct qelr_devctx *cxt, struct qelr_qp *qp, struct rdma_sq_atomic_wqe_2nd *awqe2; struct rdma_sq_atomic_wqe_3rd *awqe3; struct qelr_dpm dpm; + uint32_t wqe_length; + uint8_t wqe_size; uint16_t db_val; int rc = 0; @@ -1245,45 +1261,51 @@ static int __qelr_post_send(struct qelr_devctx *cxt, struct qelr_qp *qp, wqe->req_type = RDMA_SQ_REQ_TYPE_SEND_WITH_IMM; swqe = (struct rdma_sq_send_wqe_1st *)wqe; - swqe->wqe_size = 2; + wqe_size = sizeof(struct rdma_sq_send_wqe) / sizeof(uint64_t); swqe2 = (struct rdma_sq_send_wqe_2st *)qelr_chain_produce(&qp->sq.chain); - swqe->inv_key_or_imm_data = htobe32(htole32(wr->imm_data)); + if (dpm.is_edpm) qelr_edpm_set_inv_imm(qp, &dpm, wr->imm_data); - qelr_prepare_sq_send_data(qp, &dpm, data_size, swqe, swqe2, wr); + wqe_length = qelr_prepare_sq_send_data(qp, &dpm, data_size, + wqe_size, swqe, swqe2, + wr, 1 /* Imm */); + if (dpm.is_edpm) qelr_edpm_set_msg_data(qp, &dpm, QELR_IB_OPCODE_SEND_ONLY_WITH_IMMEDIATE, - swqe->length, se, comp); - qp->wqe_wr_id[qp->sq.prod].wqe_size = swqe->wqe_size; - qp->prev_wqe_size = swqe->wqe_size; - qp->wqe_wr_id[qp->sq.prod].bytes_len = swqe->length; + wqe_length, se, comp); + + qp->wqe_wr_id[qp->sq.prod].wqe_size = wqe_size; + qp->prev_wqe_size = wqe_size; + qp->wqe_wr_id[qp->sq.prod].bytes_len = wqe_length; break; case IBV_WR_SEND: wqe->req_type = RDMA_SQ_REQ_TYPE_SEND; swqe = (struct rdma_sq_send_wqe_1st *)wqe; - swqe->wqe_size = 2; + wqe_size = sizeof(struct rdma_sq_send_wqe) / sizeof(uint64_t); swqe2 = (struct rdma_sq_send_wqe_2st *)qelr_chain_produce(&qp->sq.chain); - qelr_prepare_sq_send_data(qp, &dpm, data_size, swqe, swqe2, wr); + wqe_length = qelr_prepare_sq_send_data(qp, &dpm, data_size, + wqe_size, swqe, swqe2, + wr, 0); if (dpm.is_edpm) qelr_edpm_set_msg_data(qp, &dpm, QELR_IB_OPCODE_SEND_ONLY, - swqe->length, se, comp); - qp->wqe_wr_id[qp->sq.prod].wqe_size = swqe->wqe_size; - qp->prev_wqe_size = swqe->wqe_size; - qp->wqe_wr_id[qp->sq.prod].bytes_len = swqe->length; + wqe_length, se, comp); + + qp->wqe_wr_id[qp->sq.prod].wqe_size = wqe_size; + qp->prev_wqe_size = wqe_size; + qp->wqe_wr_id[qp->sq.prod].bytes_len = wqe_length; break; case IBV_WR_RDMA_WRITE_WITH_IMM: wqe->req_type = RDMA_SQ_REQ_TYPE_RDMA_WR_WITH_IMM; rwqe = (struct rdma_sq_rdma_wqe_1st *)wqe; - rwqe->wqe_size = 2; - rwqe->imm_data = htobe32(htole32(wr->imm_data)); + wqe_size = sizeof(struct rdma_sq_rdma_wqe) / sizeof(uint64_t); rwqe2 = (struct rdma_sq_rdma_wqe_2nd *)qelr_chain_produce(&qp->sq.chain); if (dpm.is_edpm) { qelr_edpm_set_rdma_ext(qp, &dpm, wr->wr.rdma.remote_addr, @@ -1291,50 +1313,50 @@ static int __qelr_post_send(struct qelr_devctx *cxt, struct qelr_qp *qp, qelr_edpm_set_inv_imm(qp, &dpm, wr->imm_data); } - qelr_prepare_sq_rdma_data(qp, &dpm, data_size, rwqe, rwqe2, wr); + wqe_length = qelr_prepare_sq_rdma_data(qp, &dpm, data_size, wqe_size, rwqe, rwqe2, wr, 1 /* Imm */); if (dpm.is_edpm) qelr_edpm_set_msg_data(qp, &dpm, QELR_IB_OPCODE_RDMA_WRITE_ONLY_WITH_IMMEDIATE, - rwqe->length + sizeof(*dpm.rdma_ext), + wqe_length + sizeof(*dpm.rdma_ext), se, comp); - qp->wqe_wr_id[qp->sq.prod].wqe_size = rwqe->wqe_size; - qp->prev_wqe_size = rwqe->wqe_size; - qp->wqe_wr_id[qp->sq.prod].bytes_len = rwqe->length; + qp->wqe_wr_id[qp->sq.prod].wqe_size = wqe_size; + qp->prev_wqe_size = wqe_size; + qp->wqe_wr_id[qp->sq.prod].bytes_len = wqe_length; break; case IBV_WR_RDMA_WRITE: wqe->req_type = RDMA_SQ_REQ_TYPE_RDMA_WR; rwqe = (struct rdma_sq_rdma_wqe_1st *)wqe; - rwqe->wqe_size = 2; + wqe_size = sizeof(struct rdma_sq_rdma_wqe) / sizeof(uint64_t); rwqe2 = (struct rdma_sq_rdma_wqe_2nd *)qelr_chain_produce(&qp->sq.chain); if (dpm.is_edpm) qelr_edpm_set_rdma_ext(qp, &dpm, wr->wr.rdma.remote_addr, wr->wr.rdma.rkey); - qelr_prepare_sq_rdma_data(qp, &dpm, data_size, rwqe, rwqe2, wr); + wqe_length = qelr_prepare_sq_rdma_data(qp, &dpm, data_size, wqe_size, rwqe, rwqe2, wr, 0); if (dpm.is_edpm) qelr_edpm_set_msg_data(qp, &dpm, QELR_IB_OPCODE_RDMA_WRITE_ONLY, - rwqe->length + + wqe_length + sizeof(*dpm.rdma_ext), se, comp); - qp->wqe_wr_id[qp->sq.prod].wqe_size = rwqe->wqe_size; - qp->prev_wqe_size = rwqe->wqe_size; - qp->wqe_wr_id[qp->sq.prod].bytes_len = rwqe->length; + qp->wqe_wr_id[qp->sq.prod].wqe_size = wqe_size; + qp->prev_wqe_size = wqe_size; + qp->wqe_wr_id[qp->sq.prod].bytes_len = wqe_length; break; case IBV_WR_RDMA_READ: wqe->req_type = RDMA_SQ_REQ_TYPE_RDMA_RD; rwqe = (struct rdma_sq_rdma_wqe_1st *)wqe; - rwqe->wqe_size = 2; + wqe_size = sizeof(struct rdma_sq_rdma_wqe) / sizeof(uint64_t); rwqe2 = (struct rdma_sq_rdma_wqe_2nd *)qelr_chain_produce(&qp->sq.chain); - qelr_prepare_sq_rdma_data(qp, &dpm, data_size, rwqe, rwqe2, wr); - qp->wqe_wr_id[qp->sq.prod].wqe_size = rwqe->wqe_size; - qp->prev_wqe_size = rwqe->wqe_size; - qp->wqe_wr_id[qp->sq.prod].bytes_len = rwqe->length; + wqe_length = qelr_prepare_sq_rdma_data(qp, &dpm, data_size, wqe_size, rwqe, rwqe2, wr, 0); + qp->wqe_wr_id[qp->sq.prod].wqe_size = wqe_size; + qp->prev_wqe_size = wqe_size; + qp->wqe_wr_id[qp->sq.prod].bytes_len = wqe_length; break; case IBV_WR_ATOMIC_CMP_AND_SWP: @@ -1548,7 +1570,7 @@ static struct qelr_qp *cqe_get_qp(union rdma_cqe *cqe) { struct regpair *qph = &cqe->req.qp_handle; - return (struct qelr_qp *)HILO_U64(qph->hi, qph->lo); + return (struct qelr_qp *)HILO_U64(le32toh(qph->hi), le32toh(qph->lo)); } static int process_req(struct qelr_qp *qp, struct qelr_cq *cq, int num_entries, @@ -1612,24 +1634,25 @@ static int qelr_poll_cq_req(struct qelr_qp *qp, struct qelr_cq *cq, struct rdma_cqe_requester *req) { struct qelr_devctx *cxt = get_qelr_ctx(qp->ibv_qp.context); + uint16_t sq_cons = le16toh(req->sq_cons); int cnt = 0; switch (req->status) { case RDMA_CQE_REQ_STS_OK: - cnt = process_req(qp, cq, num_entries, wc, req->sq_cons, + cnt = process_req(qp, cq, num_entries, wc, sq_cons, IBV_WC_SUCCESS, 0); break; case RDMA_CQE_REQ_STS_WORK_REQUEST_FLUSHED_ERR: DP_ERR(cxt->dbg_fp, "Error: POLL CQ with ROCE_CQE_REQ_STS_WORK_REQUEST_FLUSHED_ERR. QP icid=0x%x\n", qp->sq.icid); - cnt = process_req(qp, cq, num_entries, wc, req->sq_cons, + cnt = process_req(qp, cq, num_entries, wc, sq_cons, IBV_WC_WR_FLUSH_ERR, 0); break; default: /* other errors case */ /* process all WQE before the consumer */ qp->state = QELR_QPS_ERR; - cnt = process_req(qp, cq, num_entries, wc, req->sq_cons - 1, + cnt = process_req(qp, cq, num_entries, wc, sq_cons - 1, IBV_WC_SUCCESS, 0); wc += cnt; /* if we have extra WC fill it with actual error info */ @@ -1704,8 +1727,8 @@ static int qelr_poll_cq_req(struct qelr_qp *qp, struct qelr_cq *cq, wc_status = IBV_WC_GENERAL_ERR; } - cnt += process_req(qp, cq, 1, wc, req->sq_cons, - wc_status, 1 /* force use of WC */); + cnt += process_req(qp, cq, 1, wc, sq_cons, wc_status, + 1 /* force use of WC */); } } @@ -1754,8 +1777,7 @@ static void __process_resp_one(struct qelr_qp *qp, struct qelr_cq *cq, wc->opcode = IBV_WC_RECV_RDMA_WITH_IMM; SWITCH_FALLTHROUGH; case QELR_RESP_IMM: - wc->imm_data = - be32toh(le32toh(resp->imm_data_or_inv_r_Key)); + wc->imm_data = htobe32(le32toh(resp->imm_data_or_inv_r_Key)); wc->wc_flags |= IBV_WC_WITH_IMM; break; case QELR_RESP_RDMA: @@ -1825,7 +1847,9 @@ static union rdma_cqe *get_cqe(struct qelr_cq *cq) static void try_consume_req_cqe(struct qelr_cq *cq, struct qelr_qp *qp, struct rdma_cqe_requester *req, int *update) { - if (le16toh(req->sq_cons) == qp->sq.wqe_cons) { + uint16_t sq_cons = le16toh(req->sq_cons); + + if (sq_cons == qp->sq.wqe_cons) { consume_cqe(cq); *update |= 1; } @@ -1833,9 +1857,9 @@ static void try_consume_req_cqe(struct qelr_cq *cq, struct qelr_qp *qp, /* used with flush only, when resp->rq_cons is valid */ static void try_consume_resp_cqe(struct qelr_cq *cq, struct qelr_qp *qp, - struct rdma_cqe_responder *resp, int *update) + uint16_t rq_cons, int *update) { - if (le16toh(resp->rq_cons) == qp->rq.wqe_cons) { + if (rq_cons == qp->rq.wqe_cons) { consume_cqe(cq); *update |= 1; } @@ -1845,12 +1869,12 @@ static int qelr_poll_cq_resp(struct qelr_qp *qp, struct qelr_cq *cq, int num_entries, struct ibv_wc *wc, struct rdma_cqe_responder *resp, int *update) { + uint16_t rq_cons = le16toh(resp->rq_cons); int cnt; if (resp->status == RDMA_CQE_RESP_STS_WORK_REQUEST_FLUSHED_ERR) { - cnt = process_resp_flush(qp, cq, num_entries, wc, - resp->rq_cons); - try_consume_resp_cqe(cq, qp, resp, update); + cnt = process_resp_flush(qp, cq, num_entries, wc, rq_cons); + try_consume_resp_cqe(cq, qp, rq_cons, update); } else { cnt = process_resp_one(qp, cq, wc, resp); consume_cqe(cq);