All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 164/198] IB/mthca: fill in more device query fields
@ 2005-04-12 10:33 akpm
  2005-04-12 21:11 ` Alexey Dobriyan
  0 siblings, 1 reply; 3+ messages in thread
From: akpm @ 2005-04-12 10:33 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, akpm, roland


From: Roland Dreier <roland@topspin.com>

Implement more of the device_query method in mthca.

Signed-off-by: Roland Dreier <roland@topspin.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/infiniband/hw/mthca/mthca_cmd.c      |    2 +
 25-akpm/drivers/infiniband/hw/mthca/mthca_provider.c |   22 +++++++++++++++----
 2 files changed, 20 insertions(+), 4 deletions(-)

diff -puN drivers/infiniband/hw/mthca/mthca_cmd.c~ib-mthca-fill-in-more-device-query-fields drivers/infiniband/hw/mthca/mthca_cmd.c
--- 25/drivers/infiniband/hw/mthca/mthca_cmd.c~ib-mthca-fill-in-more-device-query-fields	2005-04-12 03:21:42.632655752 -0700
+++ 25-akpm/drivers/infiniband/hw/mthca/mthca_cmd.c	2005-04-12 03:21:42.638654840 -0700
@@ -987,6 +987,8 @@ int mthca_QUERY_DEV_LIM(struct mthca_dev
 	if (dev->hca_type == ARBEL_NATIVE) {
 		MTHCA_GET(field, outbox, QUERY_DEV_LIM_RSZ_SRQ_OFFSET);
 		dev_lim->hca.arbel.resize_srq = field & 1;
+		MTHCA_GET(field, outbox, QUERY_DEV_LIM_MAX_SG_RQ_OFFSET);
+		dev_lim->max_sg = min_t(int, field, dev_lim->max_sg);
 		MTHCA_GET(size, outbox, QUERY_DEV_LIM_MTT_ENTRY_SZ_OFFSET);
 		dev_lim->mtt_seg_sz = size;
 		MTHCA_GET(size, outbox, QUERY_DEV_LIM_MPT_ENTRY_SZ_OFFSET);
diff -puN drivers/infiniband/hw/mthca/mthca_provider.c~ib-mthca-fill-in-more-device-query-fields drivers/infiniband/hw/mthca/mthca_provider.c
--- 25/drivers/infiniband/hw/mthca/mthca_provider.c~ib-mthca-fill-in-more-device-query-fields	2005-04-12 03:21:42.634655448 -0700
+++ 25-akpm/drivers/infiniband/hw/mthca/mthca_provider.c	2005-04-12 03:21:42.639654688 -0700
@@ -52,6 +52,8 @@ static int mthca_query_device(struct ib_
 	if (!in_mad || !out_mad)
 		goto out;
 
+	memset(props, 0, sizeof props);
+
 	props->fw_ver              = mdev->fw_ver;
 
 	memset(in_mad, 0, sizeof *in_mad);
@@ -71,14 +73,26 @@ static int mthca_query_device(struct ib_
 		goto out;
 	}
 
-	props->device_cap_flags = mdev->device_cap_flags;
-	props->vendor_id        = be32_to_cpup((u32 *) (out_mad->data + 36)) &
+	props->device_cap_flags    = mdev->device_cap_flags;
+	props->vendor_id           = be32_to_cpup((u32 *) (out_mad->data + 36)) &
 		0xffffff;
-	props->vendor_part_id   = be16_to_cpup((u16 *) (out_mad->data + 30));
-	props->hw_ver           = be16_to_cpup((u16 *) (out_mad->data + 32));
+	props->vendor_part_id      = be16_to_cpup((u16 *) (out_mad->data + 30));
+	props->hw_ver              = be16_to_cpup((u16 *) (out_mad->data + 32));
 	memcpy(&props->sys_image_guid, out_mad->data +  4, 8);
 	memcpy(&props->node_guid,      out_mad->data + 12, 8);
 
+	props->max_mr_size         = ~0ull;
+	props->max_qp              = mdev->limits.num_qps - mdev->limits.reserved_qps;
+	props->max_qp_wr           = 0xffff;
+	props->max_sge             = mdev->limits.max_sg;
+	props->max_cq              = mdev->limits.num_cqs - mdev->limits.reserved_cqs;
+	props->max_cqe             = 0xffff;
+	props->max_mr              = mdev->limits.num_mpts - mdev->limits.reserved_mrws;
+	props->max_pd              = mdev->limits.num_pds - mdev->limits.reserved_pds;
+	props->max_qp_rd_atom      = 1 << mdev->qp_table.rdb_shift;
+	props->max_qp_init_rd_atom = 1 << mdev->qp_table.rdb_shift;
+	props->local_ca_ack_delay  = mdev->limits.local_ca_ack_delay;
+
 	err = 0;
  out:
 	kfree(in_mad);
_

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

* Re: [patch 164/198] IB/mthca: fill in more device query fields
  2005-04-12 21:11 ` Alexey Dobriyan
@ 2005-04-12 17:27   ` Roland Dreier
  0 siblings, 0 replies; 3+ messages in thread
From: Roland Dreier @ 2005-04-12 17:27 UTC (permalink / raw)
  To: Alexey Dobriyan; +Cc: akpm, linux-kernel, torvalds

    >> + memset(props, 0, sizeof props);

    Alexey> sizeof *props ?

Indeed -- excellent catch considering the volume of patches that went
by today.  I've committed this fix to our svn tree so it won't get
lost, and I'll send it upstream once the patch backlog cleared a bit.

Thanks,
  Roland


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

* Re: [patch 164/198] IB/mthca: fill in more device query fields
  2005-04-12 10:33 [patch 164/198] IB/mthca: fill in more device query fields akpm
@ 2005-04-12 21:11 ` Alexey Dobriyan
  2005-04-12 17:27   ` Roland Dreier
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey Dobriyan @ 2005-04-12 21:11 UTC (permalink / raw)
  To: roland; +Cc: akpm, linux-kernel, torvalds

On Tuesday 12 April 2005 10:33, akpm@osdl.org wrote:

> Implement more of the device_query method in mthca.

> --- 25/drivers/infiniband/hw/mthca/mthca_provider.c~ib-mthca-fill-in-more-device-query-fields
> +++ 25-akpm/drivers/infiniband/hw/mthca/mthca_provider.c
> @@ -52,6 +52,8 @@ static int mthca_query_device(struct ib_

> +	memset(props, 0, sizeof props);

sizeof *props ?

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

end of thread, other threads:[~2005-04-12 18:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-12 10:33 [patch 164/198] IB/mthca: fill in more device query fields akpm
2005-04-12 21:11 ` Alexey Dobriyan
2005-04-12 17:27   ` Roland Dreier

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.