From patchwork Mon Aug 16 22:16:44 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vu Pham X-Patchwork-Id: 119817 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7GMOoIQ011875 for ; Mon, 16 Aug 2010 22:25:46 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756671Ab0HPWZq (ORCPT ); Mon, 16 Aug 2010 18:25:46 -0400 Received: from p02c12o145.mxlogic.net ([208.65.145.78]:36459 "EHLO p02c12o145.mxlogic.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756515Ab0HPWZp (ORCPT ); Mon, 16 Aug 2010 18:25:45 -0400 Received: from unknown [63.251.237.3] (EHLO p02c12o145.mxlogic.net) by p02c12o145.mxlogic.net(mxl_mta-6.7.0-0) with ESMTP id 9eab96c4.79055940.24797.00-557.55475.p02c12o145.mxlogic.net (envelope-from ); Mon, 16 Aug 2010 16:25:45 -0600 (MDT) X-MXL-Hash: 4c69bae9090a231b-9cfb9a6c4d314e1fea6ac9990ce83b8610c466fb Received: from unknown [63.251.237.3] by p02c12o145.mxlogic.net(mxl_mta-6.7.0-0) with SMTP id cc8b96c4.0.23128.00-388.51852.p02c12o145.mxlogic.net (envelope-from ); Mon, 16 Aug 2010 16:16:46 -0600 (MDT) X-MXL-Hash: 4c69b8ce56adcd90-4cc554b7562001271e4aaa01caa82a7d4549dace Received: from vu-lt.mti.mtl.com ([10.2.1.17]) by mtiexch01.mti.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 16 Aug 2010 15:21:08 -0700 Message-ID: <4C69B8CC.3070505@mellanox.com> Date: Mon, 16 Aug 2010 15:16:44 -0700 From: Vu Pham User-Agent: Thunderbird 2.0.0.23 (X11/20090812) MIME-Version: 1.0 To: Roland Dreier CC: OpenFabrics EWG , Linux RDMA , Oren Duer Subject: [PATCH v1 07/10] mlx4_core: Enable T11 support bit in mlx4 device X-OriginalArrivalTime: 16 Aug 2010 22:21:08.0046 (UTC) FILETIME=[52E4A6E0:01CB3D91] X-Spam: [F=0.2000000000; CM=0.500; S=0.200(2010073001)] X-MAIL-FROM: X-SOURCE-IP: [63.251.237.3] X-AnalysisOut: [v=1.0 c=1 a=wK7iOBmxUKoA:10 a=VphdPIyG4kEA:10 a=xupnbh4h0Y] X-AnalysisOut: [LOHZnncC45HQ==:17 a=37r9H06TAAAA:8 a=CbDCq_QkAAAA:8 a=kpVB] X-AnalysisOut: [EHK5DUD6JJhsG1MA:9 a=NCU_XMOS-6cKBkjuPrcA:7 a=K_Ii8Q5JeJfn] X-AnalysisOut: [v7hQDRFKiDVlGyAA:4 a=E3yz0KKPV6YA:10] 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]); Mon, 16 Aug 2010 22:25:46 +0000 (UTC) From 85efcd1d8e1fae3bd5293d923eaf1aa50d54cbce Mon Sep 17 00:00:00 2001 From: Vu Pham Date: Fri, 13 Aug 2010 10:01:31 -0700 Subject: [PATCH 07/10] mlx4_core: Enable T11 support bit in mlx4 device Enable T11 support bit in mlx4 device Add bool parameter to enable/disable pre_t11 support Add inteface to query the mode Signed-off-by: Oren Duer Signed-off-by: Vu pham --- drivers/net/mlx4/fw.c | 13 +++++++++++++ include/linux/mlx4/device.h | 5 ++++- 2 files changed, 17 insertions(+), 1 deletions(-) diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index 04f42ae..20bee0f 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c @@ -51,6 +51,10 @@ static int enable_qos; module_param(enable_qos, bool, 0444); MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (default: off)"); +static int mlx4_pre_t11; +module_param_named(pre_t11_mode, mlx4_pre_t11, bool, 0644); +MODULE_PARM_DESC(pre_t11_mode, "For FCoXX, enable pre-t11 mode (default: off)"); + #define MLX4_GET(dest, source, offset) \ do { \ void *__p = (char *) (source) + (offset); \ @@ -792,6 +796,8 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev, struct mlx4_init_hca_param *param) MLX4_PUT(inbox, (u8) (PAGE_SHIFT - 12), INIT_HCA_UAR_PAGE_SZ_OFFSET); MLX4_PUT(inbox, param->log_uar_sz, INIT_HCA_LOG_UAR_SZ_OFFSET); + if (!mlx4_pre_t11 && dev->caps.flags & (u32) MLX4_DEV_CAP_FLAG_FC_T11) + *(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 10); err = mlx4_cmd(dev, mailbox->dma, 0, 0, MLX4_CMD_INIT_HCA, 10000); @@ -890,3 +896,10 @@ int mlx4_NOP(struct mlx4_dev *dev) /* Input modifier of 0x1f means "finish as soon as possible." */ return mlx4_cmd(dev, 0, 0x1f, 0, MLX4_CMD_NOP, 100); } + +void mlx4_get_fc_t11_settings(struct mlx4_dev *dev, int *pre_t11, int *t11) +{ + *pre_t11 = mlx4_pre_t11; + *t11 = dev->caps.flags & MLX4_DEV_CAP_FLAG_FC_T11; +} +EXPORT_SYMBOL_GPL(mlx4_get_fc_t11_settings); diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 8afac02..46966bb 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -67,7 +67,8 @@ enum { MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, - MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21 + MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, + MLX4_DEV_CAP_FLAG_FC_T11 = 1 << 31 }; enum { @@ -491,4 +492,6 @@ int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr); int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); int mlx4_SYNC_TPT(struct mlx4_dev *dev); +void mlx4_get_fc_t11_settings(struct mlx4_dev *dev, int *pre_t11, int *t11); + #endif /* MLX4_DEVICE_H */ -- 1.6.3.3