From patchwork Mon Nov 2 06:37:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Devesh Sharma X-Patchwork-Id: 7534251 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D161D9FBE7 for ; Mon, 2 Nov 2015 06:56:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0662C20320 for ; Mon, 2 Nov 2015 06:56:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 25DB720377 for ; Mon, 2 Nov 2015 06:56:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752182AbbKBG4N (ORCPT ); Mon, 2 Nov 2015 01:56:13 -0500 Received: from cmrelayp1.emulex.com ([138.239.112.140]:53001 "EHLO CMRELAYP1.ad.emulex.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752478AbbKBG4M (ORCPT ); Mon, 2 Nov 2015 01:56:12 -0500 X-Greylist: delayed 1021 seconds by postgrey-1.27 at vger.kernel.org; Mon, 02 Nov 2015 01:56:11 EST Received: from neo01-el71.iig.avagotech.net ([10.192.205.132]) by CMRELAYP1.ad.emulex.com with Microsoft SMTPSVC(7.5.7601.17514); Sun, 1 Nov 2015 22:37:33 -0800 From: Devesh Sharma To: linux-rdma@vger.kernel.org Cc: Devesh Sharma Subject: [PATCH 3/4] RDMA/libocrdma: Prevent CQ-Doorbell floods Date: Mon, 2 Nov 2015 01:37:24 -0500 Message-Id: <1446446245-534-4-git-send-email-devesh.sharma@avagotech.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1446446245-534-1-git-send-email-devesh.sharma@avagotech.com> References: <1446446245-534-1-git-send-email-devesh.sharma@avagotech.com> X-OriginalArrivalTime: 02 Nov 2015 06:37:33.0833 (UTC) FILETIME=[F4B54F90:01D11538] Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changing CQ-Doorbell(DB) logic to prevent DB floods, it is supposed to be pressed only if any hw CQE is polled. If cq-arm was requested previously then don't bother about number of hw CQEs polled and arm the CQ. Signed-off-by: Devesh Sharma --- src/ocrdma_verbs.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/ocrdma_verbs.c b/src/ocrdma_verbs.c index d80ab27..cf6f72c 100644 --- a/src/ocrdma_verbs.c +++ b/src/ocrdma_verbs.c @@ -2003,14 +2003,11 @@ expand_cqe: } stop_cqe: cq->getp = cur_getp; - if (cq->deferred_arm) { - ocrdma_ring_cq_db(cq, 1, cq->deferred_sol, polled_hw_cqes); + if (cq->deferred_arm || polled_hw_cqes) { + ocrdma_ring_cq_db(cq, cq->deferred_arm, + cq->deferred_sol, polled_hw_cqes); cq->deferred_arm = 0; cq->deferred_sol = 0; - } else { - /* We need to pop the CQE. No need to arm */ - ocrdma_ring_cq_db(cq, 0, cq->deferred_sol, polled_hw_cqes); - cq->deferred_sol = 0; } return i;