From patchwork Wed Nov 10 12:23:34 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eli Cohen X-Patchwork-Id: 313822 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 oAACNPLc008732 for ; Wed, 10 Nov 2010 12:23:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755704Ab0KJMXh (ORCPT ); Wed, 10 Nov 2010 07:23:37 -0500 Received: from mail-ww0-f44.google.com ([74.125.82.44]:34154 "EHLO mail-ww0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755600Ab0KJMXh (ORCPT ); Wed, 10 Nov 2010 07:23:37 -0500 Received: by wwb39 with SMTP id 39so668558wwb.1 for ; Wed, 10 Nov 2010 04:23:36 -0800 (PST) Received: by 10.216.231.82 with SMTP id k60mr8224791weq.64.1289391814118; Wed, 10 Nov 2010 04:23:34 -0800 (PST) Received: from localhost ([82.166.227.17]) by mx.google.com with ESMTPS id y80sm388199weq.3.2010.11.10.04.23.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 10 Nov 2010 04:23:33 -0800 (PST) Date: Wed, 10 Nov 2010 14:23:34 +0200 From: Eli Cohen To: Roland Dreier Cc: RDMA list Subject: [PATCH 1/3] IB mlx4: extend the number of device flags Message-ID: <20101110122334.GB12037@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]); Wed, 10 Nov 2010 12:23:38 +0000 (UTC) diff --git a/drivers/net/mlx4/fw.c b/drivers/net/mlx4/fw.c index b68eee2..9e73f22 100644 --- a/drivers/net/mlx4/fw.c +++ b/drivers/net/mlx4/fw.c @@ -75,7 +75,7 @@ MODULE_PARM_DESC(enable_qos, "Enable Quality of Service support in the HCA (defa } \ } while (0) -static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags) +static void dump_dev_cap_flags(struct mlx4_dev *dev, u64 flags) { static const char *fname[] = { [ 0] = "RC transport", @@ -105,7 +105,7 @@ static void dump_dev_cap_flags(struct mlx4_dev *dev, u32 flags) mlx4_dbg(dev, "DEV_CAP flags:\n"); for (i = 0; i < ARRAY_SIZE(fname); ++i) - if (fname[i] && (flags & (1 << i))) + if (fname[i] && (flags & (1LL << i))) mlx4_dbg(dev, " %s\n", fname[i]); } @@ -147,6 +147,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) u16 stat_rate; int err; int i; + u32 tmp1, tmp2; #define QUERY_DEV_CAP_OUT_SIZE 0x100 #define QUERY_DEV_CAP_MAX_SRQ_SZ_OFFSET 0x10 @@ -180,6 +181,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) #define QUERY_DEV_CAP_MAX_GID_OFFSET 0x3b #define QUERY_DEV_CAP_RATE_SUPPORT_OFFSET 0x3c #define QUERY_DEV_CAP_MAX_PKEY_OFFSET 0x3f +#define QUERY_DEV_CAP_EXT_FLAGS_OFFSET 0x40 #define QUERY_DEV_CAP_UDP_RSS_OFFSET 0x42 #define QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET 0x43 #define QUERY_DEV_CAP_FLAGS_OFFSET 0x44 @@ -276,7 +278,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) dev_cap->udp_rss = field & 0x1; MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET); dev_cap->loopback_support = field & 0x1; - MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); + MLX4_GET(tmp1, outbox, QUERY_DEV_CAP_EXT_FLAGS_OFFSET); + MLX4_GET(tmp2, outbox, QUERY_DEV_CAP_FLAGS_OFFSET); + dev_cap->flags = tmp2 | (u64)tmp1 << 32; MLX4_GET(field, outbox, QUERY_DEV_CAP_RSVD_UAR_OFFSET); dev_cap->reserved_uars = field >> 4; MLX4_GET(field, outbox, QUERY_DEV_CAP_UAR_SZ_OFFSET); diff --git a/drivers/net/mlx4/fw.h b/drivers/net/mlx4/fw.h index 65cc72e..f8de6b1 100644 --- a/drivers/net/mlx4/fw.h +++ b/drivers/net/mlx4/fw.h @@ -80,7 +80,7 @@ struct mlx4_dev_cap { u16 stat_rate_support; int udp_rss; int loopback_support; - u32 flags; + u64 flags; int reserved_uars; int uar_size; int min_page_sz; @@ -113,6 +113,8 @@ struct mlx4_dev_cap { u8 supported_port_types[MLX4_MAX_PORTS + 1]; u8 log_max_macs[MLX4_MAX_PORTS + 1]; u8 log_max_vlans[MLX4_MAX_PORTS + 1]; + u32 max_basic_counters; + u32 max_ext_counters; }; struct mlx4_adapter { diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index a7b15bc..de5971a 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h @@ -234,7 +234,7 @@ struct mlx4_caps { int mtt_entry_sz; u32 max_msg_sz; u32 page_size_cap; - u32 flags; + u64 flags; u32 bmme_flags; u32 reserved_lkey; u16 stat_rate_support;