From patchwork Wed Sep 16 11:03:03 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 47947 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8GB9eG3021106 for ; Wed, 16 Sep 2009 11:09:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751850AbZIPLJf (ORCPT ); Wed, 16 Sep 2009 07:09:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753814AbZIPLJf (ORCPT ); Wed, 16 Sep 2009 07:09:35 -0400 Received: from mail.mellanox.co.il ([194.90.237.43]:38400 "EHLO mellanox.co.il" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751850AbZIPLJf (ORCPT ); Wed, 16 Sep 2009 07:09:35 -0400 X-Greylist: delayed 400 seconds by postgrey-1.27 at vger.kernel.org; Wed, 16 Sep 2009 07:09:34 EDT Received: from Internal Mail-Server by MTLPINE1 (envelope-from eli@mellanox.co.il) with SMTP; 16 Sep 2009 14:03:56 +0300 Received: from localhost ([10.4.1.30]) by mtlexch01.mtl.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 16 Sep 2009 14:02:52 +0300 Date: Wed, 16 Sep 2009 14:03:03 +0300 From: Eli Cohen To: Roland Dreier Cc: general-list , linux-rdma@vger.kernel.org Subject: [PATCH] mlx4: confiugre cache line size Message-ID: <20090916110302.GA32767@mtls03> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-OriginalArrivalTime: 16 Sep 2009 11:02:52.0697 (UTC) FILETIME=[3C9AB090:01CA36BD] X-TM-AS-Product-Ver: SMEX-8.0.0.1181-5.600.1016-16890.004 X-TM-AS-Result: No--4.302100-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 ConnectX can work more efficiently if the CPU cache line size is confiugred to it at INIT_HCA. This patch configures cache line size for systems that report it. Signed-off-by: Eli Cohen --- drivers/net/mlx4/fw.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index 20526ce..aa38c06 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c @@ -699,6 +699,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) #define INIT_HCA_IN_SIZE 0x200 #define INIT_HCA_VERSION_OFFSET 0x000 #define INIT_HCA_VERSION 2 +#define INIT_HCA_CACHELINE_SZ_OFFSET 0x0e #define INIT_HCA_FLAGS_OFFSET 0x014 #define INIT_HCA_QPC_OFFSET 0x020 #define INIT_HCA_QPC_BASE_OFFSET (INIT_HCA_QPC_OFFSET + 0x10) @@ -736,6 +737,12 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) *((u8 *) mailbox->buf + INIT_HCA_VERSION_OFFSET) = INIT_HCA_VERSION; +#if defined(cache_line_size) + *((u8 *) mailbox->buf + INIT_HCA_CACHELINE_SZ_OFFSET) = + order_base_2(cache_line_size() / 16) << 5; +#endif + + #if defined(__LITTLE_ENDIAN) *(inbox + INIT_HCA_FLAGS_OFFSET / 4) &= ~cpu_to_be32(1 << 1); #elif defined(__BIG_ENDIAN)