From patchwork Mon Oct 25 14:38:59 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 267062 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9PEb14A009096 for ; Mon, 25 Oct 2010 14:38:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754591Ab0JYOil (ORCPT ); Mon, 25 Oct 2010 10:38:41 -0400 Received: from mail-bw0-f46.google.com ([209.85.214.46]:56572 "EHLO mail-bw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974Ab0JYOil (ORCPT ); Mon, 25 Oct 2010 10:38:41 -0400 Received: by bwz11 with SMTP id 11so2415332bwz.19 for ; Mon, 25 Oct 2010 07:38:39 -0700 (PDT) Received: by 10.204.53.4 with SMTP id k4mr4283446bkg.145.1288017518654; Mon, 25 Oct 2010 07:38:38 -0700 (PDT) Received: from localhost ([82.166.227.17]) by mx.google.com with ESMTPS id 4sm4881567bki.13.2010.10.25.07.38.36 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 25 Oct 2010 07:38:36 -0700 (PDT) Date: Mon, 25 Oct 2010 16:38:59 +0200 From: Eli Cohen To: Roland Dreier Cc: RDMA list Subject: [PATCH] mlx4_core: Fix modify CQ Message-ID: <20101025143859.GA8420@mtldesk30> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 25 Oct 2010 14:38:42 +0000 (UTC) diff --git a/drivers/net/mlx4/cq.c b/drivers/net/mlx4/cq.c index 7cd34e9..24bf440 100644 --- a/drivers/net/mlx4/cq.c +++ b/drivers/net/mlx4/cq.c @@ -149,6 +149,13 @@ int mlx4_cq_modify(struct mlx4_dev *dev, struct mlx4_cq *cq, cq_context = mailbox->buf; memset(cq_context, 0, sizeof *cq_context); + + if (count | period) { + if (!count) + count = 0xffff; + else if (!period) + period = 0xffff; + } cq_context->cq_max_count = cpu_to_be16(count); cq_context->cq_period = cpu_to_be16(period);