* Re: [PATCH] opensm/osm_sa_multipath_record.c: livelock in mpr_rcv_get_path_parms
From: Sasha Khapyorsky @ 2010-05-25 18:39 UTC (permalink / raw)
To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100524194353.GB26919-Wuw85uim5zDR7s880joybQ@public.gmane.org>
On 15:43 Mon 24 May , Hal Rosenstock wrote:
>
> Similar to commit 1010c9c5014d5a6af2db33e27ae7156f239e7254 for
> opensm/osm_sa_path_record.c:pr_rcv_get_path_parms
>
> Signed-off-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Applied. Thanks.
Sasha
--
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
* Re: [PATCH] opensm/osm_sa_path_record.c: Add error code to newly added log message
From: Sasha Khapyorsky @ 2010-05-25 18:38 UTC (permalink / raw)
To: Hal Rosenstock; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100524194251.GA26919-Wuw85uim5zDR7s880joybQ@public.gmane.org>
On 15:42 Mon 24 May , Hal Rosenstock wrote:
>
> added in commit 1010c9c5014d5a6af2db33e27ae7156f239e7254
>
> Signed-off-by: Hal Rosenstock <hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Applied. Thanks.
Sasha
--
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
* Re: [PATCH/RFC] opensm: toggle sweeping V3
From: Sasha Khapyorsky @ 2010-05-25 18:20 UTC (permalink / raw)
To: Arthur Kepner
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dale.R.Talcott-NSQ8wuThN14
In-Reply-To: <20100525165330.GO2678-sJ/iWh9BUns@public.gmane.org>
On 09:53 Tue 25 May , Arthur Kepner wrote:
>
> Add option to toggle sweeping from opensm console.
>
> Signed-off-by: Arthur Kepner <akepner-sJ/iWh9BUns@public.gmane.org>
Applied. Thanks.
Sasha
--
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
* [PATCH] infiniband-diags/vendstat: allow multiple config space records
From: Sasha Khapyorsky @ 2010-05-25 18:13 UTC (permalink / raw)
To: linux-rdma; +Cc: Eli Dorfman, Yevgeny Kliteynik
In-Reply-To: <20100524210735.GK28549@me>
Allow to use -R and -W options (config space record access) multiple
number of times, so that multiple config space records will be reading
and/or writing. Using both -R and -W is allowed as well. Example:
vendstat -R 0x12345,0xffff -R 0x12346 -W 0x12347,0,0xfff <lid>
Note that now number of records is effectively limited by 18 (so that it
fit single MAD), this could be increased with using multiple MADs.
Signed-off-by: Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org>
---
infiniband-diags/src/vendstat.c | 69 +++++++++++++++++++++++++-------------
1 files changed, 45 insertions(+), 24 deletions(-)
diff --git a/infiniband-diags/src/vendstat.c b/infiniband-diags/src/vendstat.c
index 0add06c..92a90c8 100644
--- a/infiniband-diags/src/vendstat.c
+++ b/infiniband-diags/src/vendstat.c
@@ -144,25 +144,30 @@ static int do_vendor(ib_portid_t *portid, struct ibmad_port *srcport,
return 0;
}
-static unsigned int conf_addr, conf_val, conf_mask;
-
-static void do_config_space_record(ib_portid_t *portid, unsigned set)
+static void do_config_space_records(ib_portid_t *portid, unsigned set,
+ is3_config_space_t *cs, unsigned records)
{
- is3_config_space_t cs;
-
- memset(&cs, 0, sizeof(cs));
- cs.record[0].address = htonl(conf_addr);
- cs.record[0].data = htonl(conf_val);
- cs.record[0].mask = htonl(conf_mask);
+ unsigned i;
+
+ if (records > 18)
+ records = 18;
+ for (i = 0; i < records; i++) {
+ cs->record[i].address = htonl(cs->record[i].address);
+ cs->record[i].data = htonl(cs->record[i].data);
+ cs->record[i].mask = htonl(cs->record[i].mask);
+ }
if (do_vendor(portid, srcport, IB_MLX_VENDOR_CLASS,
set ? IB_MAD_METHOD_SET : IB_MAD_METHOD_GET,
- IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | 1 << 16, &cs))
- IBERROR("cannot %s config space record", set ? "set" : "get");
-
- printf("Config space record at 0x%x: 0x%x\n",
- ntohl(cs.record[0].address),
- ntohl(cs.record[0].data & cs.record[0].mask));
+ IB_MLX_IS3_CONFIG_SPACE_ACCESS, 2 << 22 | records << 16,
+ cs))
+ IBERROR("cannot %s config space records", set ? "set" : "get");
+
+ for (i = 0; i < records; i++) {
+ printf("Config space record at 0x%x: 0x%x\n",
+ ntohl(cs->record[i].address),
+ ntohl(cs->record[i].data & cs->record[i].mask));
+ }
}
static void counter_groups_info(ib_portid_t * portid, int port)
@@ -224,7 +229,9 @@ static void config_counter_groups(ib_portid_t * portid, int port)
}
static int general_info, xmit_wait, counter_group_info, config_counter_group;
-static unsigned int config_space_read, config_space_write;
+static is3_config_space_t write_cs, read_cs;
+static unsigned write_cs_records, read_cs_records;
+
static int process_opt(void *context, int ch, char *optarg)
{
@@ -246,20 +253,29 @@ static int process_opt(void *context, int ch, char *optarg)
return -1;
break;
case 'R':
- config_space_read = 1;
- ret = sscanf(optarg, "%x,%x", &conf_addr, &conf_mask);
+ if (read_cs_records >= 18)
+ break;
+ ret = sscanf(optarg, "%x,%x",
+ &read_cs.record[read_cs_records].address,
+ &read_cs.record[read_cs_records].mask);
if (ret < 1)
return -1;
else if (ret == 1)
- conf_mask = 0xffffffff;
+ read_cs.record[read_cs_records].mask = 0xffffffff;
+ read_cs_records++;
break;
case 'W':
- config_space_write = 1;
- ret = sscanf(optarg, "%x,%x,%x", &conf_addr, &conf_val, &conf_mask);
+ if (write_cs_records >= 18)
+ break;
+ ret = sscanf(optarg, "%x,%x,%x",
+ &write_cs.record[write_cs_records].address,
+ &write_cs.record[write_cs_records].data,
+ &write_cs.record[write_cs_records].mask);
if (ret < 2)
return -1;
else if (ret == 2)
- conf_mask = 0xffffffff;
+ write_cs.record[write_cs_records].mask = 0xffffffff;
+ write_cs_records++;
break;
default:
return -1;
@@ -329,8 +345,13 @@ int main(int argc, char **argv)
exit(0);
}
- if (config_space_read || config_space_write) {
- do_config_space_record(&portid, config_space_write);
+ if (read_cs_records || write_cs_records) {
+ if (read_cs_records)
+ do_config_space_records(&portid, 0, &read_cs,
+ read_cs_records);
+ if (write_cs_records)
+ do_config_space_records(&portid, 1, &write_cs,
+ write_cs_records);
exit(0);
}
--
1.7.0.4
--
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 related
* Re: [PATCH] ibnetdisc: Separate calls to umad and mad layer to avoid race condition on response MAD's
From: Ira Weiny @ 2010-05-25 17:45 UTC (permalink / raw)
To: Sasha Khapyorsky; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20100522144010.GR28549@me>
On Sat, 22 May 2010 07:40:10 -0700
Sasha Khapyorsky <sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org> wrote:
> On 16:48 Tue 11 May , Ira Weiny wrote:
> >
> > From: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
> > Date: Tue, 11 May 2010 15:36:08 -0700
> > Subject: [PATCH] ibnetdisc: Separate calls to umad and mad layer to avoid race condition on response MAD's
> >
> > Specify CA/Port to use which allows parallel scanning to other operations.
> >
> > Signed-off-by: Ira Weiny <weiny2-i2BcT+NCU+M@public.gmane.org>
>
> Applied. Thanks.
>
> However see a minor comment below.
>
> > ---
> > .../libibnetdisc/include/infiniband/ibnetdisc.h | 15 ++--
> > infiniband-diags/libibnetdisc/src/ibnetdisc.c | 52 +++++++-----
> > infiniband-diags/libibnetdisc/src/internal.h | 11 ++-
> > infiniband-diags/libibnetdisc/src/query_smp.c | 83 ++++++++++++++++----
> > infiniband-diags/libibnetdisc/test/testleaks.c | 16 +---
> > infiniband-diags/src/iblinkinfo.c | 8 +-
> > infiniband-diags/src/ibnetdiscover.c | 14 +---
> > infiniband-diags/src/ibqueryerrors.c | 11 ++-
> > 8 files changed, 134 insertions(+), 76 deletions(-)
>
> [snip]
>
> > diff --git a/infiniband-diags/libibnetdisc/src/internal.h b/infiniband-diags/libibnetdisc/src/internal.h
> > index 2cfde02..d037a60 100644
> > --- a/infiniband-diags/libibnetdisc/src/internal.h
> > +++ b/infiniband-diags/libibnetdisc/src/internal.h
> > @@ -54,6 +54,8 @@
> > #define MAXHOPS 63
> >
> > #define DEFAULT_MAX_SMP_ON_WIRE 2
> > +#define DEFAULT_TIMEOUT 1000
> > +#define DEFAULT_RETRIES 3
> >
> > typedef struct ibnd_scan {
> > ib_portid_t selfportid;
> > @@ -76,16 +78,19 @@ struct ibnd_smp {
> >
> > struct smp_engine {
> > struct ibmad_port *ibmad_port;
>
> After this patch ibmad_port is not used by smp_engine, but instead by an
> "upper" layer (ibnetdisc). So I would suggest to move this there (for
> example to be a member of scan struct).
Agreed. I was trying to minimize the changes by this patch because it was
mainly a bug fix.
Ira
>
> Sasha
>
[snip]
--
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
* Re: [PATCH] mlx4_en: show device's port used
From: Eli Cohen @ 2010-05-25 17:42 UTC (permalink / raw)
To: Roland Dreier
Cc: Eli Cohen, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA, Linux RDMA list,
yevgenyp-VPRAkNaXOzVS1MOuV/RT9w
In-Reply-To: <adaaarnzzsc.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
On Tue, May 25, 2010 at 09:55:47AM -0700, Roland Dreier wrote:
>
> How do other multi-port ethernet devices handle this?
I don't think there are many devices out there which have more than
one port.
> Seems that the
> cleanest way to handle this would be to add a place for drivers to set
> the port number,
So this will require changing all the drivers to put some value there
or we would need to use a default value of 1 for drivers that don't
explicitly set a value.
> and export it to userspace in generic code (so everyone
> does it the same way).
Something like ethtool? But we still need an entry under
/sys/class/net/ethx/, right?
--
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
* Re: linux-next: Tree for May 25 (infiniband/hw/qib)
From: Randy Dunlap @ 2010-05-25 17:23 UTC (permalink / raw)
To: Stephen Rothwell
Cc: linux-next-u79uwXL29TY76Z2rM5mHXA, LKML,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100525142657.c2ae7804.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
Stephen Rothwell wrote:
> Hi all,
>
> We are in the merge window again. I remind you all not to add stuff for
> 2.6.36 to your linux-next trees until after 2.6.35-rc1.
>
> Changes since 20100524:
when CONFIG_PCI_MSI is not enabled:
ERROR: "qib_init_iba6120_funcs" [drivers/infiniband/hw/qib/ib_qib.ko] undefined!
fwiw, I would make building iba6120 support dependent on PCI_MSI
(i.e., change Kconfig), remove all of the PCI_MSI ifdef-ery
in qib_iba6120.c, and add a printk or 2 in qib_init for unsupported
devices.
--
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
* Re: [PATCH] mlx4_en: show device's port used
From: Stephen Hemminger @ 2010-05-25 17:12 UTC (permalink / raw)
To: Roland Dreier
Cc: Eli Cohen, davem-fT/PcQaiUtIeIZ0/mPfg9Q,
netdev-u79uwXL29TY76Z2rM5mHXA, Linux RDMA list,
yevgenyp-VPRAkNaXOzVS1MOuV/RT9w
In-Reply-To: <adaaarnzzsc.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
On Tue, 25 May 2010 09:55:47 -0700
Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> wrote:
> > Add a sysfs file under /sys/class/net/<ethx> to show the port number within the
> > device that this network interface is using. This is needed as ConnectX devices
> > have two ports and it is useful to know which port the ethernet devices uses.
>
> How do other multi-port ethernet devices handle this? Seems that the
> cleanest way to handle this would be to add a place for drivers to set
> the port number, and export it to userspace in generic code (so everyone
> does it the same way).
There is a rarely used field in net_device called dev_id
that looks like it was intended for this.
--
--
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
* [GIT PULL] please pull infiniband.git
From: Roland Dreier @ 2010-05-25 16:58 UTC (permalink / raw)
To: torvalds-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b,
akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Linus, please pull from
master.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
This tree is also available from kernel.org mirrors at:
git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband.git for-linus
The biggest thing here is the rather huge new qib driver for QLogic
PCIe adapters. This is pretty much self-contained (just one small
change to the core to allow low-level drivers to create per-port files
in sysfs). There are also some fixes to the new iw_cxgb4 driver, as
well as a few other miscellaneous fixes.
Chien Tung (1):
RDMA/nes: Fix incorrect unlock in nes_process_mac_intr()
Faisal Latif (2):
RDMA/nes: Have ethtool read hardware registers for rx/tx stats
RDMA/nes: Async event for closed QP causes crash
Ralph Campbell (3):
IB/core: Allow device-specific per-port sysfs files
IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters
IB/ipath: Remove support for QLogic PCIe QLE devices
Roland Dreier (3):
mlx4_core: Clean up mlx4_alloc_icm() a bit
IB/mad: Make needlessly global mad_sendq_size/mad_recvq_size static
Merge branches 'cxgb4', 'misc', 'mlx4', 'nes' and 'qib' into for-next
Sebastien Dugue (1):
mlx4_core: Fix possible chunk sg list overflow in mlx4_alloc_icm()
Steve Wise (11):
RDMA/cxgb4: Detach from the LLD after unregistering RDMA device
RDMA/cxgb4: Register RDMA provider based on LLD state_change events
RDMA/cxgb4: CQ size must be IQ size - 2
RDMA/cxgb4: Optimize CQ overflow detection
RDMA/cxgb4: Fix overflow bug in CQ arm
RDMA/cxgb4: Return proper errors in fastreg mr/pbl allocation
RDMA/cxgb4: Don't limit fastreg page list depth
RDMA/cxgb4: Update some HW limits
RDMA/cxgb4: Set fence flag for inv-local-stag work requests
RDMA/cxgb4: Support IB_WR_READ_WITH_INV opcode
RDMA/cxgb4: Only insert sq qid in lookup table
drivers/infiniband/Kconfig | 1 +
drivers/infiniband/Makefile | 1 +
drivers/infiniband/core/core_priv.h | 4 +-
drivers/infiniband/core/device.c | 6 +-
drivers/infiniband/core/mad.c | 4 +-
drivers/infiniband/core/sysfs.c | 21 +-
drivers/infiniband/hw/amso1100/c2_provider.c | 2 +-
drivers/infiniband/hw/cxgb3/iwch_provider.c | 2 +-
drivers/infiniband/hw/cxgb4/cq.c | 6 +-
drivers/infiniband/hw/cxgb4/device.c | 50 +-
drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 1 +
drivers/infiniband/hw/cxgb4/mem.c | 11 +-
drivers/infiniband/hw/cxgb4/provider.c | 4 +-
drivers/infiniband/hw/cxgb4/qp.c | 33 +-
drivers/infiniband/hw/cxgb4/t4.h | 76 +-
drivers/infiniband/hw/ehca/ehca_main.c | 2 +-
drivers/infiniband/hw/ipath/Kconfig | 8 +-
drivers/infiniband/hw/ipath/Makefile | 6 +-
drivers/infiniband/hw/ipath/ipath_driver.c | 28 +-
drivers/infiniband/hw/ipath/ipath_iba6120.c | 1862 -----
drivers/infiniband/hw/ipath/ipath_iba7220.c | 2631 -------
drivers/infiniband/hw/ipath/ipath_kernel.h | 2 -
drivers/infiniband/hw/ipath/ipath_verbs.c | 2 +-
drivers/infiniband/hw/mlx4/main.c | 2 +-
drivers/infiniband/hw/mthca/mthca_provider.c | 2 +-
drivers/infiniband/hw/nes/nes_hw.c | 12 +-
drivers/infiniband/hw/nes/nes_nic.c | 72 +-
drivers/infiniband/hw/nes/nes_verbs.c | 2 +-
drivers/infiniband/hw/qib/Kconfig | 7 +
drivers/infiniband/hw/qib/Makefile | 15 +
drivers/infiniband/hw/qib/qib.h | 1439 ++++
drivers/infiniband/hw/qib/qib_6120_regs.h | 977 +++
drivers/infiniband/hw/qib/qib_7220.h | 156 +
drivers/infiniband/hw/qib/qib_7220_regs.h | 1496 ++++
drivers/infiniband/hw/qib/qib_7322_regs.h | 3163 ++++++++
drivers/infiniband/hw/qib/qib_common.h | 758 ++
drivers/infiniband/hw/qib/qib_cq.c | 484 ++
drivers/infiniband/hw/qib/qib_diag.c | 894 +++
drivers/infiniband/hw/qib/qib_dma.c | 182 +
drivers/infiniband/hw/qib/qib_driver.c | 665 ++
drivers/infiniband/hw/qib/qib_eeprom.c | 451 ++
drivers/infiniband/hw/qib/qib_file_ops.c | 2317 ++++++
drivers/infiniband/hw/qib/qib_fs.c | 613 ++
drivers/infiniband/hw/qib/qib_iba6120.c | 3588 +++++++++
drivers/infiniband/hw/qib/qib_iba7220.c | 4618 +++++++++++
drivers/infiniband/hw/qib/qib_iba7322.c | 8058 ++++++++++++++++++++
drivers/infiniband/hw/qib/qib_init.c | 1580 ++++
drivers/infiniband/hw/qib/qib_intr.c | 236 +
drivers/infiniband/hw/qib/qib_keys.c | 328 +
drivers/infiniband/hw/qib/qib_mad.c | 2173 ++++++
drivers/infiniband/hw/qib/qib_mad.h | 373 +
drivers/infiniband/hw/qib/qib_mmap.c | 174 +
drivers/infiniband/hw/qib/qib_mr.c | 503 ++
drivers/infiniband/hw/qib/qib_pcie.c | 738 ++
.../hw/{ipath/ipath_7220.h => qib/qib_pio_copy.c} | 53 +-
drivers/infiniband/hw/qib/qib_qp.c | 1255 +++
drivers/infiniband/hw/qib/qib_qsfp.c | 564 ++
drivers/infiniband/hw/qib/qib_qsfp.h | 184 +
drivers/infiniband/hw/qib/qib_rc.c | 2288 ++++++
drivers/infiniband/hw/qib/qib_ruc.c | 817 ++
.../hw/{ipath/ipath_sd7220.c => qib/qib_sd7220.c} | 859 +--
.../ipath_sd7220_img.c => qib/qib_sd7220_img.c} | 19 +-
drivers/infiniband/hw/qib/qib_sdma.c | 973 +++
drivers/infiniband/hw/qib/qib_srq.c | 375 +
drivers/infiniband/hw/qib/qib_sysfs.c | 691 ++
drivers/infiniband/hw/qib/qib_twsi.c | 498 ++
drivers/infiniband/hw/qib/qib_tx.c | 557 ++
drivers/infiniband/hw/qib/qib_uc.c | 555 ++
drivers/infiniband/hw/qib/qib_ud.c | 607 ++
drivers/infiniband/hw/qib/qib_user_pages.c | 157 +
drivers/infiniband/hw/qib/qib_user_sdma.c | 897 +++
.../hw/{ipath/ipath_7220.h => qib/qib_user_sdma.h} | 43 +-
drivers/infiniband/hw/qib/qib_verbs.c | 2248 ++++++
drivers/infiniband/hw/qib/qib_verbs.h | 1100 +++
drivers/infiniband/hw/qib/qib_verbs_mcast.c | 368 +
.../hw/{ipath/ipath_7220.h => qib/qib_wc_ppc64.c} | 49 +-
drivers/infiniband/hw/qib/qib_wc_x86_64.c | 171 +
drivers/net/mlx4/icm.c | 36 +-
include/rdma/ib_verbs.h | 4 +-
79 files changed, 51016 insertions(+), 5191 deletions(-)
delete mode 100644 drivers/infiniband/hw/ipath/ipath_iba6120.c
delete mode 100644 drivers/infiniband/hw/ipath/ipath_iba7220.c
create mode 100644 drivers/infiniband/hw/qib/Kconfig
create mode 100644 drivers/infiniband/hw/qib/Makefile
create mode 100644 drivers/infiniband/hw/qib/qib.h
create mode 100644 drivers/infiniband/hw/qib/qib_6120_regs.h
create mode 100644 drivers/infiniband/hw/qib/qib_7220.h
create mode 100644 drivers/infiniband/hw/qib/qib_7220_regs.h
create mode 100644 drivers/infiniband/hw/qib/qib_7322_regs.h
create mode 100644 drivers/infiniband/hw/qib/qib_common.h
create mode 100644 drivers/infiniband/hw/qib/qib_cq.c
create mode 100644 drivers/infiniband/hw/qib/qib_diag.c
create mode 100644 drivers/infiniband/hw/qib/qib_dma.c
create mode 100644 drivers/infiniband/hw/qib/qib_driver.c
create mode 100644 drivers/infiniband/hw/qib/qib_eeprom.c
create mode 100644 drivers/infiniband/hw/qib/qib_file_ops.c
create mode 100644 drivers/infiniband/hw/qib/qib_fs.c
create mode 100644 drivers/infiniband/hw/qib/qib_iba6120.c
create mode 100644 drivers/infiniband/hw/qib/qib_iba7220.c
create mode 100644 drivers/infiniband/hw/qib/qib_iba7322.c
create mode 100644 drivers/infiniband/hw/qib/qib_init.c
create mode 100644 drivers/infiniband/hw/qib/qib_intr.c
create mode 100644 drivers/infiniband/hw/qib/qib_keys.c
create mode 100644 drivers/infiniband/hw/qib/qib_mad.c
create mode 100644 drivers/infiniband/hw/qib/qib_mad.h
create mode 100644 drivers/infiniband/hw/qib/qib_mmap.c
create mode 100644 drivers/infiniband/hw/qib/qib_mr.c
create mode 100644 drivers/infiniband/hw/qib/qib_pcie.c
copy drivers/infiniband/hw/{ipath/ipath_7220.h => qib/qib_pio_copy.c} (57%)
create mode 100644 drivers/infiniband/hw/qib/qib_qp.c
create mode 100644 drivers/infiniband/hw/qib/qib_qsfp.c
create mode 100644 drivers/infiniband/hw/qib/qib_qsfp.h
create mode 100644 drivers/infiniband/hw/qib/qib_rc.c
create mode 100644 drivers/infiniband/hw/qib/qib_ruc.c
rename drivers/infiniband/hw/{ipath/ipath_sd7220.c => qib/qib_sd7220.c} (57%)
rename drivers/infiniband/hw/{ipath/ipath_sd7220_img.c => qib/qib_sd7220_img.c} (99%)
create mode 100644 drivers/infiniband/hw/qib/qib_sdma.c
create mode 100644 drivers/infiniband/hw/qib/qib_srq.c
create mode 100644 drivers/infiniband/hw/qib/qib_sysfs.c
create mode 100644 drivers/infiniband/hw/qib/qib_twsi.c
create mode 100644 drivers/infiniband/hw/qib/qib_tx.c
create mode 100644 drivers/infiniband/hw/qib/qib_uc.c
create mode 100644 drivers/infiniband/hw/qib/qib_ud.c
create mode 100644 drivers/infiniband/hw/qib/qib_user_pages.c
create mode 100644 drivers/infiniband/hw/qib/qib_user_sdma.c
copy drivers/infiniband/hw/{ipath/ipath_7220.h => qib/qib_user_sdma.h} (57%)
create mode 100644 drivers/infiniband/hw/qib/qib_verbs.c
create mode 100644 drivers/infiniband/hw/qib/qib_verbs.h
create mode 100644 drivers/infiniband/hw/qib/qib_verbs_mcast.c
rename drivers/infiniband/hw/{ipath/ipath_7220.h => qib/qib_wc_ppc64.c} (57%)
create mode 100644 drivers/infiniband/hw/qib/qib_wc_x86_64.c
--
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.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
* Re: [PATCH] mlx4_en: show device's port used
From: Roland Dreier @ 2010-05-25 16:55 UTC (permalink / raw)
To: Eli Cohen; +Cc: davem, netdev, Linux RDMA list, yevgenyp
In-Reply-To: <20100525135548.GA12749@mtldesk030.lab.mtl.com>
> Add a sysfs file under /sys/class/net/<ethx> to show the port number within the
> device that this network interface is using. This is needed as ConnectX devices
> have two ports and it is useful to know which port the ethernet devices uses.
How do other multi-port ethernet devices handle this? Seems that the
cleanest way to handle this would be to add a place for drivers to set
the port number, and export it to userspace in generic code (so everyone
does it the same way).
--
Roland Dreier <rolandd@cisco.com> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
^ permalink raw reply
* Re: [PATCH] RDMA/nes: fix incorrect unlock in nes_process_mac_intr
From: Roland Dreier @ 2010-05-25 16:54 UTC (permalink / raw)
To: Chien Tung; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20100525151309.GA2688@ctung-MOBL>
applied, thanks for the quick response!
--
Roland Dreier <rolandd-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.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
* [PATCH/RFC] opensm: toggle sweeping V3
From: Arthur Kepner @ 2010-05-25 16:53 UTC (permalink / raw)
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: sashak-smomgflXvOZWk0Htik3J/w, Dale.R.Talcott-NSQ8wuThN14
Add option to toggle sweeping from opensm console.
Signed-off-by: Arthur Kepner <akepner-sJ/iWh9BUns@public.gmane.org>
---
include/opensm/osm_subnet.h | 6 ++++++
opensm/osm_console.c | 32 ++++++++++++++++++++++++++++++++
opensm/osm_state_mgr.c | 8 +++++++-
opensm/osm_subnet.c | 1 +
4 files changed, 46 insertions(+), 1 deletion(-)
diff --git a/opensm/include/opensm/osm_subnet.h b/opensm/include/opensm/osm_subnet.h
index d79ed8f..2a1db99 100644
--- a/opensm/include/opensm/osm_subnet.h
+++ b/opensm/include/opensm/osm_subnet.h
@@ -532,6 +532,7 @@ typedef struct osm_subn {
boolean_t in_sweep_hop_0;
boolean_t first_time_master_sweep;
boolean_t coming_out_of_standby;
+ boolean_t sweeping_enabled;
unsigned need_update;
cl_fmap_t mgrp_mgid_tbl;
void *mboxes[IB_LID_MCAST_END_HO - IB_LID_MCAST_START_HO + 1];
@@ -651,6 +652,11 @@ typedef struct osm_subn {
* The flag is set true if the SM state was standby and now
* changed to MASTER it is reset at the end of the sweep.
*
+* sweeping_enabled
+* FALSE - sweeping is administratively disabled, all
+* sweeping is inhibited, TRUE - sweeping is done
+* normally
+*
* need_update
* This flag should be on during first non-master heavy
* (including pre-master discovery stage)
diff --git a/opensm/opensm/osm_console.c b/opensm/opensm/osm_console.c
index 968486e..bc7bea3 100644
--- a/opensm/opensm/osm_console.c
+++ b/opensm/opensm/osm_console.c
@@ -150,6 +150,16 @@ static void help_reroute(FILE * out, int detail)
}
}
+static void help_sweep(FILE * out, int detail)
+{
+ fprintf(out, "sweep [on|off]\n");
+ if (detail) {
+ fprintf(out, "enable or disable sweeping\n");
+ fprintf(out, " [on] sweep normally\n");
+ fprintf(out, " [off] inhibit all sweeping\n");
+ }
+}
+
static void help_status(FILE * out, int detail)
{
fprintf(out, "status [loop]\n");
@@ -427,11 +437,15 @@ static void print_status(osm_opensm_t * p_osm, FILE * out)
p_osm->stats.sa_mads_ignored);
fprintf(out, "\n Subnet flags\n"
" ------------\n"
+ " Sweeping enabled : %d\n"
+ " Sweep interval (seconds) : %d\n"
" Ignore existing lfts : %d\n"
" Subnet Init errors : %d\n"
" In sweep hop 0 : %d\n"
" First time master sweep : %d\n"
" Coming out of standby : %d\n",
+ p_osm->subn.sweeping_enabled,
+ p_osm->subn.opt.sweep_interval,
p_osm->subn.ignore_existing_lfts,
p_osm->subn.subnet_initialization_error,
p_osm->subn.in_sweep_hop_0,
@@ -495,6 +509,23 @@ static void reroute_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
osm_opensm_sweep(p_osm);
}
+static void sweep_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
+{
+ char *p_cmd;
+
+ p_cmd = next_token(p_last);
+ if (!p_cmd ||
+ (strcmp(p_cmd, "on") != 0 && strcmp(p_cmd, "off") != 0)) {
+ fprintf(out, "Invalid sweep command\n");
+ help_sweep(out, 1);
+ } else {
+ if (strcmp(p_cmd, "on") == 0)
+ p_osm->subn.sweeping_enabled = TRUE;
+ else
+ p_osm->subn.sweeping_enabled = FALSE;
+ }
+}
+
static void logflush_parse(char **p_last, osm_opensm_t * p_osm, FILE * out)
{
fflush(p_osm->log.out_port);
@@ -1332,6 +1363,7 @@ static const struct command console_cmds[] = {
{"priority", &help_priority, &priority_parse},
{"resweep", &help_resweep, &resweep_parse},
{"reroute", &help_reroute, &reroute_parse},
+ {"sweep", &help_sweep, &sweep_parse},
{"status", &help_status, &status_parse},
{"logflush", &help_logflush, &logflush_parse},
{"querylid", &help_querylid, &querylid_parse},
diff --git a/opensm/opensm/osm_state_mgr.c b/opensm/opensm/osm_state_mgr.c
index e43463f..81c8f54 100644
--- a/opensm/opensm/osm_state_mgr.c
+++ b/opensm/opensm/osm_state_mgr.c
@@ -1415,7 +1415,13 @@ void osm_state_mgr_process(IN osm_sm_t * sm, IN osm_signal_t signal)
switch (signal) {
case OSM_SIGNAL_SWEEP:
- do_sweep(sm);
+ if (!sm->p_subn->sweeping_enabled) {
+ OSM_LOG(sm->p_log, OSM_LOG_DEBUG, "sweeping disabled - "
+ "ignoring signal %s in state %s\n",
+ osm_get_sm_signal_str(signal),
+ osm_get_sm_mgr_state_str(sm->p_subn->sm_state));
+ } else
+ do_sweep(sm);
break;
case OSM_SIGNAL_IDLE_TIME_PROCESS_REQUEST:
do_process_mgrp_queue(sm);
diff --git a/opensm/opensm/osm_subnet.c b/opensm/opensm/osm_subnet.c
index ac8cb37..ba2c812 100644
--- a/opensm/opensm/osm_subnet.c
+++ b/opensm/opensm/osm_subnet.c
@@ -531,6 +531,7 @@ ib_api_status_t osm_subn_init(IN osm_subn_t * p_subn, IN osm_opensm_t * p_osm,
/* we assume master by default - so we only need to set it true if STANDBY */
p_subn->coming_out_of_standby = FALSE;
+ p_subn->sweeping_enabled = TRUE;
return IB_SUCCESS;
}
--
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 related
* Re: [PATCH/RFC] opensm: toggle sweeping V2
From: Arthur Kepner @ 2010-05-25 16:50 UTC (permalink / raw)
To: Sasha Khapyorsky
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dale.R.Talcott-NSQ8wuThN14
In-Reply-To: <20100525151402.GT28549@me>
On Tue, May 25, 2010 at 06:14:02PM +0300, Sasha Khapyorsky wrote:
> ....
> So could you remove this part from the patch? The rest seems fine for
> me.
>
Sure. Will send an updated version now.
--
Arthur
--
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
* Re: [PATCH v4 11/11] IB/qib: Add qib_verbs.h
From: Ralph Campbell @ 2010-05-25 16:46 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <adawruszk30.fsf-BjVyx320WGW9gfZ95n9DRSW4+XlvGpQz@public.gmane.org>
On Mon, 2010-05-24 at 21:22 -0700, Roland Dreier wrote:
> OK, I merged all the qib-related stuff up and put it in my for-next
> branch. I expect ot send it to Linus soon.
Thank you very much!
--
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
* [PATCH] opensm - address windows env issues
From: Stan C. Smith @ 2010-05-25 16:03 UTC (permalink / raw)
To: 'Sasha Khapyorsky'; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Add a Windows version of truncate_log_file().
Use the Windows flavor of vsprintf().
Would you prefer items of this nature as two separate patches?
thanks,
stan.
Signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
--- a/opensm/osm_log.c 2010-05-22 05:49:24.000000000 -0700
+++ b/opensm/osm_log.c 2010-05-24 11:40:07.823895800 -0700
@@ -96,8 +96,14 @@
static void truncate_log_file(osm_log_t * p_log)
{
- fprintf(stderr,
- "truncate_log_file: cannot truncate on windows system (yet)\n");
+ int fd = _fileno(p_log->out_port);
+ HANDLE hFile = (HANDLE) _get_osfhandle(fd);
+
+ if (_lseek(fd, 0, SEEK_SET) < 0)
+ fprintf(stderr, "truncate_log_file: cannot rewind: %s\n",
+ strerror(errno));
+ SetEndOfFile(hFile);
+ p_log->count = 0;
}
#endif /* ndef __WIN__ */
@@ -123,12 +129,21 @@
return;
va_start(args, p_str);
+#ifndef __WIN__
if (p_log->log_prefix == NULL)
vsprintf(buffer, p_str, args);
else {
int n = snprintf(buffer, sizeof(buffer), "%s: ", p_log->log_prefix);
vsprintf(buffer + n, p_str, args);
}
+#else
+ if (p_log->log_prefix == NULL)
+ _vsnprintf(buffer, 1024, (LPSTR)p_str, args);
+ else {
+ int n = snprintf(buffer, sizeof(buffer), "%s: ", p_log->log_prefix);
+ _vsnprintf(buffer + n, (1024 - n), (LPSTR)p_str, args);
+ }
+#endif
va_end(args);
/* this is a call to the syslog */
--
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
* Re: [PATCH] opensm/qos.c: Revert port ranges for calls to sl2vl_update_table().
From: Hal Rosenstock @ 2010-05-25 15:57 UTC (permalink / raw)
To: Jim Schutt
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
sashak-smomgflXvOZWk0Htik3J/w@public.gmane.org
In-Reply-To: <1274737321.4773.68.camel-mgfCWIlwujvg4c9jKm7R2O1ftBKYq+Ku@public.gmane.org>
Hi again Jim,
On Mon, May 24, 2010 at 5:42 PM, Jim Schutt <jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org> wrote:
> Hi Hal,
>
> On Mon, 2010-05-24 at 12:03 -0600, Hal Rosenstock wrote:
>> Hi Jim,
>>
>> On Fri, May 21, 2010 at 4:29 PM, Jim Schutt <jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org> wrote:
>> >
>> > Sorry, I somehow got this wrong.
>> >
>> > Corrected patch below.
>> >
>> > -- Jim
>> >
>> > On Fri, 2010-05-21 at 14:18 -0600, Jim Schutt wrote:
>> >> Before commit 051a1dd5 (opensm/osm_qos.c: split switch external and end
>> >> ports setup), osm_qos_setup() would end up calling sl2vl_update_table()
>> >> for output ports 1-N, and inport ports 0-N.
>> >>
>> >> Commit 051a1dd5 changed this around to be output ports 0-N, and input
>> >> ports 1-N, and an InfiniScale IV based fabric would log lots of errors
>> >> like these:
>> >>
>> >> log_rcv_cb_error: ERR 3111: Received MAD with error status = 0x1C
>> >> SubnGetResp(SLtoVLMappingTable), attr_mod 0x2300, TID 0xad069
>> >> Initial path: 0,1,1,4,13 Return path: 0,25,1,7,10
>> >>
>> >> The attr_mod in every such message has 0x00 in the least significant
>> >> byte.
>>
>> This is the output port.
>>
>> >> With the port ranges restored to their old values, the above log messages
>> >> stop.
>>
>> Is this with base or enhanced port 0 ? I'm assuming base. See comment below.
>
> See extra patch below.
>
>>
>> Also, what firmware version is in use ?
>
> flint reports the FW version as 7.2.0
>
>>
>> >> Signed-off-by: Jim Schutt <jaschut-4OHPYypu0djtX7QSmKvirg@public.gmane.org>
>> >> ---
>> >> opensm/opensm/osm_qos.c | 8 ++++----
>> >> 1 files changed, 4 insertions(+), 4 deletions(-)
>> >>
>> >> diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c
>> >> index 6bbbfa2..b8c3111 100644
>> >> --- a/opensm/opensm/osm_qos.c
>> >> +++ b/opensm/opensm/osm_qos.c
>> >> @@ -230,12 +230,12 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node,
>> >> &qcfg->sl2vl);
>> >> }
>> >>
>> >> - for (i = 1; i < num_ports; i++) {
>> >> + for (i = 0; i < num_ports; i++) {
>> >> p = osm_node_get_physp_ptr(node, i);
>> >> force_update = p->need_update || sm->p_subn->need_update;
>> >> - for (j = 0; j < num_ports; j++)
>> >> - if (sl2vl_update_table(sm, p, i, i << 8 | j,
>> >> - force_update, &qcfg->sl2vl))
>> >> + for (j = 1; j < num_ports; j++)
>> >> + if (sl2vl_update_table(sm, p, i, j, force_update,
>> >> + &qcfg->sl2vl))
>> >> ret = -1;
>> >> }
>> >>
>> >
>> > diff --git a/opensm/opensm/osm_qos.c b/opensm/opensm/osm_qos.c
>> > index 6bbbfa2..7d76c75 100644
>> > @@ -230,10 +230,10 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node,
>> > &qcfg->sl2vl);
>> > }
>> >
>> > - for (i = 1; i < num_ports; i++) {
>> > + for (i = 0; i < num_ports; i++) {
>> > p = osm_node_get_physp_ptr(node, i);
>> > force_update = p->need_update || sm->p_subn->need_update;
>> > - for (j = 0; j < num_ports; j++)
>> > + for (j = 1; j < num_ports; j++)
>> > if (sl2vl_update_table(sm, p, i, i << 8 | j,
>> > force_update, &qcfg->sl2vl))
>> > ret = -1;
>> >
>>
>> I think the start for j depends on whether it is base or enhanced port
>> 0. Start should be 0 for enhanced and 1 for base.
>
> Ah. I see now in the IBA 1.2.1 spec, Table 146 PortInfo, p 837, that
> only an enhanced SP0 supports OperationalVLs. So if a base SP0 doesn't
> support it, such port also doesn't support VLs, and it makes sense that
> you shouldn't attempt to program SL2VL maps.
>
> Is that what you're thinking?
I was basing this on Table 166 SMP AttributeModifier Errors p. 855 for
SLtoVLMappingTable which summarizes the related compliances for MAD
status handling.
> I added this patch on top of above, and things still work w/ no
> error messages. I guess that means our InfiniSwitch IV gear has
> only base SP0.
Yes; you can check this with smpquery switchinfo.
> --- a/opensm/opensm/osm_qos.c
> +++ b/opensm/opensm/osm_qos.c
> @@ -233,7 +233,8 @@ static int qos_extports_setup(osm_sm_t * sm, osm_node_t *node,
> for (i = 0; i < num_ports; i++) {
> p = osm_node_get_physp_ptr(node, i);
> force_update = p->need_update || sm->p_subn->need_update;
> - for (j = 1; j < num_ports; j++)
> + j = ib_switch_info_is_enhanced_port0(&node->sw->switch_info) ? 0 : 1;
> + for (; j < num_ports; j++)
> if (sl2vl_update_table(sm, p, i, i << 8 | j,
> force_update, &qcfg->sl2vl))
> ret = -1;
>
> Does that look OK to you?
Yes.
-- Hal
>
> Thanks -- Jim
>
>
>>
>> -- Hal
>>
>
>
>
--
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
* [PATCH] opensm/libvendor Reduce stack consumption
From: Stan C. Smith @ 2010-05-25 15:32 UTC (permalink / raw)
To: 'Sasha Khapyorsky'; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
Resend, as I realized the mangled email problem; sorry about the extra work.
stan.
Reduce stack consumption by using a union of structs instead of individual struct allocations.
Code borrowed from osm_vendor_ibumad_sa.c
signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
diff --git a/opensm/libvendor/osm_vendor_mlx_sa.c b/opensm/libvendor/osm_vendor_mlx_sa.c
index 91f82fa..0cc3f19 100644
--- a/opensm/libvendor/osm_vendor_mlx_sa.c
+++ b/opensm/libvendor/osm_vendor_mlx_sa.c
@@ -576,14 +576,19 @@ ib_api_status_t
osmv_query_sa(IN osm_bind_handle_t h_bind,
IN const osmv_query_req_t * const p_query_req)
{
- osmv_sa_bind_info_t *p_bind = (osmv_sa_bind_info_t *) h_bind;
+ union {
+ ib_service_record_t svc_rec;
+ ib_node_record_t node_rec;
+ ib_portinfo_record_t port_info;
+ ib_path_rec_t path_rec;
+#ifdef DUAL_SIDED_RMPP
+ ib_multipath_rec_t multipath_rec;
+#endif
+ ib_class_port_info_t class_port_info;
+ } u;
osmv_sa_mad_data_t sa_mad_data;
+ osmv_sa_bind_info_t *p_bind = (osmv_sa_bind_info_t *) h_bind;
osmv_user_query_t *p_user_query;
- ib_service_record_t svc_rec;
- ib_node_record_t node_rec;
- ib_portinfo_record_t port_info;
- ib_path_rec_t path_rec;
- ib_class_port_info_t class_port_info;
osm_log_t *p_log = p_bind->p_log;
ib_api_status_t status;
@@ -617,7 +622,7 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_service_record_t));
sa_mad_data.comp_mask = 0;
- sa_mad_data.p_attr = &svc_rec;
+ sa_mad_data.p_attr = &u.svc_rec;
break;
case OSMV_QUERY_SVC_REC_BY_NAME:
@@ -628,8 +633,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
sa_mad_data.comp_mask = IB_SR_COMPMASK_SNAME;
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_service_record_t));
- sa_mad_data.p_attr = &svc_rec;
- memcpy(svc_rec.service_name, p_query_req->p_query_input,
+ sa_mad_data.p_attr = &u.svc_rec;
+ memcpy(u.svc_rec.service_name, p_query_req->p_query_input,
sizeof(ib_svc_name_t));
break;
@@ -640,8 +645,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
sa_mad_data.comp_mask = IB_SR_COMPMASK_SID;
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_service_record_t));
- sa_mad_data.p_attr = &svc_rec;
- svc_rec.service_id =
+ sa_mad_data.p_attr = &u.svc_rec;
+ u.svc_rec.service_id =
*(ib_net64_t *) (p_query_req->p_query_input);
break;
@@ -653,7 +658,7 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_class_port_info_t));
sa_mad_data.comp_mask = 0;
- sa_mad_data.p_attr = &class_port_info;
+ sa_mad_data.p_attr = &u.class_port_info;
break;
@@ -665,8 +670,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_node_record_t));
sa_mad_data.comp_mask = IB_NR_COMPMASK_NODEGUID;
- sa_mad_data.p_attr = &node_rec;
- node_rec.node_info.node_guid =
+ sa_mad_data.p_attr = &u.node_rec;
+ u.node_rec.node_info.node_guid =
*(ib_net64_t *) (p_query_req->p_query_input);
break;
@@ -678,8 +683,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_portinfo_record_t));
sa_mad_data.comp_mask = IB_PIR_COMPMASK_LID;
- sa_mad_data.p_attr = &port_info;
- port_info.lid = *(ib_net16_t *) (p_query_req->p_query_input);
+ sa_mad_data.p_attr = &u.port_info;
+ u.port_info.lid = *(ib_net16_t *) (p_query_req->p_query_input);
break;
case OSMV_QUERY_PORT_REC_BY_LID_AND_NUM:
@@ -729,19 +734,19 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
case OSMV_QUERY_PATH_REC_BY_PORT_GUIDS:
osm_log(p_log, OSM_LOG_DEBUG,
"osmv_query_sa DBG:001 %s", "PATH_REC_BY_PORT_GUIDS\n");
- memset(&path_rec, 0, sizeof(ib_path_rec_t));
+ memset(&u.path_rec, 0, sizeof(ib_path_rec_t));
sa_mad_data.attr_id = IB_MAD_ATTR_PATH_RECORD;
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_path_rec_t));
sa_mad_data.comp_mask =
(IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID | IB_PR_COMPMASK_NUMBPATH);
- path_rec.num_path = 0x7f;
- sa_mad_data.p_attr = &path_rec;
- ib_gid_set_default(&path_rec.dgid,
+ u.path_rec.num_path = 0x7f;
+ sa_mad_data.p_attr = &u.path_rec;
+ ib_gid_set_default(&u.path_rec.dgid,
((osmv_guid_pair_t *) (p_query_req->
p_query_input))->
dest_guid);
- ib_gid_set_default(&path_rec.sgid,
+ ib_gid_set_default(&u.path_rec.sgid,
((osmv_guid_pair_t *) (p_query_req->
p_query_input))->
src_guid);
@@ -750,18 +755,18 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
case OSMV_QUERY_PATH_REC_BY_GIDS:
osm_log(p_log, OSM_LOG_DEBUG,
"osmv_query_sa DBG:001 %s", "PATH_REC_BY_GIDS\n");
- memset(&path_rec, 0, sizeof(ib_path_rec_t));
+ memset(&u.path_rec, 0, sizeof(ib_path_rec_t));
sa_mad_data.attr_id = IB_MAD_ATTR_PATH_RECORD;
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_path_rec_t));
sa_mad_data.comp_mask =
- (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID | IB_PR_COMPMASK_NUMBPATH);
- path_rec.num_path = 0x7f;
- sa_mad_data.p_attr = &path_rec;
- memcpy(&path_rec.dgid,
+ (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID | IB_PR_COMPMASK_NUMBPATH);
+ u.path_rec.num_path = 0x7f;
+ sa_mad_data.p_attr = &u.path_rec;
+ memcpy(&u.path_rec.dgid,
&((osmv_gid_pair_t *) (p_query_req->p_query_input))->
dest_gid, sizeof(ib_gid_t));
- memcpy(&path_rec.sgid,
+ memcpy(&u.path_rec.sgid,
&((osmv_gid_pair_t *) (p_query_req->p_query_input))->
src_gid, sizeof(ib_gid_t));
break;
@@ -769,18 +774,18 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
case OSMV_QUERY_PATH_REC_BY_LIDS:
osm_log(p_log, OSM_LOG_DEBUG,
"osmv_query_sa DBG:001 %s", "PATH_REC_BY_LIDS\n");
- memset(&path_rec, 0, sizeof(ib_path_rec_t));
+ memset(&u.path_rec, 0, sizeof(ib_path_rec_t));
sa_mad_data.method = IB_MAD_METHOD_GET;
sa_mad_data.attr_id = IB_MAD_ATTR_PATH_RECORD;
sa_mad_data.attr_offset =
ib_get_attr_offset(sizeof(ib_path_rec_t));
sa_mad_data.comp_mask =
(IB_PR_COMPMASK_DLID | IB_PR_COMPMASK_SLID);
- sa_mad_data.p_attr = &path_rec;
- path_rec.dlid =
+ sa_mad_data.p_attr = &u.path_rec;
+ u.path_rec.dlid =
((osmv_lid_pair_t *) (p_query_req->p_query_input))->
dest_lid;
- path_rec.slid =
+ u.path_rec.slid =
((osmv_lid_pair_t *) (p_query_req->p_query_input))->src_lid;
break;
--
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 related
* RE: [PATCH] use macro for tmp file path
From: Smith, Stan @ 2010-05-25 15:25 UTC (permalink / raw)
To: Sasha Khapyorsky
Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20100525110206.GO28549@me>
Sasha Khapyorsky wrote:
> On 09:51 Fri 21 May , Smith, Stan wrote:
>>
>> Use defined macro for tmp file path
>>
>> signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>>
>
> The patch is whitespece-mangled.
>
>> diff --git a/opensm/opensm/st.c b/opensm/opensm/st.c
>> index ea76038..2d39117 100644
>> --- a/opensm/opensm/st.c
>> +++ b/opensm/opensm/st.c
>> @@ -174,7 +174,7 @@ static int init_st = 0;
>>
>> static void stat_col()
>> {
>> - FILE *f = fopen("/var/log/osm_st_col", "w");
>> + FILE *f = fopen( OSM_DEFAULT_TMP_DIR "osm_st_col", "w");
>
> I think it was discussed somehow in the past.
>
> Shouldn't this be:
>
> OSM_DEFAULT_TMP_DIR "/osm_st_col"
>
> , so that trailing '/' will not be mandatory in directory define?
Currently OSM_DEFAULT_TMP_DIR is defined with a trailing directory delimiter.
Having the delimiter in the OSM_DEFAULT_TMP_DIR makes it easier to be consistent with \ or /.
Will resend this patch as I think I've figured out the mangled email story.
>
> Sasha
>
>> fprintf(f, "collision: %d\n", collision);
>> fclose(f);
>> }
>> --
>> 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
* RE: [PATCH] opensm/complib use portable macro syntax
From: Smith, Stan @ 2010-05-25 15:18 UTC (permalink / raw)
To: Sasha Khapyorsky
Cc: ofw-ZwoEplunGu1OwGhvXhtEPSCwEArCW2h5@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <20100525105457.GN28549@me>
Sasha Khapyorsky wrote:
> Hi Stan,
>
> On 09:45 Fri 21 May , Smith, Stan wrote:
>>
>> Use portable macro argument syntax.
>>
>> signed-of-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
> ^^^^^^^^^^^^
> Signed-off-by:
oops.
>
>>
>
> The patch below is malformed - whitespaces are mangled (please check
> your mailer).
>
> Applied by hands. Thanks.
Sorry, will investigate.
Perhaps I should resend once I've figured out the story.
>
> Sasha
>
>> diff --git a/opensm/complib/cl_event_wheel.c
>> b/opensm/complib/cl_event_wheel.c index ef6d598..eb894a6 100644 ---
>> a/opensm/complib/cl_event_wheel.c +++
>> b/opensm/complib/cl_event_wheel.c @@ -42,7 +42,7 @@
>> #include <complib/cl_event_wheel.h>
>> #include <complib/cl_debug.h>
>>
>> -#define CL_DBG(fmt, arg...)
>> +#define CL_DBG(fmt, ...)
>>
>> static cl_status_t __event_will_age_before(IN const cl_list_item_t *
>> const p_list_item, IN
>> void *context)
--
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
* Re: [PATCH/RFC] opensm: toggle sweeping V2
From: Sasha Khapyorsky @ 2010-05-25 15:14 UTC (permalink / raw)
To: Arthur Kepner
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, Dale.R.Talcott-NSQ8wuThN14
In-Reply-To: <20100524211830.GJ2678-sJ/iWh9BUns@public.gmane.org>
On 14:18 Mon 24 May , Arthur Kepner wrote:
> > > .....
> > > /* do a sweep if we received a trap */
> > > if (sm->p_subn->opt.sweep_on_trap) {
> >
> > > - /* if this is trap number 128 or run_heavy_sweep is TRUE -
> > > - update the force_heavy_sweep flag of the subnet.
> > > - Sweep also on traps 144 - these traps signal a change of
> > > - certain port capabilities.
> > > - TODO: In the future this can be changed to just getting
> > > - PortInfo on this port instead of sweeping the entire subnet. */
> > > - if (ib_notice_is_generic(p_ntci) &&
> > > - (cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 128 ||
> > > - cl_ntoh16(p_ntci->g_or_v.generic.trap_num) == 144 ||
> > > - run_heavy_sweep)) {
> > > - OSM_LOG(sm->p_log, OSM_LOG_VERBOSE,
> > > - "Forcing heavy sweep. Received trap:%u\n",
> > > + if (!sm->p_subn->sweeping_enabled) {
> > > + OSM_LOG(sm->p_log, OSM_LOG_DEBUG,
> > > + "sweeping disabled - ignoring trap %u\n",
> > > cl_ntoh16(p_ntci->g_or_v.generic.trap_num));
> >
> > Isn't this case already handled in osm_state_mgr_process() and this code
> > addition in osm_trap_rcv.c redundant?
>
> It is redundant.
So could you remove this part from the patch? The rest seems fine for
me.
Sasha
--
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
* [PATCH] RDMA/nes: fix incorrect unlock in nes_process_mac_intr
From: Chien Tung @ 2010-05-25 15:13 UTC (permalink / raw)
To: Roland Dreier; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA
commit ce6e74f2 introduced a problem where unlock took place only
within an if statement.
sparse warning:
drivers/infiniband/hw/nes/nes_hw.c:2643:9: warning: context imbalance
in 'nes_process_mac_intr' - different lock contexts for basic block
Reported-by: Roland Dreier <rdreier-FYB4Gu1CFyUAvxtiuMwx3w@public.gmane.org>
Signed-off-by: Chien Tung <chien.tin.tung-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
---
drivers/infiniband/hw/nes/nes_hw.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
index bb9c775..57874a1 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -2584,7 +2584,6 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
break;
}
}
- spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
if (phy_data & 0x0004) {
if (wide_ppm_offset &&
@@ -2639,6 +2638,8 @@ static void nes_process_mac_intr(struct nes_device *nesdev, u32 mac_number)
}
}
+ spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
+
nesadapter->mac_sw_state[mac_number] = NES_MAC_SW_IDLE;
}
--
1.6.4.2
--
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 related
* [PATCH] mlx4_en: show device's port used
From: Eli Cohen @ 2010-05-25 13:55 UTC (permalink / raw)
To: davem-fT/PcQaiUtIeIZ0/mPfg9Q
Cc: netdev-u79uwXL29TY76Z2rM5mHXA, Linux RDMA list, Roland Dreier,
yevgenyp-VPRAkNaXOzVS1MOuV/RT9w
Add a sysfs file under /sys/class/net/<ethx> to show the port number within the
device that this network interface is using. This is needed as ConnectX devices
have two ports and it is useful to know which port the ethernet devices uses.
Signed-off-by: Eli Cohen <eli-VPRAkNaXOzVS1MOuV/RT9w@public.gmane.org>
---
drivers/net/mlx4/en_netdev.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/drivers/net/mlx4/en_netdev.c b/drivers/net/mlx4/en_netdev.c
index 73c3d20..5d6f811 100644
--- a/drivers/net/mlx4/en_netdev.c
+++ b/drivers/net/mlx4/en_netdev.c
@@ -871,6 +871,16 @@ err:
return -ENOMEM;
}
+static ssize_t show_port(struct device *d, struct device_attribute *attr,
+ char *buf)
+{
+ struct mlx4_en_priv *priv = netdev_priv(to_net_dev(d));
+
+ return sprintf(buf, "%d\n", priv->port);
+ return 0;
+}
+
+static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
void mlx4_en_destroy_netdev(struct net_device *dev)
{
@@ -1067,6 +1077,12 @@ int mlx4_en_init_netdev(struct mlx4_en_dev *mdev, int port,
en_warn(priv, "Using %d TX rings\n", prof->tx_ring_num);
en_warn(priv, "Using %d RX rings\n", prof->rx_ring_num);
+ err = device_create_file(&dev->dev, &dev_attr_port);
+ if (err) {
+ mlx4_err(mdev, "failed to create sysfs file\n");
+ goto out;
+ }
+
priv->registered = 1;
queue_delayed_work(mdev->workqueue, &priv->stats_task, STATS_DELAY);
return 0;
--
1.7.1
--
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 related
* Re: [ANNOUNCE] librdmacm 1.0.12
From: Andrea Gozzelino @ 2010-05-25 13:36 UTC (permalink / raw)
To: Sean Hefty, arlin.r.davis-ral2JQCrhuEAvxtiuMwx3w
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA, 'Vladimir Sokolovsky'
In-Reply-To: <CE35DBA4CC524BD3BDA61C7DE2BD39CD-Zpru7NauK7drdx17CPfAsdBPR1lH4CV8@public.gmane.org>
On May 22, 2010 01:06 AM, Sean Hefty <sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> wrote:
> I've pushed out release 1.0.12 of librdmacm. This incorporates several
> new APIs
> that should make connecting and transferring data over RDMA devices
> simpler for
> user applications, plus adds support for user space path record
> caching.
>
> New APIs include simple wrappers for common verbs operations, such as
> memory
> registration, posting of work requests, and retrieving completions.
> Support for
> synchronous connection establishment was added, along with newer calls
> that
> combine the work done using multiple existing calls. To help address
> MPI
> scaling issues, this release provides support for IB ACM path record
> caching
> capabilities, enabled through the use of a compile time option. New
> client and
> server test applications were also added to demonstrate the use of the
> new APIs.
>
> (Note that the source code includes changes for AF_IB support, but
> AF_IB has
> been disabled in the code to avoid potential ABI compatibility issues
> until the
> kernel changes have been accepted upstream.) This version wants the
> soon to be
> released version of libibverbs, but will work with older versions
> installed.
>
> Please pull this release into OFED 1.5.2. I will provide a set of
> release notes
> next week.
>
> - 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
>
Hi Sean,
Hi Arlin,
I'm very interesting about librdmacm.
I'm working on Intel Net Effect NE020 cards from February 2010 for an
INFN experimental proposal, called REDIGO (Read out at 10 Gbits/s),
about the data
acquisition and movement systems. The covergence of storage protocols
around 10 Gigabits/s Ethernet protocols shows that one way could be the
Remote Direct Memory Access (RDMA). The goals are the investigations of
latency time, the throughput, the buffer size schemes and finally the
global event building bandwidth.
I explore different ways as TCP, SDP, RDMA, FCoE, MPI, excluded
Infiniband.
Actually I transfer data (read/write) in a server/client system with
RDMA. The transfer speed measured is about 1.17 Mbytes/s (93% of
designed bandwith). I try to measure the latency, but I have a TCP
socket as syncronization actor and the measure is not "clean". The card
nominal latency value is 6 us.
I'm not an expert of code, but I read this thread and I understand that
new librdmacm version will be easier for users.
I will wait your release notes to know if librdmacm 1.0.12 is better for
my test configuration and simplier in performance evaluation.
Thank you very much.
Keep in touch,
Andrea
Andrea Gozzelino
INFN - Laboratori Nazionali di Legnaro (LNL)
Viale dell'Universita' 2
I-35020 - Legnaro (PD)- ITALIA
Tel: +39 049 8068346
Fax: +39 049 641925
Mail: andrea.gozzelino-PK20h7lG/Rc1GQ1Ptb7lUw@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
* Re: [PATCH] opensm/libvendor Reduce stack consumption
From: Sasha Khapyorsky @ 2010-05-25 11:30 UTC (permalink / raw)
To: Smith, Stan; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <3F6F638B8D880340AB536D29CD4C1E192562EBBBCE-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
On 10:37 Fri 21 May , Smith, Stan wrote:
>
> Reduce stack consumption by using a union of structs instead of individual struct allocations.
> Code borrowed from osm_vendor_ibumad_sa.c
>
> signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
This patch is malformed too. And unlike others it has more lines to
mistype - I will not be able to test mlx vendor. Please repost in
appliable form.
Sasha
>
> diff --git a/opensm/libvendor/osm_vendor_mlx_sa.c b/opensm/libvendor/osm_vendor_mlx_sa.c
> index 91f82fa..0cc3f19 100644
> --- a/opensm/libvendor/osm_vendor_mlx_sa.c
> +++ b/opensm/libvendor/osm_vendor_mlx_sa.c
> @@ -576,14 +576,19 @@ ib_api_status_t
> osmv_query_sa(IN osm_bind_handle_t h_bind,
> IN const osmv_query_req_t * const p_query_req)
> {
> - osmv_sa_bind_info_t *p_bind = (osmv_sa_bind_info_t *) h_bind;
> + union {
> + ib_service_record_t svc_rec;
> + ib_node_record_t node_rec;
> + ib_portinfo_record_t port_info;
> + ib_path_rec_t path_rec;
> +#ifdef DUAL_SIDED_RMPP
> + ib_multipath_rec_t multipath_rec;
> +#endif
> + ib_class_port_info_t class_port_info;
> + } u;
> osmv_sa_mad_data_t sa_mad_data;
> + osmv_sa_bind_info_t *p_bind = (osmv_sa_bind_info_t *) h_bind;
> osmv_user_query_t *p_user_query;
> - ib_service_record_t svc_rec;
> - ib_node_record_t node_rec;
> - ib_portinfo_record_t port_info;
> - ib_path_rec_t path_rec;
> - ib_class_port_info_t class_port_info;
> osm_log_t *p_log = p_bind->p_log;
> ib_api_status_t status;
>
> @@ -617,7 +622,7 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_service_record_t));
> sa_mad_data.comp_mask = 0;
> - sa_mad_data.p_attr = &svc_rec;
> + sa_mad_data.p_attr = &u.svc_rec;
> break;
>
> case OSMV_QUERY_SVC_REC_BY_NAME:
> @@ -628,8 +633,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> sa_mad_data.comp_mask = IB_SR_COMPMASK_SNAME;
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_service_record_t));
> - sa_mad_data.p_attr = &svc_rec;
> - memcpy(svc_rec.service_name, p_query_req->p_query_input,
> + sa_mad_data.p_attr = &u.svc_rec;
> + memcpy(u.svc_rec.service_name, p_query_req->p_query_input,
> sizeof(ib_svc_name_t));
> break;
>
> @@ -640,8 +645,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> sa_mad_data.comp_mask = IB_SR_COMPMASK_SID;
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_service_record_t));
> - sa_mad_data.p_attr = &svc_rec;
> - svc_rec.service_id =
> + sa_mad_data.p_attr = &u.svc_rec;
> + u.svc_rec.service_id =
> *(ib_net64_t *) (p_query_req->p_query_input);
> break;
>
> @@ -653,7 +658,7 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_class_port_info_t));
> sa_mad_data.comp_mask = 0;
> - sa_mad_data.p_attr = &class_port_info;
> + sa_mad_data.p_attr = &u.class_port_info;
>
> break;
>
> @@ -665,8 +670,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_node_record_t));
> sa_mad_data.comp_mask = IB_NR_COMPMASK_NODEGUID;
> - sa_mad_data.p_attr = &node_rec;
> - node_rec.node_info.node_guid =
> + sa_mad_data.p_attr = &u.node_rec;
> + u.node_rec.node_info.node_guid =
> *(ib_net64_t *) (p_query_req->p_query_input);
>
> break;
> @@ -678,8 +683,8 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_portinfo_record_t));
> sa_mad_data.comp_mask = IB_PIR_COMPMASK_LID;
> - sa_mad_data.p_attr = &port_info;
> - port_info.lid = *(ib_net16_t *) (p_query_req->p_query_input);
> + sa_mad_data.p_attr = &u.port_info;
> + u.port_info.lid = *(ib_net16_t *) (p_query_req->p_query_input);
> break;
>
> case OSMV_QUERY_PORT_REC_BY_LID_AND_NUM:
> @@ -729,19 +734,19 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> case OSMV_QUERY_PATH_REC_BY_PORT_GUIDS:
> osm_log(p_log, OSM_LOG_DEBUG,
> "osmv_query_sa DBG:001 %s", "PATH_REC_BY_PORT_GUIDS\n");
> - memset(&path_rec, 0, sizeof(ib_path_rec_t));
> + memset(&u.path_rec, 0, sizeof(ib_path_rec_t));
> sa_mad_data.attr_id = IB_MAD_ATTR_PATH_RECORD;
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_path_rec_t));
> sa_mad_data.comp_mask =
> (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID | IB_PR_COMPMASK_NUMBPATH);
> - path_rec.num_path = 0x7f;
> - sa_mad_data.p_attr = &path_rec;
> - ib_gid_set_default(&path_rec.dgid,
> + u.path_rec.num_path = 0x7f;
> + sa_mad_data.p_attr = &u.path_rec;
> + ib_gid_set_default(&u.path_rec.dgid,
> ((osmv_guid_pair_t *) (p_query_req->
> p_query_input))->
> dest_guid);
> - ib_gid_set_default(&path_rec.sgid,
> + ib_gid_set_default(&u.path_rec.sgid,
> ((osmv_guid_pair_t *) (p_query_req->
> p_query_input))->
> src_guid);
> @@ -750,18 +755,18 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> case OSMV_QUERY_PATH_REC_BY_GIDS:
> osm_log(p_log, OSM_LOG_DEBUG,
> "osmv_query_sa DBG:001 %s", "PATH_REC_BY_GIDS\n");
> - memset(&path_rec, 0, sizeof(ib_path_rec_t));
> + memset(&u.path_rec, 0, sizeof(ib_path_rec_t));
> sa_mad_data.attr_id = IB_MAD_ATTR_PATH_RECORD;
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_path_rec_t));
> sa_mad_data.comp_mask =
> - (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID | IB_PR_COMPMASK_NUMBPATH);
> - path_rec.num_path = 0x7f;
> - sa_mad_data.p_attr = &path_rec;
> - memcpy(&path_rec.dgid,
> + (IB_PR_COMPMASK_DGID | IB_PR_COMPMASK_SGID | IB_PR_COMPMASK_NUMBPATH);
> + u.path_rec.num_path = 0x7f;
> + sa_mad_data.p_attr = &u.path_rec;
> + memcpy(&u.path_rec.dgid,
> &((osmv_gid_pair_t *) (p_query_req->p_query_input))->
> dest_gid, sizeof(ib_gid_t));
> - memcpy(&path_rec.sgid,
> + memcpy(&u.path_rec.sgid,
> &((osmv_gid_pair_t *) (p_query_req->p_query_input))->
> src_gid, sizeof(ib_gid_t));
> break;
> @@ -769,18 +774,18 @@ osmv_query_sa(IN osm_bind_handle_t h_bind,
> case OSMV_QUERY_PATH_REC_BY_LIDS:
> osm_log(p_log, OSM_LOG_DEBUG,
> "osmv_query_sa DBG:001 %s", "PATH_REC_BY_LIDS\n");
> - memset(&path_rec, 0, sizeof(ib_path_rec_t));
> + memset(&u.path_rec, 0, sizeof(ib_path_rec_t));
> sa_mad_data.method = IB_MAD_METHOD_GET;
> sa_mad_data.attr_id = IB_MAD_ATTR_PATH_RECORD;
> sa_mad_data.attr_offset =
> ib_get_attr_offset(sizeof(ib_path_rec_t));
> sa_mad_data.comp_mask =
> (IB_PR_COMPMASK_DLID | IB_PR_COMPMASK_SLID);
> - sa_mad_data.p_attr = &path_rec;
> - path_rec.dlid =
> + sa_mad_data.p_attr = &u.path_rec;
> + u.path_rec.dlid =
> ((osmv_lid_pair_t *) (p_query_req->p_query_input))->
> dest_lid;
> - path_rec.slid =
> + u.path_rec.slid =
> ((osmv_lid_pair_t *) (p_query_req->p_query_input))->src_lid;
> break;
>
--
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
* Re: [PATCH] ib_types.h add debug assert
From: Sasha Khapyorsky @ 2010-05-25 11:24 UTC (permalink / raw)
To: Smith, Stan; +Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
In-Reply-To: <3F6F638B8D880340AB536D29CD4C1E192562EBBC01-osO9UTpF0USkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
On 10:49 Fri 21 May , Smith, Stan wrote:
>
> Add a debug assert to catch incorrect MAD attr offset size.
> This proved to be useful in catching incorrect struct sizes as MAD attrs need to be a multiple of 8 bytes.
Could you clarify where was it useful and where such errors were seen?
>
> signed-off-by: stan smith <stan.smith-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Applied (again - by hands). Thanks.
Sasha
>
> diff --git a/opensm/include/iba/ib_types.h b/opensm/include/iba/ib_types.h
> index e1bc102..203c319 100644
> --- a/opensm/include/iba/ib_types.h
> +++ b/opensm/include/iba/ib_types.h
> @@ -4395,6 +4395,7 @@ static inline uint32_t OSM_API ib_get_attr_size(IN const ib_net16_t attr_offset)
>
> static inline ib_net16_t OSM_API ib_get_attr_offset(IN const uint32_t attr_size)
> {
> + CL_ASSERT((attr_size & 0x07) == 0);
> return (cl_hton16((uint16_t) (attr_size >> 3)));
> }
>
--
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
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox