From patchwork Tue Aug 6 15:34:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vipul Pandya X-Patchwork-Id: 2839444 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 76C7ABF535 for ; Tue, 6 Aug 2013 15:42:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5CD36201BA for ; Tue, 6 Aug 2013 15:42:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41C51201C0 for ; Tue, 6 Aug 2013 15:41:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755846Ab3HFPlz (ORCPT ); Tue, 6 Aug 2013 11:41:55 -0400 Received: from stargate.chelsio.com ([67.207.112.58]:1470 "EHLO stargate.chelsio.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755607Ab3HFPlz (ORCPT ); Tue, 6 Aug 2013 11:41:55 -0400 Received: from maui.asicdesigners.com (maui.asicdesigners.com [10.192.180.15]) by stargate.chelsio.com (8.13.1/8.13.1) with SMTP id r76FfqKF011138; Tue, 6 Aug 2013 08:41:52 -0700 Received: from strawberry.blr.asicdesigners.com.com ([10.193.185.96]) by maui.asicdesigners.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 6 Aug 2013 08:41:51 -0700 From: Vipul Pandya To: linux-rdma@vger.kernel.org Cc: roland@purestorage.com, divy@chelsio.com, swise@opengridcomputing.com, vipul@chelsio.com, nirranjan@chelsio.com Subject: [PATCH 6/8] RDMA/cxgb4: Always do GTS write if cidx_inc == CIDXINC_MASK. Date: Tue, 6 Aug 2013 21:04:38 +0530 Message-Id: <1375803280-7916-7-git-send-email-vipul@chelsio.com> X-Mailer: git-send-email 1.8.0 In-Reply-To: <1375803280-7916-1-git-send-email-vipul@chelsio.com> References: <1375803280-7916-1-git-send-email-vipul@chelsio.com> X-OriginalArrivalTime: 06 Aug 2013 15:41:52.0055 (UTC) FILETIME=[789F0470:01CE92BB] 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, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Steve Wise When polling, we do a GTS update if the accumulated cidx_inc == the CQ depth / 16. However, if the CQ is large enough, Cq depth / 16 exceeds the size of the field in the GTS word. So we also need to update if cidx_inc hits CIDXINC_MASK to avoid overflowing the field. Signed-off-by: Steve Wise Signed-off-by: Vipul Pandya --- drivers/infiniband/hw/cxgb4/t4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/cxgb4/t4.h b/drivers/infiniband/hw/cxgb4/t4.h index 3a6a289..1272dfe 100644 --- a/drivers/infiniband/hw/cxgb4/t4.h +++ b/drivers/infiniband/hw/cxgb4/t4.h @@ -531,7 +531,7 @@ static inline void t4_swcq_consume(struct t4_cq *cq) static inline void t4_hwcq_consume(struct t4_cq *cq) { cq->bits_type_ts = cq->queue[cq->cidx].bits_type_ts; - if (++cq->cidx_inc == (cq->size >> 4)) { + if (++cq->cidx_inc == (cq->size >> 4) || cq->cidx_inc == CIDXINC_MASK) { u32 val; val = SEINTARM(0) | CIDXINC(cq->cidx_inc) | TIMERREG(7) |