From patchwork Thu May 6 07:49:40 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 97285 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o467mUvq000398 for ; Thu, 6 May 2010 07:48:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752750Ab0EFHs3 (ORCPT ); Thu, 6 May 2010 03:48:29 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:37923 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752555Ab0EFHs3 (ORCPT ); Thu, 6 May 2010 03:48:29 -0400 Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@dev.mellanox.co.il) with SMTP; 6 May 2010 10:48:24 +0300 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 6 May 2010 10:48:23 +0300 Date: Thu, 6 May 2010 10:49:40 +0300 From: Eli Cohen To: Roland Dreier Cc: tziporet@dev.mellanox.co.il, Jason Gunthorpe , Linux RDMA list , Eli Cohen , ewg , yevgenyp@mellanox.co.il Subject: Re: [ewg] [PATCH] mlx4_core: request MSIX vectors as much as there CPU cores Message-ID: <20100506074940.GA23576@mtldesk030.lab.mtl.com> References: <20100505113047.GA12242@mtldesk030.lab.mtl.com> <20100505163252.GG15969@obsidianresearch.com> <4BE1C82F.4000009@mellanox.co.il> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-OriginalArrivalTime: 06 May 2010 07:48:24.0008 (UTC) FILETIME=[815C0C80:01CAECF0] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-6.000.1038-17366.004 X-TM-AS-Result: No--12.920000-8.000000-31 X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No 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 (demeter.kernel.org [140.211.167.41]); Thu, 06 May 2010 07:48:31 +0000 (UTC) diff --git a/drivers/net/mlx4/en_cq.c b/drivers/net/mlx4/en_cq.c index 21786ad..07c0779 100644 --- a/drivers/net/mlx4/en_cq.c +++ b/drivers/net/mlx4/en_cq.c @@ -49,11 +49,12 @@ int mlx4_en_create_cq(struct mlx4_en_priv *priv, { struct mlx4_en_dev *mdev = priv->mdev; int err; + int num_active_vectors = min_t(int, num_online_cpus(), mdev->dev->caps.num_comp_vectors); cq->size = entries; if (mode == RX) { cq->buf_size = cq->size * sizeof(struct mlx4_cqe); - cq->vector = ring % mdev->dev->caps.num_comp_vectors; + cq->vector = ring % num_active_vectors; } else { cq->buf_size = sizeof(struct mlx4_cqe); cq->vector = 0;