[openib-general] [PATCH] incorrect atomic attribute returned by ib/v_query_device
Jack Morgenstein
jackm at mellanox.co.il
Mon Sep 26 06:43:02 PDT 2005
I'm starting to fix ib_query_device/ibv_query_device -- adding missing fields,
correcting values in current fields.
Enclosed is a patch for the atomic_cap field. Please review.
Thanks.
Jack
Signed-off-by: Jack Morgenstein <jackm at mellanox.co.il>
Index: linux-kernel/infiniband/core/uverbs_cmd.c
===================================================================
--- linux-kernel/infiniband/core/uverbs_cmd.c (revision 3532)
+++ linux-kernel/infiniband/core/uverbs_cmd.c (working copy)
@@ -199,6 +199,7 @@
resp.max_pkeys = attr.max_pkeys;
resp.local_ca_ack_delay = attr.local_ca_ack_delay;
resp.phys_port_cnt = file->device->ib_dev->phys_port_cnt;
+ resp.atomic_cap = attr.atomic_cap;
if (copy_to_user((void __user *) (unsigned long) cmd.response,
&resp, sizeof resp))
Index: linux-kernel/infiniband/hw/mthca/mthca_dev.h
===================================================================
--- linux-kernel/infiniband/hw/mthca/mthca_dev.h (revision 3532)
+++ linux-kernel/infiniband/hw/mthca/mthca_dev.h (working copy)
@@ -148,6 +148,7 @@
int reserved_mcgs;
int num_pds;
int reserved_pds;
+ u32 flags;
u8 port_width_cap;
};
Index: linux-kernel/infiniband/hw/mthca/mthca_main.c
===================================================================
--- linux-kernel/infiniband/hw/mthca/mthca_main.c (revision 3532)
+++ linux-kernel/infiniband/hw/mthca/mthca_main.c (working copy)
@@ -172,6 +172,7 @@
mdev->limits.reserved_uars = dev_lim->reserved_uars;
mdev->limits.reserved_pds = dev_lim->reserved_pds;
mdev->limits.port_width_cap = dev_lim->max_port_width;
+ mdev->limits.flags = dev_lim->flags;
/* IB_DEVICE_RESIZE_MAX_WR not supported by driver.
May be doable since hardware supports it for SRQ.
Index: linux-kernel/infiniband/hw/mthca/mthca_provider.c
===================================================================
--- linux-kernel/infiniband/hw/mthca/mthca_provider.c (revision 3532)
+++ linux-kernel/infiniband/hw/mthca/mthca_provider.c (working copy)
@@ -99,6 +99,8 @@
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;
+ props->atomic_cap = (mdev->limits.flags & DEV_LIM_FLAG_ATOMIC) ?
+ IB_ATOMIC_HCA : IB_ATOMIC_NONE;
err = 0;
out:
More information about the general
mailing list