From patchwork Tue Aug 29 00:19:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9926471 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 9FEFC603B5 for ; Tue, 29 Aug 2017 00:20:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91D3B2881A for ; Tue, 29 Aug 2017 00:20:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8F6B0287EC; Tue, 29 Aug 2017 00:20:25 +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 1D4A2287EC for ; Tue, 29 Aug 2017 00:20:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751213AbdH2AUR (ORCPT ); Mon, 28 Aug 2017 20:20:17 -0400 Received: from mail-bl2nam02on0059.outbound.protection.outlook.com ([104.47.38.59]:3584 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751194AbdH2AUQ (ORCPT ); Mon, 28 Aug 2017 20:20:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=VrbHU/B8xobawKYC3zY9lYM6azSFkYAUQrw5jlCuprI=; b=rhV51F79Qh0CpLUrXHn+pOIVa/PH/22PalARWug2mHa8KlV9U07c2tzh4VXvIdW3zgtQwEZ4rqqIaBoGb9maqAC7U2luzckmrzyRPfB7xjmsCayawliKE3h3iNa+7+jnC3shFFwFKJPCmWe/mNZgfxcI0uhaHwxrPnkqlrubIEk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; Received: from promb-2s-dhcp95-136.eng.vmware.com (208.91.1.34) by DM5PR05MB3513.namprd05.prod.outlook.com (10.174.242.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.13.2; Tue, 29 Aug 2017 00:20:13 +0000 From: Adit Ranadive To: dledford@redhat.com, linux-rdma@vger.kernel.org Cc: Aditya Sarwade , pv-drivers@vmware.com, Adit Ranadive Subject: [PATCH for-next 1/2] RDMA/vmw_pvrdma: Report network header type in WC Date: Mon, 28 Aug 2017 17:19:35 -0700 Message-Id: <521f5e2169789e31a7e91dab691cd155f0100090.1503965717.git.aditr@vmware.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: MWHPR09CA0025.namprd09.prod.outlook.com (10.173.46.139) To DM5PR05MB3513.namprd05.prod.outlook.com (10.174.242.142) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6f449748-0584-4150-0e2e-08d4ee73b88d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:DM5PR05MB3513; X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3513; 3:Om6cPmgKIHJ3QuwIvrTyQKe5guNOfA2C/aiO5PEArXjQ8CmmMjfpA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7NLIM9Ity7FamuGd+TbPEYlHH9ZOQeVifWQcwhm/aZVWaHIB6TOhIYdpU0ZubS5KzAIOc+18dukf8PVer9Jo9t/OnhiDErL13Y2TxF6Wk6X68wJuofMEibJFzEsjkCvZYvY8CKLX+KV+VpFd0Rh3axkBNKIszintaahKpPPKHjENf47gkcD0q0kZuV9+khrJowEdgYGlooG6h8c2Z42WQO1GD48FgOByAMTbLa/RAxwe3tKe7LHLBgqfYNYAii9+OMNgZ2EG+K74JssedxRqui6/q; 4:4hqiMBlNaqbi6J75dSLSpGFqrPjY6wfWqHggMyke0rW9FqCGQbx9N80lDYBBw25lnHidn966ktDRvXUfFX9A5+8JmXYmLoEAbFOD/9fTL3ji7UPr0lnXBBuuMI1xPF4a+7148WiL9XxR3HppdfZpPTD2ZbltTFskM/LhO6BX1mDydbYHmJHLJPJOelfFaEPxaUOG9ImxfYc4sLG/vzOZOiEg38sHr5lzrx+vROXSJs4L/sl1BWb2yXry1aMHyOjwPiQ10wfeS2J9UBh8rPNH4opYXWfme7P/PP3CLxr1kFM= X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6041248)(20161123560025)(20161123555025)(20161123562025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:DM5PR05MB3513; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:DM5PR05MB3513; X-Forefront-PRVS: 0414DF926F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(189002)(199003)(478600001)(66066001)(47776003)(53936002)(48376002)(97736004)(4326008)(5660300001)(50226002)(86362001)(575784001)(25786009)(110136004)(107886003)(81156014)(81166006)(106356001)(50986999)(36756003)(8676002)(118296001)(54906002)(6486002)(3846002)(6116002)(2906002)(76176999)(33646002)(101416001)(68736007)(5003940100001)(7350300001)(6666003)(7736002)(105586002)(305945005)(2950100002)(42186005)(189998001)(50466002); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR05MB3513; H:promb-2s-dhcp95-136.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR05MB3513; 23:pT4/dFKD9s3oPLNDJeP3jHmVf7D7Ud+3DptpVvVH5?= =?us-ascii?Q?p4JsgX/6rIbwYkq9+7p2TFoueK3lb5ivzZAZuCCDC5+QzoVMNm86Jdsi6NwS?= =?us-ascii?Q?5P9LXV+S2H04P/cmwpYhTKvFMs0NQoFboVHEn+7PJa3mc/Fva8O3PK0kx5Et?= =?us-ascii?Q?mF6LzMk47Ki47VXvxNZjLGLBFinj5GMjlKD0AE7/CM0tkFv97GlSLfHPOctZ?= =?us-ascii?Q?3DV9ABSfhj9ZSyb7SF0gftULiu6lX2pzF2KMTBWIPvFph4w+jxZf74q6WNnS?= =?us-ascii?Q?gfVtFkUoj4dmEpkip0JJcFSuw7VhnpMUi/Z2RVmUYc6HTgeEDirobggwLpa/?= =?us-ascii?Q?vT6/n0y8JyLa9IW/UZi2+WcEnpBQNsWKBXcY5sL7rItsUimzASh8R33BmYMN?= =?us-ascii?Q?VBC//YryBzZ0suG21jdLg+SjS35B+Q5GD/1tz/jchqpjrMZFekU/ttQf9wCG?= =?us-ascii?Q?bRA3tX+xBzVNUQhlFHdFpIY9lhl8dI0bjA5NutwhPr/1qxqf84ef0Lr/aayX?= =?us-ascii?Q?9OVFq2uDV73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7rp2ptVG8Q3/in7sYrudiG9yP9aErom/r+F9QSbMQ0ElxU2iJzRnMtLBlw==; 5:ICaZl1QBRZhV3IqZusunD017RxKz7o0LksVjFursWNZJ5ewXnjA4DUUgmyPN9HslxkGLyjLdJAn3gxC339X/sEj4BJX5Eh5yQ7c0SGKdAmVWDCYQx1foGFRGmoVi4srd04iF0eJKO2KimagJjSmEfw==; 24:bGobj66M9BVUpnhaOFVQkrKEsiYybbEYht/FeeI/A8S5lBqaRpQIZjIZXV0WmOklWQORicmftPCQbmr4pYmDkKLxTktrNKRXEZWc50zpt24=; 7:KV30mZEZEYye966tz8vD+FsoB7uqHcd71d3vyIrpjJ5m/3OkyB4muMtHrUsB5nMcD9WgDxWs2ptf8ZFaxxtGxpARz8CybhGhh83lOeqC5iemDe+MX6zl6aijmhHuUzUWPJm8WaGRbbPIEFjY9/c/Aipd1GPzPaqLEgSWNG5+5QjP5CpmQGKuOb1fLW0jl8APHpL2o2xxQllsKqtuZ1Kry3Bcj7/waKlyBhLBpM5l2kg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR05MB3513; 20:FnX0erRIb6FNt+XQaUuinMX39rgBL+bcM/9SXPMmbAg41xjAG91lc1yliAtRrfcm3T6g2236C9kZiX0zmLxG3Rw/hwbato43p5BJxWc8sau7thIvoe9mEI9CXGQsevJytlKtp9+70tXEpBApWSKpJf9eUaX74D7LurW5fnfhkCk= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2017 00:20:13.0984 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR05MB3513 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: Aditya Sarwade We should report the network header type in the work completion so that the kernel can infer the right RoCE type headers. Reviewed-by: Bryan Tan Signed-off-by: Aditya Sarwade Signed-off-by: Adit Ranadive --- drivers/infiniband/hw/vmw_pvrdma/pvrdma.h | 6 ++++++ drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c | 2 ++ include/uapi/rdma/vmw_pvrdma-abi.h | 13 +++++++++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h b/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h index 663a0c3..99b2c97 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma.h @@ -426,6 +426,12 @@ static inline int pvrdma_wc_flags_to_ib(int flags) return flags; } +static inline enum rdma_network_type pvrdma_wc_network_hdr_to_ib( + enum pvrdma_network_type type) +{ + return (enum rdma_network_type)type; +} + static inline int ib_send_flags_to_pvrdma(int flags) { return flags & PVRDMA_MASK(PVRDMA_SEND_FLAGS_MAX); diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c index 90aa326..34727f6 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c @@ -389,6 +389,8 @@ static int pvrdma_poll_one(struct pvrdma_cq *cq, struct pvrdma_qp **cur_qp, wc->dlid_path_bits = cqe->dlid_path_bits; wc->port_num = cqe->port_num; wc->vendor_err = cqe->vendor_err; + wc->network_hdr_type = + pvrdma_wc_network_hdr_to_ib(cqe->network_hdr_type); /* Update shared ring state */ pvrdma_idx_ring_inc(&cq->ring_state->rx.cons_head, cq->ibcq.cqe); diff --git a/include/uapi/rdma/vmw_pvrdma-abi.h b/include/uapi/rdma/vmw_pvrdma-abi.h index c8c1d2d..6a87806 100644 --- a/include/uapi/rdma/vmw_pvrdma-abi.h +++ b/include/uapi/rdma/vmw_pvrdma-abi.h @@ -58,6 +58,13 @@ #define PVRDMA_UAR_CQ_ARM BIT(30) /* Arm bit. */ #define PVRDMA_UAR_CQ_POLL BIT(31) /* Poll bit. */ +enum pvrdma_network_type { + PVRDMA_NETWORK_IB, + PVRDMA_NETWORK_ROCE_V1 = PVRDMA_NETWORK_IB, + PVRDMA_NETWORK_IPV4, + PVRDMA_NETWORK_IPV6 +}; + enum pvrdma_wr_opcode { PVRDMA_WR_RDMA_WRITE, PVRDMA_WR_RDMA_WRITE_WITH_IMM, @@ -125,7 +132,8 @@ enum pvrdma_wc_flags { PVRDMA_WC_IP_CSUM_OK = 1 << 3, PVRDMA_WC_WITH_SMAC = 1 << 4, PVRDMA_WC_WITH_VLAN = 1 << 5, - PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_VLAN, + PVRDMA_WC_WITH_NETWORK_HDR_TYPE = 1 << 6, + PVRDMA_WC_FLAGS_MAX = PVRDMA_WC_WITH_NETWORK_HDR_TYPE, }; struct pvrdma_alloc_ucontext_resp { @@ -283,7 +291,8 @@ struct pvrdma_cqe { __u8 dlid_path_bits; __u8 port_num; __u8 smac[6]; - __u8 reserved2[7]; /* Pad to next power of 2 (64). */ + __u8 network_hdr_type; + __u8 reserved2[6]; /* Pad to next power of 2 (64). */ }; #endif /* __VMW_PVRDMA_ABI_H__ */