From patchwork Tue Aug 29 22:51:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9928415 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 2A44A603B4 for ; Tue, 29 Aug 2017 22:51:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 184A028A91 for ; Tue, 29 Aug 2017 22:51:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03C0428A76; Tue, 29 Aug 2017 22:51:47 +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 827D128A76 for ; Tue, 29 Aug 2017 22:51:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751290AbdH2Wvm (ORCPT ); Tue, 29 Aug 2017 18:51:42 -0400 Received: from mail-by2nam03on0076.outbound.protection.outlook.com ([104.47.42.76]:7455 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751272AbdH2Wvl (ORCPT ); Tue, 29 Aug 2017 18:51:41 -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=YUNcaFOqjNBRAhSWr9mjSaPV2FlJiHiQQkgsQ/yWZ8w=; b=pAk8xu846QoMlmU87x7V9poe1M8lR4Z4y+QtP/fkzgBrPrACt/D72PDU8GEwYfO+i6zNkKZs3lOxYgAkV1hTINGxX94e2HVEs1TxDDxCtMaYu5+8Lpmc7uotgz7MU01kPd5l20kOf1z2OFKV66ruPmfKXMPW7l4KlHpr+Hn3iMg= Received: from promb-2s-dhcp95-136.eng.vmware.com (208.91.1.34) by CY4PR05MB3510.namprd05.prod.outlook.com (10.171.247.19) 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 22:51:39 +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 v1 1/2] RDMA/vmw_pvrdma: Report network header type in WC Date: Tue, 29 Aug 2017 15:51:29 -0700 Message-Id: <2abd8333de3bb9a2e609f107b1826470a54d1c30.1504045411.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: CO2PR05CA0069.namprd05.prod.outlook.com (10.166.88.165) To CY4PR05MB3510.namprd05.prod.outlook.com (10.171.247.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b799ada1-cf21-4481-70b1-08d4ef308312 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:CY4PR05MB3510; X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3510; 3:9Gfd+rqiiFwsCXhH2svORJNZQTrce2tY6BVlVROuCWhpz3MDXzx09eIBal0G9D6NRZO8XoboHtq1Hc9lUXb15NPygfVL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BolReqnsWiL3akcVslfibiyuC61YW1M+OrWtrPMsodJajELcFbQUoBNkiP/+XZKzrFAl9eFh773UOyvvcQsZ/x1D3iJF5IL1z4uVlg/GRYkf6VJNflXct9bCOPYXEz9L8RaffUYkFJdNNnjVEbfiMjvjZwdCQ5mgBoSoNLz7jH8jBUydHgPrhf5VUQS3JJI3M8zmST/hejqRXgqzIkmUEnsQvIgf40AjoXE2KDTu4CaVitE5ycbiWasraknZ; 4:WuxqzZxHW/ZYgbl/9EusIF1T95wLd0b+ZYxWiKhiyfs6/xQekoUhHZG9m1VTi8IIRv9KeoDM9KqNF4n9VRq1q5S06QM2DVToF2nKO6HR0DDZ8DraNq1VxB01aMkyNMbaDZBfUb436Dynm8k1kADNh37cw68+cQkID83TrqiZZk2ZrkPI9Ky5ziasRKcRxfIH1qasLQ2pzwPybFfxr2Ie1dHbRgxAzDOw4PqNjWM5jLKz5wQwitnFg2A004qv3Tzs+XE6jWDVWBugOA27Qz7QwrhI396dMai8mdjXNoFZy1M= 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)(10201501046)(100000703101)(100105400095)(3002001)(93006095)(93001095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123562025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR05MB3510; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR05MB3510; X-Forefront-PRVS: 0414DF926F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(7370300001)(4630300001)(6009001)(39860400002)(189002)(199003)(50986999)(101416001)(105586002)(5003940100001)(33646002)(106356001)(2906002)(118296001)(42186005)(3846002)(6116002)(2950100002)(36756003)(5660300001)(6486002)(76176999)(6666003)(48376002)(189998001)(47776003)(50466002)(7350300001)(66066001)(478600001)(53936002)(81166006)(81156014)(68736007)(25786009)(305945005)(50226002)(107886003)(110136004)(4326008)(97736004)(86362001)(7736002)(8676002)(54906002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR05MB3510; 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) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY4PR05MB3510; 23:N+sWFaH4yFdWtRocfIWPAKZfXlZNrg7oCyaTVzrfD?= =?us-ascii?Q?rY3Tt8C0fNdpt/sbMrnE0B47RCu1cXZcpO4I+7kH1WgRAeJHpV6LVRh5aPKT?= =?us-ascii?Q?sQ1XzMP05yNcD603ElshrU6EVGA4JB4fTk/z2ww8RFKoTVjxr7iic2Qh1d1s?= =?us-ascii?Q?RISLPJBVDFgfXRMxwrPCv/nP7kSiWJzcMnrP0FawIw9pn05wZU9yxNQw9+Z5?= =?us-ascii?Q?kqQYD82G1x9U4/PIuZmt4xa1x1H/+ygCO+U/1HLVSGOiBCskdAiqMpnbCOyG?= =?us-ascii?Q?htTSOIDCNQzCnQMwHDu/AJYPihEPDup1eTGgHaxkd6KtVwB3aGGZYxs38Bc8?= =?us-ascii?Q?xUlPtlosOfzWZz/jBqqItoiVoTUsbeeowJurmMWcj19giIXvveg14BDLJGZ3?= =?us-ascii?Q?jtncJHx3P3O15k+tjZ94AF4he0z/ElZbhoPMgNZwPQF/p1/JZ0EgjUx2TQik?= =?us-ascii?Q?lYxV6gtkc1AyE0IwlWYuKnNeODUK3f6/tnxliUjtMuKm5JcUMoNvyVXWF1rh?= =?us-ascii?Q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lTWKrpxrdYc/4C0v/tWJe/jIfEKGLqB6XDIPqoW1imGaJtx4j7Awqj4+EJrybn1FQ==; 5:yQGcwC738hj0q7z+AXT6vWy/6++gml/fSE5n6aSq34Y0qEMxXHhh2VHKZrmkEpubXSEIFRIJirwcjvhjm9d6QiHubcQ00CdKam9KljcpRlSv4s/xco16knoVCMT+h2BJqqDZMVOJMJr2YJGiEREttQ==; 24:2OOxQpehgSM5g2xejCrPLtUH0Y5wnz17Cx2WBCoHbv05KYjJTne/8yVvXCn/ezm6viBvcP5ubtTcavCmKUfI4eW1Vgj0EIZDnGoH2jFSQrY=; 7:c91drDeV8cw7r5tFWc4XvM4MdkgxykKjYqyV8hwjTlBdEz+vTVPAssBmH20LxC7YUYVeBjy25KWowmL2F1OO0WnbeFBpDUev/YOQvv8NBsESYkqXMqOtoNJMUwGYhOEJ3VPMkGjVIIiSruz40oNJNxRKrZOVhiq9yPNSVYES9LAC2D0BTDCXGwe88ocjFDSJqrPKsXA4qU3hmr6UkSzi2VrIeri6m2fXQuhr5UraxKE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3510; 20:VP3ArkoplNtNv6FbL9HNTXeZM14NuxHOibB7RrH4jz/w4yQt+eo71BPYB/GSPpJQueZ4uDj/ZNkAks2yFp/sVDwcobSPhn+65dk7BEpnAYgphDmUoL50+GlfvEqEsO2LQ0NOyefNuFAQPmmaHqXA3zv7UwL41ALJfZnaCdENboU= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2017 22:51:39.8668 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR05MB3510 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 Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c | 1 + include/uapi/rdma/vmw_pvrdma-abi.h | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c index 90aa326..8a12dc7 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c @@ -389,6 +389,7 @@ 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 = 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..c6569b0 100644 --- a/include/uapi/rdma/vmw_pvrdma-abi.h +++ b/include/uapi/rdma/vmw_pvrdma-abi.h @@ -125,7 +125,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 +284,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__ */