From patchwork Thu Aug 10 07:46:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adit Ranadive X-Patchwork-Id: 9892963 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 7C06860348 for ; Thu, 10 Aug 2017 07:49:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AEE028AD2 for ; Thu, 10 Aug 2017 07:49:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CFC728ADD; Thu, 10 Aug 2017 07:49:43 +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 BF96A28991 for ; Thu, 10 Aug 2017 07:49:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751842AbdHJHtZ (ORCPT ); Thu, 10 Aug 2017 03:49:25 -0400 Received: from mail-cys01nam02on0040.outbound.protection.outlook.com ([104.47.37.40]:19328 "EHLO NAM02-CY1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751512AbdHJHtY (ORCPT ); Thu, 10 Aug 2017 03:49:24 -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=WXE2JlCqyfouYUANBUCt1SmInCs0PZXrSgdJZfYIx+M=; b=Cb9EWbjnZEZIlzbqsuRJ3d4j+RkTZ9mvmbChMuWaZ1kUlbogOWrgyDcgdPEhGwT2Zj/J2cHo+lMLABvndE7K4pMEL4sNg28vbZhbZKzlrOu7FkHvaSt6elnJd5tZWL0bpHmg+WfDpytl9IRQv5HuLntauDEyH0r2s4FS+4DApfA= 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.1.1341.9; Thu, 10 Aug 2017 07:49:21 +0000 From: Adit Ranadive To: dledford@redhat.com, linux-rdma@vger.kernel.org, pv-drivers@vmware.com Cc: Bryan Tan , Jorgen Hansen , Aditya Sarwade , Adit Ranadive Subject: [PATCH for-rc] RDMA/vmw_pvrdma: Report CQ missed events Date: Thu, 10 Aug 2017 00:46:15 -0700 Message-Id: <1502351175-1762-1-git-send-email-aditr@vmware.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: DM5PR06CA0052.namprd06.prod.outlook.com (10.168.110.142) To CY4PR05MB3510.namprd05.prod.outlook.com (10.171.247.19) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5b3a2d5e-216f-4e8d-8b0f-08d4dfc45069 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:KX5QEFYnlL0XRied+9B9LFz2K0rAbaS1vsh8NuPonYdxAFvG2wt1wCal1vUpduzdHCR6QW+16lP9u0p0Qa2rgIpqdKpZrYV+REPYLZsDLZw3LG0yN1ask6UkKpUlZUlMN0g8W7MyyVTY6j27djq6OCP9Paf8JsVMFAu6WpEcmN5YFHB5uW++0bVJkM6lEJ776qrYTnNEYaI/VyJ364SDBsapeLBWULVLbmokpEZ026tPN+k34cWMkIfEooZYmKcm; 25:ZwYmIiosMEDnQaVVe+YIk/lceGUGiikd1oRE79PXjtrrU0rypO1ZdKPovxGV5qvrWBlMCfs+kD0xT/ag37RJurJoQyn5w3m0ekzXAXtZEd/L8Vw6MkplRrwk1gEiaPjwRnUy/FxOzPlyOodVEeub8RGNhcrcLystTBmxxxzRq5a1B1aTsP9pXcqqZrrl67ewhBlE4j8L8HM2DXtZCpgyfH49lvnA4tgptRLHaJB5f6XqmWYN8TNgd4sWtcr/HJt5iSffsTnQo6XM0uoYRnK8Ii1pIdt9DLZIpUAxNEj4kZDlMoecbl7MzjL3F/W3AT26LmaqJZxoMjMLFwWTWFxKwQ==; 31:CZMo8wcQH7ZeGVVRqkoTcvHZ5buziOjgTdQLMjFC/ibNlMvPmrqGcPg2CDuT5Z5mjp2SyDZeqiNsepqE+Y7RB5AUXyCt0Ry5ZiZ6nWFh91iOUOR1oULva7g9daXHZKI+MIgLSn7hhGOLcVbl4i8UZVrKcR22uxe8jsocEG3qZsDnFBj4A+7xh4tMQfMZ7rWpef/NnueoqSkQVrdgVEfizpXFz1/yUZ2sCXhjuCtxvfA= X-MS-TrafficTypeDiagnostic: CY4PR05MB3510: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aditr@vmware.com; X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3510; 20:Oy0MnOfg8N3zZdusU9PYMkliAwmt19Rm9UAI6inw2mWiYaSJ1ckqDdCL9rRZSsOiZcCG1jqD8dZGBYn6w3lpZg5++HiICn5oG8LxtjzSUngCywJgVroir1iHDLCr11lykhNGfjb1Fqj0SyqENTE4yDmtxWF/hGz496QS2tl2OyKhZgmBKWBXJhwAlGwg+Nz3l22ndD2mowSBTODBpI4Bx6vQKcMsk6fpkIzuDoOii7XQXbWf8dx1auoizK17DiQMWtn7GmsO2VHr9DNgjrthZZuHdalAjU+46jlP89+FSgIyN6GSfRo8gmKA6bjoIkd0wipNOZrqGm0IDqBg8GGWJ/0+Nyz0qftRaMacp7exUlfw5937sDP+kZA5T8q8KyqteEpxJ6fOBl+odZGOLP9yb9OMzao0RKRApx0w6J5RqoMe8ppFY7IH7TDWeREQPJcReoXvRFnZvqQWd+Fs4vJIrQo7rA3IbLFnCZdElULSx+OqH8pG9Jccv4MCQe55brPO; 4:oLoiHUsNPc5brmOW+MxPyr96Fe/Kho/+z/K5LA68kZ91xIbMX/52kIwXp3YHQEli7GUiljBRDhIG/UhdP9JU5xCiNgVg0m7AZbfHw/W9aK9IwF1kCD/ftffOSQHVChvU+6Ffi9+0D3P6SPIJsM+CzL7PNOuiEOxjWwSvUO+L0nQjr+x0hZQpdKdABezaxmpZKq1NFS4zbol/T90crXNb9pSMgOXA8kEf+A4up/7XdmSNGsWKyndnCLRx3CZsNgatcQdu6QSYaJe8Y0A6QbvxQu/UmTt9SCEnASZ2iKMdSin+SUFKBEoY3q1DigwJRapb4pIVCjgQT1aH7I1mDSyElw== X-Exchange-Antispam-Report-Test: UriScan:(61668805478150)(211171220733660); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(100000703101)(100105400095)(93006095)(93001095)(3002001)(10201501046)(6041248)(20161123558100)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(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: 03950F25EC X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39860400002)(39450400003)(39840400002)(39400400002)(39410400002)(39850400002)(199003)(189002)(6486002)(3846002)(189998001)(50466002)(2906002)(50986999)(97736004)(36756003)(48376002)(33646002)(6116002)(6666003)(106356001)(86362001)(5660300001)(101416001)(6636002)(105586002)(68736007)(42186005)(305945005)(50226002)(4326008)(25786009)(53936002)(8676002)(66066001)(7350300001)(47776003)(478600001)(107886003)(38730400002)(54906002)(7736002)(110136004)(81156014)(81166006)(5003940100001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR05MB3510; H:promb-2s-dhcp95-136.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX: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; CY4PR05MB3510; 23:CC9zgD3dLBjQ75XtRYHVVBJsDs/JqYVKFNclm7O70?= =?us-ascii?Q?nJjOzBQWcxjHzWPfqCTBKLEMd0WOcZ5bbqEdrrV5Rjs85TeY1k+8cPaEBiPE?= =?us-ascii?Q?BAe5EROwqTr/HwBVjAvqgZDt9AMeNOGqgL8UWVdX4yaa/tOpl25aMAXJ8A9i?= =?us-ascii?Q?lPYadTXiE7IzSB7O0AiGZwdVwD1mIsKfAiJ13PWbNnbXLXYzV+I0zhwUiZut?= =?us-ascii?Q?b6YsjzF8vK2BGRGOzQJQz8PCMHVOu2hij7FkWxHp8sWOY5R/FV1j/HER2jUw?= =?us-ascii?Q?i1HCleMcaYF6RzH6wS82FHnSWnEphQoTRWxipWXq4FbsD80IGKLoqdxidBPd?= =?us-ascii?Q?yLE8dZlZkqNv8M2pfdyxVoxXJnUpp1q53T7JU9H8RE265wdQFc81aqjU3XCg?= =?us-ascii?Q?91Q7s3WKHQ4uccG0pEHaArGOrvtK2EScosvhd70e63N9ZFaYFx86MyaoUGr7?= =?us-ascii?Q?F3GSlsP2jeVsqA5BDMma7mCTj6mE95hRfQmaH4YydizbXXp2vVIcCefxx3fg?= =?us-ascii?Q?ilaDQOpACWCf3p3ZWdQNicjAeuRuRd3KEdcZfsseIqtGDRCNJVXqEm80Hti3?= =?us-ascii?Q?crPUWgplN+EqW584Q5qSEq5LFGM+X5FVlkDl5dzr+fl1ynz4hTKJMJ6Oagdd?= =?us-ascii?Q?kdlqpBazStiaWKHTvG6ElIjSqf05m+bkcW9twU5t7UZ370lL0i6b9Q7lfMp5?= =?us-ascii?Q?USuJtVUAholuJfbro2vcnuP7jr2wRXxF6jUaHBleOrr9KCyCxyvuTgKhjBir?= =?us-ascii?Q?CuRS5r4U1Zvog0djpiwBtzIcACn3xX/4OKhkHJbZvBE/LBFNXaXc7tlXzLiO?= =?us-ascii?Q?nrfZTajh6+DC5yxPbzaKuXs4IGki1KhjUP7D4BPzZ1yRX5PyPcVzfJ5qhEt2?= =?us-ascii?Q?lMty9KP198lHEuGmyZKt6jR3ZLnTqp5g5K8FP54f2eGiwO6zGDuJku84ylb0?= =?us-ascii?Q?DaUDSjJ2p437nYgYbkTuI+UOvQdF/GllfXIyd0lFuHD2kcPbAFxLYmNXzg9w?= =?us-ascii?Q?bxnA2u+eTRSBXHyttp8xgGASOkyZ/ickoAgatjtsUdMokrUfv7D8nLeHf97N?= =?us-ascii?Q?gR3Gyg+s6RKSh6FLeLAOj9d5/JlVWKS8URw6K303iZsq28dcKgdzEr0qsLtP?= =?us-ascii?Q?Ga4doUaDVuC0gUNEHoEit66YL3ZesFWPyCDjUsU/JZkp4uswBIqXHKD7moU3?= =?us-ascii?Q?wURDa/kJ033DfhrjasRma9CxxvJKugvUVO/tz6PIUlT1Fh1SeCWfMYftg=3D?= =?us-ascii?Q?=3D?= X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3510; 6:teFaEFvut8dhORPCFipPV2bffzyIuvz34wwBQZk7zRREE9LYcWdlN4wgLTjbZSSSbv4IqSDpqx69/hjSUJzdmzovl3A5ak9QfNWvHM5FKFJUoKZlVSAJmbSZbnBshgqpEzEgYNBU1PSofOtCyljXDXD89erS51f1ZxgVaVo2+ux78t5nBJ8/HU1MpgdBVStvoCG+G7DQj8DytI5nU8dLh7IX6dLe79jehW3qETgft5M0q2ukpedQLJP/OMgUsRJn6T4y4RZ7WFrzTXj345hdXNPdP+v2lTeStQI0LiiahixxtqCKjOGpQVUU1gu3yCfcsBaE5W95C1DkffyrIan9hg==; 5:om3uFCv3HQojsPXwnHpMO4/vlCoZtHYYf8cNGh+bIgX0T8hbLftUNlRmPben6lS+MXSBTgjr6rt/hB8FqRm79a9Eunx0EWQZI+CNj8Ds6S7MsWf1AIHWCGlDDt0Ib+qYMnEmSkiPZ8mz1QFP7s7qcA==; 24:p8fYwfPb79OLcBmfKQAr+FvD9q/jCTdW3lc6EtMvDLnqKfCTKh3mubskGtUBlA7UfAChq8P/v2FSztb5lruI17r7n7SfLBUskRViTm4psak=; 7:M0RObJTjaI37di9RCe8rIyJJf64eeZ2S7pG8zCAA3hS1rh8+vPlU05YixUd0HdNskDIJw8Zf3SL9c7lo8WiZXTnu4S+ALK8wet3BueNAlHgGRFE5Mmv3AyRM8pTq2xNrkpR0SDe2fbisH+t9VsCcO9Kp+iki+JwNJPtFaJrCsknV4qx9J3udX/pyvBaYqEllaYzfDw7SRNKSNKuyGs0rY+5Y8DDqbDGmcFPa4YdMxPo= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR05MB3510; 20:EMeYAmRHByH4/3STIMJ2HYyPleBhteANsjkzC9mNrzBnC9XI5s1yotY4Xl39gM1dOobvmrPfheGYVjEYn4bJftwF2Ivaj0e+KwxHIKLUuI4WMFHuXo8qJt7xmFoZ5wqpKtPet9zCARwbJVoeTvIw1ornAOpivUvIKiGOUbWdRTw= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2017 07:49:21.2617 (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: Bryan Tan There is a chance of a race between arming the CQ and receiving completions. By reporting CQ missed events any ULPs should poll again to get the completions. Fixes: 29c8d9eba550 ("IB: Add vmw_pvrdma driver") Acked-by: Aditya Sarwade Signed-off-by: Bryan Tan Signed-off-by: Adit Ranadive Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c index 69bda61..f4ab5fa 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_cq.c @@ -65,12 +65,27 @@ int pvrdma_req_notify_cq(struct ib_cq *ibcq, struct pvrdma_dev *dev = to_vdev(ibcq->device); struct pvrdma_cq *cq = to_vcq(ibcq); u32 val = cq->cq_handle; + unsigned long flags; val |= (notify_flags & IB_CQ_SOLICITED_MASK) == IB_CQ_SOLICITED ? PVRDMA_UAR_CQ_ARM_SOL : PVRDMA_UAR_CQ_ARM; + spin_lock_irqsave(&cq->cq_lock, flags); + pvrdma_write_uar_cq(dev, val); + if (notify_flags & IB_CQ_REPORT_MISSED_EVENTS) { + unsigned int head; + + if (pvrdma_idx_ring_has_data(&cq->ring_state->rx, + cq->ibcq.cqe, &head)) { + spin_unlock_irqrestore(&cq->cq_lock, flags); + return 1; + } + } + + spin_unlock_irqrestore(&cq->cq_lock, flags); + return 0; }