All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/9] IBoE updates: GID change event and network flow counters
@ 2011-06-15 14:38 Or Gerlitz
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:38 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma, Eli Cohen

Roland,

The enclosed patch series enhances the IBoE kernel stack to
use GID change event and network flow counters.

This work is based on earlier patches done by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
posted during Nov/2010 see http://marc.info/?l=linux-rdma&m=128939180605962

The first change is used to avoid using the irrelevant LID change
event for updating the IB core GID cache, and is made of two patches:

[PATCH 1/9] ib/core: Add GID change event
[PATCH 2/9] ib/mlx4: use GID change event on IBoE code

The second change is used such that eventually we're able to
implement port level packets/bytes performance counters for
IBoE and is made of seven patches:

[PATCH 3/9] mlx4: extend cap flags to 64 bit
[PATCH 4/9] mlx4: align current extended capabilities to use the flags field
[PATCH 5/9] mlx4: Fix layout of QP context for correct location of counter index
[PATCH 6/9] mlx4: add network flow counters
[PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
[PATCH 8/9] ib/mlx4: use flow counters on IBoE ports
[PATCH 9/9] ib/mlx4: support PMA counters for IBoE

patches #3 and #4 change the mlx4 driver such that it now uses
a 64 bit capability flags. This extended cap flags field is used
to account for currently implemented extended capabilities (e.g
udp_rss, uc/mc vep steering, etc) and for the flow counters capability.
These two patches are light in the sense that they don't add/remove
any functionality from the driver.

patch #5 is a bug fix for driver view of the mlx4 QP context
layout w.r.t to the counter index location.

patch #6 adds mlx4 support for network flow counters, where such counter
can be pointed by a set containing one or more QPs and track receive and
transmit packets and bytes of these QPs.

patch #7 moves the various definitions and mad structures related to IBA
PM agent from the ipath and qib drivers into a single include file, so we
can later use them for IBoE and avoid the current code duplication...

patches #8 and #9 bring the actual IBoE use of the counters,
done through allocating flow counter per Ethernet/IBoE port,
such that this counter is later pointed by all mlx4_ib QPs created
on that port. Later this counter can be queried so get a port level
packets/bytes performance counters ala IB

Or.


 drivers/infiniband/core/cache.c         |    3
 drivers/infiniband/hw/ipath/ipath_mad.c |  134 ------------------------
 drivers/infiniband/hw/mlx4/mad.c        |   68 ++++++++++++
 drivers/infiniband/hw/mlx4/main.c       |   22 +++-
 drivers/infiniband/hw/mlx4/mlx4_ib.h    |    1
 drivers/infiniband/hw/mlx4/qp.c         |   10 +
 drivers/infiniband/hw/qib/qib_mad.h     |  176 --------------------------------
 drivers/net/mlx4/en_ethtool.c           |    9 -
 drivers/net/mlx4/en_main.c              |    3
 drivers/net/mlx4/en_netdev.c            |    5
 drivers/net/mlx4/en_port.c              |    6 -
 drivers/net/mlx4/en_selftest.c          |    3
 drivers/net/mlx4/fw.c                   |   39 ++++---
 drivers/net/mlx4/fw.h                   |    8 -
 drivers/net/mlx4/main.c                 |   62 ++++++++++-
 drivers/net/mlx4/mcg.c                  |   17 +--
 drivers/net/mlx4/mlx4.h                 |    1
 drivers/net/mlx4/port.c                 |    8 -
 include/linux/mlx4/cmd.h                |    3
 include/linux/mlx4/device.h             |   60 ++++++----
 include/linux/mlx4/qp.h                 |    8 -
 include/rdma/ib_verbs.h                 |    3
 22 files changed, 262 insertions(+), 387 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 1/9] ib/core: Add GID change event
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
@ 2011-06-15 14:39   ` Or Gerlitz
  2011-06-15 14:40   ` [PATCH 2/9] ib/mlx4: use GID change event on IBoE code Or Gerlitz
                     ` (7 subsequent siblings)
  8 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:39 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Add IB GID change event. This is needed for IBoE when the HW driver
updates the GID (e.g when new vlans are added/deleted) table and the
change should be reflected to the IB core cache.

Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/core/cache.c |    3 ++-
 include/rdma/ib_verbs.h         |    3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

Index: b/drivers/infiniband/core/cache.c
===================================================================
--- a/drivers/infiniband/core/cache.c
+++ b/drivers/infiniband/core/cache.c
@@ -302,7 +302,8 @@ static void ib_cache_event(struct ib_eve
 	    event->event == IB_EVENT_LID_CHANGE  ||
 	    event->event == IB_EVENT_PKEY_CHANGE ||
 	    event->event == IB_EVENT_SM_CHANGE   ||
-	    event->event == IB_EVENT_CLIENT_REREGISTER) {
+	    event->event == IB_EVENT_CLIENT_REREGISTER ||
+	    event->event == IB_EVENT_GID_CHANGE) {
 		work = kmalloc(sizeof *work, GFP_ATOMIC);
 		if (work) {
 			INIT_WORK(&work->work, ib_cache_task);
Index: b/include/rdma/ib_verbs.h
===================================================================
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -350,7 +350,8 @@ enum ib_event_type {
 	IB_EVENT_SRQ_ERR,
 	IB_EVENT_SRQ_LIMIT_REACHED,
 	IB_EVENT_QP_LAST_WQE_REACHED,
-	IB_EVENT_CLIENT_REREGISTER
+	IB_EVENT_CLIENT_REREGISTER,
+	IB_EVENT_GID_CHANGE,
 };

 struct ib_event {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 2/9] ib/mlx4: use GID change event on IBoE code
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 14:39   ` [PATCH 1/9] ib/core: Add GID change event Or Gerlitz
@ 2011-06-15 14:40   ` Or Gerlitz
  2011-06-15 14:41   ` [PATCH 3/9] mlx4: extend cap flags to 64 bit Or Gerlitz
                     ` (6 subsequent siblings)
  8 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:40 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

As IBoE doesn't use LIDs, use the GID change event to
update the IB core cache for addition/deletion of GIDs.

Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: b/drivers/infiniband/hw/mlx4/main.c
===================================================================
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -816,7 +816,7 @@ static void update_gids_task(struct work
 		memcpy(gw->dev->iboe.gid_table[gw->port - 1], gw->gids, sizeof gw->gids);
 		event.device = &gw->dev->ib_dev;
 		event.element.port_num = gw->port;
-		event.event    = IB_EVENT_LID_CHANGE;
+		event.event    = IB_EVENT_GID_CHANGE;
 		ib_dispatch_event(&event);
 	}


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 3/9] mlx4: extend cap flags to 64 bit
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 14:39   ` [PATCH 1/9] ib/core: Add GID change event Or Gerlitz
  2011-06-15 14:40   ` [PATCH 2/9] ib/mlx4: use GID change event on IBoE code Or Gerlitz
@ 2011-06-15 14:41   ` Or Gerlitz
  2011-06-15 14:42   ` [PATCH 4/9] mlx4: align current extended capabilities to use the flags field Or Gerlitz
                     ` (5 subsequent siblings)
  8 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:41 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Towards adding another dword containing more device flags,
extend the device capabilities flags field from 32 to 64 bit.
Derived from patch by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

---
 drivers/net/mlx4/fw.c       |    9 +++++----
 drivers/net/mlx4/fw.h       |    2 +-
 include/linux/mlx4/device.h |   34 +++++++++++++++++-----------------
 3 files changed, 23 insertions(+), 22 deletions(-)

Index: b/drivers/net/mlx4/fw.c
===================================================================
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -75,7 +75,7 @@ MODULE_PARM_DESC(enable_qos, "Enable Qua
 		}						      \
 	} 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 ml

 	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]);
 }

@@ -142,7 +142,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	struct mlx4_cmd_mailbox *mailbox;
 	u32 *outbox;
 	u8 field;
-	u32 field32;
+	u32 field32, flags;
 	u16 size;
 	u16 stat_rate;
 	int err;
@@ -279,7 +279,8 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET);
 	dev_cap->loopback_support = field & 0x1;
 	dev_cap->wol = field & 0x40;
-	MLX4_GET(dev_cap->flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
+	MLX4_GET(flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
+	dev_cap->flags = flags;
 	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);
Index: b/drivers/net/mlx4/fw.h
===================================================================
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -83,7 +83,7 @@ struct mlx4_dev_cap {
 	int vep_uc_steering;
 	int vep_mc_steering;
 	int wol;
-	u32 flags;
+	u64 flags;
 	int reserved_uars;
 	int uar_size;
 	int min_page_sz;
Index: b/include/linux/mlx4/device.h
===================================================================
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -58,22 +58,22 @@ enum {
 };

 enum {
-	MLX4_DEV_CAP_FLAG_RC		= 1 <<  0,
-	MLX4_DEV_CAP_FLAG_UC		= 1 <<  1,
-	MLX4_DEV_CAP_FLAG_UD		= 1 <<  2,
-	MLX4_DEV_CAP_FLAG_SRQ		= 1 <<  6,
-	MLX4_DEV_CAP_FLAG_IPOIB_CSUM	= 1 <<  7,
-	MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	= 1 <<  8,
-	MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	= 1 <<  9,
-	MLX4_DEV_CAP_FLAG_DPDP		= 1 << 12,
-	MLX4_DEV_CAP_FLAG_BLH		= 1 << 15,
-	MLX4_DEV_CAP_FLAG_MEM_WINDOW	= 1 << 16,
-	MLX4_DEV_CAP_FLAG_APM		= 1 << 17,
-	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_IBOE		= 1 << 30
+	MLX4_DEV_CAP_FLAG_RC		= 1LL <<  0,
+	MLX4_DEV_CAP_FLAG_UC		= 1LL <<  1,
+	MLX4_DEV_CAP_FLAG_UD		= 1LL <<  2,
+	MLX4_DEV_CAP_FLAG_SRQ		= 1LL <<  6,
+	MLX4_DEV_CAP_FLAG_IPOIB_CSUM	= 1LL <<  7,
+	MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR	= 1LL <<  8,
+	MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR	= 1LL <<  9,
+	MLX4_DEV_CAP_FLAG_DPDP		= 1LL << 12,
+	MLX4_DEV_CAP_FLAG_BLH		= 1LL << 15,
+	MLX4_DEV_CAP_FLAG_MEM_WINDOW	= 1LL << 16,
+	MLX4_DEV_CAP_FLAG_APM		= 1LL << 17,
+	MLX4_DEV_CAP_FLAG_ATOMIC	= 1LL << 18,
+	MLX4_DEV_CAP_FLAG_RAW_MCAST	= 1LL << 19,
+	MLX4_DEV_CAP_FLAG_UD_AV_PORT	= 1LL << 20,
+	MLX4_DEV_CAP_FLAG_UD_MCAST	= 1LL << 21,
+	MLX4_DEV_CAP_FLAG_IBOE		= 1LL << 30
 };

 enum {
@@ -253,7 +253,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;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 4/9] mlx4: align current extended capabilities to use the flags field
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
                     ` (2 preceding siblings ...)
  2011-06-15 14:41   ` [PATCH 3/9] mlx4: extend cap flags to 64 bit Or Gerlitz
@ 2011-06-15 14:42   ` Or Gerlitz
       [not found]     ` <alpine.LRH.2.00.1106151742330.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 14:43   ` [PATCH 5/NNN] mlx4: Fix layout of QP context for correct location of counter index Or Gerlitz
                     ` (4 subsequent siblings)
  8 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:42 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Query another dword containing up to 32 extended device capabilities,
such that the 64 bit dev cap flags field contains both the extended
and the non-extended device flags. Align the code which handles the
current extended device capabilities (e.g udp rss, wol, vep steering,
etc) to use the extended device cap flags field instead of a field per
extended capability. Initial patch done by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>


Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

---
 drivers/net/mlx4/en_ethtool.c  |    9 +++++----
 drivers/net/mlx4/en_main.c     |    3 ++-
 drivers/net/mlx4/en_netdev.c   |    5 +++--
 drivers/net/mlx4/en_port.c     |    6 ++++--
 drivers/net/mlx4/en_selftest.c |    3 ++-
 drivers/net/mlx4/fw.c          |   24 +++++++++++-------------
 drivers/net/mlx4/fw.h          |    5 -----
 drivers/net/mlx4/main.c        |    5 -----
 drivers/net/mlx4/mcg.c         |   17 ++++++++++-------
 drivers/net/mlx4/port.c        |    8 ++++----
 include/linux/mlx4/device.h    |   12 ++++++------
 11 files changed, 47 insertions(+), 50 deletions(-)

Index: b/drivers/net/mlx4/fw.c
===================================================================
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -99,7 +99,12 @@ static void dump_dev_cap_flags(struct ml
 		[21] = "UD multicast support",
 		[24] = "Demand paging support",
 		[25] = "Router support",
-		[30] = "IBoE support"
+		[30] = "IBoE support",
+		[32] = "Unicast loopback support",
+		[38] = "Wake On LAN support",
+		[40] = "UDP RSS support",
+		[41] = "Unicast VEP steering support",
+		[42] = "Multicast VEP steering support"
 	};
 	int i;

@@ -142,7 +147,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	struct mlx4_cmd_mailbox *mailbox;
 	u32 *outbox;
 	u8 field;
-	u32 field32, flags;
+	u32 field32, flags, ext_flags;
 	u16 size;
 	u16 stat_rate;
 	int err;
@@ -180,8 +185,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 #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_UDP_RSS_OFFSET		0x42
-#define QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET	0x43
+#define QUERY_DEV_CAP_EXT_FLAGS_OFFSET		0x40
 #define QUERY_DEV_CAP_FLAGS_OFFSET		0x44
 #define QUERY_DEV_CAP_RSVD_UAR_OFFSET		0x48
 #define QUERY_DEV_CAP_UAR_SZ_OFFSET		0x49
@@ -272,15 +276,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	dev_cap->max_msg_sz = 1 << (field & 0x1f);
 	MLX4_GET(stat_rate, outbox, QUERY_DEV_CAP_RATE_SUPPORT_OFFSET);
 	dev_cap->stat_rate_support = stat_rate;
-	MLX4_GET(field, outbox, QUERY_DEV_CAP_UDP_RSS_OFFSET);
-	dev_cap->udp_rss = field & 0x1;
-	dev_cap->vep_uc_steering = field & 0x2;
-	dev_cap->vep_mc_steering = field & 0x4;
-	MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET);
-	dev_cap->loopback_support = field & 0x1;
-	dev_cap->wol = field & 0x40;
+	MLX4_GET(ext_flags, outbox, QUERY_DEV_CAP_EXT_FLAGS_OFFSET);
 	MLX4_GET(flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
-	dev_cap->flags = flags;
+	dev_cap->flags = flags | (u64)ext_flags << 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);
@@ -802,7 +800,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev,
 	MLX4_PUT(inbox, param->mc_base,		INIT_HCA_MC_BASE_OFFSET);
 	MLX4_PUT(inbox, param->log_mc_entry_sz, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET);
 	MLX4_PUT(inbox, param->log_mc_hash_sz,  INIT_HCA_LOG_MC_HASH_SZ_OFFSET);
-	if (dev->caps.vep_mc_steering)
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		MLX4_PUT(inbox, (u8) (1 << 3),	INIT_HCA_UC_STEERING_OFFSET);
 	MLX4_PUT(inbox, param->log_mc_table_sz, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET);

Index: b/include/linux/mlx4/device.h
===================================================================
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -73,7 +73,12 @@ enum {
 	MLX4_DEV_CAP_FLAG_RAW_MCAST	= 1LL << 19,
 	MLX4_DEV_CAP_FLAG_UD_AV_PORT	= 1LL << 20,
 	MLX4_DEV_CAP_FLAG_UD_MCAST	= 1LL << 21,
-	MLX4_DEV_CAP_FLAG_IBOE		= 1LL << 30
+	MLX4_DEV_CAP_FLAG_IBOE		= 1LL << 30,
+	MLX4_DEV_CAP_FLAG_UC_LOOPBACK	= 1LL << 32,
+	MLX4_DEV_CAP_FLAG_WOL		= 1LL << 38,
+	MLX4_DEV_CAP_FLAG_UDP_RSS	= 1LL << 40,
+	MLX4_DEV_CAP_FLAG_VEP_UC_STEER	= 1LL << 41,
+	MLX4_DEV_CAP_FLAG_VEP_MC_STEER	= 1LL << 42
 };

 enum {
@@ -257,11 +262,6 @@ struct mlx4_caps {
 	u32			bmme_flags;
 	u32			reserved_lkey;
 	u16			stat_rate_support;
-	int			udp_rss;
-	int			loopback_support;
-	int			vep_uc_steering;
-	int			vep_mc_steering;
-	int			wol;
 	u8			port_width_cap[MLX4_MAX_PORTS + 1];
 	int			max_gso_sz;
 	int                     reserved_qps_cnt[MLX4_NUM_QP_REGION];
Index: b/drivers/net/mlx4/fw.h
===================================================================
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -78,11 +78,6 @@ struct mlx4_dev_cap {
 	u16 wavelength[MLX4_MAX_PORTS + 1];
 	u64 trans_code[MLX4_MAX_PORTS + 1];
 	u16 stat_rate_support;
-	int udp_rss;
-	int loopback_support;
-	int vep_uc_steering;
-	int vep_mc_steering;
-	int wol;
 	u64 flags;
 	int reserved_uars;
 	int uar_size;
Index: b/drivers/net/mlx4/main.c
===================================================================
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -226,11 +226,6 @@ static int mlx4_dev_cap(struct mlx4_dev
 	dev->caps.bmme_flags	     = dev_cap->bmme_flags;
 	dev->caps.reserved_lkey	     = dev_cap->reserved_lkey;
 	dev->caps.stat_rate_support  = dev_cap->stat_rate_support;
-	dev->caps.udp_rss	     = dev_cap->udp_rss;
-	dev->caps.loopback_support   = dev_cap->loopback_support;
-	dev->caps.vep_uc_steering    = dev_cap->vep_uc_steering;
-	dev->caps.vep_mc_steering    = dev_cap->vep_mc_steering;
-	dev->caps.wol		     = dev_cap->wol;
 	dev->caps.max_gso_sz	     = dev_cap->max_gso_sz;

 	dev->caps.log_num_macs  = log_num_mac;
Index: b/drivers/net/mlx4/en_main.c
===================================================================
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -106,7 +106,8 @@ static int mlx4_en_get_profile(struct ml

 	params->tcp_rss = tcp_rss;
 	params->udp_rss = udp_rss;
-	if (params->udp_rss && !mdev->dev->caps.udp_rss) {
+	if (params->udp_rss && !mdev->dev->caps.flags
+					& MLX4_DEV_CAP_FLAG_UDP_RSS) {
 		mlx4_warn(mdev, "UDP RSS is not supported on this device.\n");
 		params->udp_rss = 0;
 	}
Index: b/drivers/net/mlx4/en_ethtool.c
===================================================================
--- a/drivers/net/mlx4/en_ethtool.c
+++ b/drivers/net/mlx4/en_ethtool.c
@@ -135,7 +135,7 @@ static void mlx4_en_get_wol(struct net_d
 	int err = 0;
 	u64 config = 0;

-	if (!priv->mdev->dev->caps.wol) {
+	if (!priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL) {
 		wol->supported = 0;
 		wol->wolopts = 0;
 		return;
@@ -165,7 +165,7 @@ static int mlx4_en_set_wol(struct net_de
 	u64 config = 0;
 	int err = 0;

-	if (!priv->mdev->dev->caps.wol)
+	if (!priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)
 		return -EOPNOTSUPP;

 	if (wol->supported & ~WAKE_MAGIC)
@@ -201,7 +201,8 @@ static int mlx4_en_get_sset_count(struct
 		return NUM_ALL_STATS +
 			(priv->tx_ring_num + priv->rx_ring_num) * 2;
 	case ETH_SS_TEST:
-		return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.loopback_support) * 2;
+		return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags
+					& MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2;
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -251,7 +252,7 @@ static void mlx4_en_get_strings(struct n
 	case ETH_SS_TEST:
 		for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++)
 			strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
-		if (priv->mdev->dev->caps.loopback_support)
+		if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK)
 			for (; i < MLX4_EN_NUM_SELF_TEST; i++)
 				strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
 		break;
Index: b/drivers/net/mlx4/en_selftest.c
===================================================================
--- a/drivers/net/mlx4/en_selftest.c
+++ b/drivers/net/mlx4/en_selftest.c
@@ -159,7 +159,8 @@ retry_tx:
 				goto retry_tx;
 		}

-		if (priv->mdev->dev->caps.loopback_support){
+		if (priv->mdev->dev->caps.flags &
+					MLX4_DEV_CAP_FLAG_UC_LOOPBACK) {
 			buf[3] = mlx4_en_test_registers(priv);
 			buf[4] = mlx4_en_test_loopback(priv);
 		}
Index: b/drivers/net/mlx4/port.c
===================================================================
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -146,7 +146,7 @@ int mlx4_register_mac(struct mlx4_dev *d
 	int i, err = 0;
 	int free = -1;

-	if (dev->caps.vep_uc_steering) {
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) {
 		err = mlx4_uc_steer_add(dev, port, mac, qpn, 1);
 		if (!err) {
 			entry = kmalloc(sizeof *entry, GFP_KERNEL);
@@ -203,7 +203,7 @@ int mlx4_register_mac(struct mlx4_dev *d
 		goto out;
 	}

-	if (!dev->caps.vep_uc_steering)
+	if (!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)
 		*qpn = info->base_qpn + free;
 	++table->total;
 out:
@@ -243,7 +243,7 @@ void mlx4_unregister_mac(struct mlx4_dev
 	int index = qpn - info->base_qpn;
 	struct mlx4_mac_entry *entry;

-	if (dev->caps.vep_uc_steering) {
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) {
 		entry = radix_tree_lookup(&info->mac_tree, qpn);
 		if (entry) {
 			mlx4_uc_steer_release(dev, port, entry->mac, qpn, 1);
@@ -274,7 +274,7 @@ int mlx4_replace_mac(struct mlx4_dev *de
 	struct mlx4_mac_entry *entry;
 	int err;

-	if (dev->caps.vep_uc_steering) {
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) {
 		entry = radix_tree_lookup(&info->mac_tree, qpn);
 		if (!entry)
 			return -EINVAL;
Index: b/drivers/net/mlx4/en_netdev.c
===================================================================
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -239,7 +239,8 @@ static void mlx4_en_do_set_multicast(str
 			priv->flags |= MLX4_EN_FLAG_PROMISC;

 			/* Enable promiscouos mode */
-			if (!mdev->dev->caps.vep_uc_steering)
+			if (!mdev->dev->caps.flags &
+						MLX4_DEV_CAP_FLAG_VEP_UC_STEER)
 				err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port,
 							     priv->base_qpn, 1);
 			else
@@ -285,7 +286,7 @@ static void mlx4_en_do_set_multicast(str
 		priv->flags &= ~MLX4_EN_FLAG_PROMISC;

 		/* Disable promiscouos mode */
-		if (!mdev->dev->caps.vep_uc_steering)
+		if (!mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)
 			err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port,
 						     priv->base_qpn, 0);
 		else
Index: b/drivers/net/mlx4/en_port.c
===================================================================
--- a/drivers/net/mlx4/en_port.c
+++ b/drivers/net/mlx4/en_port.c
@@ -119,9 +119,11 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_d
 	struct mlx4_set_port_rqp_calc_context *context;
 	int err;
 	u32 in_mod;
-	u32 m_promisc = (dev->caps.vep_mc_steering) ? MCAST_DIRECT : MCAST_DEFAULT;
+	u32 m_promisc = (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) ?
+						MCAST_DIRECT : MCAST_DEFAULT;

-	if (dev->caps.vep_mc_steering && dev->caps.vep_uc_steering)
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER  &&
+			dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)
 		return 0;

 	mailbox = mlx4_alloc_cmd_mailbox(dev);
Index: b/drivers/net/mlx4/mcg.c
===================================================================
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -559,7 +559,8 @@ static int find_entry(struct mlx4_dev *d
 	struct mlx4_mgm *mgm = mgm_mailbox->buf;
 	u8 *mgid;
 	int err;
-	u8 op_mod = (prot == MLX4_PROT_ETH) ? !!(dev->caps.vep_mc_steering) : 0;
+	u8 op_mod = (prot == MLX4_PROT_ETH) ?
+		!!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) : 0;

 	mailbox = mlx4_alloc_cmd_mailbox(dev);
 	if (IS_ERR(mailbox))
@@ -834,7 +835,8 @@ int mlx4_multicast_attach(struct mlx4_de

 	steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER;

-	if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering)
+	if (prot == MLX4_PROT_ETH &&
+			!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		return 0;

 	if (prot == MLX4_PROT_ETH)
@@ -853,7 +855,8 @@ int mlx4_multicast_detach(struct mlx4_de

 	steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER;

-	if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering)
+	if (prot == MLX4_PROT_ETH &&
+			!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		return 0;

 	if (prot == MLX4_PROT_ETH) {
@@ -867,7 +870,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_detach)

 int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		return 0;


@@ -877,7 +880,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc

 int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		return 0;


@@ -887,7 +890,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc

 int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		return 0;


@@ -897,7 +900,7 @@ EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_a

 int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		return 0;

 	return remove_promisc_qp(dev, 0, port, MLX4_UC_STEER, qpn);

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 5/NNN] mlx4: Fix layout of QP context for correct location of counter index
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
                     ` (3 preceding siblings ...)
  2011-06-15 14:42   ` [PATCH 4/9] mlx4: align current extended capabilities to use the flags field Or Gerlitz
@ 2011-06-15 14:43   ` Or Gerlitz
  2011-06-15 14:47   ` [PATCH 6/9] mlx4: add network flow counters Or Gerlitz
                     ` (3 subsequent siblings)
  8 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:43 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Fix the address handle portion of the QP context structure to have
the correct bit location for the counter index field.

Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 include/linux/mlx4/qp.h |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: b/include/linux/mlx4/qp.h
===================================================================
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -99,7 +99,7 @@ struct mlx4_qp_path {
 	u8			fl;
 	u8			reserved1[2];
 	u8			pkey_index;
-	u8			reserved2;
+	u8			counter_index;
 	u8			grh_mylmc;
 	__be16			rlid;
 	u8			ackto;
@@ -111,8 +111,7 @@ struct mlx4_qp_path {
 	u8			sched_queue;
 	u8			vlan_index;
 	u8			reserved3[2];
-	u8			counter_index;
-	u8			reserved4;
+	u8			reserved4[2];
 	u8			dmac[6];
 };


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 6/9] mlx4: add network flow counters
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
                     ` (4 preceding siblings ...)
  2011-06-15 14:43   ` [PATCH 5/NNN] mlx4: Fix layout of QP context for correct location of counter index Or Gerlitz
@ 2011-06-15 14:47   ` Or Gerlitz
       [not found]     ` <alpine.LRH.2.00.1106151745060.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 14:48   ` [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions Or Gerlitz
                     ` (2 subsequent siblings)
  8 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:47 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma, Eli Cohen

CX devices support set of flow counters that can be pointed by a set
containing one or more QPs. Each such counter tracks receive and
transmit packets and bytes of these QPs. This patch queries the
device to check support for counters, handles initialization of the
HCA to enable counters, and initializes a bitmap allocator to control
counter allocations. Derived from patch by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/net/mlx4/fw.c       |   12 ++++++++-
 drivers/net/mlx4/fw.h       |    1
 drivers/net/mlx4/main.c     |   57 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/mlx4/mlx4.h     |    1
 include/linux/mlx4/cmd.h    |    3 ++
 include/linux/mlx4/device.h |   18 +++++++++++++
 6 files changed, 90 insertions(+), 2 deletions(-)

Index: b/drivers/net/mlx4/fw.c
===================================================================
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -104,7 +104,8 @@ static void dump_dev_cap_flags(struct ml
 		[38] = "Wake On LAN support",
 		[40] = "UDP RSS support",
 		[41] = "Unicast VEP steering support",
-		[42] = "Multicast VEP steering support"
+		[42] = "Multicast VEP steering support",
+		[48] = "Counters support",
 	};
 	int i;

@@ -203,6 +204,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 #define QUERY_DEV_CAP_MAX_MCG_OFFSET		0x63
 #define QUERY_DEV_CAP_RSVD_PD_OFFSET		0x64
 #define QUERY_DEV_CAP_MAX_PD_OFFSET		0x65
+#define QUERY_DEV_CAP_MAX_COUNTERS_OFFSET	0x68
 #define QUERY_DEV_CAP_RDMARC_ENTRY_SZ_OFFSET	0x80
 #define QUERY_DEV_CAP_QPC_ENTRY_SZ_OFFSET	0x82
 #define QUERY_DEV_CAP_AUX_ENTRY_SZ_OFFSET	0x84
@@ -355,6 +357,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 		 QUERY_DEV_CAP_RSVD_LKEY_OFFSET);
 	MLX4_GET(dev_cap->max_icm_sz, outbox,
 		 QUERY_DEV_CAP_MAX_ICM_SZ_OFFSET);
+	if (dev_cap->flags & MLX4_DEV_CAP_FLAG_COUNTERS)
+		MLX4_GET(dev_cap->max_counters, outbox,
+			 QUERY_DEV_CAP_MAX_COUNTERS_OFFSET);

 	if (dev->flags & MLX4_FLAG_OLD_PORT_CMDS) {
 		for (i = 1; i <= dev_cap->num_ports; ++i) {
@@ -448,6 +453,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	mlx4_dbg(dev, "Max RQ desc size: %d, max RQ S/G: %d\n",
 		 dev_cap->max_rq_desc_sz, dev_cap->max_rq_sg);
 	mlx4_dbg(dev, "Max GSO size: %d\n", dev_cap->max_gso_sz);
+	mlx4_dbg(dev, "Max counters: %d\n", dev_cap->max_counters);

 	dump_dev_cap_flags(dev, dev_cap->flags);

@@ -780,6 +786,10 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev,
 	if (enable_qos)
 		*(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 2);

+	/* enable counters */
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS)
+		*(inbox + INIT_HCA_FLAGS_OFFSET / 4) |= cpu_to_be32(1 << 4);
+
 	/* QPC/EEC/CQC/EQC/RDMARC attributes */

 	MLX4_PUT(inbox, param->qpc_base,      INIT_HCA_QPC_BASE_OFFSET);
Index: b/drivers/net/mlx4/fw.h
===================================================================
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -111,6 +111,7 @@ 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_counters;
 };

 struct mlx4_adapter {
Index: b/drivers/net/mlx4/main.c
===================================================================
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -143,6 +143,7 @@ static void mlx4_set_port_mask(struct ml
 		if (dev->caps.port_type[i] == MLX4_PORT_TYPE_IB)
 			dev->caps.port_mask |= 1 << (i - 1);
 }
+
 static int mlx4_dev_cap(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap)
 {
 	int err;
@@ -257,6 +258,8 @@ static int mlx4_dev_cap(struct mlx4_dev

 	mlx4_set_port_mask(dev);

+	dev->caps.max_counters = 1 << ilog2(dev_cap->max_counters);
+
 	dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FW] = dev_cap->reserved_qps;
 	dev->caps.reserved_qps_cnt[MLX4_QP_REGION_ETH_ADDR] =
 		dev->caps.reserved_qps_cnt[MLX4_QP_REGION_FC_ADDR] =
@@ -834,6 +837,48 @@ err_stop_fw:
 	return err;
 }

+static int mlx4_init_counters_table(struct mlx4_dev *dev)
+{
+	struct mlx4_priv *priv = mlx4_priv(dev);
+	int nent, err;
+
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS))
+		return -ENOENT;
+
+	nent = dev->caps.max_counters;
+	err = mlx4_bitmap_init(&priv->counters_bitmap, nent, nent - 1, 0, 0);
+	if (err)
+		return err;
+	return 0;
+}
+
+static void mlx4_cleanup_counters_table(struct mlx4_dev *dev)
+{
+	mlx4_bitmap_cleanup(&mlx4_priv(dev)->counters_bitmap);
+}
+
+int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx)
+{
+	struct mlx4_priv *priv = mlx4_priv(dev);
+
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_COUNTERS))
+		return -ENOENT;
+
+	*idx = mlx4_bitmap_alloc(&priv->counters_bitmap);
+	if (*idx == -1)
+		return -ENOMEM;
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(mlx4_counter_alloc);
+
+void mlx4_counter_free(struct mlx4_dev *dev, u32 idx)
+{
+	mlx4_bitmap_free(&mlx4_priv(dev)->counters_bitmap, idx);
+	return;
+}
+EXPORT_SYMBOL_GPL(mlx4_counter_free);
+
 static int mlx4_setup_hca(struct mlx4_dev *dev)
 {
 	struct mlx4_priv *priv = mlx4_priv(dev);
@@ -938,6 +983,13 @@ static int mlx4_setup_hca(struct mlx4_de
 		goto err_qp_table_free;
 	}

+	err = mlx4_init_counters_table(dev);
+	if (err && err != -ENOENT) {
+		mlx4_err(dev, "Failed to initialize "
+				"counters table, aborting.\n");
+		goto err_counters_table_free;
+	}
+
 	for (port = 1; port <= dev->caps.num_ports; port++) {
 		enum mlx4_port_type port_type = 0;
 		mlx4_SENSE_PORT(dev, port, &port_type);
@@ -964,6 +1016,9 @@ static int mlx4_setup_hca(struct mlx4_de
 err_mcg_table_free:
 	mlx4_cleanup_mcg_table(dev);

+err_counters_table_free:
+	mlx4_cleanup_counters_table(dev);
+
 err_qp_table_free:
 	mlx4_cleanup_qp_table(dev);

@@ -1294,6 +1349,7 @@ err_port:
 	for (--port; port >= 1; --port)
 		mlx4_cleanup_port_info(&priv->port[port]);

+	mlx4_cleanup_counters_table(dev);
 	mlx4_cleanup_mcg_table(dev);
 	mlx4_cleanup_qp_table(dev);
 	mlx4_cleanup_srq_table(dev);
@@ -1354,6 +1410,7 @@ static void mlx4_remove_one(struct pci_d
 			mlx4_CLOSE_PORT(dev, p);
 		}

+		mlx4_cleanup_counters_table(dev);
 		mlx4_cleanup_mcg_table(dev);
 		mlx4_cleanup_qp_table(dev);
 		mlx4_cleanup_srq_table(dev);
Index: b/drivers/net/mlx4/mlx4.h
===================================================================
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -342,6 +342,7 @@ struct mlx4_priv {
 	struct mlx4_srq_table	srq_table;
 	struct mlx4_qp_table	qp_table;
 	struct mlx4_mcg_table	mcg_table;
+	struct mlx4_bitmap	counters_bitmap;

 	struct mlx4_catas_err	catas_err;

Index: b/include/linux/mlx4/device.h
===================================================================
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -78,7 +78,8 @@ enum {
 	MLX4_DEV_CAP_FLAG_WOL		= 1LL << 38,
 	MLX4_DEV_CAP_FLAG_UDP_RSS	= 1LL << 40,
 	MLX4_DEV_CAP_FLAG_VEP_UC_STEER	= 1LL << 41,
-	MLX4_DEV_CAP_FLAG_VEP_MC_STEER	= 1LL << 42
+	MLX4_DEV_CAP_FLAG_VEP_MC_STEER	= 1LL << 42,
+	MLX4_DEV_CAP_FLAG_COUNTERS	= 1LL << 48
 };

 enum {
@@ -274,6 +275,7 @@ struct mlx4_caps {
 	u8			supported_type[MLX4_MAX_PORTS + 1];
 	u32			port_mask;
 	enum mlx4_port_type	possible_type[MLX4_MAX_PORTS + 1];
+	u32			max_counters;
 };

 struct mlx4_buf_list {
@@ -438,6 +440,17 @@ union mlx4_ext_av {
 	struct mlx4_eth_av	eth;
 };

+struct mlx4_counter {
+	u8	reserved1[3];
+	u8	counter_mode;
+	__be32	num_ifc;
+	u32	reserved2[2];
+	__be64	rx_frames;
+	__be64	rx_bytes;
+	__be64	tx_frames;
+	__be64	tx_bytes;
+};
+
 struct mlx4_dev {
 	struct pci_dev	       *pdev;
 	unsigned long		flags;
@@ -568,4 +581,7 @@ void mlx4_release_eq(struct mlx4_dev *de
 int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
 int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);

+int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx);
+void mlx4_counter_free(struct mlx4_dev *dev, u32 idx);
+
 #endif /* MLX4_DEVICE_H */
Index: b/include/linux/mlx4/cmd.h
===================================================================
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -123,6 +123,9 @@ enum {
 	/* debug commands */
 	MLX4_CMD_QUERY_DEBUG_MSG = 0x2a,
 	MLX4_CMD_SET_DEBUG_MSG	 = 0x2b,
+
+	/* statistics commands */
+	MLX4_CMD_QUERY_IF_STAT	 = 0X54,
 };

 enum {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
                     ` (5 preceding siblings ...)
  2011-06-15 14:47   ` [PATCH 6/9] mlx4: add network flow counters Or Gerlitz
@ 2011-06-15 14:48   ` Or Gerlitz
       [not found]     ` <alpine.LRH.2.00.1106151747390.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 14:49   ` [PATCH 8/9] ib/mlx4: use flow counters on IBoE ports Or Gerlitz
  2011-06-15 14:51   ` [PATCH 9/9] ib/mlx4: support PMA counters for IBoE Or Gerlitz
  8 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:48 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Move the various definitions and mad structures needed for software
implementation of IBA PM agent from the ipath and qib drivers into
a single include file, which in turn could be used by more consumers.

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/hw/ipath/ipath_mad.c |  134 --------------------
 drivers/infiniband/hw/qib/qib_mad.h     |  176 --------------------------
 include/rdma/ib_pma.h                   |  212 ++++++++++++++++++++++++++++++++
 3 files changed, 215 insertions(+), 307 deletions(-)

Index: b/drivers/infiniband/hw/ipath/ipath_mad.c
===================================================================
--- a/drivers/infiniband/hw/ipath/ipath_mad.c
+++ b/drivers/infiniband/hw/ipath/ipath_mad.c
@@ -32,6 +32,7 @@
  */

 #include <rdma/ib_smi.h>
+#include <rdma/ib_pma.h>

 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
@@ -789,139 +790,6 @@ static int recv_subn_set_pkeytable(struc
 	return recv_subn_get_pkeytable(smp, ibdev);
 }

-#define IB_PMA_CLASS_PORT_INFO		cpu_to_be16(0x0001)
-#define IB_PMA_PORT_SAMPLES_CONTROL	cpu_to_be16(0x0010)
-#define IB_PMA_PORT_SAMPLES_RESULT	cpu_to_be16(0x0011)
-#define IB_PMA_PORT_COUNTERS		cpu_to_be16(0x0012)
-#define IB_PMA_PORT_COUNTERS_EXT	cpu_to_be16(0x001D)
-#define IB_PMA_PORT_SAMPLES_RESULT_EXT	cpu_to_be16(0x001E)
-
-struct ib_perf {
-	u8 base_version;
-	u8 mgmt_class;
-	u8 class_version;
-	u8 method;
-	__be16 status;
-	__be16 unused;
-	__be64 tid;
-	__be16 attr_id;
-	__be16 resv;
-	__be32 attr_mod;
-	u8 reserved[40];
-	u8 data[192];
-} __attribute__ ((packed));
-
-struct ib_pma_classportinfo {
-	u8 base_version;
-	u8 class_version;
-	__be16 cap_mask;
-	u8 reserved[3];
-	u8 resp_time_value;	/* only lower 5 bits */
-	union ib_gid redirect_gid;
-	__be32 redirect_tc_sl_fl;	/* 8, 4, 20 bits respectively */
-	__be16 redirect_lid;
-	__be16 redirect_pkey;
-	__be32 redirect_qp;	/* only lower 24 bits */
-	__be32 redirect_qkey;
-	union ib_gid trap_gid;
-	__be32 trap_tc_sl_fl;	/* 8, 4, 20 bits respectively */
-	__be16 trap_lid;
-	__be16 trap_pkey;
-	__be32 trap_hl_qp;	/* 8, 24 bits respectively */
-	__be32 trap_qkey;
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplescontrol {
-	u8 opcode;
-	u8 port_select;
-	u8 tick;
-	u8 counter_width;	/* only lower 3 bits */
-	__be32 counter_mask0_9;	/* 2, 10 * 3, bits */
-	__be16 counter_mask10_14;	/* 1, 5 * 3, bits */
-	u8 sample_mechanisms;
-	u8 sample_status;	/* only lower 2 bits */
-	__be64 option_mask;
-	__be64 vendor_mask;
-	__be32 sample_start;
-	__be32 sample_interval;
-	__be16 tag;
-	__be16 counter_select[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult {
-	__be16 tag;
-	__be16 sample_status;	/* only lower 2 bits */
-	__be32 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult_ext {
-	__be16 tag;
-	__be16 sample_status;	/* only lower 2 bits */
-	__be32 extended_width;	/* only upper 2 bits */
-	__be64 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved1;
-	u8 lli_ebor_errors;	/* 4, 4, bits */
-	__be16 reserved2;
-	__be16 vl15_dropped;
-	__be32 port_xmit_data;
-	__be32 port_rcv_data;
-	__be32 port_xmit_packets;
-	__be32 port_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SEL_SYMBOL_ERROR			cpu_to_be16(0x0001)
-#define IB_PMA_SEL_LINK_ERROR_RECOVERY		cpu_to_be16(0x0002)
-#define IB_PMA_SEL_LINK_DOWNED			cpu_to_be16(0x0004)
-#define IB_PMA_SEL_PORT_RCV_ERRORS		cpu_to_be16(0x0008)
-#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS	cpu_to_be16(0x0010)
-#define IB_PMA_SEL_PORT_XMIT_DISCARDS		cpu_to_be16(0x0040)
-#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS	cpu_to_be16(0x0200)
-#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS	cpu_to_be16(0x0400)
-#define IB_PMA_SEL_PORT_VL15_DROPPED		cpu_to_be16(0x0800)
-#define IB_PMA_SEL_PORT_XMIT_DATA		cpu_to_be16(0x1000)
-#define IB_PMA_SEL_PORT_RCV_DATA		cpu_to_be16(0x2000)
-#define IB_PMA_SEL_PORT_XMIT_PACKETS		cpu_to_be16(0x4000)
-#define IB_PMA_SEL_PORT_RCV_PACKETS		cpu_to_be16(0x8000)
-
-struct ib_pma_portcounters_ext {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be32 reserved1;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_unicast_xmit_packets;
-	__be64 port_unicast_rcv_packets;
-	__be64 port_multicast_xmit_packets;
-	__be64 port_multicast_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SELX_PORT_XMIT_DATA		cpu_to_be16(0x0001)
-#define IB_PMA_SELX_PORT_RCV_DATA		cpu_to_be16(0x0002)
-#define IB_PMA_SELX_PORT_XMIT_PACKETS		cpu_to_be16(0x0004)
-#define IB_PMA_SELX_PORT_RCV_PACKETS		cpu_to_be16(0x0008)
-#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS	cpu_to_be16(0x0010)
-#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS	cpu_to_be16(0x0020)
-#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS	cpu_to_be16(0x0040)
-#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS	cpu_to_be16(0x0080)
-
 static int recv_pma_get_classportinfo(struct ib_perf *pmp)
 {
 	struct ib_pma_classportinfo *p =
Index: b/drivers/infiniband/hw/qib/qib_mad.h
===================================================================
--- a/drivers/infiniband/hw/qib/qib_mad.h
+++ b/drivers/infiniband/hw/qib/qib_mad.h
@@ -32,6 +32,8 @@
  * SOFTWARE.
  */

+#include <rdma/ib_pma.h>
+
 #define IB_SMP_UNSUP_VERSION    cpu_to_be16(0x0004)
 #define IB_SMP_UNSUP_METHOD     cpu_to_be16(0x0008)
 #define IB_SMP_UNSUP_METH_ATTR  cpu_to_be16(0x000C)
@@ -180,185 +182,11 @@ struct ib_vl_weight_elem {
 #define IB_VLARB_HIGHPRI_0_31   3
 #define IB_VLARB_HIGHPRI_32_63  4

-/*
- * PMA class portinfo capability mask bits
- */
-#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
-#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
-#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
-
-#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
-#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
-#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
-#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
-#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
-#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
-#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)
-
-struct ib_perf {
-	u8 base_version;
-	u8 mgmt_class;
-	u8 class_version;
-	u8 method;
-	__be16 status;
-	__be16 unused;
-	__be64 tid;
-	__be16 attr_id;
-	__be16 resv;
-	__be32 attr_mod;
-	u8 reserved[40];
-	u8 data[192];
-} __attribute__ ((packed));
-
-struct ib_pma_classportinfo {
-	u8 base_version;
-	u8 class_version;
-	__be16 cap_mask;
-	u8 reserved[3];
-	u8 resp_time_value;     /* only lower 5 bits */
-	union ib_gid redirect_gid;
-	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
-	__be16 redirect_lid;
-	__be16 redirect_pkey;
-	__be32 redirect_qp;     /* only lower 24 bits */
-	__be32 redirect_qkey;
-	union ib_gid trap_gid;
-	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
-	__be16 trap_lid;
-	__be16 trap_pkey;
-	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
-	__be32 trap_qkey;
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplescontrol {
-	u8 opcode;
-	u8 port_select;
-	u8 tick;
-	u8 counter_width;       /* only lower 3 bits */
-	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
-	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
-	u8 sample_mechanisms;
-	u8 sample_status;       /* only lower 2 bits */
-	__be64 option_mask;
-	__be64 vendor_mask;
-	__be32 sample_start;
-	__be32 sample_interval;
-	__be16 tag;
-	__be16 counter_select[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult {
-	__be16 tag;
-	__be16 sample_status;   /* only lower 2 bits */
-	__be32 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult_ext {
-	__be16 tag;
-	__be16 sample_status;   /* only lower 2 bits */
-	__be32 extended_width;  /* only upper 2 bits */
-	__be64 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved1;
-	u8 lli_ebor_errors;     /* 4, 4, bits */
-	__be16 reserved2;
-	__be16 vl15_dropped;
-	__be32 port_xmit_data;
-	__be32 port_rcv_data;
-	__be32 port_xmit_packets;
-	__be32 port_rcv_packets;
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters_cong {
-	u8 reserved;
-	u8 reserved1;
-	__be16 port_check_rate;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved2;
-	u8 lli_ebor_errors;    /* 4, 4, bits */
-	__be16 reserved3;
-	__be16 vl15_dropped;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_xmit_wait;
-	__be64 port_adr_events;
-} __attribute__ ((packed));
-
-#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
-#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01
-
 #define QIB_XMIT_RATE_UNSUPPORTED               0x0
 #define QIB_XMIT_RATE_PICO                      0x7
 /* number of 4nsec cycles equaling 2secs */
 #define QIB_CONG_TIMER_PSINTERVAL               0x1DCD64EC

-#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
-#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
-#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
-#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
-#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
-#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
-#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
-#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
-#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
-#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
-#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
-#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
-#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
-
-#define IB_PMA_SEL_CONG_ALL                     0x01
-#define IB_PMA_SEL_CONG_PORT_DATA               0x02
-#define IB_PMA_SEL_CONG_XMIT                    0x04
-#define IB_PMA_SEL_CONG_ROUTING                 0x08
-
-struct ib_pma_portcounters_ext {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be32 reserved1;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_unicast_xmit_packets;
-	__be64 port_unicast_rcv_packets;
-	__be64 port_multicast_xmit_packets;
-	__be64 port_multicast_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
-#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
-#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
-#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
-#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
-#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
-#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
-#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
-
 /*
  * The PortSamplesControl.CounterMasks field is an array of 3 bit fields
  * which specify the N'th counter's capabilities. See ch. 16.1.3.2.
Index: b/include/rdma/ib_pma.h
===================================================================
--- /dev/null
+++ b/include/rdma/ib_pma.h
@@ -0,0 +1,212 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
+ * All rights reserved.
+ * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if !defined(IB_PMA_H)
+#define IB_PMA_H
+
+/*
+ * PMA class portinfo capability mask bits
+ */
+#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
+#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
+#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
+
+#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
+#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
+#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
+#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
+#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
+#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
+#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)
+
+struct ib_perf {
+	u8 base_version;
+	u8 mgmt_class;
+	u8 class_version;
+	u8 method;
+	__be16 status;
+	__be16 unused;
+	__be64 tid;
+	__be16 attr_id;
+	__be16 resv;
+	__be32 attr_mod;
+	u8 reserved[40];
+	u8 data[192];
+} __attribute__ ((packed));
+
+struct ib_pma_classportinfo {
+	u8 base_version;
+	u8 class_version;
+	__be16 cap_mask;
+	u8 reserved[3];
+	u8 resp_time_value;     /* only lower 5 bits */
+	union ib_gid redirect_gid;
+	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
+	__be16 redirect_lid;
+	__be16 redirect_pkey;
+	__be32 redirect_qp;     /* only lower 24 bits */
+	__be32 redirect_qkey;
+	union ib_gid trap_gid;
+	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
+	__be16 trap_lid;
+	__be16 trap_pkey;
+	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
+	__be32 trap_qkey;
+} __attribute__ ((packed));
+
+struct ib_pma_portsamplescontrol {
+	u8 opcode;
+	u8 port_select;
+	u8 tick;
+	u8 counter_width;       /* only lower 3 bits */
+	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
+	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
+	u8 sample_mechanisms;
+	u8 sample_status;       /* only lower 2 bits */
+	__be64 option_mask;
+	__be64 vendor_mask;
+	__be32 sample_start;
+	__be32 sample_interval;
+	__be16 tag;
+	__be16 counter_select[15];
+} __attribute__ ((packed));
+
+struct ib_pma_portsamplesresult {
+	__be16 tag;
+	__be16 sample_status;   /* only lower 2 bits */
+	__be32 counter[15];
+} __attribute__ ((packed));
+
+struct ib_pma_portsamplesresult_ext {
+	__be16 tag;
+	__be16 sample_status;   /* only lower 2 bits */
+	__be32 extended_width;  /* only upper 2 bits */
+	__be64 counter[15];
+} __attribute__ ((packed));
+
+struct ib_pma_portcounters {
+	u8 reserved;
+	u8 port_select;
+	__be16 counter_select;
+	__be16 symbol_error_counter;
+	u8 link_error_recovery_counter;
+	u8 link_downed_counter;
+	__be16 port_rcv_errors;
+	__be16 port_rcv_remphys_errors;
+	__be16 port_rcv_switch_relay_errors;
+	__be16 port_xmit_discards;
+	u8 port_xmit_constraint_errors;
+	u8 port_rcv_constraint_errors;
+	u8 reserved1;
+	u8 lli_ebor_errors;     /* 4, 4, bits */
+	__be16 reserved2;
+	__be16 vl15_dropped;
+	__be32 port_xmit_data;
+	__be32 port_rcv_data;
+	__be32 port_xmit_packets;
+	__be32 port_rcv_packets;
+} __attribute__ ((packed));
+
+struct ib_pma_portcounters_cong {
+	u8 reserved;
+	u8 reserved1;
+	__be16 port_check_rate;
+	__be16 symbol_error_counter;
+	u8 link_error_recovery_counter;
+	u8 link_downed_counter;
+	__be16 port_rcv_errors;
+	__be16 port_rcv_remphys_errors;
+	__be16 port_rcv_switch_relay_errors;
+	__be16 port_xmit_discards;
+	u8 port_xmit_constraint_errors;
+	u8 port_rcv_constraint_errors;
+	u8 reserved2;
+	u8 lli_ebor_errors;    /* 4, 4, bits */
+	__be16 reserved3;
+	__be16 vl15_dropped;
+	__be64 port_xmit_data;
+	__be64 port_rcv_data;
+	__be64 port_xmit_packets;
+	__be64 port_rcv_packets;
+	__be64 port_xmit_wait;
+	__be64 port_adr_events;
+} __attribute__ ((packed));
+
+#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
+#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01
+
+#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
+#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
+#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
+#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
+#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
+#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
+#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
+#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
+#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
+#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
+#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
+#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
+#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
+
+#define IB_PMA_SEL_CONG_ALL                     0x01
+#define IB_PMA_SEL_CONG_PORT_DATA               0x02
+#define IB_PMA_SEL_CONG_XMIT                    0x04
+#define IB_PMA_SEL_CONG_ROUTING                 0x08
+
+struct ib_pma_portcounters_ext {
+	u8 reserved;
+	u8 port_select;
+	__be16 counter_select;
+	__be32 reserved1;
+	__be64 port_xmit_data;
+	__be64 port_rcv_data;
+	__be64 port_xmit_packets;
+	__be64 port_rcv_packets;
+	__be64 port_unicast_xmit_packets;
+	__be64 port_unicast_rcv_packets;
+	__be64 port_multicast_xmit_packets;
+	__be64 port_multicast_rcv_packets;
+} __attribute__ ((packed));
+
+#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
+#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
+#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
+#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
+#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
+#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
+#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
+#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
+
+#endif /* IB_PMA_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 8/9] ib/mlx4: use flow counters on IBoE ports
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
                     ` (6 preceding siblings ...)
  2011-06-15 14:48   ` [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions Or Gerlitz
@ 2011-06-15 14:49   ` Or Gerlitz
  2011-06-15 14:51   ` [PATCH 9/9] ib/mlx4: support PMA counters for IBoE Or Gerlitz
  8 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:49 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Allocate flow counter per Ethernet/IBoE port, and attach this
counter to all the QPs created on that port.  Based on patch
by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/main.c    |   20 ++++++++++++++++++--
 drivers/infiniband/hw/mlx4/mlx4_ib.h |    1 +
 drivers/infiniband/hw/mlx4/qp.c      |   10 +++++++++-
 include/linux/mlx4/qp.h              |    3 ++-
 4 files changed, 30 insertions(+), 4 deletions(-)

Index: b/drivers/infiniband/hw/mlx4/main.c
===================================================================
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1098,11 +1098,22 @@ static void *mlx4_ib_add(struct mlx4_dev
 	if (init_node_data(ibdev))
 		goto err_map;

+	for (i = 0; i < ibdev->num_ports; ++i) {
+		if (mlx4_ib_port_link_layer(&ibdev->ib_dev, i + 1) ==
+						IB_LINK_LAYER_ETHERNET) {
+			err = mlx4_counter_alloc(ibdev->dev,
+							&ibdev->counters[i]);
+			if (err)
+				ibdev->counters[i] = -1;
+		} else
+				ibdev->counters[i] = -1;
+	}
+
 	spin_lock_init(&ibdev->sm_lock);
 	mutex_init(&ibdev->cap_mask_mutex);

 	if (ib_register_device(&ibdev->ib_dev, NULL))
-		goto err_map;
+		goto err_counter;

 	if (mlx4_ib_mad_init(ibdev))
 		goto err_reg;
@@ -1132,6 +1143,10 @@ err_notif:
 err_reg:
 	ib_unregister_device(&ibdev->ib_dev);

+err_counter:
+	for (; i; --i)
+		mlx4_counter_free(ibdev->dev, ibdev->counters[i - 1]);
+
 err_map:
 	iounmap(ibdev->uar_map);

@@ -1160,7 +1175,8 @@ static void mlx4_ib_remove(struct mlx4_d
 		ibdev->iboe.nb.notifier_call = NULL;
 	}
 	iounmap(ibdev->uar_map);
-
+	for (p = 0; p < ibdev->num_ports; ++p)
+		mlx4_counter_free(ibdev->dev, ibdev->counters[p]);
 	mlx4_foreach_port(p, dev, MLX4_PORT_TYPE_IB)
 		mlx4_CLOSE_PORT(dev, p);

Index: b/drivers/infiniband/hw/mlx4/mlx4_ib.h
===================================================================
--- a/drivers/infiniband/hw/mlx4/mlx4_ib.h
+++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h
@@ -193,6 +193,7 @@ struct mlx4_ib_dev {
 	struct mutex		cap_mask_mutex;
 	bool			ib_active;
 	struct mlx4_ib_iboe	iboe;
+	int			counters[MLX4_MAX_PORTS];
 };

 static inline struct mlx4_ib_dev *to_mdev(struct ib_device *ibdev)
Index: b/drivers/infiniband/hw/mlx4/qp.c
===================================================================
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -893,7 +893,6 @@ static int mlx4_set_path(struct mlx4_ib_
 			--path->static_rate;
 	} else
 		path->static_rate = 0;
-	path->counter_index = 0xff;

 	if (ah->ah_flags & IB_AH_GRH) {
 		if (ah->grh.sgid_index >= dev->dev->caps.gid_table_len[port]) {
@@ -1034,6 +1033,15 @@ static int __mlx4_ib_modify_qp(struct ib
 		}
 	}

+	if (cur_state == IB_QPS_INIT && new_state == IB_QPS_RTR) {
+		if (dev->counters[qp->port - 1] != -1) {
+			context->pri_path.counter_index =
+						dev->counters[qp->port - 1];
+			optpar |= MLX4_QP_OPTPAR_COUNTER_INDEX;
+		} else
+			context->pri_path.counter_index = 0xff;
+	}
+
 	if (attr_mask & IB_QP_PKEY_INDEX) {
 		context->pri_path.pkey_index = attr->pkey_index;
 		optpar |= MLX4_QP_OPTPAR_PKEY_INDEX;
Index: b/include/linux/mlx4/qp.h
===================================================================
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -54,7 +54,8 @@ enum mlx4_qp_optpar {
 	MLX4_QP_OPTPAR_RETRY_COUNT		= 1 << 12,
 	MLX4_QP_OPTPAR_RNR_RETRY		= 1 << 13,
 	MLX4_QP_OPTPAR_ACK_TIMEOUT		= 1 << 14,
-	MLX4_QP_OPTPAR_SCHED_QUEUE		= 1 << 16
+	MLX4_QP_OPTPAR_SCHED_QUEUE		= 1 << 16,
+	MLX4_QP_OPTPAR_COUNTER_INDEX		= 1 << 20
 };

 enum mlx4_qp_state {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH 9/9] ib/mlx4: support PMA counters for IBoE
       [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
                     ` (7 preceding siblings ...)
  2011-06-15 14:49   ` [PATCH 8/9] ib/mlx4: use flow counters on IBoE ports Or Gerlitz
@ 2011-06-15 14:51   ` Or Gerlitz
  8 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-15 14:51 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Use the per port counter attached to all QPs created on that port
to implement port level packets/bytes performance counters ala IB.
Derived from patch by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
 drivers/infiniband/hw/mlx4/mad.c |   68 ++++++++++++++++++++++++++++++++++++++-
 1 file changed, 67 insertions(+), 1 deletion(-)

Index: b/drivers/infiniband/hw/mlx4/mad.c
===================================================================
--- a/drivers/infiniband/hw/mlx4/mad.c
+++ b/drivers/infiniband/hw/mlx4/mad.c
@@ -35,6 +35,7 @@

 #include <linux/mlx4/cmd.h>
 #include <linux/gfp.h>
+#include <rdma/ib_pma.h>

 #include "mlx4_ib.h"

@@ -232,7 +233,7 @@ static void forward_trap(struct mlx4_ib_
 	}
 }

-int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags,	u8 port_num,
+static int ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
 			struct ib_wc *in_wc, struct ib_grh *in_grh,
 			struct ib_mad *in_mad, struct ib_mad *out_mad)
 {
@@ -302,6 +303,71 @@ int mlx4_ib_process_mad(struct ib_device
 	return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
 }

+static void edit_counter(struct mlx4_counter *cnt,
+					struct ib_pma_portcounters *pma_cnt)
+{
+	pma_cnt->port_xmit_data = cpu_to_be32((be64_to_cpu(cnt->tx_bytes)>>2));
+	pma_cnt->port_rcv_data  = cpu_to_be32((be64_to_cpu(cnt->rx_bytes)>>2));
+	pma_cnt->port_xmit_packets = cpu_to_be32(be64_to_cpu(cnt->tx_frames));
+	pma_cnt->port_rcv_packets  = cpu_to_be32(be64_to_cpu(cnt->rx_frames));
+}
+
+static int iboe_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
+			struct ib_wc *in_wc, struct ib_grh *in_grh,
+			struct ib_mad *in_mad, struct ib_mad *out_mad)
+{
+	struct mlx4_cmd_mailbox *mailbox;
+	struct mlx4_ib_dev *dev = to_mdev(ibdev);
+	int err;
+	u32 inmod = dev->counters[port_num - 1] & 0xffff;
+	u8 mode;
+
+	if (in_mad->mad_hdr.mgmt_class != IB_MGMT_CLASS_PERF_MGMT)
+		return -EINVAL;
+
+	mailbox = mlx4_alloc_cmd_mailbox(dev->dev);
+	if (IS_ERR(mailbox))
+		return IB_MAD_RESULT_FAILURE;
+
+	err = mlx4_cmd_box(dev->dev, 0, mailbox->dma, inmod, 0,
+			   MLX4_CMD_QUERY_IF_STAT, MLX4_CMD_TIME_CLASS_C);
+	if (err)
+		err = IB_MAD_RESULT_FAILURE;
+	else {
+		memset(out_mad->data, 0, sizeof out_mad->data);
+		mode = ((struct mlx4_counter *)mailbox->buf)->counter_mode;
+		switch (mode & 0xf) {
+		case 0:
+			edit_counter(mailbox->buf,
+						(void *)(out_mad->data + 40));
+			err = IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_REPLY;
+			break;
+		default:
+			err = IB_MAD_RESULT_FAILURE;
+		}
+	}
+
+	mlx4_free_cmd_mailbox(dev->dev, mailbox);
+
+	return err;
+}
+
+int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags,	u8 port_num,
+			struct ib_wc *in_wc, struct ib_grh *in_grh,
+			struct ib_mad *in_mad, struct ib_mad *out_mad)
+{
+	switch (rdma_port_get_link_layer(ibdev, port_num)) {
+	case IB_LINK_LAYER_INFINIBAND:
+		return ib_process_mad(ibdev, mad_flags, port_num, in_wc,
+				      in_grh, in_mad, out_mad);
+	case IB_LINK_LAYER_ETHERNET:
+		return iboe_process_mad(ibdev, mad_flags, port_num, in_wc,
+					  in_grh, in_mad, out_mad);
+	default:
+		return -EINVAL;
+	}
+}
+
 static void send_handler(struct ib_mad_agent *agent,
 			 struct ib_mad_send_wc *mad_send_wc)
 {

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH 6/9] mlx4: add network flow counters
       [not found]     ` <alpine.LRH.2.00.1106151745060.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
@ 2011-06-15 15:22       ` Hefty, Sean
  0 siblings, 0 replies; 44+ messages in thread
From: Hefty, Sean @ 2011-06-15 15:22 UTC (permalink / raw)
  To: Or Gerlitz, Roland Dreier; +Cc: linux-rdma, Eli Cohen

> +void mlx4_counter_free(struct mlx4_dev *dev, u32 idx)
> +{
> +	mlx4_bitmap_free(&mlx4_priv(dev)->counters_bitmap, idx);
> +	return;

total nit, but don't need return here

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]     ` <alpine.LRH.2.00.1106151747390.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
@ 2011-06-15 16:08       ` Hal Rosenstock
       [not found]         ` <4DF8D90A.1000208-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  2011-06-15 23:10       ` Hefty, Sean
  2011-06-16  8:20       ` [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions Or Gerlitz
  2 siblings, 1 reply; 44+ messages in thread
From: Hal Rosenstock @ 2011-06-15 16:08 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Roland Dreier, linux-rdma

On 6/15/2011 10:48 AM, Or Gerlitz wrote:
> Move the various definitions and mad structures needed for software
> implementation of IBA PM agent from the ipath and qib drivers into
> a single include file, which in turn could be used by more consumers.
> 
> Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
> ---
>  drivers/infiniband/hw/ipath/ipath_mad.c |  134 --------------------
>  drivers/infiniband/hw/qib/qib_mad.h     |  176 --------------------------
>  include/rdma/ib_pma.h                   |  212 ++++++++++++++++++++++++++++++++
>  3 files changed, 215 insertions(+), 307 deletions(-)
> 
> Index: b/drivers/infiniband/hw/ipath/ipath_mad.c
> ===================================================================
> --- a/drivers/infiniband/hw/ipath/ipath_mad.c
> +++ b/drivers/infiniband/hw/ipath/ipath_mad.c
> @@ -32,6 +32,7 @@
>   */
> 
>  #include <rdma/ib_smi.h>
> +#include <rdma/ib_pma.h>
> 
>  #include "ipath_kernel.h"
>  #include "ipath_verbs.h"
> @@ -789,139 +790,6 @@ static int recv_subn_set_pkeytable(struc
>  	return recv_subn_get_pkeytable(smp, ibdev);
>  }
> 
> -#define IB_PMA_CLASS_PORT_INFO		cpu_to_be16(0x0001)
> -#define IB_PMA_PORT_SAMPLES_CONTROL	cpu_to_be16(0x0010)
> -#define IB_PMA_PORT_SAMPLES_RESULT	cpu_to_be16(0x0011)
> -#define IB_PMA_PORT_COUNTERS		cpu_to_be16(0x0012)
> -#define IB_PMA_PORT_COUNTERS_EXT	cpu_to_be16(0x001D)
> -#define IB_PMA_PORT_SAMPLES_RESULT_EXT	cpu_to_be16(0x001E)
> -
> -struct ib_perf {
> -	u8 base_version;
> -	u8 mgmt_class;
> -	u8 class_version;
> -	u8 method;
> -	__be16 status;
> -	__be16 unused;
> -	__be64 tid;
> -	__be16 attr_id;
> -	__be16 resv;
> -	__be32 attr_mod;
> -	u8 reserved[40];
> -	u8 data[192];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_classportinfo {
> -	u8 base_version;
> -	u8 class_version;
> -	__be16 cap_mask;
> -	u8 reserved[3];
> -	u8 resp_time_value;	/* only lower 5 bits */
> -	union ib_gid redirect_gid;
> -	__be32 redirect_tc_sl_fl;	/* 8, 4, 20 bits respectively */
> -	__be16 redirect_lid;
> -	__be16 redirect_pkey;
> -	__be32 redirect_qp;	/* only lower 24 bits */
> -	__be32 redirect_qkey;
> -	union ib_gid trap_gid;
> -	__be32 trap_tc_sl_fl;	/* 8, 4, 20 bits respectively */
> -	__be16 trap_lid;
> -	__be16 trap_pkey;
> -	__be32 trap_hl_qp;	/* 8, 24 bits respectively */
> -	__be32 trap_qkey;
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portsamplescontrol {
> -	u8 opcode;
> -	u8 port_select;
> -	u8 tick;
> -	u8 counter_width;	/* only lower 3 bits */
> -	__be32 counter_mask0_9;	/* 2, 10 * 3, bits */
> -	__be16 counter_mask10_14;	/* 1, 5 * 3, bits */
> -	u8 sample_mechanisms;
> -	u8 sample_status;	/* only lower 2 bits */
> -	__be64 option_mask;
> -	__be64 vendor_mask;
> -	__be32 sample_start;
> -	__be32 sample_interval;
> -	__be16 tag;
> -	__be16 counter_select[15];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portsamplesresult {
> -	__be16 tag;
> -	__be16 sample_status;	/* only lower 2 bits */
> -	__be32 counter[15];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portsamplesresult_ext {
> -	__be16 tag;
> -	__be16 sample_status;	/* only lower 2 bits */
> -	__be32 extended_width;	/* only upper 2 bits */
> -	__be64 counter[15];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portcounters {
> -	u8 reserved;
> -	u8 port_select;
> -	__be16 counter_select;
> -	__be16 symbol_error_counter;
> -	u8 link_error_recovery_counter;
> -	u8 link_downed_counter;
> -	__be16 port_rcv_errors;
> -	__be16 port_rcv_remphys_errors;
> -	__be16 port_rcv_switch_relay_errors;
> -	__be16 port_xmit_discards;
> -	u8 port_xmit_constraint_errors;
> -	u8 port_rcv_constraint_errors;
> -	u8 reserved1;
> -	u8 lli_ebor_errors;	/* 4, 4, bits */
> -	__be16 reserved2;
> -	__be16 vl15_dropped;
> -	__be32 port_xmit_data;
> -	__be32 port_rcv_data;
> -	__be32 port_xmit_packets;
> -	__be32 port_rcv_packets;
> -} __attribute__ ((packed));
> -
> -#define IB_PMA_SEL_SYMBOL_ERROR			cpu_to_be16(0x0001)
> -#define IB_PMA_SEL_LINK_ERROR_RECOVERY		cpu_to_be16(0x0002)
> -#define IB_PMA_SEL_LINK_DOWNED			cpu_to_be16(0x0004)
> -#define IB_PMA_SEL_PORT_RCV_ERRORS		cpu_to_be16(0x0008)
> -#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS	cpu_to_be16(0x0010)
> -#define IB_PMA_SEL_PORT_XMIT_DISCARDS		cpu_to_be16(0x0040)
> -#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS	cpu_to_be16(0x0200)
> -#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS	cpu_to_be16(0x0400)
> -#define IB_PMA_SEL_PORT_VL15_DROPPED		cpu_to_be16(0x0800)
> -#define IB_PMA_SEL_PORT_XMIT_DATA		cpu_to_be16(0x1000)
> -#define IB_PMA_SEL_PORT_RCV_DATA		cpu_to_be16(0x2000)
> -#define IB_PMA_SEL_PORT_XMIT_PACKETS		cpu_to_be16(0x4000)
> -#define IB_PMA_SEL_PORT_RCV_PACKETS		cpu_to_be16(0x8000)
> -
> -struct ib_pma_portcounters_ext {
> -	u8 reserved;
> -	u8 port_select;
> -	__be16 counter_select;
> -	__be32 reserved1;
> -	__be64 port_xmit_data;
> -	__be64 port_rcv_data;
> -	__be64 port_xmit_packets;
> -	__be64 port_rcv_packets;
> -	__be64 port_unicast_xmit_packets;
> -	__be64 port_unicast_rcv_packets;
> -	__be64 port_multicast_xmit_packets;
> -	__be64 port_multicast_rcv_packets;
> -} __attribute__ ((packed));
> -
> -#define IB_PMA_SELX_PORT_XMIT_DATA		cpu_to_be16(0x0001)
> -#define IB_PMA_SELX_PORT_RCV_DATA		cpu_to_be16(0x0002)
> -#define IB_PMA_SELX_PORT_XMIT_PACKETS		cpu_to_be16(0x0004)
> -#define IB_PMA_SELX_PORT_RCV_PACKETS		cpu_to_be16(0x0008)
> -#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS	cpu_to_be16(0x0010)
> -#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS	cpu_to_be16(0x0020)
> -#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS	cpu_to_be16(0x0040)
> -#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS	cpu_to_be16(0x0080)
> -
>  static int recv_pma_get_classportinfo(struct ib_perf *pmp)
>  {
>  	struct ib_pma_classportinfo *p =
> Index: b/drivers/infiniband/hw/qib/qib_mad.h
> ===================================================================
> --- a/drivers/infiniband/hw/qib/qib_mad.h
> +++ b/drivers/infiniband/hw/qib/qib_mad.h
> @@ -32,6 +32,8 @@
>   * SOFTWARE.
>   */
> 
> +#include <rdma/ib_pma.h>
> +
>  #define IB_SMP_UNSUP_VERSION    cpu_to_be16(0x0004)
>  #define IB_SMP_UNSUP_METHOD     cpu_to_be16(0x0008)
>  #define IB_SMP_UNSUP_METH_ATTR  cpu_to_be16(0x000C)
> @@ -180,185 +182,11 @@ struct ib_vl_weight_elem {
>  #define IB_VLARB_HIGHPRI_0_31   3
>  #define IB_VLARB_HIGHPRI_32_63  4
> 
> -/*
> - * PMA class portinfo capability mask bits
> - */
> -#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
> -#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
> -#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
> -
> -#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
> -#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
> -#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
> -#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
> -#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
> -#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
> -#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)

This looks like a proprietary counter to me and if so should be left here.

> -
> -struct ib_perf {
> -	u8 base_version;
> -	u8 mgmt_class;
> -	u8 class_version;
> -	u8 method;
> -	__be16 status;
> -	__be16 unused;
> -	__be64 tid;
> -	__be16 attr_id;
> -	__be16 resv;
> -	__be32 attr_mod;
> -	u8 reserved[40];
> -	u8 data[192];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_classportinfo {
> -	u8 base_version;
> -	u8 class_version;
> -	__be16 cap_mask;
> -	u8 reserved[3];
> -	u8 resp_time_value;     /* only lower 5 bits */
> -	union ib_gid redirect_gid;
> -	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
> -	__be16 redirect_lid;
> -	__be16 redirect_pkey;
> -	__be32 redirect_qp;     /* only lower 24 bits */
> -	__be32 redirect_qkey;
> -	union ib_gid trap_gid;
> -	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
> -	__be16 trap_lid;
> -	__be16 trap_pkey;
> -	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
> -	__be32 trap_qkey;
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portsamplescontrol {
> -	u8 opcode;
> -	u8 port_select;
> -	u8 tick;
> -	u8 counter_width;       /* only lower 3 bits */
> -	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
> -	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
> -	u8 sample_mechanisms;
> -	u8 sample_status;       /* only lower 2 bits */
> -	__be64 option_mask;
> -	__be64 vendor_mask;
> -	__be32 sample_start;
> -	__be32 sample_interval;
> -	__be16 tag;
> -	__be16 counter_select[15];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portsamplesresult {
> -	__be16 tag;
> -	__be16 sample_status;   /* only lower 2 bits */
> -	__be32 counter[15];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portsamplesresult_ext {
> -	__be16 tag;
> -	__be16 sample_status;   /* only lower 2 bits */
> -	__be32 extended_width;  /* only upper 2 bits */
> -	__be64 counter[15];
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portcounters {
> -	u8 reserved;
> -	u8 port_select;
> -	__be16 counter_select;
> -	__be16 symbol_error_counter;
> -	u8 link_error_recovery_counter;
> -	u8 link_downed_counter;
> -	__be16 port_rcv_errors;
> -	__be16 port_rcv_remphys_errors;
> -	__be16 port_rcv_switch_relay_errors;
> -	__be16 port_xmit_discards;
> -	u8 port_xmit_constraint_errors;
> -	u8 port_rcv_constraint_errors;
> -	u8 reserved1;
> -	u8 lli_ebor_errors;     /* 4, 4, bits */
> -	__be16 reserved2;
> -	__be16 vl15_dropped;
> -	__be32 port_xmit_data;
> -	__be32 port_rcv_data;
> -	__be32 port_xmit_packets;
> -	__be32 port_rcv_packets;
> -} __attribute__ ((packed));
> -
> -struct ib_pma_portcounters_cong {
> -	u8 reserved;
> -	u8 reserved1;
> -	__be16 port_check_rate;
> -	__be16 symbol_error_counter;
> -	u8 link_error_recovery_counter;
> -	u8 link_downed_counter;
> -	__be16 port_rcv_errors;
> -	__be16 port_rcv_remphys_errors;
> -	__be16 port_rcv_switch_relay_errors;
> -	__be16 port_xmit_discards;
> -	u8 port_xmit_constraint_errors;
> -	u8 port_rcv_constraint_errors;
> -	u8 reserved2;
> -	u8 lli_ebor_errors;    /* 4, 4, bits */
> -	__be16 reserved3;
> -	__be16 vl15_dropped;
> -	__be64 port_xmit_data;
> -	__be64 port_rcv_data;
> -	__be64 port_xmit_packets;
> -	__be64 port_rcv_packets;
> -	__be64 port_xmit_wait;
> -	__be64 port_adr_events;
> -} __attribute__ ((packed));

Same as above.

> -
> -#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
> -#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01
> -
>  #define QIB_XMIT_RATE_UNSUPPORTED               0x0
>  #define QIB_XMIT_RATE_PICO                      0x7
>  /* number of 4nsec cycles equaling 2secs */
>  #define QIB_CONG_TIMER_PSINTERVAL               0x1DCD64EC
> 
> -#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
> -#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
> -#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
> -#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
> -#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
> -#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
> -#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
> -#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
> -#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
> -#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
> -#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
> -#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
> -#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
> -
> -#define IB_PMA_SEL_CONG_ALL                     0x01
> -#define IB_PMA_SEL_CONG_PORT_DATA               0x02
> -#define IB_PMA_SEL_CONG_XMIT                    0x04
> -#define IB_PMA_SEL_CONG_ROUTING                 0x08

Are these related to the proprietary counter above ?

> -
> -struct ib_pma_portcounters_ext {
> -	u8 reserved;
> -	u8 port_select;
> -	__be16 counter_select;
> -	__be32 reserved1;
> -	__be64 port_xmit_data;
> -	__be64 port_rcv_data;
> -	__be64 port_xmit_packets;
> -	__be64 port_rcv_packets;
> -	__be64 port_unicast_xmit_packets;
> -	__be64 port_unicast_rcv_packets;
> -	__be64 port_multicast_xmit_packets;
> -	__be64 port_multicast_rcv_packets;
> -} __attribute__ ((packed));
> -
> -#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
> -#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
> -#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
> -#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
> -#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
> -#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
> -#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
> -#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
> -
>  /*
>   * The PortSamplesControl.CounterMasks field is an array of 3 bit fields
>   * which specify the N'th counter's capabilities. See ch. 16.1.3.2.
> Index: b/include/rdma/ib_pma.h
> ===================================================================
> --- /dev/null
> +++ b/include/rdma/ib_pma.h
> @@ -0,0 +1,212 @@
> +/*
> + * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
> + * All rights reserved.
> + * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
> + *
> + * This software is available to you under a choice of one of two
> + * licenses.  You may choose to be licensed under the terms of the GNU
> + * General Public License (GPL) Version 2, available from the file
> + * COPYING in the main directory of this source tree, or the
> + * OpenIB.org BSD license below:
> + *
> + *     Redistribution and use in source and binary forms, with or
> + *     without modification, are permitted provided that the following
> + *     conditions are met:
> + *
> + *      - Redistributions of source code must retain the above
> + *        copyright notice, this list of conditions and the following
> + *        disclaimer.
> + *
> + *      - Redistributions in binary form must reproduce the above
> + *        copyright notice, this list of conditions and the following
> + *        disclaimer in the documentation and/or other materials
> + *        provided with the distribution.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
> + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
> + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
> + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
> + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
> + * SOFTWARE.
> + */
> +
> +#if !defined(IB_PMA_H)
> +#define IB_PMA_H
> +
> +/*
> + * PMA class portinfo capability mask bits
> + */
> +#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
> +#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
> +#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
> +
> +#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
> +#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
> +#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
> +#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
> +#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
> +#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
> +#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)

Same as comment above.

> +
> +struct ib_perf {
> +	u8 base_version;
> +	u8 mgmt_class;
> +	u8 class_version;
> +	u8 method;
> +	__be16 status;
> +	__be16 unused;
> +	__be64 tid;
> +	__be16 attr_id;
> +	__be16 resv;
> +	__be32 attr_mod;
> +	u8 reserved[40];
> +	u8 data[192];
> +} __attribute__ ((packed));
> +
> +struct ib_pma_classportinfo {
> +	u8 base_version;
> +	u8 class_version;
> +	__be16 cap_mask;
> +	u8 reserved[3];
> +	u8 resp_time_value;     /* only lower 5 bits */
> +	union ib_gid redirect_gid;
> +	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
> +	__be16 redirect_lid;
> +	__be16 redirect_pkey;
> +	__be32 redirect_qp;     /* only lower 24 bits */
> +	__be32 redirect_qkey;
> +	union ib_gid trap_gid;
> +	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
> +	__be16 trap_lid;
> +	__be16 trap_pkey;
> +	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
> +	__be32 trap_qkey;
> +} __attribute__ ((packed));
> +
> +struct ib_pma_portsamplescontrol {
> +	u8 opcode;
> +	u8 port_select;
> +	u8 tick;
> +	u8 counter_width;       /* only lower 3 bits */
> +	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
> +	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
> +	u8 sample_mechanisms;
> +	u8 sample_status;       /* only lower 2 bits */
> +	__be64 option_mask;
> +	__be64 vendor_mask;
> +	__be32 sample_start;
> +	__be32 sample_interval;
> +	__be16 tag;
> +	__be16 counter_select[15];
> +} __attribute__ ((packed));
> +
> +struct ib_pma_portsamplesresult {
> +	__be16 tag;
> +	__be16 sample_status;   /* only lower 2 bits */
> +	__be32 counter[15];
> +} __attribute__ ((packed));
> +
> +struct ib_pma_portsamplesresult_ext {
> +	__be16 tag;
> +	__be16 sample_status;   /* only lower 2 bits */
> +	__be32 extended_width;  /* only upper 2 bits */
> +	__be64 counter[15];
> +} __attribute__ ((packed));
> +
> +struct ib_pma_portcounters {
> +	u8 reserved;
> +	u8 port_select;
> +	__be16 counter_select;
> +	__be16 symbol_error_counter;
> +	u8 link_error_recovery_counter;
> +	u8 link_downed_counter;
> +	__be16 port_rcv_errors;
> +	__be16 port_rcv_remphys_errors;
> +	__be16 port_rcv_switch_relay_errors;
> +	__be16 port_xmit_discards;
> +	u8 port_xmit_constraint_errors;
> +	u8 port_rcv_constraint_errors;
> +	u8 reserved1;
> +	u8 lli_ebor_errors;     /* 4, 4, bits */
> +	__be16 reserved2;
> +	__be16 vl15_dropped;
> +	__be32 port_xmit_data;
> +	__be32 port_rcv_data;
> +	__be32 port_xmit_packets;
> +	__be32 port_rcv_packets;
> +} __attribute__ ((packed));
> +
> +struct ib_pma_portcounters_cong {
> +	u8 reserved;
> +	u8 reserved1;
> +	__be16 port_check_rate;
> +	__be16 symbol_error_counter;
> +	u8 link_error_recovery_counter;
> +	u8 link_downed_counter;
> +	__be16 port_rcv_errors;
> +	__be16 port_rcv_remphys_errors;
> +	__be16 port_rcv_switch_relay_errors;
> +	__be16 port_xmit_discards;
> +	u8 port_xmit_constraint_errors;
> +	u8 port_rcv_constraint_errors;
> +	u8 reserved2;
> +	u8 lli_ebor_errors;    /* 4, 4, bits */
> +	__be16 reserved3;
> +	__be16 vl15_dropped;
> +	__be64 port_xmit_data;
> +	__be64 port_rcv_data;
> +	__be64 port_xmit_packets;
> +	__be64 port_rcv_packets;
> +	__be64 port_xmit_wait;
> +	__be64 port_adr_events;
> +} __attribute__ ((packed));
> +
> +#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
> +#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01

Same as comment above.

> +
> +#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
> +#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
> +#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
> +#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
> +#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
> +#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
> +#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
> +#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
> +#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
> +#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
> +#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
> +#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
> +#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
> +
> +#define IB_PMA_SEL_CONG_ALL                     0x01
> +#define IB_PMA_SEL_CONG_PORT_DATA               0x02
> +#define IB_PMA_SEL_CONG_XMIT                    0x04
> +#define IB_PMA_SEL_CONG_ROUTING                 0x08

Same as comment above.

-- Hal

> +
> +struct ib_pma_portcounters_ext {
> +	u8 reserved;
> +	u8 port_select;
> +	__be16 counter_select;
> +	__be32 reserved1;
> +	__be64 port_xmit_data;
> +	__be64 port_rcv_data;
> +	__be64 port_xmit_packets;
> +	__be64 port_rcv_packets;
> +	__be64 port_unicast_xmit_packets;
> +	__be64 port_unicast_rcv_packets;
> +	__be64 port_multicast_xmit_packets;
> +	__be64 port_multicast_rcv_packets;
> +} __attribute__ ((packed));
> +
> +#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
> +#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
> +#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
> +#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
> +#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
> +#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
> +#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
> +#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
> +
> +#endif /* IB_PMA_H */
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]     ` <alpine.LRH.2.00.1106151747390.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 16:08       ` Hal Rosenstock
@ 2011-06-15 23:10       ` Hefty, Sean
       [not found]         ` <1828884A29C6694DAF28B7E6B8A8237302148F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2011-06-16  8:20       ` [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions Or Gerlitz
  2 siblings, 1 reply; 44+ messages in thread
From: Hefty, Sean @ 2011-06-15 23:10 UTC (permalink / raw)
  To: Or Gerlitz, Roland Dreier; +Cc: linux-rdma

Other than that one nit, the other patches in this series look good to me.  See below for comments on this one.

> +/*
> + * PMA class portinfo capability mask bits
> + */
> +#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
> +#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
> +#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
> +
> +#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)

Hmm... we're defining attributes in different ways (see ib_sa.h and ib_smi.h).  Someday we may want to make things consistent.

> +#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
> +#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
> +#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
> +#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
> +#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
> +#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)
> +
> +struct ib_perf {
> +	u8 base_version;
> +	u8 mgmt_class;
> +	u8 class_version;
> +	u8 method;
> +	__be16 status;
> +	__be16 unused;
> +	__be64 tid;
> +	__be16 attr_id;
> +	__be16 resv;
> +	__be32 attr_mod;
> +	u8 reserved[40];
> +	u8 data[192];
> +} __attribute__ ((packed));

This should use struct ib_mad_hdr, possibly adding appropriate values to ib_mad.h for the 40 and 192.  See the enum in ib_mad.h with IB_MGMT_* values.  I would also rename this to struct ib_pm_mad to better match the existing mad definitions.

> +
> +struct ib_pma_classportinfo {
> +	u8 base_version;
> +	u8 class_version;
> +	__be16 cap_mask;
> +	u8 reserved[3];
> +	u8 resp_time_value;     /* only lower 5 bits */
> +	union ib_gid redirect_gid;
> +	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
> +	__be16 redirect_lid;
> +	__be16 redirect_pkey;
> +	__be32 redirect_qp;     /* only lower 24 bits */
> +	__be32 redirect_qkey;
> +	union ib_gid trap_gid;
> +	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
> +	__be16 trap_lid;
> +	__be16 trap_pkey;
> +	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
> +	__be32 trap_qkey;
> +} __attribute__ ((packed));

This needs to be replaced with struct ib_class_port_info in ib_mad.h.

> +
> +struct ib_pma_portsamplescontrol {
> +	u8 opcode;
> +	u8 port_select;
> +	u8 tick;
> +	u8 counter_width;       /* only lower 3 bits */
> +	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
> +	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */

Comments for the bit fields aren't very clear, maybe say something more like '10 3-bit fields'.  For things like counter_width, my preference is something like /* resv: 7:3, counter width: 2:0 */ to clarify which bits are used and indicate that the others are currently reserved.

> +	u8 sample_mechanisms;
> +	u8 sample_status;       /* only lower 2 bits */
> +	__be64 option_mask;
> +	__be64 vendor_mask;
> +	__be32 sample_start;
> +	__be32 sample_interval;
> +	__be16 tag;
> +	__be16 counter_select[15];
> +} __attribute__ ((packed));

There are fields missing at the end: reserved 32-bits, SamplesOnlyOptionMask 64-bit, reserved 896-bits.  This should make the structure naturally aligned, which could remove the packed attribute.

> +struct ib_pma_portsamplesresult {
> +	__be16 tag;
> +	__be16 sample_status;   /* only lower 2 bits */
> +	__be32 counter[15];
> +} __attribute__ ((packed));

this is naturally aligned

> +struct ib_pma_portsamplesresult_ext {
> +	__be16 tag;
> +	__be16 sample_status;   /* only lower 2 bits */
> +	__be32 extended_width;  /* only upper 2 bits */
> +	__be64 counter[15];
> +} __attribute__ ((packed));

this is naturally aligned

> +struct ib_pma_portcounters {
> +	u8 reserved;
> +	u8 port_select;
> +	__be16 counter_select;
> +	__be16 symbol_error_counter;
> +	u8 link_error_recovery_counter;
> +	u8 link_downed_counter;
> +	__be16 port_rcv_errors;
> +	__be16 port_rcv_remphys_errors;
> +	__be16 port_rcv_switch_relay_errors;
> +	__be16 port_xmit_discards;
> +	u8 port_xmit_constraint_errors;
> +	u8 port_rcv_constraint_errors;
> +	u8 reserved1;
> +	u8 lli_ebor_errors;     /* 4, 4, bits */

lli_ebor?  what about link_overrun_errors instead, or at least something a little more descriptive?

Enhancing the comment can also help: /* LocalLink: 7:4, BufferOverrun: 3:0 */

> +	__be16 reserved2;
> +	__be16 vl15_dropped;
> +	__be32 port_xmit_data;
> +	__be32 port_rcv_data;
> +	__be32 port_xmit_packets;
> +	__be32 port_rcv_packets;
> +} __attribute__ ((packed));

missing PortXmitWait 32-bits at end

> +
> +struct ib_pma_portcounters_cong {
> +	u8 reserved;
> +	u8 reserved1;
> +	__be16 port_check_rate;
> +	__be16 symbol_error_counter;
> +	u8 link_error_recovery_counter;
> +	u8 link_downed_counter;
> +	__be16 port_rcv_errors;
> +	__be16 port_rcv_remphys_errors;
> +	__be16 port_rcv_switch_relay_errors;
> +	__be16 port_xmit_discards;
> +	u8 port_xmit_constraint_errors;
> +	u8 port_rcv_constraint_errors;
> +	u8 reserved2;
> +	u8 lli_ebor_errors;    /* 4, 4, bits */
> +	__be16 reserved3;
> +	__be16 vl15_dropped;
> +	__be64 port_xmit_data;
> +	__be64 port_rcv_data;
> +	__be64 port_xmit_packets;
> +	__be64 port_rcv_packets;
> +	__be64 port_xmit_wait;
> +	__be64 port_adr_events;
> +} __attribute__ ((packed));
> +
> +#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
> +#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01
>
> +#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
> +#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
> +#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
> +#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
> +#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
> +#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
> +#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
> +#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
> +#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
> +#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
> +#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
> +#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
> +#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
> +
> +#define IB_PMA_SEL_CONG_ALL                     0x01
> +#define IB_PMA_SEL_CONG_PORT_DATA               0x02
> +#define IB_PMA_SEL_CONG_XMIT                    0x04
> +#define IB_PMA_SEL_CONG_ROUTING                 0x08
> +
> +struct ib_pma_portcounters_ext {
> +	u8 reserved;
> +	u8 port_select;
> +	__be16 counter_select;
> +	__be32 reserved1;
> +	__be64 port_xmit_data;
> +	__be64 port_rcv_data;
> +	__be64 port_xmit_packets;
> +	__be64 port_rcv_packets;
> +	__be64 port_unicast_xmit_packets;
> +	__be64 port_unicast_rcv_packets;
> +	__be64 port_multicast_xmit_packets;
> +	__be64 port_multicast_rcv_packets;
> +} __attribute__ ((packed));
> +
> +#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
> +#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
> +#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
> +#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
> +#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
> +#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
> +#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
> +#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)

Rather than having IB_PMA_SEL_* and IB_PMA_SELX_*, we could follow what's done in ib_sa.h:

IB_PM_<structure>_<field>

- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]         ` <1828884A29C6694DAF28B7E6B8A8237302148F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2011-06-15 23:46           ` Ira Weiny
       [not found]             ` <20110615164619.994a49a4.weiny2-i2BcT+NCU+M@public.gmane.org>
  2011-06-16  7:39           ` Or Gerlitz
  1 sibling, 1 reply; 44+ messages in thread
From: Ira Weiny @ 2011-06-15 23:46 UTC (permalink / raw)
  To: Hefty, Sean; +Cc: Or Gerlitz, Roland Dreier, linux-rdma

Minor issue.

PM is defined in the spec glossary to be "Partition Manager".  :-(  Therefore I have refrained from using "PM" or "pm" in structs or defines.  I would not mind settling on an abbreviation; "PMA" perhaps?

Ira

On Wed, 15 Jun 2011 16:10:24 -0700
"Hefty, Sean" <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:

> Other than that one nit, the other patches in this series look good to me.  See below for comments on this one.
> 
> > +/*
> > + * PMA class portinfo capability mask bits
> > + */
> > +#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
> > +#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
> > +#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
> > +
> > +#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
> 
> Hmm... we're defining attributes in different ways (see ib_sa.h and ib_smi.h).  Someday we may want to make things consistent.
> 
> > +#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
> > +#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
> > +#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
> > +#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
> > +#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
> > +#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)
> > +
> > +struct ib_perf {
> > +	u8 base_version;
> > +	u8 mgmt_class;
> > +	u8 class_version;
> > +	u8 method;
> > +	__be16 status;
> > +	__be16 unused;
> > +	__be64 tid;
> > +	__be16 attr_id;
> > +	__be16 resv;
> > +	__be32 attr_mod;
> > +	u8 reserved[40];
> > +	u8 data[192];
> > +} __attribute__ ((packed));
> 
> This should use struct ib_mad_hdr, possibly adding appropriate values to ib_mad.h for the 40 and 192.  See the enum in ib_mad.h with IB_MGMT_* values.  I would also rename this to struct ib_pm_mad to better match the existing mad definitions.
> 
> > +
> > +struct ib_pma_classportinfo {
> > +	u8 base_version;
> > +	u8 class_version;
> > +	__be16 cap_mask;
> > +	u8 reserved[3];
> > +	u8 resp_time_value;     /* only lower 5 bits */
> > +	union ib_gid redirect_gid;
> > +	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
> > +	__be16 redirect_lid;
> > +	__be16 redirect_pkey;
> > +	__be32 redirect_qp;     /* only lower 24 bits */
> > +	__be32 redirect_qkey;
> > +	union ib_gid trap_gid;
> > +	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
> > +	__be16 trap_lid;
> > +	__be16 trap_pkey;
> > +	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
> > +	__be32 trap_qkey;
> > +} __attribute__ ((packed));
> 
> This needs to be replaced with struct ib_class_port_info in ib_mad.h.
> 
> > +
> > +struct ib_pma_portsamplescontrol {
> > +	u8 opcode;
> > +	u8 port_select;
> > +	u8 tick;
> > +	u8 counter_width;       /* only lower 3 bits */
> > +	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
> > +	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
> 
> Comments for the bit fields aren't very clear, maybe say something more like '10 3-bit fields'.  For things like counter_width, my preference is something like /* resv: 7:3, counter width: 2:0 */ to clarify which bits are used and indicate that the others are currently reserved.
> 
> > +	u8 sample_mechanisms;
> > +	u8 sample_status;       /* only lower 2 bits */
> > +	__be64 option_mask;
> > +	__be64 vendor_mask;
> > +	__be32 sample_start;
> > +	__be32 sample_interval;
> > +	__be16 tag;
> > +	__be16 counter_select[15];
> > +} __attribute__ ((packed));
> 
> There are fields missing at the end: reserved 32-bits, SamplesOnlyOptionMask 64-bit, reserved 896-bits.  This should make the structure naturally aligned, which could remove the packed attribute.
> 
> > +struct ib_pma_portsamplesresult {
> > +	__be16 tag;
> > +	__be16 sample_status;   /* only lower 2 bits */
> > +	__be32 counter[15];
> > +} __attribute__ ((packed));
> 
> this is naturally aligned
> 
> > +struct ib_pma_portsamplesresult_ext {
> > +	__be16 tag;
> > +	__be16 sample_status;   /* only lower 2 bits */
> > +	__be32 extended_width;  /* only upper 2 bits */
> > +	__be64 counter[15];
> > +} __attribute__ ((packed));
> 
> this is naturally aligned
> 
> > +struct ib_pma_portcounters {
> > +	u8 reserved;
> > +	u8 port_select;
> > +	__be16 counter_select;
> > +	__be16 symbol_error_counter;
> > +	u8 link_error_recovery_counter;
> > +	u8 link_downed_counter;
> > +	__be16 port_rcv_errors;
> > +	__be16 port_rcv_remphys_errors;
> > +	__be16 port_rcv_switch_relay_errors;
> > +	__be16 port_xmit_discards;
> > +	u8 port_xmit_constraint_errors;
> > +	u8 port_rcv_constraint_errors;
> > +	u8 reserved1;
> > +	u8 lli_ebor_errors;     /* 4, 4, bits */
> 
> lli_ebor?  what about link_overrun_errors instead, or at least something a little more descriptive?
> 
> Enhancing the comment can also help: /* LocalLink: 7:4, BufferOverrun: 3:0 */
> 
> > +	__be16 reserved2;
> > +	__be16 vl15_dropped;
> > +	__be32 port_xmit_data;
> > +	__be32 port_rcv_data;
> > +	__be32 port_xmit_packets;
> > +	__be32 port_rcv_packets;
> > +} __attribute__ ((packed));
> 
> missing PortXmitWait 32-bits at end
> 
> > +
> > +struct ib_pma_portcounters_cong {
> > +	u8 reserved;
> > +	u8 reserved1;
> > +	__be16 port_check_rate;
> > +	__be16 symbol_error_counter;
> > +	u8 link_error_recovery_counter;
> > +	u8 link_downed_counter;
> > +	__be16 port_rcv_errors;
> > +	__be16 port_rcv_remphys_errors;
> > +	__be16 port_rcv_switch_relay_errors;
> > +	__be16 port_xmit_discards;
> > +	u8 port_xmit_constraint_errors;
> > +	u8 port_rcv_constraint_errors;
> > +	u8 reserved2;
> > +	u8 lli_ebor_errors;    /* 4, 4, bits */
> > +	__be16 reserved3;
> > +	__be16 vl15_dropped;
> > +	__be64 port_xmit_data;
> > +	__be64 port_rcv_data;
> > +	__be64 port_xmit_packets;
> > +	__be64 port_rcv_packets;
> > +	__be64 port_xmit_wait;
> > +	__be64 port_adr_events;
> > +} __attribute__ ((packed));
> > +
> > +#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
> > +#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01
> >
> > +#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
> > +#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
> > +#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
> > +#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
> > +#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
> > +#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
> > +#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
> > +#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
> > +#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
> > +#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
> > +#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
> > +#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
> > +#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
> > +
> > +#define IB_PMA_SEL_CONG_ALL                     0x01
> > +#define IB_PMA_SEL_CONG_PORT_DATA               0x02
> > +#define IB_PMA_SEL_CONG_XMIT                    0x04
> > +#define IB_PMA_SEL_CONG_ROUTING                 0x08
> > +
> > +struct ib_pma_portcounters_ext {
> > +	u8 reserved;
> > +	u8 port_select;
> > +	__be16 counter_select;
> > +	__be32 reserved1;
> > +	__be64 port_xmit_data;
> > +	__be64 port_rcv_data;
> > +	__be64 port_xmit_packets;
> > +	__be64 port_rcv_packets;
> > +	__be64 port_unicast_xmit_packets;
> > +	__be64 port_unicast_rcv_packets;
> > +	__be64 port_multicast_xmit_packets;
> > +	__be64 port_multicast_rcv_packets;
> > +} __attribute__ ((packed));
> > +
> > +#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
> > +#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
> > +#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
> > +#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
> > +#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
> > +#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
> > +#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
> > +#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
> 
> Rather than having IB_PMA_SEL_* and IB_PMA_SELX_*, we could follow what's done in ib_sa.h:
> 
> IB_PM_<structure>_<field>
> 
> - Sean
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


-- 
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
weiny2-i2BcT+NCU+M@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]             ` <20110615164619.994a49a4.weiny2-i2BcT+NCU+M@public.gmane.org>
@ 2011-06-15 23:51               ` Hefty, Sean
  0 siblings, 0 replies; 44+ messages in thread
From: Hefty, Sean @ 2011-06-15 23:51 UTC (permalink / raw)
  To: Ira Weiny; +Cc: Or Gerlitz, Roland Dreier, linux-rdma

> PM is defined in the spec glossary to be "Partition Manager".  :-(
> Therefore I have refrained from using "PM" or "pm" in structs or defines.
> I would not mind settling on an abbreviation; "PMA" perhaps?

The spec also lists the glossary at the front... :P  I have no issues with PMA, I was more concerned being consistent with other areas of the code.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]         ` <1828884A29C6694DAF28B7E6B8A8237302148F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2011-06-15 23:46           ` Ira Weiny
@ 2011-06-16  7:39           ` Or Gerlitz
       [not found]             ` <4DF9B319.6070100-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-16  7:39 UTC (permalink / raw)
  To: Hefty, Sean; +Cc: Roland Dreier, linux-rdma

Hefty, Sean wrote:
> Other than that one nit, the other patches in this series look good to me.  See below for comments on this one.

>> +struct ib_perf {
>> +	u8 base_version;
>> +	u8 mgmt_class;
>> +	u8 class_version;
>> +	u8 method;
>> +	__be16 status;
>> +	__be16 unused;
>> +	__be64 tid;
>> +	__be16 attr_id;
>> +	__be16 resv;
>> +	__be32 attr_mod;
>> +	u8 reserved[40];
>> +	u8 data[192];
>> +} __attribute__ ((packed));

> This should use struct ib_mad_hdr, possibly adding appropriate values to ib_mad.h for the 40 and 192.  
> See the enum in ib_mad.h with IB_MGMT_* values.  I would also rename this to struct ib_pm_mad to better 
> match the existing mad definitions.

okay, replaced all the fields except for the last two with struct 
ib_mad_hdr and renamed the structure to ib_pma_mad (long live sed)

>> +struct ib_pma_classportinfo {
> This needs to be replaced with struct ib_class_port_info in ib_mad.h.

good catch, done

>> +struct ib_pma_portsamplescontrol {
>> +	u8 counter_width;       /* only lower 3 bits */
>> +	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
>> +	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */

> Comments for the bit fields aren't very clear, maybe say something more like '10 3-bit fields'.  
> For things like counter_width, my preference is something like /* resv: 7:3, counter width: 2:0 */ 
> to clarify which bits are used and indicate that the others are currently reserved.

done, changed the comments as you suggested

>> +	__be16 counter_select[15];
>> +} __attribute__ ((packed));

> There are fields missing at the end: reserved 32-bits, SamplesOnlyOptionMask 64-bit, reserved 896-bits.  
> This should make the structure naturally aligned, which could remove the packed attribute.

done, added reserved fields and removed packing.

>> +struct ib_pma_portsamplesresult {
> this is naturally aligned

OKAY, removed packing here

> 
>> +struct ib_pma_portsamplesresult_ext {
> this is naturally aligned

OKAY, removed packing also here

>> +struct ib_pma_portcounters {
>> +	u8 lli_ebor_errors;     /* 4, 4, bits */

> lli_ebor?  what about link_overrun_errors instead, or at least something a little more descriptive?
> Enhancing the comment can also help: /* LocalLink: 7:4, BufferOverrun: 3:0 */

done, changed field name to link_overrun_errors and added the comment 
you suggested.

>> +	__be32 port_xmit_data;
>> +	__be32 port_rcv_data;
>> +	__be32 port_xmit_packets;
>> +	__be32 port_rcv_packets;
>> +} __attribute__ ((packed));

> missing PortXmitWait 32-bits at end

added, thanks


> Rather than having IB_PMA_SEL_* and IB_PMA_SELX_*, we could follow what's done in ib_sa.h:
> IB_PM_<structure>_<field>

I would need some guidance here...  maybe you can elaborate a little 
further with the V1 posting which will follow soon

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]         ` <4DF8D90A.1000208-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-06-16  8:01           ` Or Gerlitz
  0 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-16  8:01 UTC (permalink / raw)
  To: Hal Rosenstock; +Cc: Roland Dreier, linux-rdma

Hal Rosenstock wrote:
>> Index: b/drivers/infiniband/hw/qib/qib_mad.h

>> -#define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)
> This looks like a proprietary counter to me and if so should be left here.

okay, will get it back there

>> -struct ib_pma_portcounters_cong {
> Same as above.

sure, done

>> -#define IB_PMA_SEL_CONG_ALL                     0x01
>> -#define IB_PMA_SEL_CONG_PORT_DATA               0x02
>> -#define IB_PMA_SEL_CONG_XMIT                    0x04
>> -#define IB_PMA_SEL_CONG_ROUTING                 0x08

> Are these related to the proprietary counter above ?
yes, and as such, will leave them here

>> +#define IB_PMA_CONG_HW_CONTROL_TIMER            0x00
>> +#define IB_PMA_CONG_HW_CONTROL_SAMPLE           0x01

> Same as comment above.

removed from here, back home to qib code
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]     ` <alpine.LRH.2.00.1106151747390.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-15 16:08       ` Hal Rosenstock
  2011-06-15 23:10       ` Hefty, Sean
@ 2011-06-16  8:20       ` Or Gerlitz
       [not found]         ` <alpine.LRH.2.00.1106161119120.12552-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-16  8:20 UTC (permalink / raw)
  To: Roland Dreier, Sean Hefty, hal-VPRAkNaXOzVWk0Htik3J/w; +Cc: linux-rdma

Move the various definitions and mad structures needed for software
implementation of IBA PM agent from the ipath and qib drivers into
a single include file, which in turn could be used by more consumers.

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---

changes from V0 - applied feedback from Sean and Hal

 - renamed struct ib_perf to be ib_pma_mad which now starts with struct ib_mad_hdr
 - removed struct ib_pma_classportinfo, use struct ib_class_port_info from ib_mad.h
 - clarified comments for bit fields, adding missing fields for ib_pma_portsamplescontrol
 - removed packing from struct ib_pma_portsamples{control, result, result_ext}
 - changed struct ib_pma_portcounters :: lli_ebor_errors to be link_overrun_errors
 - added xmit wait to struct ib_pma_portcounters
 - left proprietary defs in the qib code

 drivers/infiniband/hw/ipath/ipath_mad.c |  198 +++++---------------------------
 drivers/infiniband/hw/qib/qib_mad.h     |  151 ------------------------
 include/rdma/ib_pma.h                   |  164 ++++++++++++++++++++++++++
 3 files changed, 200 insertions(+), 313 deletions(-)

Index: linux-2.6.39-rc/drivers/infiniband/hw/ipath/ipath_mad.c
===================================================================
--- linux-2.6.39-rc.orig/drivers/infiniband/hw/ipath/ipath_mad.c
+++ linux-2.6.39-rc/drivers/infiniband/hw/ipath/ipath_mad.c
@@ -32,6 +32,7 @@
  */

 #include <rdma/ib_smi.h>
+#include <rdma/ib_pma.h>

 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
@@ -789,151 +790,18 @@ static int recv_subn_set_pkeytable(struc
 	return recv_subn_get_pkeytable(smp, ibdev);
 }

-#define IB_PMA_CLASS_PORT_INFO		cpu_to_be16(0x0001)
-#define IB_PMA_PORT_SAMPLES_CONTROL	cpu_to_be16(0x0010)
-#define IB_PMA_PORT_SAMPLES_RESULT	cpu_to_be16(0x0011)
-#define IB_PMA_PORT_COUNTERS		cpu_to_be16(0x0012)
-#define IB_PMA_PORT_COUNTERS_EXT	cpu_to_be16(0x001D)
-#define IB_PMA_PORT_SAMPLES_RESULT_EXT	cpu_to_be16(0x001E)
-
-struct ib_perf {
-	u8 base_version;
-	u8 mgmt_class;
-	u8 class_version;
-	u8 method;
-	__be16 status;
-	__be16 unused;
-	__be64 tid;
-	__be16 attr_id;
-	__be16 resv;
-	__be32 attr_mod;
-	u8 reserved[40];
-	u8 data[192];
-} __attribute__ ((packed));
-
-struct ib_pma_classportinfo {
-	u8 base_version;
-	u8 class_version;
-	__be16 cap_mask;
-	u8 reserved[3];
-	u8 resp_time_value;	/* only lower 5 bits */
-	union ib_gid redirect_gid;
-	__be32 redirect_tc_sl_fl;	/* 8, 4, 20 bits respectively */
-	__be16 redirect_lid;
-	__be16 redirect_pkey;
-	__be32 redirect_qp;	/* only lower 24 bits */
-	__be32 redirect_qkey;
-	union ib_gid trap_gid;
-	__be32 trap_tc_sl_fl;	/* 8, 4, 20 bits respectively */
-	__be16 trap_lid;
-	__be16 trap_pkey;
-	__be32 trap_hl_qp;	/* 8, 24 bits respectively */
-	__be32 trap_qkey;
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplescontrol {
-	u8 opcode;
-	u8 port_select;
-	u8 tick;
-	u8 counter_width;	/* only lower 3 bits */
-	__be32 counter_mask0_9;	/* 2, 10 * 3, bits */
-	__be16 counter_mask10_14;	/* 1, 5 * 3, bits */
-	u8 sample_mechanisms;
-	u8 sample_status;	/* only lower 2 bits */
-	__be64 option_mask;
-	__be64 vendor_mask;
-	__be32 sample_start;
-	__be32 sample_interval;
-	__be16 tag;
-	__be16 counter_select[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult {
-	__be16 tag;
-	__be16 sample_status;	/* only lower 2 bits */
-	__be32 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult_ext {
-	__be16 tag;
-	__be16 sample_status;	/* only lower 2 bits */
-	__be32 extended_width;	/* only upper 2 bits */
-	__be64 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved1;
-	u8 lli_ebor_errors;	/* 4, 4, bits */
-	__be16 reserved2;
-	__be16 vl15_dropped;
-	__be32 port_xmit_data;
-	__be32 port_rcv_data;
-	__be32 port_xmit_packets;
-	__be32 port_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SEL_SYMBOL_ERROR			cpu_to_be16(0x0001)
-#define IB_PMA_SEL_LINK_ERROR_RECOVERY		cpu_to_be16(0x0002)
-#define IB_PMA_SEL_LINK_DOWNED			cpu_to_be16(0x0004)
-#define IB_PMA_SEL_PORT_RCV_ERRORS		cpu_to_be16(0x0008)
-#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS	cpu_to_be16(0x0010)
-#define IB_PMA_SEL_PORT_XMIT_DISCARDS		cpu_to_be16(0x0040)
-#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS	cpu_to_be16(0x0200)
-#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS	cpu_to_be16(0x0400)
-#define IB_PMA_SEL_PORT_VL15_DROPPED		cpu_to_be16(0x0800)
-#define IB_PMA_SEL_PORT_XMIT_DATA		cpu_to_be16(0x1000)
-#define IB_PMA_SEL_PORT_RCV_DATA		cpu_to_be16(0x2000)
-#define IB_PMA_SEL_PORT_XMIT_PACKETS		cpu_to_be16(0x4000)
-#define IB_PMA_SEL_PORT_RCV_PACKETS		cpu_to_be16(0x8000)
-
-struct ib_pma_portcounters_ext {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be32 reserved1;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_unicast_xmit_packets;
-	__be64 port_unicast_rcv_packets;
-	__be64 port_multicast_xmit_packets;
-	__be64 port_multicast_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SELX_PORT_XMIT_DATA		cpu_to_be16(0x0001)
-#define IB_PMA_SELX_PORT_RCV_DATA		cpu_to_be16(0x0002)
-#define IB_PMA_SELX_PORT_XMIT_PACKETS		cpu_to_be16(0x0004)
-#define IB_PMA_SELX_PORT_RCV_PACKETS		cpu_to_be16(0x0008)
-#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS	cpu_to_be16(0x0010)
-#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS	cpu_to_be16(0x0020)
-#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS	cpu_to_be16(0x0040)
-#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS	cpu_to_be16(0x0080)
-
-static int recv_pma_get_classportinfo(struct ib_perf *pmp)
+static int recv_pma_get_classportinfo(struct ib_pma_mad *pmp)
 {
-	struct ib_pma_classportinfo *p =
-		(struct ib_pma_classportinfo *)pmp->data;
+	struct ib_class_port_info *p =
+		(struct ib_class_port_info *)pmp->data;

 	memset(pmp->data, 0, sizeof(pmp->data));

-	if (pmp->attr_mod != 0)
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0)
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	/* Indicate AllPortSelect is valid (only one port anyway) */
-	p->cap_mask = cpu_to_be16(1 << 8);
+	p->capability_mask = cpu_to_be16(1 << 8);
 	p->base_version = 1;
 	p->class_version = 1;
 	/*
@@ -957,7 +825,7 @@ static int recv_pma_get_classportinfo(st
 				    COUNTER_MASK(1, 3) | \
 				    COUNTER_MASK(1, 4))

-static int recv_pma_get_portsamplescontrol(struct ib_perf *pmp,
+static int recv_pma_get_portsamplescontrol(struct ib_pma_mad *pmp,
 					   struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplescontrol *p =
@@ -970,9 +838,9 @@ static int recv_pma_get_portsamplescontr
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (port_select != port && port_select != 0xFF))
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 	/*
 	 * Ticks are 10x the link transfer period which for 2.5Gbs is 4
 	 * nsec.  0 == 4 nsec., 1 == 8 nsec., ..., 255 == 1020 nsec.  Sample
@@ -1006,7 +874,7 @@ static int recv_pma_get_portsamplescontr
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_set_portsamplescontrol(struct ib_perf *pmp,
+static int recv_pma_set_portsamplescontrol(struct ib_pma_mad *pmp,
 					   struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplescontrol *p =
@@ -1017,9 +885,9 @@ static int recv_pma_set_portsamplescontr
 	u8 status;
 	int ret;

-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (p->port_select != port && p->port_select != 0xFF)) {
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 		ret = reply((struct ib_smp *) pmp);
 		goto bail;
 	}
@@ -1093,7 +961,7 @@ static u64 get_counter(struct ipath_ibde
 	return ret;
 }

-static int recv_pma_get_portsamplesresult(struct ib_perf *pmp,
+static int recv_pma_get_portsamplesresult(struct ib_pma_mad *pmp,
 					  struct ib_device *ibdev)
 {
 	struct ib_pma_portsamplesresult *p =
@@ -1118,7 +986,7 @@ static int recv_pma_get_portsamplesresul
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_get_portsamplesresult_ext(struct ib_perf *pmp,
+static int recv_pma_get_portsamplesresult_ext(struct ib_pma_mad *pmp,
 					      struct ib_device *ibdev)
 {
 	struct ib_pma_portsamplesresult_ext *p =
@@ -1145,7 +1013,7 @@ static int recv_pma_get_portsamplesresul
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_get_portcounters(struct ib_perf *pmp,
+static int recv_pma_get_portcounters(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1179,9 +1047,9 @@ static int recv_pma_get_portcounters(str
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (port_select != port && port_select != 0xFF))
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	if (cntrs.symbol_error_counter > 0xFFFFUL)
 		p->symbol_error_counter = cpu_to_be16(0xFFFF);
@@ -1216,7 +1084,7 @@ static int recv_pma_get_portcounters(str
 		cntrs.local_link_integrity_errors = 0xFUL;
 	if (cntrs.excessive_buffer_overrun_errors > 0xFUL)
 		cntrs.excessive_buffer_overrun_errors = 0xFUL;
-	p->lli_ebor_errors = (cntrs.local_link_integrity_errors << 4) |
+	p->link_overrun_errors = (cntrs.local_link_integrity_errors << 4) |
 		cntrs.excessive_buffer_overrun_errors;
 	if (cntrs.vl15_dropped > 0xFFFFUL)
 		p->vl15_dropped = cpu_to_be16(0xFFFF);
@@ -1244,7 +1112,7 @@ static int recv_pma_get_portcounters(str
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_get_portcounters_ext(struct ib_perf *pmp,
+static int recv_pma_get_portcounters_ext(struct ib_pma_mad *pmp,
 					 struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters_ext *p =
@@ -1265,9 +1133,9 @@ static int recv_pma_get_portcounters_ext
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (port_select != port && port_select != 0xFF))
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	p->port_xmit_data = cpu_to_be64(swords);
 	p->port_rcv_data = cpu_to_be64(rwords);
@@ -1281,7 +1149,7 @@ static int recv_pma_get_portcounters_ext
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_set_portcounters(struct ib_perf *pmp,
+static int recv_pma_set_portcounters(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1344,7 +1212,7 @@ static int recv_pma_set_portcounters(str
 	return recv_pma_get_portcounters(pmp, ibdev, port);
 }

-static int recv_pma_set_portcounters_ext(struct ib_perf *pmp,
+static int recv_pma_set_portcounters_ext(struct ib_pma_mad *pmp,
 					 struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1518,19 +1386,19 @@ static int process_perf(struct ib_device
 			struct ib_mad *in_mad,
 			struct ib_mad *out_mad)
 {
-	struct ib_perf *pmp = (struct ib_perf *)out_mad;
+	struct ib_pma_mad *pmp = (struct ib_pma_mad *)out_mad;
 	int ret;

 	*out_mad = *in_mad;
-	if (pmp->class_version != 1) {
-		pmp->status |= IB_SMP_UNSUP_VERSION;
+	if (pmp->mad_hdr.class_version != 1) {
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION;
 		ret = reply((struct ib_smp *) pmp);
 		goto bail;
 	}

-	switch (pmp->method) {
+	switch (pmp->mad_hdr.method) {
 	case IB_MGMT_METHOD_GET:
-		switch (pmp->attr_id) {
+		switch (pmp->mad_hdr.attr_id) {
 		case IB_PMA_CLASS_PORT_INFO:
 			ret = recv_pma_get_classportinfo(pmp);
 			goto bail;
@@ -1554,13 +1422,13 @@ static int process_perf(struct ib_device
 							    port_num);
 			goto bail;
 		default:
-			pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+			pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 			ret = reply((struct ib_smp *) pmp);
 			goto bail;
 		}

 	case IB_MGMT_METHOD_SET:
-		switch (pmp->attr_id) {
+		switch (pmp->mad_hdr.attr_id) {
 		case IB_PMA_PORT_SAMPLES_CONTROL:
 			ret = recv_pma_set_portsamplescontrol(pmp, ibdev,
 							      port_num);
@@ -1574,7 +1442,7 @@ static int process_perf(struct ib_device
 							    port_num);
 			goto bail;
 		default:
-			pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+			pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 			ret = reply((struct ib_smp *) pmp);
 			goto bail;
 		}
@@ -1588,7 +1456,7 @@ static int process_perf(struct ib_device
 		ret = IB_MAD_RESULT_SUCCESS;
 		goto bail;
 	default:
-		pmp->status |= IB_SMP_UNSUP_METHOD;
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_METHOD;
 		ret = reply((struct ib_smp *) pmp);
 	}

Index: linux-2.6.39-rc/drivers/infiniband/hw/qib/qib_mad.h
===================================================================
--- linux-2.6.39-rc.orig/drivers/infiniband/hw/qib/qib_mad.h
+++ linux-2.6.39-rc/drivers/infiniband/hw/qib/qib_mad.h
@@ -32,6 +32,8 @@
  * SOFTWARE.
  */

+#include <rdma/ib_pma.h>
+
 #define IB_SMP_UNSUP_VERSION    cpu_to_be16(0x0004)
 #define IB_SMP_UNSUP_METHOD     cpu_to_be16(0x0008)
 #define IB_SMP_UNSUP_METH_ATTR  cpu_to_be16(0x000C)
@@ -180,109 +182,8 @@ struct ib_vl_weight_elem {
 #define IB_VLARB_HIGHPRI_0_31   3
 #define IB_VLARB_HIGHPRI_32_63  4

-/*
- * PMA class portinfo capability mask bits
- */
-#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
-#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
-#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
-
-#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
-#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
-#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
-#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
-#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
-#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
 #define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)

-struct ib_perf {
-	u8 base_version;
-	u8 mgmt_class;
-	u8 class_version;
-	u8 method;
-	__be16 status;
-	__be16 unused;
-	__be64 tid;
-	__be16 attr_id;
-	__be16 resv;
-	__be32 attr_mod;
-	u8 reserved[40];
-	u8 data[192];
-} __attribute__ ((packed));
-
-struct ib_pma_classportinfo {
-	u8 base_version;
-	u8 class_version;
-	__be16 cap_mask;
-	u8 reserved[3];
-	u8 resp_time_value;     /* only lower 5 bits */
-	union ib_gid redirect_gid;
-	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
-	__be16 redirect_lid;
-	__be16 redirect_pkey;
-	__be32 redirect_qp;     /* only lower 24 bits */
-	__be32 redirect_qkey;
-	union ib_gid trap_gid;
-	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
-	__be16 trap_lid;
-	__be16 trap_pkey;
-	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
-	__be32 trap_qkey;
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplescontrol {
-	u8 opcode;
-	u8 port_select;
-	u8 tick;
-	u8 counter_width;       /* only lower 3 bits */
-	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
-	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
-	u8 sample_mechanisms;
-	u8 sample_status;       /* only lower 2 bits */
-	__be64 option_mask;
-	__be64 vendor_mask;
-	__be32 sample_start;
-	__be32 sample_interval;
-	__be16 tag;
-	__be16 counter_select[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult {
-	__be16 tag;
-	__be16 sample_status;   /* only lower 2 bits */
-	__be32 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult_ext {
-	__be16 tag;
-	__be16 sample_status;   /* only lower 2 bits */
-	__be32 extended_width;  /* only upper 2 bits */
-	__be64 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved1;
-	u8 lli_ebor_errors;     /* 4, 4, bits */
-	__be16 reserved2;
-	__be16 vl15_dropped;
-	__be32 port_xmit_data;
-	__be32 port_rcv_data;
-	__be32 port_xmit_packets;
-	__be32 port_rcv_packets;
-} __attribute__ ((packed));
-
 struct ib_pma_portcounters_cong {
 	u8 reserved;
 	u8 reserved1;
@@ -297,7 +198,7 @@ struct ib_pma_portcounters_cong {
 	u8 port_xmit_constraint_errors;
 	u8 port_rcv_constraint_errors;
 	u8 reserved2;
-	u8 lli_ebor_errors;    /* 4, 4, bits */
+	u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
 	__be16 reserved3;
 	__be16 vl15_dropped;
 	__be64 port_xmit_data;
@@ -316,49 +217,11 @@ struct ib_pma_portcounters_cong {
 /* number of 4nsec cycles equaling 2secs */
 #define QIB_CONG_TIMER_PSINTERVAL               0x1DCD64EC

-#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
-#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
-#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
-#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
-#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
-#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
-#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
-#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
-#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
-#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
-#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
-#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
-#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
-
 #define IB_PMA_SEL_CONG_ALL                     0x01
 #define IB_PMA_SEL_CONG_PORT_DATA               0x02
 #define IB_PMA_SEL_CONG_XMIT                    0x04
 #define IB_PMA_SEL_CONG_ROUTING                 0x08

-struct ib_pma_portcounters_ext {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be32 reserved1;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_unicast_xmit_packets;
-	__be64 port_unicast_rcv_packets;
-	__be64 port_multicast_xmit_packets;
-	__be64 port_multicast_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
-#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
-#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
-#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
-#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
-#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
-#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
-#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
-
 /*
  * The PortSamplesControl.CounterMasks field is an array of 3 bit fields
  * which specify the N'th counter's capabilities. See ch. 16.1.3.2.
Index: linux-2.6.39-rc/include/rdma/ib_pma.h
===================================================================
--- /dev/null
+++ linux-2.6.39-rc/include/rdma/ib_pma.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
+ * All rights reserved.
+ * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if !defined(IB_PMA_H)
+#define IB_PMA_H
+
+#include <rdma/ib_mad.h>
+
+/*
+ * PMA class portinfo capability mask bits
+ */
+#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
+#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
+#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
+
+#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
+#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
+#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
+#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
+#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
+#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
+
+struct ib_pma_mad {
+	struct ib_mad_hdr mad_hdr;
+	u8 reserved[40];
+	u8 data[192];
+} __attribute__ ((packed));
+
+struct ib_pma_portsamplescontrol {
+	u8 opcode;
+	u8 port_select;
+	u8 tick;
+	u8 counter_width;		/* resv: 7:3, counter width: 2:0 */
+	__be32 counter_mask0_9;		/* 2, 10 3-bit fields */
+	__be16 counter_mask10_14;	/* 1, 5 3-bit fields */
+	u8 sample_mechanisms;
+	u8 sample_status;		/* only lower 2 bits */
+	__be64 option_mask;
+	__be64 vendor_mask;
+	__be32 sample_start;
+	__be32 sample_interval;
+	__be16 tag;
+	__be16 counter_select[15];
+	__be32 reserved1;
+	__be64 samples_only_option_mask;
+	__be32 reserved2[28];
+};
+
+struct ib_pma_portsamplesresult {
+	__be16 tag;
+	__be16 sample_status;   /* only lower 2 bits */
+	__be32 counter[15];
+};
+
+struct ib_pma_portsamplesresult_ext {
+	__be16 tag;
+	__be16 sample_status;   /* only lower 2 bits */
+	__be32 extended_width;  /* only upper 2 bits */
+	__be64 counter[15];
+};
+
+struct ib_pma_portcounters {
+	u8 reserved;
+	u8 port_select;
+	__be16 counter_select;
+	__be16 symbol_error_counter;
+	u8 link_error_recovery_counter;
+	u8 link_downed_counter;
+	__be16 port_rcv_errors;
+	__be16 port_rcv_remphys_errors;
+	__be16 port_rcv_switch_relay_errors;
+	__be16 port_xmit_discards;
+	u8 port_xmit_constraint_errors;
+	u8 port_rcv_constraint_errors;
+	u8 reserved1;
+	u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
+	__be16 reserved2;
+	__be16 vl15_dropped;
+	__be32 port_xmit_data;
+	__be32 port_rcv_data;
+	__be32 port_xmit_packets;
+	__be32 port_rcv_packets;
+	__be32 port_xmit_wait;
+} __attribute__ ((packed));
+
+
+#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
+#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
+#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
+#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
+#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
+#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
+#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
+#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
+#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
+#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
+#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
+#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
+#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
+
+struct ib_pma_portcounters_ext {
+	u8 reserved;
+	u8 port_select;
+	__be16 counter_select;
+	__be32 reserved1;
+	__be64 port_xmit_data;
+	__be64 port_rcv_data;
+	__be64 port_xmit_packets;
+	__be64 port_rcv_packets;
+	__be64 port_unicast_xmit_packets;
+	__be64 port_unicast_rcv_packets;
+	__be64 port_multicast_xmit_packets;
+	__be64 port_multicast_rcv_packets;
+} __attribute__ ((packed));
+
+#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
+#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
+#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
+#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
+#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
+#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
+#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
+#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
+
+#endif /* IB_PMA_H */

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]         ` <alpine.LRH.2.00.1106161119120.12552-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
@ 2011-06-16 14:18           ` Or Gerlitz
       [not found]             ` <4DFA10CC.5080002-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  2011-07-05 15:46           ` [PATCH V2 " Or Gerlitz
  1 sibling, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-16 14:18 UTC (permalink / raw)
  To: Mike Marciniszyn; +Cc: linux-rdma


> Move the various definitions and mad structures needed for software
> implementation of IBA PM agent from the ipath and qib drivers into
> a single include file, which in turn could be used by more consumers.
Hi, I don't see any maintainer entry for qib and the ipath maintainer 
entry seems
to be invalid? are you the maintainer? could you look here?

Or.

> changes from V0 - applied feedback from Sean and Hal
>
>   - renamed struct ib_perf to be ib_pma_mad which now starts with struct ib_mad_hdr
>   - removed struct ib_pma_classportinfo, use struct ib_class_port_info from ib_mad.h
>   - clarified comments for bit fields, adding missing fields for ib_pma_portsamplescontrol
>   - removed packing from struct ib_pma_portsamples{control, result, result_ext}
>   - changed struct ib_pma_portcounters :: lli_ebor_errors to be link_overrun_errors
>   - added xmit wait to struct ib_pma_portcounters
>   - left proprietary defs in the qib code
>
>   drivers/infiniband/hw/ipath/ipath_mad.c |  198 +++++---------------------------
>   drivers/infiniband/hw/qib/qib_mad.h     |  151 ------------------------
>   include/rdma/ib_pma.h                   |  164 ++++++++++++++++++++++++++
>   3 files changed, 200 insertions(+), 313 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]             ` <4DFA10CC.5080002-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2011-06-16 15:49               ` Mike Marciniszyn
       [not found]                 ` <35AAF1E4A771E142979F27B51793A4888838E71F03-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Mike Marciniszyn @ 2011-06-16 15:49 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: linux-rdma, Todd Rimmer, Edward Mascarenhas

Yes,

I'm the maintainer for both qib and ipath.

I'm currently looking over these fixes.

We also have pending fixes in the qib_mad.c that are complicating my testing with the various source streams we are maintaining.

I would be nice as a result of this if we could resolve issues associated with https://patchwork.kernel.org/patch/523041/ to reduce those impacts.

Mike


> -----Original Message-----
> From: Or Gerlitz [mailto:ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org]
> Sent: Thursday, June 16, 2011 10:19 AM
> To: Mike Marciniszyn
> Cc: linux-rdma
> Subject: Re: [PATCH V1 7/9] ib/pma: add include file for IBA
> performance counters definitions
>
>
> > Move the various definitions and mad structures needed for software
> > implementation of IBA PM agent from the ipath and qib drivers into
> > a single include file, which in turn could be used by more consumers.
> Hi, I don't see any maintainer entry for qib and the ipath maintainer
> entry seems
> to be invalid? are you the maintainer? could you look here?
>
> Or.
>
> > changes from V0 - applied feedback from Sean and Hal
> >
> >   - renamed struct ib_perf to be ib_pma_mad which now starts with
> struct ib_mad_hdr
> >   - removed struct ib_pma_classportinfo, use struct
> ib_class_port_info from ib_mad.h
> >   - clarified comments for bit fields, adding missing fields for
> ib_pma_portsamplescontrol
> >   - removed packing from struct ib_pma_portsamples{control, result,
> result_ext}
> >   - changed struct ib_pma_portcounters :: lli_ebor_errors to be
> link_overrun_errors
> >   - added xmit wait to struct ib_pma_portcounters
> >   - left proprietary defs in the qib code
> >
> >   drivers/infiniband/hw/ipath/ipath_mad.c |  198 +++++---------------
> ------------
> >   drivers/infiniband/hw/qib/qib_mad.h     |  151 --------------------
> ----
> >   include/rdma/ib_pma.h                   |  164
> ++++++++++++++++++++++++++
> >   3 files changed, 200 insertions(+), 313 deletions(-)


This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]             ` <4DF9B319.6070100-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2011-06-16 16:19               ` Hefty, Sean
       [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237302184A-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Hefty, Sean @ 2011-06-16 16:19 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Roland Dreier, linux-rdma

> > Rather than having IB_PMA_SEL_* and IB_PMA_SELX_*, we could follow
> what's done in ib_sa.h:
> > IB_PM_<structure>_<field>
> 
> I would need some guidance here...  maybe you can elaborate a little
> further with the V1 posting which will follow soon

Here's part of a comment from ib_sa.h:

 * Structures for SA records are named "struct ib_sa_xxx_rec."
 * For a record with structure ib_sa_xxx_rec, the naming convention
 * for the component mask value for field yyy is IB_SA_XXX_REC_YYY (we
 * never use different abbreviations or otherwise change the spelling
 * of xxx/yyy between ib_sa_xxx_rec.yyy and IB_SA_XXX_REC_YYY).

>From V1, we have:

+struct ib_pma_portcounters_ext {
..
+	__be64 port_unicast_xmit_packets;
..
+#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)

at this point, you're patches look good to me and are an improvement over what's there now.  So, I'd file this comment as a future nice to have.

- Sean
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237302184A-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
@ 2011-06-16 17:57                   ` Or Gerlitz
  2011-06-20 16:46                   ` IBoE updates - GID change event / network flow counters (was: [PATCH 7/9] ib/pma: add include file for IBA perf counters) Or Gerlitz
  1 sibling, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-16 17:57 UTC (permalink / raw)
  To: Hefty, Sean; +Cc: Or Gerlitz, Roland Dreier, linux-rdma

Hefty, Sean <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> at this point, you're patches look good to me and are an improvement over what's there
> now.  So, I'd file this comment as a future nice to have.

cool, thanks,

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                 ` <35AAF1E4A771E142979F27B51793A4888838E71F03-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
@ 2011-06-16 18:14                   ` Or Gerlitz
       [not found]                     ` <BANLkTikpMWYaXB8Ne+FaLGHi2L5TUCNDkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-16 18:14 UTC (permalink / raw)
  To: Mike Marciniszyn; +Cc: Or Gerlitz, linux-rdma

Mike Marciniszyn <mike.marciniszyn-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org> wrote:

> Yes, I'm the maintainer for both qib and ipath. I'm currently looking over these fixes.

thanks,

> We also have pending fixes in the qib_mad.c that are complicating my
> testing with the various source streams we are maintaining.

are you okay to have this patch accepted first and later re-submit
your other patch?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: IBoE updates - GID change event / network flow counters (was: [PATCH 7/9] ib/pma: add include file for IBA perf counters)
       [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237302184A-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
  2011-06-16 17:57                   ` Or Gerlitz
@ 2011-06-20 16:46                   ` Or Gerlitz
       [not found]                     ` <4DFF797E.5090904-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  1 sibling, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-06-20 16:46 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Hefty, Sean, linux-rdma, Mike Marciniszyn

Hefty, Sean wrote:
> at this point, you're patches look good to me and are an improvement over what's there now.  
> So, I'd file this comment as a future nice to have.

Roland,

My patch series went through Sean's review (and passed... patch 7/9 
needed fixes and I posted V1 for it) any more feedback you need to 
accept them or you just want to go over them yourself?

Or.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: IBoE updates - GID change event / network flow counters (was: [PATCH 7/9] ib/pma: add include file for IBA perf counters)
       [not found]                     ` <4DFF797E.5090904-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2011-06-20 18:18                       ` Roland Dreier
       [not found]                         ` <BANLkTi=VR6v=xSwzLRHDL1x2=05wF-H5KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Roland Dreier @ 2011-06-20 18:18 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Hefty, Sean, linux-rdma, Mike Marciniszyn

On Mon, Jun 20, 2011 at 9:46 AM, Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:
> Hefty, Sean wrote:
>>
>> at this point, you're patches look good to me and are an improvement over
>> what's there now.  So, I'd file this comment as a future nice to have.
>
> Roland,
>
> My patch series went through Sean's review (and passed... patch 7/9 needed
> fixes and I posted V1 for it) any more feedback you need to accept them or
> you just want to go over them yourself?

Looks fine for 3.1, I expect to merge it in the next week or two (possibly will
see some minor nits as I merge them).

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: IBoE updates - GID change event / network flow counters (was: [PATCH 7/9] ib/pma: add include file for IBA perf counters)
       [not found]                         ` <BANLkTi=VR6v=xSwzLRHDL1x2=05wF-H5KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-06-20 20:38                           ` Or Gerlitz
  2011-07-16 19:57                           ` Or Gerlitz
  1 sibling, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-06-20 20:38 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Or Gerlitz, Hefty, Sean, linux-rdma, Mike Marciniszyn

Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> Looks fine for 3.1, I expect to merge it in the next week or two (possibly will
> see some minor nits as I merge them).

Sounds good, thanks!

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH V2 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]         ` <alpine.LRH.2.00.1106161119120.12552-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
  2011-06-16 14:18           ` Or Gerlitz
@ 2011-07-05 15:46           ` Or Gerlitz
  1 sibling, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-07-05 15:46 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma, Mike Marciniszyn

Move the various definitions and mad structures needed for software
implementation of IBA PM agent from the ipath and qib drivers into
a single include file, which in turn could be used by more consumers.

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---

Roland, this adds a section which slipped away when I generated the
patch, sorry for that. Are you going to merge these patches this week?

changes from V0 - applied feedback from Sean and Hal
 - renamed ib_perf to be ib_pma_mad which now starts with struct ib_mad_hdr
 - removed struct ib_pma_classportinfo, use struct ib_class_port_info from ib_mad.h
 - clarified comments for bit fields, adding missing fields for ib_pma_portsamplescontrol
 - removed packing from struct ib_pma_portsamples{control, result, result_ext}
 - changed struct ib_pma_portcounters :: lli_ebor_errors to be link_overrun_errors
 - added xmit wait to struct ib_pma_portcounters
 - left proprietary defs in the qib code

changes from V1
  - added the modifications in qib_mad.c made due to the review by Sean, which
    were left out by mistake

 drivers/infiniband/hw/ipath/ipath_mad.c |  198 +++++---------------------------
 drivers/infiniband/hw/qib/qib_mad.c     |   78 ++++++------
 drivers/infiniband/hw/qib/qib_mad.h     |  143 -----------------------
 include/rdma/ib_pma.h                   |  156 +++++++++++++++++++++++++
 4 files changed, 231 insertions(+), 344 deletions(-)

Index: b/drivers/infiniband/hw/ipath/ipath_mad.c
===================================================================
--- a/drivers/infiniband/hw/ipath/ipath_mad.c
+++ b/drivers/infiniband/hw/ipath/ipath_mad.c
@@ -32,6 +32,7 @@
  */

 #include <rdma/ib_smi.h>
+#include <rdma/ib_pma.h>

 #include "ipath_kernel.h"
 #include "ipath_verbs.h"
@@ -789,151 +790,18 @@ static int recv_subn_set_pkeytable(struc
 	return recv_subn_get_pkeytable(smp, ibdev);
 }

-#define IB_PMA_CLASS_PORT_INFO		cpu_to_be16(0x0001)
-#define IB_PMA_PORT_SAMPLES_CONTROL	cpu_to_be16(0x0010)
-#define IB_PMA_PORT_SAMPLES_RESULT	cpu_to_be16(0x0011)
-#define IB_PMA_PORT_COUNTERS		cpu_to_be16(0x0012)
-#define IB_PMA_PORT_COUNTERS_EXT	cpu_to_be16(0x001D)
-#define IB_PMA_PORT_SAMPLES_RESULT_EXT	cpu_to_be16(0x001E)
-
-struct ib_perf {
-	u8 base_version;
-	u8 mgmt_class;
-	u8 class_version;
-	u8 method;
-	__be16 status;
-	__be16 unused;
-	__be64 tid;
-	__be16 attr_id;
-	__be16 resv;
-	__be32 attr_mod;
-	u8 reserved[40];
-	u8 data[192];
-} __attribute__ ((packed));
-
-struct ib_pma_classportinfo {
-	u8 base_version;
-	u8 class_version;
-	__be16 cap_mask;
-	u8 reserved[3];
-	u8 resp_time_value;	/* only lower 5 bits */
-	union ib_gid redirect_gid;
-	__be32 redirect_tc_sl_fl;	/* 8, 4, 20 bits respectively */
-	__be16 redirect_lid;
-	__be16 redirect_pkey;
-	__be32 redirect_qp;	/* only lower 24 bits */
-	__be32 redirect_qkey;
-	union ib_gid trap_gid;
-	__be32 trap_tc_sl_fl;	/* 8, 4, 20 bits respectively */
-	__be16 trap_lid;
-	__be16 trap_pkey;
-	__be32 trap_hl_qp;	/* 8, 24 bits respectively */
-	__be32 trap_qkey;
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplescontrol {
-	u8 opcode;
-	u8 port_select;
-	u8 tick;
-	u8 counter_width;	/* only lower 3 bits */
-	__be32 counter_mask0_9;	/* 2, 10 * 3, bits */
-	__be16 counter_mask10_14;	/* 1, 5 * 3, bits */
-	u8 sample_mechanisms;
-	u8 sample_status;	/* only lower 2 bits */
-	__be64 option_mask;
-	__be64 vendor_mask;
-	__be32 sample_start;
-	__be32 sample_interval;
-	__be16 tag;
-	__be16 counter_select[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult {
-	__be16 tag;
-	__be16 sample_status;	/* only lower 2 bits */
-	__be32 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult_ext {
-	__be16 tag;
-	__be16 sample_status;	/* only lower 2 bits */
-	__be32 extended_width;	/* only upper 2 bits */
-	__be64 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved1;
-	u8 lli_ebor_errors;	/* 4, 4, bits */
-	__be16 reserved2;
-	__be16 vl15_dropped;
-	__be32 port_xmit_data;
-	__be32 port_rcv_data;
-	__be32 port_xmit_packets;
-	__be32 port_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SEL_SYMBOL_ERROR			cpu_to_be16(0x0001)
-#define IB_PMA_SEL_LINK_ERROR_RECOVERY		cpu_to_be16(0x0002)
-#define IB_PMA_SEL_LINK_DOWNED			cpu_to_be16(0x0004)
-#define IB_PMA_SEL_PORT_RCV_ERRORS		cpu_to_be16(0x0008)
-#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS	cpu_to_be16(0x0010)
-#define IB_PMA_SEL_PORT_XMIT_DISCARDS		cpu_to_be16(0x0040)
-#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS	cpu_to_be16(0x0200)
-#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS	cpu_to_be16(0x0400)
-#define IB_PMA_SEL_PORT_VL15_DROPPED		cpu_to_be16(0x0800)
-#define IB_PMA_SEL_PORT_XMIT_DATA		cpu_to_be16(0x1000)
-#define IB_PMA_SEL_PORT_RCV_DATA		cpu_to_be16(0x2000)
-#define IB_PMA_SEL_PORT_XMIT_PACKETS		cpu_to_be16(0x4000)
-#define IB_PMA_SEL_PORT_RCV_PACKETS		cpu_to_be16(0x8000)
-
-struct ib_pma_portcounters_ext {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be32 reserved1;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_unicast_xmit_packets;
-	__be64 port_unicast_rcv_packets;
-	__be64 port_multicast_xmit_packets;
-	__be64 port_multicast_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SELX_PORT_XMIT_DATA		cpu_to_be16(0x0001)
-#define IB_PMA_SELX_PORT_RCV_DATA		cpu_to_be16(0x0002)
-#define IB_PMA_SELX_PORT_XMIT_PACKETS		cpu_to_be16(0x0004)
-#define IB_PMA_SELX_PORT_RCV_PACKETS		cpu_to_be16(0x0008)
-#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS	cpu_to_be16(0x0010)
-#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS	cpu_to_be16(0x0020)
-#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS	cpu_to_be16(0x0040)
-#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS	cpu_to_be16(0x0080)
-
-static int recv_pma_get_classportinfo(struct ib_perf *pmp)
+static int recv_pma_get_classportinfo(struct ib_pma_mad *pmp)
 {
-	struct ib_pma_classportinfo *p =
-		(struct ib_pma_classportinfo *)pmp->data;
+	struct ib_class_port_info *p =
+		(struct ib_class_port_info *)pmp->data;

 	memset(pmp->data, 0, sizeof(pmp->data));

-	if (pmp->attr_mod != 0)
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0)
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	/* Indicate AllPortSelect is valid (only one port anyway) */
-	p->cap_mask = cpu_to_be16(1 << 8);
+	p->capability_mask = cpu_to_be16(1 << 8);
 	p->base_version = 1;
 	p->class_version = 1;
 	/*
@@ -957,7 +825,7 @@ static int recv_pma_get_classportinfo(st
 				    COUNTER_MASK(1, 3) | \
 				    COUNTER_MASK(1, 4))

-static int recv_pma_get_portsamplescontrol(struct ib_perf *pmp,
+static int recv_pma_get_portsamplescontrol(struct ib_pma_mad *pmp,
 					   struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplescontrol *p =
@@ -970,9 +838,9 @@ static int recv_pma_get_portsamplescontr
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (port_select != port && port_select != 0xFF))
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 	/*
 	 * Ticks are 10x the link transfer period which for 2.5Gbs is 4
 	 * nsec.  0 == 4 nsec., 1 == 8 nsec., ..., 255 == 1020 nsec.  Sample
@@ -1006,7 +874,7 @@ static int recv_pma_get_portsamplescontr
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_set_portsamplescontrol(struct ib_perf *pmp,
+static int recv_pma_set_portsamplescontrol(struct ib_pma_mad *pmp,
 					   struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplescontrol *p =
@@ -1017,9 +885,9 @@ static int recv_pma_set_portsamplescontr
 	u8 status;
 	int ret;

-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (p->port_select != port && p->port_select != 0xFF)) {
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 		ret = reply((struct ib_smp *) pmp);
 		goto bail;
 	}
@@ -1093,7 +961,7 @@ static u64 get_counter(struct ipath_ibde
 	return ret;
 }

-static int recv_pma_get_portsamplesresult(struct ib_perf *pmp,
+static int recv_pma_get_portsamplesresult(struct ib_pma_mad *pmp,
 					  struct ib_device *ibdev)
 {
 	struct ib_pma_portsamplesresult *p =
@@ -1118,7 +986,7 @@ static int recv_pma_get_portsamplesresul
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_get_portsamplesresult_ext(struct ib_perf *pmp,
+static int recv_pma_get_portsamplesresult_ext(struct ib_pma_mad *pmp,
 					      struct ib_device *ibdev)
 {
 	struct ib_pma_portsamplesresult_ext *p =
@@ -1145,7 +1013,7 @@ static int recv_pma_get_portsamplesresul
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_get_portcounters(struct ib_perf *pmp,
+static int recv_pma_get_portcounters(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1179,9 +1047,9 @@ static int recv_pma_get_portcounters(str
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (port_select != port && port_select != 0xFF))
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	if (cntrs.symbol_error_counter > 0xFFFFUL)
 		p->symbol_error_counter = cpu_to_be16(0xFFFF);
@@ -1216,7 +1084,7 @@ static int recv_pma_get_portcounters(str
 		cntrs.local_link_integrity_errors = 0xFUL;
 	if (cntrs.excessive_buffer_overrun_errors > 0xFUL)
 		cntrs.excessive_buffer_overrun_errors = 0xFUL;
-	p->lli_ebor_errors = (cntrs.local_link_integrity_errors << 4) |
+	p->link_overrun_errors = (cntrs.local_link_integrity_errors << 4) |
 		cntrs.excessive_buffer_overrun_errors;
 	if (cntrs.vl15_dropped > 0xFFFFUL)
 		p->vl15_dropped = cpu_to_be16(0xFFFF);
@@ -1244,7 +1112,7 @@ static int recv_pma_get_portcounters(str
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_get_portcounters_ext(struct ib_perf *pmp,
+static int recv_pma_get_portcounters_ext(struct ib_pma_mad *pmp,
 					 struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters_ext *p =
@@ -1265,9 +1133,9 @@ static int recv_pma_get_portcounters_ext
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 ||
+	if (pmp->mad_hdr.attr_mod != 0 ||
 	    (port_select != port && port_select != 0xFF))
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	p->port_xmit_data = cpu_to_be64(swords);
 	p->port_rcv_data = cpu_to_be64(rwords);
@@ -1281,7 +1149,7 @@ static int recv_pma_get_portcounters_ext
 	return reply((struct ib_smp *) pmp);
 }

-static int recv_pma_set_portcounters(struct ib_perf *pmp,
+static int recv_pma_set_portcounters(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1344,7 +1212,7 @@ static int recv_pma_set_portcounters(str
 	return recv_pma_get_portcounters(pmp, ibdev, port);
 }

-static int recv_pma_set_portcounters_ext(struct ib_perf *pmp,
+static int recv_pma_set_portcounters_ext(struct ib_pma_mad *pmp,
 					 struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1518,19 +1386,19 @@ static int process_perf(struct ib_device
 			struct ib_mad *in_mad,
 			struct ib_mad *out_mad)
 {
-	struct ib_perf *pmp = (struct ib_perf *)out_mad;
+	struct ib_pma_mad *pmp = (struct ib_pma_mad *)out_mad;
 	int ret;

 	*out_mad = *in_mad;
-	if (pmp->class_version != 1) {
-		pmp->status |= IB_SMP_UNSUP_VERSION;
+	if (pmp->mad_hdr.class_version != 1) {
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION;
 		ret = reply((struct ib_smp *) pmp);
 		goto bail;
 	}

-	switch (pmp->method) {
+	switch (pmp->mad_hdr.method) {
 	case IB_MGMT_METHOD_GET:
-		switch (pmp->attr_id) {
+		switch (pmp->mad_hdr.attr_id) {
 		case IB_PMA_CLASS_PORT_INFO:
 			ret = recv_pma_get_classportinfo(pmp);
 			goto bail;
@@ -1554,13 +1422,13 @@ static int process_perf(struct ib_device
 							    port_num);
 			goto bail;
 		default:
-			pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+			pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 			ret = reply((struct ib_smp *) pmp);
 			goto bail;
 		}

 	case IB_MGMT_METHOD_SET:
-		switch (pmp->attr_id) {
+		switch (pmp->mad_hdr.attr_id) {
 		case IB_PMA_PORT_SAMPLES_CONTROL:
 			ret = recv_pma_set_portsamplescontrol(pmp, ibdev,
 							      port_num);
@@ -1574,7 +1442,7 @@ static int process_perf(struct ib_device
 							    port_num);
 			goto bail;
 		default:
-			pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+			pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 			ret = reply((struct ib_smp *) pmp);
 			goto bail;
 		}
@@ -1588,7 +1456,7 @@ static int process_perf(struct ib_device
 		ret = IB_MAD_RESULT_SUCCESS;
 		goto bail;
 	default:
-		pmp->status |= IB_SMP_UNSUP_METHOD;
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_METHOD;
 		ret = reply((struct ib_smp *) pmp);
 	}

Index: b/drivers/infiniband/hw/qib/qib_mad.h
===================================================================
--- a/drivers/infiniband/hw/qib/qib_mad.h
+++ b/drivers/infiniband/hw/qib/qib_mad.h
@@ -32,6 +32,8 @@
  * SOFTWARE.
  */

+#include <rdma/ib_pma.h>
+
 #define IB_SMP_UNSUP_VERSION    cpu_to_be16(0x0004)
 #define IB_SMP_UNSUP_METHOD     cpu_to_be16(0x0008)
 #define IB_SMP_UNSUP_METH_ATTR  cpu_to_be16(0x000C)
@@ -180,109 +182,8 @@ struct ib_vl_weight_elem {
 #define IB_VLARB_HIGHPRI_0_31   3
 #define IB_VLARB_HIGHPRI_32_63  4

-/*
- * PMA class portinfo capability mask bits
- */
-#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
-#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
-#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
-
-#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
-#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
-#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
-#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
-#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
-#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
 #define IB_PMA_PORT_COUNTERS_CONG       cpu_to_be16(0xFF00)

-struct ib_perf {
-	u8 base_version;
-	u8 mgmt_class;
-	u8 class_version;
-	u8 method;
-	__be16 status;
-	__be16 unused;
-	__be64 tid;
-	__be16 attr_id;
-	__be16 resv;
-	__be32 attr_mod;
-	u8 reserved[40];
-	u8 data[192];
-} __attribute__ ((packed));
-
-struct ib_pma_classportinfo {
-	u8 base_version;
-	u8 class_version;
-	__be16 cap_mask;
-	u8 reserved[3];
-	u8 resp_time_value;     /* only lower 5 bits */
-	union ib_gid redirect_gid;
-	__be32 redirect_tc_sl_fl;       /* 8, 4, 20 bits respectively */
-	__be16 redirect_lid;
-	__be16 redirect_pkey;
-	__be32 redirect_qp;     /* only lower 24 bits */
-	__be32 redirect_qkey;
-	union ib_gid trap_gid;
-	__be32 trap_tc_sl_fl;   /* 8, 4, 20 bits respectively */
-	__be16 trap_lid;
-	__be16 trap_pkey;
-	__be32 trap_hl_qp;      /* 8, 24 bits respectively */
-	__be32 trap_qkey;
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplescontrol {
-	u8 opcode;
-	u8 port_select;
-	u8 tick;
-	u8 counter_width;       /* only lower 3 bits */
-	__be32 counter_mask0_9; /* 2, 10 * 3, bits */
-	__be16 counter_mask10_14;       /* 1, 5 * 3, bits */
-	u8 sample_mechanisms;
-	u8 sample_status;       /* only lower 2 bits */
-	__be64 option_mask;
-	__be64 vendor_mask;
-	__be32 sample_start;
-	__be32 sample_interval;
-	__be16 tag;
-	__be16 counter_select[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult {
-	__be16 tag;
-	__be16 sample_status;   /* only lower 2 bits */
-	__be32 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portsamplesresult_ext {
-	__be16 tag;
-	__be16 sample_status;   /* only lower 2 bits */
-	__be32 extended_width;  /* only upper 2 bits */
-	__be64 counter[15];
-} __attribute__ ((packed));
-
-struct ib_pma_portcounters {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be16 symbol_error_counter;
-	u8 link_error_recovery_counter;
-	u8 link_downed_counter;
-	__be16 port_rcv_errors;
-	__be16 port_rcv_remphys_errors;
-	__be16 port_rcv_switch_relay_errors;
-	__be16 port_xmit_discards;
-	u8 port_xmit_constraint_errors;
-	u8 port_rcv_constraint_errors;
-	u8 reserved1;
-	u8 lli_ebor_errors;     /* 4, 4, bits */
-	__be16 reserved2;
-	__be16 vl15_dropped;
-	__be32 port_xmit_data;
-	__be32 port_rcv_data;
-	__be32 port_xmit_packets;
-	__be32 port_rcv_packets;
-} __attribute__ ((packed));
-
 struct ib_pma_portcounters_cong {
 	u8 reserved;
 	u8 reserved1;
@@ -297,7 +198,7 @@ struct ib_pma_portcounters_cong {
 	u8 port_xmit_constraint_errors;
 	u8 port_rcv_constraint_errors;
 	u8 reserved2;
-	u8 lli_ebor_errors;    /* 4, 4, bits */
+	u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
 	__be16 reserved3;
 	__be16 vl15_dropped;
 	__be64 port_xmit_data;
@@ -316,49 +217,11 @@ struct ib_pma_portcounters_cong {
 /* number of 4nsec cycles equaling 2secs */
 #define QIB_CONG_TIMER_PSINTERVAL               0x1DCD64EC

-#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
-#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
-#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
-#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
-#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
-#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
-#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
-#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
-#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
-#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
-#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
-#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
-#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
-
 #define IB_PMA_SEL_CONG_ALL                     0x01
 #define IB_PMA_SEL_CONG_PORT_DATA               0x02
 #define IB_PMA_SEL_CONG_XMIT                    0x04
 #define IB_PMA_SEL_CONG_ROUTING                 0x08

-struct ib_pma_portcounters_ext {
-	u8 reserved;
-	u8 port_select;
-	__be16 counter_select;
-	__be32 reserved1;
-	__be64 port_xmit_data;
-	__be64 port_rcv_data;
-	__be64 port_xmit_packets;
-	__be64 port_rcv_packets;
-	__be64 port_unicast_xmit_packets;
-	__be64 port_unicast_rcv_packets;
-	__be64 port_multicast_xmit_packets;
-	__be64 port_multicast_rcv_packets;
-} __attribute__ ((packed));
-
-#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
-#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
-#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
-#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
-#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
-#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
-#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
-#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
-
 /*
  * The PortSamplesControl.CounterMasks field is an array of 3 bit fields
  * which specify the N'th counter's capabilities. See ch. 16.1.3.2.
Index: b/include/rdma/ib_pma.h
===================================================================
--- /dev/null
+++ b/include/rdma/ib_pma.h
@@ -0,0 +1,156 @@
+/*
+ * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
+ * All rights reserved.
+ * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
+ *
+ * This software is available to you under a choice of one of two
+ * licenses.  You may choose to be licensed under the terms of the GNU
+ * General Public License (GPL) Version 2, available from the file
+ * COPYING in the main directory of this source tree, or the
+ * OpenIB.org BSD license below:
+ *
+ *     Redistribution and use in source and binary forms, with or
+ *     without modification, are permitted provided that the following
+ *     conditions are met:
+ *
+ *      - Redistributions of source code must retain the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer.
+ *
+ *      - Redistributions in binary form must reproduce the above
+ *        copyright notice, this list of conditions and the following
+ *        disclaimer in the documentation and/or other materials
+ *        provided with the distribution.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#if !defined(IB_PMA_H)
+#define IB_PMA_H
+
+#include <rdma/ib_mad.h>
+
+/*
+ * PMA class portinfo capability mask bits
+ */
+#define IB_PMA_CLASS_CAP_ALLPORTSELECT  cpu_to_be16(1 << 8)
+#define IB_PMA_CLASS_CAP_EXT_WIDTH      cpu_to_be16(1 << 9)
+#define IB_PMA_CLASS_CAP_XMIT_WAIT      cpu_to_be16(1 << 12)
+
+#define IB_PMA_CLASS_PORT_INFO          cpu_to_be16(0x0001)
+#define IB_PMA_PORT_SAMPLES_CONTROL     cpu_to_be16(0x0010)
+#define IB_PMA_PORT_SAMPLES_RESULT      cpu_to_be16(0x0011)
+#define IB_PMA_PORT_COUNTERS            cpu_to_be16(0x0012)
+#define IB_PMA_PORT_COUNTERS_EXT        cpu_to_be16(0x001D)
+#define IB_PMA_PORT_SAMPLES_RESULT_EXT  cpu_to_be16(0x001E)
+
+struct ib_pma_mad {
+	struct ib_mad_hdr mad_hdr;
+	u8 reserved[40];
+	u8 data[192];
+} __attribute__ ((packed));
+
+struct ib_pma_portsamplescontrol {
+	u8 opcode;
+	u8 port_select;
+	u8 tick;
+	u8 counter_width;		/* resv: 7:3, counter width: 2:0 */
+	__be32 counter_mask0_9;		/* 2, 10 3-bit fields */
+	__be16 counter_mask10_14;	/* 1, 5 3-bit fields */
+	u8 sample_mechanisms;
+	u8 sample_status;		/* only lower 2 bits */
+	__be64 option_mask;
+	__be64 vendor_mask;
+	__be32 sample_start;
+	__be32 sample_interval;
+	__be16 tag;
+	__be16 counter_select[15];
+	__be32 reserved1;
+	__be64 samples_only_option_mask;
+	__be32 reserved2[28];
+};
+
+struct ib_pma_portsamplesresult {
+	__be16 tag;
+	__be16 sample_status;   /* only lower 2 bits */
+	__be32 counter[15];
+};
+
+struct ib_pma_portsamplesresult_ext {
+	__be16 tag;
+	__be16 sample_status;   /* only lower 2 bits */
+	__be32 extended_width;  /* only upper 2 bits */
+	__be64 counter[15];
+};
+
+struct ib_pma_portcounters {
+	u8 reserved;
+	u8 port_select;
+	__be16 counter_select;
+	__be16 symbol_error_counter;
+	u8 link_error_recovery_counter;
+	u8 link_downed_counter;
+	__be16 port_rcv_errors;
+	__be16 port_rcv_remphys_errors;
+	__be16 port_rcv_switch_relay_errors;
+	__be16 port_xmit_discards;
+	u8 port_xmit_constraint_errors;
+	u8 port_rcv_constraint_errors;
+	u8 reserved1;
+	u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
+	__be16 reserved2;
+	__be16 vl15_dropped;
+	__be32 port_xmit_data;
+	__be32 port_rcv_data;
+	__be32 port_xmit_packets;
+	__be32 port_rcv_packets;
+	__be32 port_xmit_wait;
+} __attribute__ ((packed));
+
+
+#define IB_PMA_SEL_SYMBOL_ERROR                 cpu_to_be16(0x0001)
+#define IB_PMA_SEL_LINK_ERROR_RECOVERY          cpu_to_be16(0x0002)
+#define IB_PMA_SEL_LINK_DOWNED                  cpu_to_be16(0x0004)
+#define IB_PMA_SEL_PORT_RCV_ERRORS              cpu_to_be16(0x0008)
+#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS      cpu_to_be16(0x0010)
+#define IB_PMA_SEL_PORT_XMIT_DISCARDS           cpu_to_be16(0x0040)
+#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS  cpu_to_be16(0x0200)
+#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS    cpu_to_be16(0x0400)
+#define IB_PMA_SEL_PORT_VL15_DROPPED            cpu_to_be16(0x0800)
+#define IB_PMA_SEL_PORT_XMIT_DATA               cpu_to_be16(0x1000)
+#define IB_PMA_SEL_PORT_RCV_DATA                cpu_to_be16(0x2000)
+#define IB_PMA_SEL_PORT_XMIT_PACKETS            cpu_to_be16(0x4000)
+#define IB_PMA_SEL_PORT_RCV_PACKETS             cpu_to_be16(0x8000)
+
+struct ib_pma_portcounters_ext {
+	u8 reserved;
+	u8 port_select;
+	__be16 counter_select;
+	__be32 reserved1;
+	__be64 port_xmit_data;
+	__be64 port_rcv_data;
+	__be64 port_xmit_packets;
+	__be64 port_rcv_packets;
+	__be64 port_unicast_xmit_packets;
+	__be64 port_unicast_rcv_packets;
+	__be64 port_multicast_xmit_packets;
+	__be64 port_multicast_rcv_packets;
+} __attribute__ ((packed));
+
+#define IB_PMA_SELX_PORT_XMIT_DATA              cpu_to_be16(0x0001)
+#define IB_PMA_SELX_PORT_RCV_DATA               cpu_to_be16(0x0002)
+#define IB_PMA_SELX_PORT_XMIT_PACKETS           cpu_to_be16(0x0004)
+#define IB_PMA_SELX_PORT_RCV_PACKETS            cpu_to_be16(0x0008)
+#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS       cpu_to_be16(0x0010)
+#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS        cpu_to_be16(0x0020)
+#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS     cpu_to_be16(0x0040)
+#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS      cpu_to_be16(0x0080)
+
+#endif /* IB_PMA_H */
Index: b/drivers/infiniband/hw/qib/qib_mad.c
===================================================================
--- a/drivers/infiniband/hw/qib/qib_mad.c
+++ b/drivers/infiniband/hw/qib/qib_mad.c
@@ -1125,22 +1125,22 @@ static int subn_trap_repress(struct ib_s
 	return IB_MAD_RESULT_SUCCESS | IB_MAD_RESULT_CONSUMED;
 }

-static int pma_get_classportinfo(struct ib_perf *pmp,
+static int pma_get_classportinfo(struct ib_pma_mad *pmp,
 				 struct ib_device *ibdev)
 {
-	struct ib_pma_classportinfo *p =
-		(struct ib_pma_classportinfo *)pmp->data;
+	struct ib_class_port_info *p =
+		(struct ib_class_port_info *)pmp->data;
 	struct qib_devdata *dd = dd_from_ibdev(ibdev);

 	memset(pmp->data, 0, sizeof(pmp->data));

-	if (pmp->attr_mod != 0)
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0)
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	/* Note that AllPortSelect is not valid */
 	p->base_version = 1;
 	p->class_version = 1;
-	p->cap_mask = IB_PMA_CLASS_CAP_EXT_WIDTH;
+	p->capability_mask = IB_PMA_CLASS_CAP_EXT_WIDTH;
 	/*
 	 * Set the most significant bit of CM2 to indicate support for
 	 * congestion statistics
@@ -1154,7 +1154,7 @@ static int pma_get_classportinfo(struct
 	return reply((struct ib_smp *) pmp);
 }

-static int pma_get_portsamplescontrol(struct ib_perf *pmp,
+static int pma_get_portsamplescontrol(struct ib_pma_mad *pmp,
 				      struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplescontrol *p =
@@ -1169,8 +1169,8 @@ static int pma_get_portsamplescontrol(st
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 || port_select != port) {
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0 || port_select != port) {
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 		goto bail;
 	}
 	spin_lock_irqsave(&ibp->lock, flags);
@@ -1192,7 +1192,7 @@ bail:
 	return reply((struct ib_smp *) pmp);
 }

-static int pma_set_portsamplescontrol(struct ib_perf *pmp,
+static int pma_set_portsamplescontrol(struct ib_pma_mad *pmp,
 				      struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplescontrol *p =
@@ -1205,8 +1205,8 @@ static int pma_set_portsamplescontrol(st
 	u8 status, xmit_flags;
 	int ret;

-	if (pmp->attr_mod != 0 || p->port_select != port) {
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0 || p->port_select != port) {
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 		ret = reply((struct ib_smp *) pmp);
 		goto bail;
 	}
@@ -1321,7 +1321,7 @@ static u64 get_cache_hw_sample_counters(
 	return ret;
 }

-static int pma_get_portsamplesresult(struct ib_perf *pmp,
+static int pma_get_portsamplesresult(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplesresult *p =
@@ -1360,7 +1360,7 @@ static int pma_get_portsamplesresult(str
 	return reply((struct ib_smp *) pmp);
 }

-static int pma_get_portsamplesresult_ext(struct ib_perf *pmp,
+static int pma_get_portsamplesresult_ext(struct ib_pma_mad *pmp,
 					 struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portsamplesresult_ext *p =
@@ -1402,7 +1402,7 @@ static int pma_get_portsamplesresult_ext
 	return reply((struct ib_smp *) pmp);
 }

-static int pma_get_portcounters(struct ib_perf *pmp,
+static int pma_get_portcounters(struct ib_pma_mad *pmp,
 				struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1436,8 +1436,8 @@ static int pma_get_portcounters(struct i
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 || port_select != port)
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0 || port_select != port)
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	if (cntrs.symbol_error_counter > 0xFFFFUL)
 		p->symbol_error_counter = cpu_to_be16(0xFFFF);
@@ -1472,7 +1472,7 @@ static int pma_get_portcounters(struct i
 		cntrs.local_link_integrity_errors = 0xFUL;
 	if (cntrs.excessive_buffer_overrun_errors > 0xFUL)
 		cntrs.excessive_buffer_overrun_errors = 0xFUL;
-	p->lli_ebor_errors = (cntrs.local_link_integrity_errors << 4) |
+	p->link_overrun_errors = (cntrs.local_link_integrity_errors << 4) |
 		cntrs.excessive_buffer_overrun_errors;
 	if (cntrs.vl15_dropped > 0xFFFFUL)
 		p->vl15_dropped = cpu_to_be16(0xFFFF);
@@ -1500,7 +1500,7 @@ static int pma_get_portcounters(struct i
 	return reply((struct ib_smp *) pmp);
 }

-static int pma_get_portcounters_cong(struct ib_perf *pmp,
+static int pma_get_portcounters_cong(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	/* Congestion PMA packets start at offset 24 not 64 */
@@ -1510,7 +1510,7 @@ static int pma_get_portcounters_cong(str
 	struct qib_ibport *ibp = to_iport(ibdev, port);
 	struct qib_pportdata *ppd = ppd_from_ibp(ibp);
 	struct qib_devdata *dd = dd_from_ppd(ppd);
-	u32 port_select = be32_to_cpu(pmp->attr_mod) & 0xFF;
+	u32 port_select = be32_to_cpu(pmp->mad_hdr.attr_mod) & 0xFF;
 	u64 xmit_wait_counter;
 	unsigned long flags;

@@ -1519,9 +1519,9 @@ static int pma_get_portcounters_cong(str
 	 * SET method ends up calling this anyway.
 	 */
 	if (!dd->psxmitwait_supported)
-		pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 	if (port_select != port)
-		pmp->status |= IB_SMP_INVALID_FIELD;
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;

 	qib_get_counters(ppd, &cntrs);
 	spin_lock_irqsave(&ppd->ibport_data.lock, flags);
@@ -1603,7 +1603,7 @@ static int pma_get_portcounters_cong(str
 		cntrs.local_link_integrity_errors = 0xFUL;
 	if (cntrs.excessive_buffer_overrun_errors > 0xFUL)
 		cntrs.excessive_buffer_overrun_errors = 0xFUL;
-	p->lli_ebor_errors = (cntrs.local_link_integrity_errors << 4) |
+	p->link_overrun_errors = (cntrs.local_link_integrity_errors << 4) |
 		cntrs.excessive_buffer_overrun_errors;
 	if (cntrs.vl15_dropped > 0xFFFFUL)
 		p->vl15_dropped = cpu_to_be16(0xFFFF);
@@ -1613,7 +1613,7 @@ static int pma_get_portcounters_cong(str
 	return reply((struct ib_smp *)pmp);
 }

-static int pma_get_portcounters_ext(struct ib_perf *pmp,
+static int pma_get_portcounters_ext(struct ib_pma_mad *pmp,
 				    struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters_ext *p =
@@ -1626,8 +1626,8 @@ static int pma_get_portcounters_ext(stru
 	memset(pmp->data, 0, sizeof(pmp->data));

 	p->port_select = port_select;
-	if (pmp->attr_mod != 0 || port_select != port) {
-		pmp->status |= IB_SMP_INVALID_FIELD;
+	if (pmp->mad_hdr.attr_mod != 0 || port_select != port) {
+		pmp->mad_hdr.status |= IB_SMP_INVALID_FIELD;
 		goto bail;
 	}

@@ -1652,7 +1652,7 @@ bail:
 	return reply((struct ib_smp *) pmp);
 }

-static int pma_set_portcounters(struct ib_perf *pmp,
+static int pma_set_portcounters(struct ib_pma_mad *pmp,
 				struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1715,14 +1715,14 @@ static int pma_set_portcounters(struct i
 	return pma_get_portcounters(pmp, ibdev, port);
 }

-static int pma_set_portcounters_cong(struct ib_perf *pmp,
+static int pma_set_portcounters_cong(struct ib_pma_mad *pmp,
 				     struct ib_device *ibdev, u8 port)
 {
 	struct qib_ibport *ibp = to_iport(ibdev, port);
 	struct qib_pportdata *ppd = ppd_from_ibp(ibp);
 	struct qib_devdata *dd = dd_from_ppd(ppd);
 	struct qib_verbs_counters cntrs;
-	u32 counter_select = (be32_to_cpu(pmp->attr_mod) >> 24) & 0xFF;
+	u32 counter_select = (be32_to_cpu(pmp->mad_hdr.attr_mod) >> 24) & 0xFF;
 	int ret = 0;
 	unsigned long flags;

@@ -1766,7 +1766,7 @@ static int pma_set_portcounters_cong(str
 	return ret;
 }

-static int pma_set_portcounters_ext(struct ib_perf *pmp,
+static int pma_set_portcounters_ext(struct ib_pma_mad *pmp,
 				    struct ib_device *ibdev, u8 port)
 {
 	struct ib_pma_portcounters *p = (struct ib_pma_portcounters *)
@@ -1959,19 +1959,19 @@ static int process_perf(struct ib_device
 			struct ib_mad *in_mad,
 			struct ib_mad *out_mad)
 {
-	struct ib_perf *pmp = (struct ib_perf *)out_mad;
+	struct ib_pma_mad *pmp = (struct ib_pma_mad *)out_mad;
 	int ret;

 	*out_mad = *in_mad;
-	if (pmp->class_version != 1) {
-		pmp->status |= IB_SMP_UNSUP_VERSION;
+	if (pmp->mad_hdr.class_version != 1) {
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_VERSION;
 		ret = reply((struct ib_smp *) pmp);
 		goto bail;
 	}

-	switch (pmp->method) {
+	switch (pmp->mad_hdr.method) {
 	case IB_MGMT_METHOD_GET:
-		switch (pmp->attr_id) {
+		switch (pmp->mad_hdr.attr_id) {
 		case IB_PMA_CLASS_PORT_INFO:
 			ret = pma_get_classportinfo(pmp, ibdev);
 			goto bail;
@@ -1994,13 +1994,13 @@ static int process_perf(struct ib_device
 			ret = pma_get_portcounters_cong(pmp, ibdev, port);
 			goto bail;
 		default:
-			pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+			pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 			ret = reply((struct ib_smp *) pmp);
 			goto bail;
 		}

 	case IB_MGMT_METHOD_SET:
-		switch (pmp->attr_id) {
+		switch (pmp->mad_hdr.attr_id) {
 		case IB_PMA_PORT_SAMPLES_CONTROL:
 			ret = pma_set_portsamplescontrol(pmp, ibdev, port);
 			goto bail;
@@ -2014,7 +2014,7 @@ static int process_perf(struct ib_device
 			ret = pma_set_portcounters_cong(pmp, ibdev, port);
 			goto bail;
 		default:
-			pmp->status |= IB_SMP_UNSUP_METH_ATTR;
+			pmp->mad_hdr.status |= IB_SMP_UNSUP_METH_ATTR;
 			ret = reply((struct ib_smp *) pmp);
 			goto bail;
 		}
@@ -2030,7 +2030,7 @@ static int process_perf(struct ib_device
 		goto bail;

 	default:
-		pmp->status |= IB_SMP_UNSUP_METHOD;
+		pmp->mad_hdr.status |= IB_SMP_UNSUP_METHOD;
 		ret = reply((struct ib_smp *) pmp);
 	}


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                     ` <BANLkTikpMWYaXB8Ne+FaLGHi2L5TUCNDkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-07-05 15:49                       ` Mike Marciniszyn
       [not found]                         ` <35AAF1E4A771E142979F27B51793A4888838FEE740-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Mike Marciniszyn @ 2011-07-05 15:49 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Or Gerlitz, linux-rdma

I just realized your submissions were in my "junk" folder.

I would prefer that the other patch get accepted first.

Mike

> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-
> owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Or Gerlitz
> Sent: Thursday, June 16, 2011 2:15 PM
> To: Mike Marciniszyn
> Cc: Or Gerlitz; linux-rdma
> Subject: Re: [PATCH V1 7/9] ib/pma: add include file for IBA
> performance counters definitions
>
> Mike Marciniszyn <mike.marciniszyn-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org> wrote:
>
> > Yes, I'm the maintainer for both qib and ipath. I'm currently looking
> over these fixes.
>
> thanks,
>
> > We also have pending fixes in the qib_mad.c that are complicating my
> > testing with the various source streams we are maintaining.
>
> are you okay to have this patch accepted first and later re-submit
> your other patch?
>
> Or.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                         ` <35AAF1E4A771E142979F27B51793A4888838FEE740-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
@ 2011-07-05 16:01                           ` Or Gerlitz
       [not found]                             ` <4E133575.8040105-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-07-05 16:01 UTC (permalink / raw)
  To: Mike Marciniszyn; +Cc: Roland Dreier, linux-rdma

On 7/5/2011 6:49 PM, Mike Marciniszyn wrote:
> I just realized your submissions were in my "junk" folder.
> I would prefer that the other patch get accepted first.

So I can generate my patch on top of yours, and re-submit,
no problem, just lets see what Roland prefers, please send me pointer to 
these patches.

Or.


--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                             ` <4E133575.8040105-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
@ 2011-07-05 19:34                               ` Roland Dreier
       [not found]                                 ` <CAL1RGDX7U=PMjWadeS3Gp+xST56xJiK=qydwu1PMcvkfb7DcnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Roland Dreier @ 2011-07-05 19:34 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Mike Marciniszyn, linux-rdma

>> I just realized your submissions were in my "junk" folder.
>> I would prefer that the other patch get accepted first.
>
> So I can generate my patch on top of yours, and re-submit,
> no problem, just lets see what Roland prefers, please send me pointer to
> these patches.

What's the other patch in question here?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                 ` <CAL1RGDX7U=PMjWadeS3Gp+xST56xJiK=qydwu1PMcvkfb7DcnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-07-06  3:11                                   ` Or Gerlitz
       [not found]                                     ` <CAJZOPZK3tT9gXP46ek-tO3xyvj7=eKyGJXBoim9uOMbJc4BtfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Or Gerlitz @ 2011-07-06  3:11 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Or Gerlitz, Mike Marciniszyn, linux-rdma

Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:

> What's the other patch in question here?

I don't know, waiting to hear from Mike, Mike?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* RE: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                     ` <CAJZOPZK3tT9gXP46ek-tO3xyvj7=eKyGJXBoim9uOMbJc4BtfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-07-06 12:39                                       ` Mike Marciniszyn
       [not found]                                         ` <35AAF1E4A771E142979F27B51793A4888838FEE894-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Mike Marciniszyn @ 2011-07-06 12:39 UTC (permalink / raw)
  To: Or Gerlitz, Roland Dreier; +Cc: Or Gerlitz, linux-rdma, Ira Weiny

Sorry for the delay.   We're pretty swamped here!

The patch that is not yet approved is https://patchwork.kernel.org/patch/523041/

The objections to date for the patch center on the use of reserved bits to key the existence of some vendor specific queries.

The feature is vital for many customers.

I'm open to alternatives:
- keying the existence on HCA attributes
- keying the existing on XmitWait and implementing that support.  There is a hole in the current spec in the there is no way to reset the counter, although the I think there is a proposal for that.  There is also no 64 bit query support for that counter.

Mike


> -----Original Message-----
> From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-
> owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Or Gerlitz
> Sent: Tuesday, July 05, 2011 11:12 PM
> To: Roland Dreier
> Cc: Or Gerlitz; Mike Marciniszyn; linux-rdma
> Subject: Re: [PATCH V1 7/9] ib/pma: add include file for IBA
> performance counters definitions
>
> Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
>
> > What's the other patch in question here?
>
> I don't know, waiting to hear from Mike, Mike?
>
> Or.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                         ` <35AAF1E4A771E142979F27B51793A4888838FEE894-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
@ 2011-07-06 15:51                                           ` Roland Dreier
       [not found]                                             ` <CAL1RGDWHYMQHbZWwkysqZ7TLrB_ZDJWSTC4YCqk1wpme_3+BrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-07-06 16:47                                           ` Ira Weiny
  1 sibling, 1 reply; 44+ messages in thread
From: Roland Dreier @ 2011-07-06 15:51 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: Or Gerlitz, Or Gerlitz, linux-rdma, Ira Weiny, Hal Rosenstock,
	Sean Hefty

> The patch that is not yet approved is https://patchwork.kernel.org/patch/523041/
>
> The objections to date for the patch center on the use of reserved bits to key the existence of some vendor specific queries.

Hmm, I'm not a huge fan of that patch since as you say it uses bits
that the IB spec says are reserved.  I'd be more inclined to take Or's
patches which have gotten positive feedback from Sean, if we have to
choose.  Hal (and/or anyone else who has more insight into the IBTA
intentions for management architecture), what do you think of the
patch linked above?

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                         ` <35AAF1E4A771E142979F27B51793A4888838FEE894-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
  2011-07-06 15:51                                           ` Roland Dreier
@ 2011-07-06 16:47                                           ` Ira Weiny
  1 sibling, 0 replies; 44+ messages in thread
From: Ira Weiny @ 2011-07-06 16:47 UTC (permalink / raw)
  To: Mike Marciniszyn; +Cc: Or Gerlitz, Roland Dreier, Or Gerlitz, linux-rdma

On Wed, 6 Jul 2011 05:39:21 -0700
Mike Marciniszyn <mike.marciniszyn-h88ZbnxC6KDQT0dZR+AlfA@public.gmane.org> wrote:

> Sorry for the delay.   We're pretty swamped here!
> 
> The patch that is not yet approved is https://patchwork.kernel.org/patch/523041/
> 
> The objections to date for the patch center on the use of reserved bits to key the existence of some vendor specific queries.
> 
> The feature is vital for many customers.
> 
> I'm open to alternatives:
> - keying the existence on HCA attributes
> - keying the existing on XmitWait and implementing that support.  There is a hole in the current spec in the there is no way to reset the counter, although the I think there is a proposal for that.

The errata was passed and published.  The ability to clear XmitWait was corrected with the addition of CounterSelect2 (8bits wide offset 144) bit 0 to select XmitWait.  This is published in the 1.2.1 errata on page 4 reference ID 4527.

Although the publish date on this versioin is 3/21/2011 I am pretty sure this was published earlier than that.

Ira

> There is also no 64 bit query support for that counter.
> 
> Mike
> 
> 
> > -----Original Message-----
> > From: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [mailto:linux-rdma-
> > owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Or Gerlitz
> > Sent: Tuesday, July 05, 2011 11:12 PM
> > To: Roland Dreier
> > Cc: Or Gerlitz; Mike Marciniszyn; linux-rdma
> > Subject: Re: [PATCH V1 7/9] ib/pma: add include file for IBA
> > performance counters definitions
> >
> > Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:
> >
> > > What's the other patch in question here?
> >
> > I don't know, waiting to hear from Mike, Mike?
> >
> > Or.
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-rdma"
> > in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> This message and any attached documents contain information from QLogic Corporation or its wholly-owned subsidiaries that may be confidential. If you are not the intended recipient, you may not read, copy, distribute, or use this information. If you have received this transmission in error, please notify the sender immediately by reply e-mail and then delete this message.
> 


-- 
Ira Weiny
Math Programmer/Computer Scientist
Lawrence Livermore National Lab
925-423-8008
weiny2-i2BcT+NCU+M@public.gmane.org
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                             ` <CAL1RGDWHYMQHbZWwkysqZ7TLrB_ZDJWSTC4YCqk1wpme_3+BrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-07-06 16:57                                               ` Hal Rosenstock
       [not found]                                                 ` <4E14940A.9080700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Hal Rosenstock @ 2011-07-06 16:57 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Mike Marciniszyn, Or Gerlitz, Or Gerlitz, linux-rdma, Ira Weiny,
	Hal Rosenstock, Sean Hefty

On 7/6/2011 11:51 AM, Roland Dreier wrote:
>> The patch that is not yet approved is https://patchwork.kernel.org/patch/523041/
>>
>> The objections to date for the patch center on the use of reserved bits to key the existence of some vendor specific queries.
> 
> Hmm, I'm not a huge fan of that patch since as you say it uses bits
> that the IB spec says are reserved.  I'd be more inclined to take Or's
> patches which have gotten positive feedback from Sean, if we have to
> choose.  Hal (and/or anyone else who has more insight into the IBTA
> intentions for management architecture), what do you think of the
> patch linked above?

When the patch was originally issued, I had commented on this issue
(http://www.spinics.net/lists/linux-rdma/msg07020.html). There were two
issues I saw:

1. Two CapabilityMask2 bits are set for congestion statistics which
appears to be a proprietary feature.

#define IB_PMA_CLASS_CAP_PORT_CONGS     cpu_to_be32(3 << 30)

In general, it's dangerous to use IBA reserved bits as they may be
claimed by errata to support new features. Should this feature be taken
forward to the IBTA ?

2. A reserved field in some structure was being set for xmit wait rather
than updating the structure for the spec errata for this.

I think this has been fixed in the latest version of the patch.

You had originally commented on this issue in
http://www.spinics.net/lists/linux-rdma/msg07058.html

I can rereview the patch intoto if this is needed.

-- Hal

> 
>  - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                 ` <4E14940A.9080700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-07-06 17:50                                                   ` Roland Dreier
       [not found]                                                     ` <CAL1RGDVpuwsgfVRxNw098W_wRECGn0uinQR+8txE96n5KtDXgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Roland Dreier @ 2011-07-06 17:50 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: Mike Marciniszyn, Or Gerlitz, Or Gerlitz, linux-rdma, Ira Weiny,
	Hal Rosenstock, Sean Hefty

On Wed, Jul 6, 2011 at 9:57 AM, Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> I can rereview the patch intoto if this is needed.

If you wouldn't mind, that would be great.  I would like to get a
solution for qib in
the tree but as I said I don't like stealing reserved bits, and I'm
not confident I
know the tradeoffs here.

 - R.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                     ` <CAL1RGDVpuwsgfVRxNw098W_wRECGn0uinQR+8txE96n5KtDXgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-07-06 18:15                                                       ` Jason Gunthorpe
       [not found]                                                         ` <20110706181507.GC1162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  2011-07-06 18:27                                                       ` Hal Rosenstock
  2011-07-07  6:55                                                       ` Or Gerlitz
  2 siblings, 1 reply; 44+ messages in thread
From: Jason Gunthorpe @ 2011-07-06 18:15 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Hal Rosenstock, Mike Marciniszyn, Or Gerlitz, Or Gerlitz,
	linux-rdma, Ira Weiny, Hal Rosenstock, Sean Hefty

On Wed, Jul 06, 2011 at 10:50:46AM -0700, Roland Dreier wrote:
> On Wed, Jul 6, 2011 at 9:57 AM, Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
> > I can rereview the patch intoto if this is needed.

> If you wouldn't mind, that would be great.  I would like to get a
> solution for qib in the tree but as I said I don't like stealing
> reserved bits, and I'm not confident I know the tradeoffs here.

It isn't just using a reserved bit in the cap mask, it is using a
reserved PM attribute ID as well (C16-2.1.2), and there is no way
around that..

Vendor specific stuff must be placed into a vendor specific class and
not put into the classes controlled by IBA.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                         ` <20110706181507.GC1162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2011-07-06 18:24                                                           ` Hal Rosenstock
       [not found]                                                             ` <4E14A87B.2070405-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Hal Rosenstock @ 2011-07-06 18:24 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Roland Dreier, Mike Marciniszyn, Or Gerlitz, Or Gerlitz,
	linux-rdma, Ira Weiny, Hal Rosenstock, Sean Hefty

On 7/6/2011 2:15 PM, Jason Gunthorpe wrote:
> On Wed, Jul 06, 2011 at 10:50:46AM -0700, Roland Dreier wrote:
>> On Wed, Jul 6, 2011 at 9:57 AM, Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
>>> I can rereview the patch intoto if this is needed.
> 
>> If you wouldn't mind, that would be great.  I would like to get a
>> solution for qib in the tree but as I said I don't like stealing
>> reserved bits, and I'm not confident I know the tradeoffs here.
> 
> It isn't just using a reserved bit in the cap mask, it is using a
> reserved PM attribute ID as well (C16-2.1.2), 

Indeed.

> and there is no way around that..
> 
> Vendor specific stuff must be placed into a vendor specific class and
> not put into the classes controlled by IBA.

Either that or modify that compliance to allow for (optional) vendor
specific attributes in the PerfMgt class as is already done for the SM
class.

-- Hal

> Jason
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                     ` <CAL1RGDVpuwsgfVRxNw098W_wRECGn0uinQR+8txE96n5KtDXgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-07-06 18:15                                                       ` Jason Gunthorpe
@ 2011-07-06 18:27                                                       ` Hal Rosenstock
  2011-07-07  6:55                                                       ` Or Gerlitz
  2 siblings, 0 replies; 44+ messages in thread
From: Hal Rosenstock @ 2011-07-06 18:27 UTC (permalink / raw)
  To: Roland Dreier
  Cc: Mike Marciniszyn, Or Gerlitz, Or Gerlitz, linux-rdma, Ira Weiny,
	Hal Rosenstock, Sean Hefty

On 7/6/2011 1:50 PM, Roland Dreier wrote:
> On Wed, Jul 6, 2011 at 9:57 AM, Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org> wrote:
>> I can rereview the patch intoto if this is needed.
> 
> If you wouldn't mind, that would be great.  I would like to get a
> solution for qib in
> the tree but as I said I don't like stealing reserved bits, and I'm
> not confident I
> know the tradeoffs here.

There are possibly two different scopes here:

1. Standardized XmitWait support (not addressed in this patch) -
mentioned by Ira

and

2. Vendor specific congestion attributes (in this patch)

For #2, this requires either to be moved to some vendor specific class
as Jason suggested or some IBTA errata relating to adding vendor
specific PerfMgt class attributes.

-- Hal

>  - R.
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                             ` <4E14A87B.2070405-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2011-07-06 18:45                                                               ` Jason Gunthorpe
       [not found]                                                                 ` <20110706184511.GD1162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
  0 siblings, 1 reply; 44+ messages in thread
From: Jason Gunthorpe @ 2011-07-06 18:45 UTC (permalink / raw)
  To: Hal Rosenstock
  Cc: Roland Dreier, Mike Marciniszyn, Or Gerlitz, Or Gerlitz,
	linux-rdma, Ira Weiny, Hal Rosenstock, Sean Hefty

On Wed, Jul 06, 2011 at 02:24:59PM -0400, Hal Rosenstock wrote:

> > Vendor specific stuff must be placed into a vendor specific class and
> > not put into the classes controlled by IBA.
> 
> Either that or modify that compliance to allow for (optional) vendor
> specific attributes in the PerfMgt class as is already done for the SM
> class.

Just adding vendor usable attributes doesn't really address the
problem of discoverability. With the SM class it is at least
imaginable there is some kind of out of band discovery before the
attributes are used, can't see that for PM. Plus, there is no defined
SMP vendor specific MAD, only GMP, so it makes a little more sense..

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                                 ` <20110706184511.GD1162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
@ 2011-07-06 18:53                                                                   ` Hal Rosenstock
  0 siblings, 0 replies; 44+ messages in thread
From: Hal Rosenstock @ 2011-07-06 18:53 UTC (permalink / raw)
  To: Jason Gunthorpe
  Cc: Roland Dreier, Mike Marciniszyn, Or Gerlitz, Or Gerlitz,
	linux-rdma, Ira Weiny, Hal Rosenstock, Sean Hefty

On 7/6/2011 2:45 PM, Jason Gunthorpe wrote:
> On Wed, Jul 06, 2011 at 02:24:59PM -0400, Hal Rosenstock wrote:
> 
>>> Vendor specific stuff must be placed into a vendor specific class and
>>> not put into the classes controlled by IBA.
>>
>> Either that or modify that compliance to allow for (optional) vendor
>> specific attributes in the PerfMgt class as is already done for the SM
>> class.
> 
> Just adding vendor usable attributes doesn't really address the
> problem of discoverability. With the SM class it is at least
> imaginable there is some kind of out of band discovery before the
> attributes are used, can't see that for PM. 

There are other ways to deal with this issue IMO. Moving it to a vendor
class doesn't make the issue necessarily go away either.

> Plus, there is no defined SMP vendor specific MAD, only GMP, 

True.

> so it makes a little more sense..

I think it could be done either way.

-- Hal

> Jason
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions
       [not found]                                                     ` <CAL1RGDVpuwsgfVRxNw098W_wRECGn0uinQR+8txE96n5KtDXgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-07-06 18:15                                                       ` Jason Gunthorpe
  2011-07-06 18:27                                                       ` Hal Rosenstock
@ 2011-07-07  6:55                                                       ` Or Gerlitz
  2 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-07-07  6:55 UTC (permalink / raw)
  To: Roland Dreier, Mike Marciniszyn
  Cc: Hal Rosenstock, linux-rdma, Ira Weiny, Hal Rosenstock, Sean Hefty

Roland Dreier wrote:
>> I can rereview the patch intoto if this is needed.
> If you wouldn't mind, that would be great. I would like to get a solution for
> qib in the tree but as I said I don't like stealing reserved bits, and I'm
> not confident I know the tradeoffs here.

Roland, MiKe

Reading further on this thread the posts made by Ira, Hal and Jason, it 
seems
that there's still way to go with the other qib / mad related patch. I think
that at this point, this patch can be accepted 1st, and we'll take it 
from there,
makes sense?

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* [PATCH V1 4/9] mlx4: align current extended capabilities to use the flags field
       [not found]     ` <alpine.LRH.2.00.1106151742330.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
@ 2011-07-07 19:19       ` Or Gerlitz
  0 siblings, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-07-07 19:19 UTC (permalink / raw)
  To: Roland Dreier; +Cc: linux-rdma

Query another dword containing up to 32 extended device capabilities,
such that the 64 bit dev cap flags field contains both the extended
and the non-extended device flags. Align the code which handles the
current extended device capabilities (e.g udp rss, wol, vep steering,
etc) to use the extended device cap flags field instead of a field per
extended capability. Initial patch done by Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

Signed-off-by: Or Gerlitz <ogerlitz-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>

changes from v0:
	fixed sparse warnings

---
 drivers/net/mlx4/en_ethtool.c  |    9 +++++----
 drivers/net/mlx4/en_main.c     |    3 ++-
 drivers/net/mlx4/en_netdev.c   |    5 +++--
 drivers/net/mlx4/en_port.c     |    6 ++++--
 drivers/net/mlx4/en_selftest.c |    3 ++-
 drivers/net/mlx4/fw.c          |   24 +++++++++++-------------
 drivers/net/mlx4/fw.h          |    5 -----
 drivers/net/mlx4/main.c        |    5 -----
 drivers/net/mlx4/mcg.c         |   17 ++++++++++-------
 drivers/net/mlx4/port.c        |    8 ++++----
 include/linux/mlx4/device.h    |   12 ++++++------
 11 files changed, 47 insertions(+), 50 deletions(-)

Index: b/drivers/net/mlx4/fw.c
===================================================================
--- a/drivers/net/mlx4/fw.c
+++ b/drivers/net/mlx4/fw.c
@@ -99,7 +99,12 @@ static void dump_dev_cap_flags(struct ml
 		[21] = "UD multicast support",
 		[24] = "Demand paging support",
 		[25] = "Router support",
-		[30] = "IBoE support"
+		[30] = "IBoE support",
+		[32] = "Unicast loopback support",
+		[38] = "Wake On LAN support",
+		[40] = "UDP RSS support",
+		[41] = "Unicast VEP steering support",
+		[42] = "Multicast VEP steering support"
 	};
 	int i;

@@ -142,7 +147,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	struct mlx4_cmd_mailbox *mailbox;
 	u32 *outbox;
 	u8 field;
-	u32 field32, flags;
+	u32 field32, flags, ext_flags;
 	u16 size;
 	u16 stat_rate;
 	int err;
@@ -180,8 +185,7 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 #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_UDP_RSS_OFFSET		0x42
-#define QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET	0x43
+#define QUERY_DEV_CAP_EXT_FLAGS_OFFSET		0x40
 #define QUERY_DEV_CAP_FLAGS_OFFSET		0x44
 #define QUERY_DEV_CAP_RSVD_UAR_OFFSET		0x48
 #define QUERY_DEV_CAP_UAR_SZ_OFFSET		0x49
@@ -272,15 +276,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *
 	dev_cap->max_msg_sz = 1 << (field & 0x1f);
 	MLX4_GET(stat_rate, outbox, QUERY_DEV_CAP_RATE_SUPPORT_OFFSET);
 	dev_cap->stat_rate_support = stat_rate;
-	MLX4_GET(field, outbox, QUERY_DEV_CAP_UDP_RSS_OFFSET);
-	dev_cap->udp_rss = field & 0x1;
-	dev_cap->vep_uc_steering = field & 0x2;
-	dev_cap->vep_mc_steering = field & 0x4;
-	MLX4_GET(field, outbox, QUERY_DEV_CAP_ETH_UC_LOOPBACK_OFFSET);
-	dev_cap->loopback_support = field & 0x1;
-	dev_cap->wol = field & 0x40;
+	MLX4_GET(ext_flags, outbox, QUERY_DEV_CAP_EXT_FLAGS_OFFSET);
 	MLX4_GET(flags, outbox, QUERY_DEV_CAP_FLAGS_OFFSET);
-	dev_cap->flags = flags;
+	dev_cap->flags = flags | (u64)ext_flags << 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);
@@ -802,7 +800,7 @@ int mlx4_INIT_HCA(struct mlx4_dev *dev,
 	MLX4_PUT(inbox, param->mc_base,		INIT_HCA_MC_BASE_OFFSET);
 	MLX4_PUT(inbox, param->log_mc_entry_sz, INIT_HCA_LOG_MC_ENTRY_SZ_OFFSET);
 	MLX4_PUT(inbox, param->log_mc_hash_sz,  INIT_HCA_LOG_MC_HASH_SZ_OFFSET);
-	if (dev->caps.vep_mc_steering)
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER)
 		MLX4_PUT(inbox, (u8) (1 << 3),	INIT_HCA_UC_STEERING_OFFSET);
 	MLX4_PUT(inbox, param->log_mc_table_sz, INIT_HCA_LOG_MC_TABLE_SZ_OFFSET);

Index: b/include/linux/mlx4/device.h
===================================================================
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -73,7 +73,12 @@ enum {
 	MLX4_DEV_CAP_FLAG_RAW_MCAST	= 1LL << 19,
 	MLX4_DEV_CAP_FLAG_UD_AV_PORT	= 1LL << 20,
 	MLX4_DEV_CAP_FLAG_UD_MCAST	= 1LL << 21,
-	MLX4_DEV_CAP_FLAG_IBOE		= 1LL << 30
+	MLX4_DEV_CAP_FLAG_IBOE		= 1LL << 30,
+	MLX4_DEV_CAP_FLAG_UC_LOOPBACK	= 1LL << 32,
+	MLX4_DEV_CAP_FLAG_WOL		= 1LL << 38,
+	MLX4_DEV_CAP_FLAG_UDP_RSS	= 1LL << 40,
+	MLX4_DEV_CAP_FLAG_VEP_UC_STEER	= 1LL << 41,
+	MLX4_DEV_CAP_FLAG_VEP_MC_STEER	= 1LL << 42
 };

 enum {
@@ -257,11 +262,6 @@ struct mlx4_caps {
 	u32			bmme_flags;
 	u32			reserved_lkey;
 	u16			stat_rate_support;
-	int			udp_rss;
-	int			loopback_support;
-	int			vep_uc_steering;
-	int			vep_mc_steering;
-	int			wol;
 	u8			port_width_cap[MLX4_MAX_PORTS + 1];
 	int			max_gso_sz;
 	int                     reserved_qps_cnt[MLX4_NUM_QP_REGION];
Index: b/drivers/net/mlx4/fw.h
===================================================================
--- a/drivers/net/mlx4/fw.h
+++ b/drivers/net/mlx4/fw.h
@@ -78,11 +78,6 @@ struct mlx4_dev_cap {
 	u16 wavelength[MLX4_MAX_PORTS + 1];
 	u64 trans_code[MLX4_MAX_PORTS + 1];
 	u16 stat_rate_support;
-	int udp_rss;
-	int loopback_support;
-	int vep_uc_steering;
-	int vep_mc_steering;
-	int wol;
 	u64 flags;
 	int reserved_uars;
 	int uar_size;
Index: b/drivers/net/mlx4/main.c
===================================================================
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -226,11 +226,6 @@ static int mlx4_dev_cap(struct mlx4_dev
 	dev->caps.bmme_flags	     = dev_cap->bmme_flags;
 	dev->caps.reserved_lkey	     = dev_cap->reserved_lkey;
 	dev->caps.stat_rate_support  = dev_cap->stat_rate_support;
-	dev->caps.udp_rss	     = dev_cap->udp_rss;
-	dev->caps.loopback_support   = dev_cap->loopback_support;
-	dev->caps.vep_uc_steering    = dev_cap->vep_uc_steering;
-	dev->caps.vep_mc_steering    = dev_cap->vep_mc_steering;
-	dev->caps.wol		     = dev_cap->wol;
 	dev->caps.max_gso_sz	     = dev_cap->max_gso_sz;

 	dev->caps.log_num_macs  = log_num_mac;
Index: b/drivers/net/mlx4/en_main.c
===================================================================
--- a/drivers/net/mlx4/en_main.c
+++ b/drivers/net/mlx4/en_main.c
@@ -106,7 +106,8 @@ static int mlx4_en_get_profile(struct ml

 	params->tcp_rss = tcp_rss;
 	params->udp_rss = udp_rss;
-	if (params->udp_rss && !mdev->dev->caps.udp_rss) {
+	if (params->udp_rss && !(mdev->dev->caps.flags
+					& MLX4_DEV_CAP_FLAG_UDP_RSS)) {
 		mlx4_warn(mdev, "UDP RSS is not supported on this device.\n");
 		params->udp_rss = 0;
 	}
Index: b/drivers/net/mlx4/en_ethtool.c
===================================================================
--- a/drivers/net/mlx4/en_ethtool.c
+++ b/drivers/net/mlx4/en_ethtool.c
@@ -104,7 +104,7 @@ static void mlx4_en_get_wol(struct net_d
 	int err = 0;
 	u64 config = 0;

-	if (!priv->mdev->dev->caps.wol) {
+	if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL)) {
 		wol->supported = 0;
 		wol->wolopts = 0;
 		return;
@@ -134,7 +134,7 @@ static int mlx4_en_set_wol(struct net_de
 	u64 config = 0;
 	int err = 0;

-	if (!priv->mdev->dev->caps.wol)
+	if (!(priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_WOL))
 		return -EOPNOTSUPP;

 	if (wol->supported & ~WAKE_MAGIC)
@@ -170,7 +170,8 @@ static int mlx4_en_get_sset_count(struct
 		return NUM_ALL_STATS +
 			(priv->tx_ring_num + priv->rx_ring_num) * 2;
 	case ETH_SS_TEST:
-		return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.loopback_support) * 2;
+		return MLX4_EN_NUM_SELF_TEST - !(priv->mdev->dev->caps.flags
+					& MLX4_DEV_CAP_FLAG_UC_LOOPBACK) * 2;
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -220,7 +221,7 @@ static void mlx4_en_get_strings(struct n
 	case ETH_SS_TEST:
 		for (i = 0; i < MLX4_EN_NUM_SELF_TEST - 2; i++)
 			strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
-		if (priv->mdev->dev->caps.loopback_support)
+		if (priv->mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_UC_LOOPBACK)
 			for (; i < MLX4_EN_NUM_SELF_TEST; i++)
 				strcpy(data + i * ETH_GSTRING_LEN, mlx4_en_test_names[i]);
 		break;
Index: b/drivers/net/mlx4/en_selftest.c
===================================================================
--- a/drivers/net/mlx4/en_selftest.c
+++ b/drivers/net/mlx4/en_selftest.c
@@ -159,7 +159,8 @@ retry_tx:
 				goto retry_tx;
 		}

-		if (priv->mdev->dev->caps.loopback_support){
+		if (priv->mdev->dev->caps.flags &
+					MLX4_DEV_CAP_FLAG_UC_LOOPBACK) {
 			buf[3] = mlx4_en_test_registers(priv);
 			buf[4] = mlx4_en_test_loopback(priv);
 		}
Index: b/drivers/net/mlx4/port.c
===================================================================
--- a/drivers/net/mlx4/port.c
+++ b/drivers/net/mlx4/port.c
@@ -146,7 +146,7 @@ int mlx4_register_mac(struct mlx4_dev *d
 	int i, err = 0;
 	int free = -1;

-	if (dev->caps.vep_uc_steering) {
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) {
 		err = mlx4_uc_steer_add(dev, port, mac, qpn, 1);
 		if (!err) {
 			entry = kmalloc(sizeof *entry, GFP_KERNEL);
@@ -203,7 +203,7 @@ int mlx4_register_mac(struct mlx4_dev *d
 		goto out;
 	}

-	if (!dev->caps.vep_uc_steering)
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
 		*qpn = info->base_qpn + free;
 	++table->total;
 out:
@@ -243,7 +243,7 @@ void mlx4_unregister_mac(struct mlx4_dev
 	int index = qpn - info->base_qpn;
 	struct mlx4_mac_entry *entry;

-	if (dev->caps.vep_uc_steering) {
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) {
 		entry = radix_tree_lookup(&info->mac_tree, qpn);
 		if (entry) {
 			mlx4_uc_steer_release(dev, port, entry->mac, qpn, 1);
@@ -274,7 +274,7 @@ int mlx4_replace_mac(struct mlx4_dev *de
 	struct mlx4_mac_entry *entry;
 	int err;

-	if (dev->caps.vep_uc_steering) {
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER) {
 		entry = radix_tree_lookup(&info->mac_tree, qpn);
 		if (!entry)
 			return -EINVAL;
Index: b/drivers/net/mlx4/en_netdev.c
===================================================================
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -239,7 +239,8 @@ static void mlx4_en_do_set_multicast(str
 			priv->flags |= MLX4_EN_FLAG_PROMISC;

 			/* Enable promiscouos mode */
-			if (!mdev->dev->caps.vep_uc_steering)
+			if (!(mdev->dev->caps.flags &
+						MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
 				err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port,
 							     priv->base_qpn, 1);
 			else
@@ -285,7 +286,7 @@ static void mlx4_en_do_set_multicast(str
 		priv->flags &= ~MLX4_EN_FLAG_PROMISC;

 		/* Disable promiscouos mode */
-		if (!mdev->dev->caps.vep_uc_steering)
+		if (!(mdev->dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER))
 			err = mlx4_SET_PORT_qpn_calc(mdev->dev, priv->port,
 						     priv->base_qpn, 0);
 		else
Index: b/drivers/net/mlx4/en_port.c
===================================================================
--- a/drivers/net/mlx4/en_port.c
+++ b/drivers/net/mlx4/en_port.c
@@ -119,9 +119,11 @@ int mlx4_SET_PORT_qpn_calc(struct mlx4_d
 	struct mlx4_set_port_rqp_calc_context *context;
 	int err;
 	u32 in_mod;
-	u32 m_promisc = (dev->caps.vep_mc_steering) ? MCAST_DIRECT : MCAST_DEFAULT;
+	u32 m_promisc = (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) ?
+						MCAST_DIRECT : MCAST_DEFAULT;

-	if (dev->caps.vep_mc_steering && dev->caps.vep_uc_steering)
+	if (dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER  &&
+			dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_UC_STEER)
 		return 0;

 	mailbox = mlx4_alloc_cmd_mailbox(dev);
Index: b/drivers/net/mlx4/mcg.c
===================================================================
--- a/drivers/net/mlx4/mcg.c
+++ b/drivers/net/mlx4/mcg.c
@@ -559,7 +559,8 @@ static int find_entry(struct mlx4_dev *d
 	struct mlx4_mgm *mgm = mgm_mailbox->buf;
 	u8 *mgid;
 	int err;
-	u8 op_mod = (prot == MLX4_PROT_ETH) ? !!(dev->caps.vep_mc_steering) : 0;
+	u8 op_mod = (prot == MLX4_PROT_ETH) ?
+		!!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) : 0;

 	mailbox = mlx4_alloc_cmd_mailbox(dev);
 	if (IS_ERR(mailbox))
@@ -834,7 +835,8 @@ int mlx4_multicast_attach(struct mlx4_de

 	steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER;

-	if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering)
+	if (prot == MLX4_PROT_ETH &&
+			!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
 		return 0;

 	if (prot == MLX4_PROT_ETH)
@@ -853,7 +855,8 @@ int mlx4_multicast_detach(struct mlx4_de

 	steer = (is_valid_ether_addr(&gid[10])) ? MLX4_UC_STEER : MLX4_MC_STEER;

-	if (prot == MLX4_PROT_ETH && !dev->caps.vep_mc_steering)
+	if (prot == MLX4_PROT_ETH &&
+			!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
 		return 0;

 	if (prot == MLX4_PROT_ETH) {
@@ -867,7 +870,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_detach)

 int mlx4_multicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
 		return 0;


@@ -877,7 +880,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc

 int mlx4_multicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
 		return 0;


@@ -887,7 +890,7 @@ EXPORT_SYMBOL_GPL(mlx4_multicast_promisc

 int mlx4_unicast_promisc_add(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
 		return 0;


@@ -897,7 +900,7 @@ EXPORT_SYMBOL_GPL(mlx4_unicast_promisc_a

 int mlx4_unicast_promisc_remove(struct mlx4_dev *dev, u32 qpn, u8 port)
 {
-	if (!dev->caps.vep_mc_steering)
+	if (!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER))
 		return 0;

 	return remove_promisc_qp(dev, 0, port, MLX4_UC_STEER, qpn);
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

* Re: IBoE updates - GID change event / network flow counters (was: [PATCH 7/9] ib/pma: add include file for IBA perf counters)
       [not found]                         ` <BANLkTi=VR6v=xSwzLRHDL1x2=05wF-H5KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  2011-06-20 20:38                           ` Or Gerlitz
@ 2011-07-16 19:57                           ` Or Gerlitz
  1 sibling, 0 replies; 44+ messages in thread
From: Or Gerlitz @ 2011-07-16 19:57 UTC (permalink / raw)
  To: Roland Dreier; +Cc: Or Gerlitz, Hefty, Sean, linux-rdma, Mike Marciniszyn

On Mon, Jun 20, 2011 at 9:18 PM, Roland Dreier <roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org> wrote:

> Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org> wrote:

>> Roland, My patch series went through Sean's review (and passed... patch 7/9 needed
>> fixes and I posted V1 for it) any more feedback you need to accept them or
>> you just want to go over them yourself?

> Looks fine for 3.1, I expect to merge it in the next week or two (possibly will
> see some minor nits as I merge them).

Hi Roland,

As we're @ -rc7 - just checking that you indeed going to start merging
this soon, indeed?
patch 4/9 has V1 and 7/9 V2, both were posted as replies on the same
thread as V0, let me know if this creates and problem for you.

Or.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 44+ messages in thread

end of thread, other threads:[~2011-07-16 19:57 UTC | newest]

Thread overview: 44+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-15 14:38 [PATCH 0/9] IBoE updates: GID change event and network flow counters Or Gerlitz
     [not found] ` <alpine.LRH.2.00.1106151733410.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2011-06-15 14:39   ` [PATCH 1/9] ib/core: Add GID change event Or Gerlitz
2011-06-15 14:40   ` [PATCH 2/9] ib/mlx4: use GID change event on IBoE code Or Gerlitz
2011-06-15 14:41   ` [PATCH 3/9] mlx4: extend cap flags to 64 bit Or Gerlitz
2011-06-15 14:42   ` [PATCH 4/9] mlx4: align current extended capabilities to use the flags field Or Gerlitz
     [not found]     ` <alpine.LRH.2.00.1106151742330.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2011-07-07 19:19       ` [PATCH V1 " Or Gerlitz
2011-06-15 14:43   ` [PATCH 5/NNN] mlx4: Fix layout of QP context for correct location of counter index Or Gerlitz
2011-06-15 14:47   ` [PATCH 6/9] mlx4: add network flow counters Or Gerlitz
     [not found]     ` <alpine.LRH.2.00.1106151745060.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2011-06-15 15:22       ` Hefty, Sean
2011-06-15 14:48   ` [PATCH 7/9] ib/pma: add include file for IBA performance counters definitions Or Gerlitz
     [not found]     ` <alpine.LRH.2.00.1106151747390.15844-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2011-06-15 16:08       ` Hal Rosenstock
     [not found]         ` <4DF8D90A.1000208-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-06-16  8:01           ` Or Gerlitz
2011-06-15 23:10       ` Hefty, Sean
     [not found]         ` <1828884A29C6694DAF28B7E6B8A8237302148F-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-06-15 23:46           ` Ira Weiny
     [not found]             ` <20110615164619.994a49a4.weiny2-i2BcT+NCU+M@public.gmane.org>
2011-06-15 23:51               ` Hefty, Sean
2011-06-16  7:39           ` Or Gerlitz
     [not found]             ` <4DF9B319.6070100-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-06-16 16:19               ` Hefty, Sean
     [not found]                 ` <1828884A29C6694DAF28B7E6B8A8237302184A-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2011-06-16 17:57                   ` Or Gerlitz
2011-06-20 16:46                   ` IBoE updates - GID change event / network flow counters (was: [PATCH 7/9] ib/pma: add include file for IBA perf counters) Or Gerlitz
     [not found]                     ` <4DFF797E.5090904-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-06-20 18:18                       ` Roland Dreier
     [not found]                         ` <BANLkTi=VR6v=xSwzLRHDL1x2=05wF-H5KQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-20 20:38                           ` Or Gerlitz
2011-07-16 19:57                           ` Or Gerlitz
2011-06-16  8:20       ` [PATCH V1 7/9] ib/pma: add include file for IBA performance counters definitions Or Gerlitz
     [not found]         ` <alpine.LRH.2.00.1106161119120.12552-VYr5/9ddeaGSIdy2EShu12Xnswh1EIUO@public.gmane.org>
2011-06-16 14:18           ` Or Gerlitz
     [not found]             ` <4DFA10CC.5080002-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-06-16 15:49               ` Mike Marciniszyn
     [not found]                 ` <35AAF1E4A771E142979F27B51793A4888838E71F03-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2011-06-16 18:14                   ` Or Gerlitz
     [not found]                     ` <BANLkTikpMWYaXB8Ne+FaLGHi2L5TUCNDkQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-05 15:49                       ` Mike Marciniszyn
     [not found]                         ` <35AAF1E4A771E142979F27B51793A4888838FEE740-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2011-07-05 16:01                           ` Or Gerlitz
     [not found]                             ` <4E133575.8040105-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2011-07-05 19:34                               ` Roland Dreier
     [not found]                                 ` <CAL1RGDX7U=PMjWadeS3Gp+xST56xJiK=qydwu1PMcvkfb7DcnA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06  3:11                                   ` Or Gerlitz
     [not found]                                     ` <CAJZOPZK3tT9gXP46ek-tO3xyvj7=eKyGJXBoim9uOMbJc4BtfQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06 12:39                                       ` Mike Marciniszyn
     [not found]                                         ` <35AAF1E4A771E142979F27B51793A4888838FEE894-HolNjIBXvBOXx9kJd3VG2h2eb7JE58TQ@public.gmane.org>
2011-07-06 15:51                                           ` Roland Dreier
     [not found]                                             ` <CAL1RGDWHYMQHbZWwkysqZ7TLrB_ZDJWSTC4YCqk1wpme_3+BrQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06 16:57                                               ` Hal Rosenstock
     [not found]                                                 ` <4E14940A.9080700-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-07-06 17:50                                                   ` Roland Dreier
     [not found]                                                     ` <CAL1RGDVpuwsgfVRxNw098W_wRECGn0uinQR+8txE96n5KtDXgw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-07-06 18:15                                                       ` Jason Gunthorpe
     [not found]                                                         ` <20110706181507.GC1162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-07-06 18:24                                                           ` Hal Rosenstock
     [not found]                                                             ` <4E14A87B.2070405-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2011-07-06 18:45                                                               ` Jason Gunthorpe
     [not found]                                                                 ` <20110706184511.GD1162-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2011-07-06 18:53                                                                   ` Hal Rosenstock
2011-07-06 18:27                                                       ` Hal Rosenstock
2011-07-07  6:55                                                       ` Or Gerlitz
2011-07-06 16:47                                           ` Ira Weiny
2011-07-05 15:46           ` [PATCH V2 " Or Gerlitz
2011-06-15 14:49   ` [PATCH 8/9] ib/mlx4: use flow counters on IBoE ports Or Gerlitz
2011-06-15 14:51   ` [PATCH 9/9] ib/mlx4: support PMA counters for IBoE Or Gerlitz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.