Re: [openib-general] [PATCHv5] osm: partition manager force policy

2006-06-20 Thread Eitan Zahavi
Hi Hal,

Thanks for applying the patch.

Regarding the issues :

Hal Rosenstock wrote:
>>+
>>+ CL_ASSERT( p_pkey_tbl );
> 
> 
> Should the other routines also assert on this or should this be
> consistent with the others ?
Yes it should b consistent.
Normally I add assertion on OUT parameters such that a "misuse" is caught.
The idea is that parameters provided by reference are more likely to be passed
by mistake as NULL. So I would remove the assert on p_key_tbl.
> 
> 
>>+ CL_ASSERT( p_block_idx != NULL );
>>+ CL_ASSERT( p_pkey_idx != NULL );
> 
> 
> There is no p_pkey_idx parameter. I presume this should be p_pkey_index.
Ooops - this means the code will not compile in debug mode !
I see you fixed that.
> 
> 
> Also, two things about osm_pkey_mgr.c:
> 
> Was there a need to reorder the routines ? This broke the diff so it had
> to be done largely by hand.
I reordered to to be defined in the order used.
Already agree with Sasha that I should have done that on separate patch.
> 
> Also, it would have been nice not to mix the format changes with the
> substantive changes. Try to keep it to "one thought per patch".
OK.
> 
> This patch has been applied with cosmetic changes. We will go from
> here...
Thanks

Eitan

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] ib_gid lookup

2006-06-20 Thread Sean Hefty
>  i'm trying to find whether i can do a lookup of ib_gid by either
>node name or node's ip address. is this information available from
>the subnet manager?

A lookup is done from IP address to GID using the address translation module
(ib_addr).  This functionality is exposed to userspace through the rdma_cm
(resolve_addr routine).

- Sean

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [PATCH v2 1/2] iWARP changes to libibverbs.

2006-06-20 Thread Roland Dreier
Looks pretty good.  I'll get this into the libibverbs development tree
soon (I'm working on the MADV_DONTFORK stuff right now).

 - R.

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [PATCH v3 1/7] AMSO1100 Low Level Driver.

2006-06-20 Thread Arjan van de Ven
On Tue, 2006-06-20 at 15:30 -0500, Steve Wise wrote:

> +/*
> + * Allocate TX ring elements and chain them together.
> + * One-to-one association of adapter descriptors with ring elements.
> + */
> +static int c2_tx_ring_alloc(struct c2_ring *tx_ring, void *vaddr,
> + dma_addr_t base, void __iomem * mmio_txp_ring)
> +{
> + struct c2_tx_desc *tx_desc;
> + struct c2_txp_desc __iomem *txp_desc;
> + struct c2_element *elem;
> + int i;
> +
> + tx_ring->start = kmalloc(sizeof(*elem) * tx_ring->count, GFP_KERNEL);

I would think this needs a dma_alloc_coherent() rather than a kmalloc...


> +
> +/* Free all buffers in RX ring, assumes receiver stopped */
> +static void c2_rx_clean(struct c2_port *c2_port)
> +{
> + struct c2_dev *c2dev = c2_port->c2dev;
> + struct c2_ring *rx_ring = &c2_port->rx_ring;
> + struct c2_element *elem;
> + struct c2_rx_desc *rx_desc;
> +
> + elem = rx_ring->start;
> + do {
> + rx_desc = elem->ht_desc;
> + rx_desc->len = 0;
> +
> + __raw_writew(0, elem->hw_desc + C2_RXP_STATUS);
> + __raw_writew(0, elem->hw_desc + C2_RXP_COUNT);
> + __raw_writew(0, elem->hw_desc + C2_RXP_LEN);

you seem to be a fan of the __raw_write() functions... any reason why?
__raw_ is not a magic "go faster" prefix

Also on a related note, have you checked the driver for the needed PCI
posting flushes?

> +
> + /* Disable IRQs by clearing the interrupt mask */
> + writel(1, c2dev->regs + C2_IDIS);
> + writel(0, c2dev->regs + C2_NIMR0);

like here...
> +
> + elem = tx_ring->to_use;
> + elem->skb = skb;
> + elem->mapaddr = mapaddr;
> + elem->maplen = maplen;
> +
> + /* Tell HW to xmit */
> + __raw_writeq(cpu_to_be64(mapaddr), elem->hw_desc + C2_TXP_ADDR);
> + __raw_writew(cpu_to_be16(maplen), elem->hw_desc + C2_TXP_LEN);
> + __raw_writew(cpu_to_be16(TXP_HTXD_READY), elem->hw_desc + C2_TXP_FLAGS);

or here

> +static int c2_change_mtu(struct net_device *netdev, int new_mtu)
> +{
> + int ret = 0;
> +
> + if (new_mtu < ETH_ZLEN || new_mtu > ETH_JUMBO_MTU)
> + return -EINVAL;
> +
> + netdev->mtu = new_mtu;
> +
> + if (netif_running(netdev)) {
> + c2_down(netdev);
> +
> + c2_up(netdev);
> + }

this looks odd...




___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v3 7/7] AMSO1100 Makefiles and Kconfig changes.

2006-06-20 Thread Steve Wise

Review Changes:

- C2DEBUG -> DEBUG
---

 drivers/infiniband/Kconfig |1 +
 drivers/infiniband/Makefile|1 +
 drivers/infiniband/hw/amso1100/Kbuild  |   10 ++
 drivers/infiniband/hw/amso1100/Kconfig |   15 +++
 drivers/infiniband/hw/amso1100/README  |   11 +++
 5 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig
index ba2d650..04e6d4f 100644
--- a/drivers/infiniband/Kconfig
+++ b/drivers/infiniband/Kconfig
@@ -36,6 +36,7 @@ config INFINIBAND_ADDR_TRANS
 
 source "drivers/infiniband/hw/mthca/Kconfig"
 source "drivers/infiniband/hw/ipath/Kconfig"
+source "drivers/infiniband/hw/amso1100/Kconfig"
 
 source "drivers/infiniband/ulp/ipoib/Kconfig"
 
diff --git a/drivers/infiniband/Makefile b/drivers/infiniband/Makefile
index eea2732..e2b93f9 100644
--- a/drivers/infiniband/Makefile
+++ b/drivers/infiniband/Makefile
@@ -1,5 +1,6 @@
 obj-$(CONFIG_INFINIBAND)   += core/
 obj-$(CONFIG_INFINIBAND_MTHCA) += hw/mthca/
 obj-$(CONFIG_IPATH_CORE)   += hw/ipath/
+obj-$(CONFIG_INFINIBAND_AMSO1100)  += hw/amso1100/
 obj-$(CONFIG_INFINIBAND_IPOIB) += ulp/ipoib/
 obj-$(CONFIG_INFINIBAND_SRP)   += ulp/srp/
diff --git a/drivers/infiniband/hw/amso1100/Kbuild 
b/drivers/infiniband/hw/amso1100/Kbuild
new file mode 100644
index 000..e1f10ab
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/Kbuild
@@ -0,0 +1,10 @@
+EXTRA_CFLAGS += -Idrivers/infiniband/include
+
+ifdef CONFIG_INFINIBAND_AMSO1100_DEBUG
+EXTRA_CFLAGS += -DDEBUG
+endif
+
+obj-$(CONFIG_INFINIBAND_AMSO1100) += iw_c2.o
+
+iw_c2-y := c2.o c2_provider.o c2_rnic.o c2_alloc.o c2_mq.o c2_ae.o c2_vq.o \
+   c2_intr.o c2_cq.o c2_qp.o c2_cm.o c2_mm.o c2_pd.o
diff --git a/drivers/infiniband/hw/amso1100/Kconfig 
b/drivers/infiniband/hw/amso1100/Kconfig
new file mode 100644
index 000..809cb14
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/Kconfig
@@ -0,0 +1,15 @@
+config INFINIBAND_AMSO1100
+   tristate "Ammasso 1100 HCA support"
+   depends on PCI && INET && INFINIBAND
+   ---help---
+ This is a low-level driver for the Ammasso 1100 host
+ channel adapter (HCA).
+
+config INFINIBAND_AMSO1100_DEBUG
+   bool "Verbose debugging output"
+   depends on INFINIBAND_AMSO1100
+   default n
+   ---help---
+ This option causes the amso1100 driver to produce a bunch of
+ debug messages.  Select this if you are developing the driver
+ or trying to diagnose a problem.
diff --git a/drivers/infiniband/hw/amso1100/README 
b/drivers/infiniband/hw/amso1100/README
new file mode 100644
index 000..1331353
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/README
@@ -0,0 +1,11 @@
+This is the OpenFabrics provider driver for the 
+AMSO1100 1Gb RNIC adapter. 
+
+This adapter is available in limited quantities 
+for development purposes from Open Grid Computing.
+
+This driver requires the IWCM and CMA mods necessary
+to support iWARP.
+
+Contact [EMAIL PROTECTED] for more information.
+

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v3 6/7] AMSO1100: Privileged Verbs Queues.

2006-06-20 Thread Steve Wise

Review Changes:

dprintk() -> pr_debug()
---

 drivers/infiniband/hw/amso1100/c2_vq.c |  260 
 drivers/infiniband/hw/amso1100/c2_vq.h |   63 
 2 files changed, 323 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_vq.c 
b/drivers/infiniband/hw/amso1100/c2_vq.c
new file mode 100644
index 000..445b1ed
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_vq.c
@@ -0,0 +1,260 @@
+/*
+ * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, 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.
+ */
+#include 
+#include 
+
+#include "c2_vq.h"
+#include "c2_provider.h"
+
+/*
+ * Verbs Request Objects:
+ *
+ * VQ Request Objects are allocated by the kernel verbs handlers.
+ * They contain a wait object, a refcnt, an atomic bool indicating that the
+ * adapter has replied, and a copy of the verb reply work request.
+ * A pointer to the VQ Request Object is passed down in the context
+ * field of the work request message, and reflected back by the adapter
+ * in the verbs reply message.  The function handle_vq() in the interrupt
+ * path will use this pointer to:
+ * 1) append a copy of the verbs reply message
+ * 2) mark that the reply is ready
+ * 3) wake up the kernel verbs handler blocked awaiting the reply.
+ *
+ *
+ * The kernel verbs handlers do a "get" to put a 2nd reference on the 
+ * VQ Request object.  If the kernel verbs handler exits before the adapter
+ * can respond, this extra reference will keep the VQ Request object around
+ * until the adapter's reply can be processed.  The reason we need this is
+ * because a pointer to this object is stuffed into the context field of
+ * the verbs work request message, and reflected back in the reply message.
+ * It is used in the interrupt handler (handle_vq()) to wake up the appropriate
+ * kernel verb handler that is blocked awaiting the verb reply.  
+ * So handle_vq() will do a "put" on the object when it's done accessing it.
+ * NOTE:  If we guarantee that the kernel verb handler will never bail before 
+ *getting the reply, then we don't need these refcnts.
+ *
+ *
+ * VQ Request objects are freed by the kernel verbs handlers only 
+ * after the verb has been processed, or when the adapter fails and
+ * does not reply.  
+ *
+ *
+ * Verbs Reply Buffers:
+ *
+ * VQ Reply bufs are local host memory copies of a 
+ * outstanding Verb Request reply
+ * message.  The are always allocated by the kernel verbs handlers, and _may_ 
be
+ * freed by either the kernel verbs handler -or- the interrupt handler.  The
+ * kernel verbs handler _must_ free the repbuf, then free the vq request object
+ * in that order.
+ */
+
+int vq_init(struct c2_dev *c2dev)
+{
+   sprintf(c2dev->vq_cache_name, "c2-vq:dev%c",
+   (char) ('0' + c2dev->devnum));
+   c2dev->host_msg_cache =
+   kmem_cache_create(c2dev->vq_cache_name, c2dev->rep_vq.msg_size, 0,
+ SLAB_HWCACHE_ALIGN, NULL, NULL);
+   if (c2dev->host_msg_cache == NULL) {
+   return -ENOMEM;
+   }
+   return 0;
+}
+
+void vq_term(struct c2_dev *c2dev)
+{
+   kmem_cache_destroy(c2dev->host_msg_cache);
+}
+
+/* vq_req_alloc - allocate a VQ Request Object and initialize it.
+ * The refcnt is set to 1.
+ */
+struct c2_vq_req *vq_req_alloc(struct c2_dev *c2dev)
+{
+   struct c2_vq_req *r;
+
+   r = kmalloc(sizeof(struct c2_vq_req), GFP_KERNEL);
+   if (r) {
+   init_waitqueue_head(&r->wait_object);
+   r->reply_msg = (u64) NULL;
+   r->

[openib-general] [PATCH v3 5/7] AMSO1100 Message Queues.

2006-06-20 Thread Steve Wise

V2 Review Changes:

- correctly map host memory for DMA (don't use __pa()).

V1 Review Changes:

- remove useless asserts

- assert() -> BUG_ON()

- C2_DEBUG -> DEBUG
---

 drivers/infiniband/hw/amso1100/c2_mq.c |  175 
 drivers/infiniband/hw/amso1100/c2_mq.h |  107 
 2 files changed, 282 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_mq.c 
b/drivers/infiniband/hw/amso1100/c2_mq.c
new file mode 100644
index 000..96bbe9a
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_mq.c
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, 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.
+ */
+#include "c2.h"
+#include "c2_mq.h"
+
+void *c2_mq_alloc(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_ADAPTER_TARGET);
+
+   if (c2_mq_full(q)) {
+   return NULL;
+   } else {
+#ifdef DEBUG
+   struct c2wr_hdr *m =
+   (struct c2wr_hdr *) (q->msg_pool.host + q->priv * 
q->msg_size);
+#ifdef CCMSGMAGIC
+   BUG_ON(m->magic != be32_to_cpu(~CCWR_MAGIC));
+   m->magic = cpu_to_be32(CCWR_MAGIC);
+#endif
+   return m;
+#else
+   return q->msg_pool.host + q->priv * q->msg_size;
+#endif
+   }
+}
+
+void c2_mq_produce(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_ADAPTER_TARGET);
+
+   if (!c2_mq_full(q)) {
+   q->priv = (q->priv + 1) % q->q_size;
+   q->hint_count++;
+   /* Update peer's offset. */
+   __raw_writew(cpu_to_be16(q->priv), &q->peer->shared);
+   }
+}
+
+void *c2_mq_consume(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_HOST_TARGET);
+
+   if (c2_mq_empty(q)) {
+   return NULL;
+   } else {
+#ifdef DEBUG
+   struct c2wr_hdr *m = (struct c2wr_hdr *)
+   (q->msg_pool.host + q->priv * q->msg_size);
+#ifdef CCMSGMAGIC
+   BUG_ON(m->magic != be32_to_cpu(CCWR_MAGIC));
+#endif
+   return m;
+#else
+   return q->msg_pool.host + q->priv * q->msg_size;
+#endif
+   }
+}
+
+void c2_mq_free(struct c2_mq *q)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_HOST_TARGET);
+
+   if (!c2_mq_empty(q)) {
+
+#ifdef CCMSGMAGIC
+   {
+   struct c2wr_hdr __iomem *m = (struct c2wr_hdr __iomem *)
+   (q->msg_pool.adapter + q->priv * q->msg_size);
+   __raw_writel(cpu_to_be32(~CCWR_MAGIC), &m->magic);
+   }
+#endif
+   q->priv = (q->priv + 1) % q->q_size;
+   /* Update peer's offset. */
+   __raw_writew(cpu_to_be16(q->priv), &q->peer->shared);
+   }
+}
+
+
+void c2_mq_lconsume(struct c2_mq *q, u32 wqe_count)
+{
+   BUG_ON(q->magic != C2_MQ_MAGIC);
+   BUG_ON(q->type != C2_MQ_ADAPTER_TARGET);
+
+   while (wqe_count--) {
+   BUG_ON(c2_mq_empty(q));
+   *q->shared = cpu_to_be16((be16_to_cpu(*q->shared)+1) % 
q->q_size);
+   }
+}
+
+
+u32 c2_mq_count(struct c2_mq *q)
+{
+   s32 count;
+
+   if (q->type == C2_MQ_HOST_TARGET) {
+   count = be16_to_cpu(*q->shared) - q->priv;
+   } else {
+   count = q->priv - be16_to_cpu(*q->shared);
+   }
+
+   if (count < 0) {
+   count += q->q_size;
+   }
+
+   return (u32) count;
+}
+
+voi

[openib-general] [PATCH v3 4/7] AMSO1100 Memory Management.

2006-06-20 Thread Steve Wise

V2 Review Changes:

- removed c2_array services and replaced them with the idr.

- removed c2_alloc services and made them pd-specific.

- don't use GFP_DMA.

- correctly map host memory for DMA (don't use __pa()).

V1 Review Changes:

- sizeof -> sizeof()

- cleaned up comments
---

 drivers/infiniband/hw/amso1100/c2_alloc.c |  144 +++
 drivers/infiniband/hw/amso1100/c2_mm.c|  375 +
 2 files changed, 519 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_alloc.c 
b/drivers/infiniband/hw/amso1100/c2_alloc.c
new file mode 100644
index 000..013b152
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_alloc.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (c) 2004 Topspin Communications.  All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, 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.
+ */
+
+#include 
+#include 
+#include 
+
+#include "c2.h"
+
+static int c2_alloc_mqsp_chunk(struct c2_dev *c2dev, gfp_t gfp_mask, 
+  struct sp_chunk **head)
+{
+   int i;
+   struct sp_chunk *new_head;
+
+   new_head = (struct sp_chunk *) __get_free_page(gfp_mask);
+   if (new_head == NULL)
+   return -ENOMEM;
+
+   new_head->dma_addr = dma_map_single(c2dev->ibdev.dma_device, new_head, 
+   PAGE_SIZE, DMA_FROM_DEVICE);
+   pci_unmap_addr_set(new_head, mapping, new_head->dma_addr);
+
+   new_head->next = NULL;
+   new_head->head = 0;
+
+   /* build list where each index is the next free slot */
+   for (i = 0;
+i < (PAGE_SIZE - sizeof(struct sp_chunk) - 
+ sizeof(u16)) / sizeof(u16) - 1; 
+i++) {
+   new_head->shared_ptr[i] = i + 1;
+   }
+   /* terminate list */
+   new_head->shared_ptr[i] = 0x;
+
+   *head = new_head;
+   return 0;
+}
+
+int c2_init_mqsp_pool(struct c2_dev *c2dev, gfp_t gfp_mask, 
+ struct sp_chunk **root)
+{
+   return c2_alloc_mqsp_chunk(c2dev, gfp_mask, root);
+}
+
+void c2_free_mqsp_pool(struct c2_dev *c2dev, struct sp_chunk *root)
+{
+   struct sp_chunk *next;
+
+   while (root) {
+   next = root->next;
+   dma_unmap_single(c2dev->ibdev.dma_device, 
+pci_unmap_addr(root, mapping), PAGE_SIZE, 
+DMA_FROM_DEVICE);
+   __free_page((struct page *) root);
+   root = next;
+   }
+}
+
+u16 *c2_alloc_mqsp(struct c2_dev *c2dev, struct sp_chunk *head, 
+  dma_addr_t *dma_addr, gfp_t gfp_mask)
+{
+   u16 mqsp;
+
+   while (head) {
+   mqsp = head->head;
+   if (mqsp != 0x) {
+   head->head = head->shared_ptr[mqsp];
+   break;
+   } else if (head->next == NULL) {
+   if (c2_alloc_mqsp_chunk(c2dev, gfp_mask, &head->next) ==
+   0) {
+   head = head->next;
+   mqsp = head->head;
+   head->head = head->shared_ptr[mqsp];
+   break;
+   } else
+   return NULL;
+   } else
+   head = head->next;
+   }
+   if (head) {
+   *dma_addr = head->dma_addr + 
+   ((unsigned long) &(head->shared_ptr[mqsp]) - 
+(unsigned long) head);
+   pr_debug("%s addr %p dma_addr

[openib-general] [PATCH v3 2/7] AMSO1100 WR / Event Definitions.

2006-06-20 Thread Steve Wise

Review Changes:

- C2_DEBUG -> DEBUG

- removed useless comments
---

 drivers/infiniband/hw/amso1100/c2_ae.h |  108 ++
 drivers/infiniband/hw/amso1100/c2_status.h |  158 +++
 drivers/infiniband/hw/amso1100/c2_wr.h | 1520 
 3 files changed, 1786 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/amso1100/c2_ae.h 
b/drivers/infiniband/hw/amso1100/c2_ae.h
new file mode 100644
index 000..3a065c3
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_ae.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, 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.
+ */
+#ifndef _C2_AE_H_
+#define _C2_AE_H_
+
+/*
+ * WARNING: If you change this file, also bump C2_IVN_BASE
+ * in common/include/clustercore/c2_ivn.h.
+ */
+
+/*
+ * Asynchronous Event Identifiers
+ *
+ * These start at 0x80 only so it's obvious from inspection that
+ * they are not work-request statuses.  This isn't critical.
+ *
+ * NOTE: these event id's must fit in eight bits.
+ */
+enum c2_event_id {
+   CCAE_REMOTE_SHUTDOWN = 0x80,
+   CCAE_ACTIVE_CONNECT_RESULTS,
+   CCAE_CONNECTION_REQUEST,
+   CCAE_LLP_CLOSE_COMPLETE,
+   CCAE_TERMINATE_MESSAGE_RECEIVED,
+   CCAE_LLP_CONNECTION_RESET,
+   CCAE_LLP_CONNECTION_LOST,
+   CCAE_LLP_SEGMENT_SIZE_INVALID,
+   CCAE_LLP_INVALID_CRC,
+   CCAE_LLP_BAD_FPDU,
+   CCAE_INVALID_DDP_VERSION,
+   CCAE_INVALID_RDMA_VERSION,
+   CCAE_UNEXPECTED_OPCODE,
+   CCAE_INVALID_DDP_QUEUE_NUMBER,
+   CCAE_RDMA_READ_NOT_ENABLED,
+   CCAE_RDMA_WRITE_NOT_ENABLED,
+   CCAE_RDMA_READ_TOO_SMALL,
+   CCAE_NO_L_BIT,
+   CCAE_TAGGED_INVALID_STAG,
+   CCAE_TAGGED_BASE_BOUNDS_VIOLATION,
+   CCAE_TAGGED_ACCESS_RIGHTS_VIOLATION,
+   CCAE_TAGGED_INVALID_PD,
+   CCAE_WRAP_ERROR,
+   CCAE_BAD_CLOSE,
+   CCAE_BAD_LLP_CLOSE,
+   CCAE_INVALID_MSN_RANGE,
+   CCAE_INVALID_MSN_GAP,
+   CCAE_IRRQ_OVERFLOW,
+   CCAE_IRRQ_MSN_GAP,
+   CCAE_IRRQ_MSN_RANGE,
+   CCAE_IRRQ_INVALID_STAG,
+   CCAE_IRRQ_BASE_BOUNDS_VIOLATION,
+   CCAE_IRRQ_ACCESS_RIGHTS_VIOLATION,
+   CCAE_IRRQ_INVALID_PD,
+   CCAE_IRRQ_WRAP_ERROR,
+   CCAE_CQ_SQ_COMPLETION_OVERFLOW,
+   CCAE_CQ_RQ_COMPLETION_ERROR,
+   CCAE_QP_SRQ_WQE_ERROR,
+   CCAE_QP_LOCAL_CATASTROPHIC_ERROR,
+   CCAE_CQ_OVERFLOW,
+   CCAE_CQ_OPERATION_ERROR,
+   CCAE_SRQ_LIMIT_REACHED,
+   CCAE_QP_RQ_LIMIT_REACHED,
+   CCAE_SRQ_CATASTROPHIC_ERROR,
+   CCAE_RNIC_CATASTROPHIC_ERROR
+/* WARNING If you add more id's, make sure their values fit in eight bits. */
+};
+
+/*
+ * Resource Indicators and Identifiers
+ */
+enum c2_resource_indicator {
+   C2_RES_IND_QP = 1,
+   C2_RES_IND_EP,
+   C2_RES_IND_CQ,
+   C2_RES_IND_SRQ,
+};
+
+#endif /* _C2_AE_H_ */
diff --git a/drivers/infiniband/hw/amso1100/c2_status.h 
b/drivers/infiniband/hw/amso1100/c2_status.h
new file mode 100644
index 000..6ee4aa9
--- /dev/null
+++ b/drivers/infiniband/hw/amso1100/c2_status.h
@@ -0,0 +1,158 @@
+/*
+ * Copyright (c) 2005 Ammasso, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, 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, w

[openib-general] [PATCH v3 0/7][RFC] Ammasso 1100 iWARP Driver

2006-06-20 Thread Steve Wise

This patchset implements the iWARP provider driver for the Ammasso
1100 RNIC.  It is dependent on the "iWARP Core Support" patch set.  We're
submitting it for review with the goal for inclusion in the 2.6.19 kernel.
This code has gone through several reviews in the openib-general list.
Now we are submitting it for external review by the linux community.

This StGIT patchset is cloned from Roland Dreier's infiniband.git
for-2.6.19 branch.  The patchset consists of 7 patches:

1 - Low-level device interface and native stack support
2 - Work request definitions
3 - Provider interface
4 - Memory management
5 - User mode message queue implementation  
6 - Verbs queue implementation
7 - Kconfig and Makefile

I believe I've addressed all the round 1 and 2 review comments.
Details of the changes are tracked in each patch comment.

Signed-off-by: Tom Tucker <[EMAIL PROTECTED]>
Signed-off-by: Steve Wise <[EMAIL PROTECTED]>

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v3 2/2] iWARP Core Changes.

2006-06-20 Thread Steve Wise

This patch contains modifications to the existing rdma header files,
core files, drivers, and ulp files to support iWARP.

V2 Review updates:

V1 Review updates:

- copy_addr() -> rdma_copy_addr()

- dst_dev_addr param in rdma_copy_addr to const.

- various spacing nits with recasting

- include linux/inetdevice.h to get ip_dev_find() prototype.

- dev_put() after successful ip_dev_find()
---

 drivers/infiniband/core/Makefile |4 
 drivers/infiniband/core/addr.c   |   19 +
 drivers/infiniband/core/cache.c  |8 -
 drivers/infiniband/core/cm.c |3 
 drivers/infiniband/core/cma.c|  355 +++---
 drivers/infiniband/core/device.c |6 
 drivers/infiniband/core/mad.c|   11 +
 drivers/infiniband/core/sa_query.c   |5 
 drivers/infiniband/core/smi.c|   18 +
 drivers/infiniband/core/sysfs.c  |   18 +
 drivers/infiniband/core/ucm.c|5 
 drivers/infiniband/core/user_mad.c   |9 -
 drivers/infiniband/hw/ipath/ipath_verbs.c|2 
 drivers/infiniband/hw/mthca/mthca_provider.c |2 
 drivers/infiniband/ulp/ipoib/ipoib_main.c|8 +
 drivers/infiniband/ulp/srp/ib_srp.c  |2 
 include/rdma/ib_addr.h   |   15 +
 include/rdma/ib_verbs.h  |   39 ++-
 18 files changed, 437 insertions(+), 92 deletions(-)

diff --git a/drivers/infiniband/core/Makefile b/drivers/infiniband/core/Makefile
index 68e73ec..163d991 100644
--- a/drivers/infiniband/core/Makefile
+++ b/drivers/infiniband/core/Makefile
@@ -1,7 +1,7 @@
 infiniband-$(CONFIG_INFINIBAND_ADDR_TRANS) := ib_addr.o rdma_cm.o
 
 obj-$(CONFIG_INFINIBAND) +=ib_core.o ib_mad.o ib_sa.o \
-   ib_cm.o $(infiniband-y)
+   ib_cm.o iw_cm.o $(infiniband-y)
 obj-$(CONFIG_INFINIBAND_USER_MAD) +=   ib_umad.o
 obj-$(CONFIG_INFINIBAND_USER_ACCESS) +=ib_uverbs.o ib_ucm.o
 
@@ -14,6 +14,8 @@ ib_sa-y :=sa_query.o
 
 ib_cm-y := cm.o
 
+iw_cm-y := iwcm.o
+
 rdma_cm-y :=   cma.o
 
 ib_addr-y :=   addr.o
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
index d294bbc..83f84ef 100644
--- a/drivers/infiniband/core/addr.c
+++ b/drivers/infiniband/core/addr.c
@@ -32,6 +32,7 @@ #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -60,12 +61,15 @@ static LIST_HEAD(req_list);
 static DECLARE_WORK(work, process_req, NULL);
 static struct workqueue_struct *addr_wq;
 
-static int copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
-unsigned char *dst_dev_addr)
+int rdma_copy_addr(struct rdma_dev_addr *dev_addr, struct net_device *dev,
+const unsigned char *dst_dev_addr)
 {
switch (dev->type) {
case ARPHRD_INFINIBAND:
-   dev_addr->dev_type = IB_NODE_CA;
+   dev_addr->dev_type = RDMA_NODE_IB_CA;
+   break;
+   case ARPHRD_ETHER:
+   dev_addr->dev_type = RDMA_NODE_RNIC;
break;
default:
return -EADDRNOTAVAIL;
@@ -77,6 +81,7 @@ static int copy_addr(struct rdma_dev_add
memcpy(dev_addr->dst_dev_addr, dst_dev_addr, MAX_ADDR_LEN);
return 0;
 }
+EXPORT_SYMBOL(rdma_copy_addr);
 
 int rdma_translate_ip(struct sockaddr *addr, struct rdma_dev_addr *dev_addr)
 {
@@ -88,7 +93,7 @@ int rdma_translate_ip(struct sockaddr *a
if (!dev)
return -EADDRNOTAVAIL;
 
-   ret = copy_addr(dev_addr, dev, NULL);
+   ret = rdma_copy_addr(dev_addr, dev, NULL);
dev_put(dev);
return ret;
 }
@@ -160,7 +165,7 @@ static int addr_resolve_remote(struct so
 
/* If the device does ARP internally, return 'done' */
if (rt->idev->dev->flags & IFF_NOARP) {
-   copy_addr(addr, rt->idev->dev, NULL);
+   rdma_copy_addr(addr, rt->idev->dev, NULL);
goto put;
}
 
@@ -180,7 +185,7 @@ static int addr_resolve_remote(struct so
src_in->sin_addr.s_addr = rt->rt_src;
}
 
-   ret = copy_addr(addr, neigh->dev, neigh->ha);
+   ret = rdma_copy_addr(addr, neigh->dev, neigh->ha);
 release:
neigh_release(neigh);
 put:
@@ -244,7 +249,7 @@ static int addr_resolve_local(struct soc
if (ZERONET(src_ip)) {
src_in->sin_family = dst_in->sin_family;
src_in->sin_addr.s_addr = dst_ip;
-   ret = copy_addr(addr, dev, dev->dev_addr);
+   ret = rdma_copy_addr(addr, dev, dev->dev_addr);
} else if (LOOPBACK(src_ip)) {
ret = rdma_translate_ip((struct sockaddr *)dst_in, addr);
if (!ret)
diff --git a/drivers/infiniband/core/cache.c b/drivers/infiniband/core/cache

[openib-general] [PATCH v3 1/2] iWARP Connection Manager.

2006-06-20 Thread Steve Wise

This patch provides the new files implementing the iWARP Connection
Manager.

This module is a logical instance of the xx_cm where xx is the transport
type (ib or iw). The symbols exported are used by the transport
independent rdma_cm module, and are available also for transport
dependent ULPs.

V2 Review Changes:

- BUG_ON(1) -> BUG()

- Don't typecast whan assigning between something* and void*

- pre-allocate iwcm_work objects to avoid allocating them in the interrupt
  context.

- copy private data on connect request and connect reply events.

- #if !defined() -> #ifndef

V1 Review Changes:

- sizeof -> sizeof()

- removed printks

- removed TT debug code

- cleaned up lock/unlock around switch statements.

- waitqueue -> completion for destroy path.
---

 drivers/infiniband/core/iwcm.c | 1008 
 include/rdma/iw_cm.h   |  255 ++
 include/rdma/iw_cm_private.h   |   63 +++
 3 files changed, 1326 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/core/iwcm.c b/drivers/infiniband/core/iwcm.c
new file mode 100644
index 000..fe43c00
--- /dev/null
+++ b/drivers/infiniband/core/iwcm.c
@@ -0,0 +1,1008 @@
+/*
+ * Copyright (c) 2004, 2005 Intel Corporation.  All rights reserved.
+ * Copyright (c) 2004 Topspin Corporation.  All rights reserved.
+ * Copyright (c) 2004, 2005 Voltaire Corporation.  All rights reserved.
+ * Copyright (c) 2005 Sun Microsystems, Inc. All rights reserved.
+ * Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved.
+ * Copyright (c) 2005 Network Appliance, 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.
+ *
+ */
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+MODULE_AUTHOR("Tom Tucker");
+MODULE_DESCRIPTION("iWARP CM");
+MODULE_LICENSE("Dual BSD/GPL");
+
+static struct workqueue_struct *iwcm_wq;
+struct iwcm_work {
+   struct work_struct work;
+   struct iwcm_id_private *cm_id;
+   struct list_head list;
+   struct iw_cm_event event;
+   struct list_head free_list;
+};
+
+/* 
+ * The following services provide a mechanism for pre-allocating iwcm_work 
+ * elements.  The design pre-allocates them  based on the cm_id type:
+ * LISTENING IDS:  Get enough elements preallocated to handle the
+ * listen backlog.
+ * ACTIVE IDS: 4: CONNECT_REPLY, ESTABLISHED, DISCONNECT, CLOSE
+ * PASSIVE IDS:3: ESTABLISHED, DISCONNECT, CLOSE 
+ *
+ * Allocating them in connect and listen avoids having to deal
+ * with allocation failures on the event upcall from the provider (which 
+ * is called in the interrupt context).  
+ *
+ * One exception is when creating the cm_id for incoming connection requests.  
+ * There are two cases:
+ * 1) in the event upcall, cm_event_handler(), for a listening cm_id.  If
+ *the backlog is exceeded, then no more connection request events will
+ *be processed.  cm_event_handler() returns -ENOMEM in this case.  Its up
+ *to the provider to reject the connectino request.
+ * 2) in the connection request workqueue handler, cm_conn_req_handler().
+ *If work elements cannot be allocated for the new connect request cm_id,
+ *then IWCM will call the provider reject method.  This is ok since
+ *cm_conn_req_handler() runs in the workqueue thread context.
+ */
+
+static struct iwcm_work *get_work(struct iwcm_id_private *cm_id_priv)
+{
+   struct iwcm_work *work;
+
+   if (list_empty(&cm_id_priv->work_free_list))
+   return NULL;
+   work = list_entry(cm_id_priv->work_free_list

[openib-general] [PATCH v3 0/2][RFC] iWARP Core Support

2006-06-20 Thread Steve Wise

This patchset defines the modifications to the Linux infiniband subsystem
to support iWARP devices.  We're submitting it for review now with the
goal for inclusion in the 2.6.19 kernel.  This code has gone through
several reviews in the openib-general list.  Now we are submitting it
for external review by the linux community.

This StGIT patchset is cloned from Roland Dreier's infiniband.git
for-2.6.19 branch.  The patchset consists of 2 patches:

1 - New iWARP CM implementation.  
2 - Core changes to support iWARP.

I believe I've addressed all the round 1 and 2 review comments.
Details of the changes are tracked in each patch comment.

Signed-off-by: Tom Tucker <[EMAIL PROTECTED]>
Signed-off-by: Steve Wise <[EMAIL PROTECTED]>

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v1 1/2] AMSO1100 Verbs Library.

2006-06-20 Thread Steve Wise

This code implements user verbs for the Ammasso 1100 device.  This library
doesn't do kernel bypass (but it could someday).
---

 libamso/src/amso-abi.h |   79 +
 libamso/src/amso.c |  180 +
 libamso/src/amso.h |  156 +
 libamso/src/amso.map   |6 +
 libamso/src/cq.c   |   57 +
 libamso/src/qp.c   |   55 +
 libamso/src/verbs.c|  303 
 7 files changed, 836 insertions(+), 0 deletions(-)

diff --git a/libamso/src/amso-abi.h b/libamso/src/amso-abi.h
new file mode 100644
index 000..a3df617
--- /dev/null
+++ b/libamso/src/amso-abi.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2006 Open Grid Computing, 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.
+ */
+#ifndef AMSO_ABI_H
+#define AMSO_ABI_H
+
+#include 
+
+struct amso_alloc_ucontext_resp {
+   struct ibv_get_context_resp ibv_resp;
+};
+
+struct amso_alloc_pd_resp {
+   struct ibv_alloc_pd_resp ibv_resp;
+};
+
+struct amso_create_cq {
+   struct ibv_create_cq ibv_cmd;
+};
+
+
+struct amso_create_cq_resp {
+   struct ibv_create_cq_resp ibv_resp;
+   __u32 cqid;
+   __u32 entries;
+   __u64 physaddr; /* library mmaps this to get addressability */
+   __u64 queue;
+};
+
+struct amso_create_qp {
+   struct ibv_create_qp ibv_cmd;
+};
+
+struct amso_create_qp_resp {
+   struct ibv_create_qp_resp ibv_resp;
+   __u32 qpid;
+   __u32 entries;  /* actual number of entries after creation */
+   __u64 physaddr; /* library mmaps this to get addressability */
+   __u64 physsize; /* library mmaps this to get addressability */
+   __u64 queue;
+};
+
+
+struct t3_cqe {
+   __u32 header:32;
+   __u32 len:32;
+   __u32 wrid_hi_stag:32;
+   __u32 wrid_low_msn:32;
+};
+
+#endif /* AMSO_ABI_H */
diff --git a/libamso/src/amso.c b/libamso/src/amso.c
new file mode 100644
index 000..c017281
--- /dev/null
+++ b/libamso/src/amso.c
@@ -0,0 +1,180 @@
+/*
+ * Copyright (c) 2006 Open Grid Computing, 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 HAVE_CONFIG_H
+#  include 
+#endif /* HAVE_CONFIG_H *

[openib-general] [PATCH v1 2/2] AMSO1100 Makefiles.

2006-06-20 Thread Steve Wise


---

 libamso/Makefile.am |   27 +++
 libamso/autogen.sh  |8 +++
 libamso/configure.in|   41 ++
 libamso/libamso.spec.in |   56 +++
 4 files changed, 132 insertions(+), 0 deletions(-)

diff --git a/libamso/Makefile.am b/libamso/Makefile.am
new file mode 100644
index 000..9e2cbc1
--- /dev/null
+++ b/libamso/Makefile.am
@@ -0,0 +1,27 @@
+# $Id: $
+
+amsolibdir = $(libdir)/infiniband
+
+amsolib_LTLIBRARIES = src/amso.la
+
+src_amso_la_CFLAGS = -g -Wall -D_GNU_SOURCE
+
+if HAVE_LD_VERSION_SCRIPT
+amso_version_script = -Wl,--version-script=$(srcdir)/src/amso.map
+else
+amso_version_script =
+endif
+
+src_amso_la_SOURCES = src/cq.c src/amso.c src/qp.c \
+src/verbs.c
+src_amso_la_LDFLAGS = -avoid-version -module \
+$(amso_version_script)
+
+#DEBIAN = debian/changelog debian/compat debian/control debian/copyright \
+#debian/libamso1.install debian/libamso-dev.install debian/rules
+
+EXTRA_DIST = src/amso.h src/amso-abi.h \
+src/amso.map libamso.spec.in $(DEBIAN)
+
+dist-hook: libamso.spec
+   cp libamso.spec $(distdir)
diff --git a/libamso/autogen.sh b/libamso/autogen.sh
new file mode 100755
index 000..fd47839
--- /dev/null
+++ b/libamso/autogen.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+set -x
+aclocal -I config
+libtoolize --force --copy
+autoheader
+automake --foreign --add-missing --copy
+autoconf
diff --git a/libamso/configure.in b/libamso/configure.in
new file mode 100644
index 000..4a920c4
--- /dev/null
+++ b/libamso/configure.in
@@ -0,0 +1,41 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_PREREQ(2.57)
+AC_INIT(libamso, 1.0-rc4, openib-general@openib.org)
+AC_CONFIG_SRCDIR([src/amso.h])
+AC_CONFIG_AUX_DIR(config)
+AM_CONFIG_HEADER(config.h)
+AM_INIT_AUTOMAKE(libamso, 1.0-rc4)
+AM_PROG_LIBTOOL
+
+dnl Checks for programs
+AC_PROG_CC
+
+dnl Checks for libraries
+AC_CHECK_LIB(ibverbs, ibv_get_device_list, [],
+AC_MSG_ERROR([ibv_get_device_list() not found.  libmthca requires 
libibverbs.]))
+
+dnl Checks for header files.
+AC_CHECK_HEADERS(sysfs/libsysfs.h)
+AC_CHECK_HEADER(infiniband/driver.h, [],
+AC_MSG_ERROR([ not found.  Is libibverbs installed?]))
+AC_HEADER_STDC
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_CHECK_SIZEOF(long)
+
+dnl Checks for library functions
+AC_CHECK_FUNCS(ibv_read_sysfs_file)
+
+AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
+if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; 
then
+ac_cv_version_script=yes
+else
+ac_cv_version_script=no
+fi)
+
+AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
+
+AC_CONFIG_FILES([Makefile libamso.spec])
+AC_OUTPUT
diff --git a/libamso/libamso.spec.in b/libamso/libamso.spec.in
new file mode 100644
index 000..1bbb9cb
--- /dev/null
+++ b/libamso/libamso.spec.in
@@ -0,0 +1,56 @@
+# $Id: $
+
+%define ver  @VERSION@
+
+Name: libamso
+Version: 1.0
+Release: 0.2.rc4%{?dist}
+Summary: AMSO1100 Userspace Library
+
+Group: System Environment/Libraries
+License: GPL/BSD
+Url: http://openib.org/
+Source: http://openib.org/downloads/%{name}-%{ver}.tar.gz
+BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires: libibverbs-devel
+
+%description
+libamso provides a device-specific userspace driver for Chelsio RNICs
+for use with the libibverbs library.
+
+%package devel
+Summary: Development files for the libamso driver
+Group: System Environment/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description devel
+Static version of libamso that may be linked directly to an
+application, which may be useful for debugging.
+
+%prep
+%setup -q -n %{name}-%{ver}
+
+%build
+%configure
+make %{?_smp_mflags}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+%makeinstall
+# remove unpackaged files from the buildroot
+rm -f $RPM_BUILD_ROOT%{_libdir}/infiniband/*.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,-)
+%{_libdir}/infiniband/amso.so
+%doc AUTHORS COPYING ChangeLog README
+
+%files devel
+%defattr(-,root,root,-)
+%{_libdir}/infiniband/amso.a
+
+%changelog

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v1 0/2] [RFC] Ammasso 1100 iWARP Library

2006-06-20 Thread Steve Wise

This patchset implements a user verbs library for the Ammasso 1100 device.
We're submitting it for review with the goal for inclusion in the gen2
trunk.

Signed-off-by: Tom Tucker <[EMAIL PROTECTED]>
Signed-off-by: Steve Wise <[EMAIL PROTECTED]>

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v2 2/2] iWARP changes to librdmacm.

2006-06-20 Thread Steve Wise

For iWARP, rdma_disconnect() moves the QP to SQD instead of ERR. The
iWARP providers map SQD to the RDMAC verbs CLOSING state.
---

 librdmacm/src/cma.c |   22 +-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/librdmacm/src/cma.c b/librdmacm/src/cma.c
index e99d15c..a250f69 100644
--- a/librdmacm/src/cma.c
+++ b/librdmacm/src/cma.c
@@ -633,6 +633,17 @@ static int ucma_modify_qp_rts(struct rdm
return ibv_modify_qp(id->qp, &qp_attr, qp_attr_mask);
 }
 
+static int ucma_modify_qp_sqd(struct rdma_cm_id *id)
+{
+   struct ibv_qp_attr qp_attr;
+
+   if (!id->qp)
+   return 0;
+
+   qp_attr.qp_state = IBV_QPS_SQD;
+   return ibv_modify_qp(id->qp, &qp_attr, IBV_QP_STATE);
+}
+
 static int ucma_modify_qp_err(struct rdma_cm_id *id)
 {
struct ibv_qp_attr qp_attr;
@@ -881,7 +892,16 @@ int rdma_disconnect(struct rdma_cm_id *i
void *msg;
int ret, size;
 
-   ret = ucma_modify_qp_err(id);
+   switch (ibv_get_transport_type(id->verbs)) {
+   case IBV_TRANSPORT_IB:
+   ret = ucma_modify_qp_err(id);
+   break;
+   case IBV_TRANSPORT_IWARP:
+   ret = ucma_modify_qp_sqd(id);
+   break;
+   default:
+   ret = -EINVAL;
+   }
if (ret)
return ret;
 

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v2 0/2] [RFC] iWARP Core Usermode Support

2006-06-20 Thread Steve Wise

This patchset defines the modifications to the Open Fabrics gen2 userspace
tree to support iWARP devices.  This is the 2nd review of most of these
changes and we have incorporated all comments from the 1st review.

We're submitting it for review with the goal for inclusion in the gen2
svn trunk.  It is not dependent on the kernel iWARP patchset currently
under review, so we could commit this to the svn trunk now if desired.

This patchset is based on revision 7620 of the svn trunk.  It consists
of 2 patches:

1 - Changes to libibverbs/
2 - Changes to librdmacm/

Signed-off-by: Tom Tucker <[EMAIL PROTECTED]>
Signed-off-by: Steve Wise <[EMAIL PROTECTED]>

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH v2 1/2] iWARP changes to libibverbs.

2006-06-20 Thread Steve Wise

Cache the node type (iWARP vs IB) in the ib_device struct to enable
transport-dependent logic.
---

 libibverbs/include/infiniband/verbs.h |   44 -
 libibverbs/src/device.c   |   16 
 2 files changed, 59 insertions(+), 1 deletions(-)

diff --git a/libibverbs/include/infiniband/verbs.h 
b/libibverbs/include/infiniband/verbs.h
index 7679436..0ff97e9 100644
--- a/libibverbs/include/infiniband/verbs.h
+++ b/libibverbs/include/infiniband/verbs.h
@@ -66,9 +66,17 @@ union ibv_gid {
 };
 
 enum ibv_node_type {
+   IBV_NODE_UNKNOWN=-1,
IBV_NODE_CA = 1,
IBV_NODE_SWITCH,
-   IBV_NODE_ROUTER
+   IBV_NODE_ROUTER,
+   IBV_NODE_RNIC
+};
+
+enum ibv_transport_type {
+   IBV_TRANSPORT_UNKNOWN=0,
+   IBV_TRANSPORT_IB=1,
+   IBV_TRANSPORT_IWARP=2
 };
 
 enum ibv_device_cap_flags {
@@ -574,6 +582,7 @@ enum {
 
 struct ibv_device {
struct ibv_driver  *driver;
+   enum ibv_node_type  node_type;
struct ibv_device_ops   ops;
/* Name of underlying kernel IB device, eg "mthca0" */
charname[IBV_SYSFS_NAME_MAX];
@@ -673,6 +682,39 @@ const char *ibv_get_device_name(struct i
 uint64_t ibv_get_device_guid(struct ibv_device *device);
 
 /**
+ * ibv_get_transport_type - Return device's network transport type
+ */
+static inline enum ibv_transport_type
+ibv_get_transport_type(struct ibv_context *context)
+{
+   if (!context->device)
+   return IBV_TRANSPORT_UNKNOWN;
+
+   switch (context->device->node_type) {
+   case IBV_NODE_CA:
+   case IBV_NODE_SWITCH:
+   case IBV_NODE_ROUTER:
+   return IBV_TRANSPORT_IB;
+   case IBV_NODE_RNIC:
+   return IBV_TRANSPORT_IWARP;
+   default:
+   return IBV_TRANSPORT_UNKNOWN;
+   }
+}
+
+/**
+ * ibv_get_node_type - Return device's node type
+ */
+static inline enum ibv_node_type
+ibv_get_node_type(struct ibv_context *context)
+{
+   if (!context->device)
+   return IBV_NODE_UNKNOWN;
+
+   return context->device->node_type;
+}
+
+/**
  * ibv_open_device - Initialize device for use
  */
 struct ibv_context *ibv_open_device(struct ibv_device *device);
diff --git a/libibverbs/src/device.c b/libibverbs/src/device.c
index de97d4d..f08059e 100644
--- a/libibverbs/src/device.c
+++ b/libibverbs/src/device.c
@@ -107,6 +107,20 @@ uint64_t ibv_get_device_guid(struct ibv_
return htonll(guid);
 }
 
+static enum ibv_node_type query_node_type(struct ibv_device *device)
+{
+   char node_desc[24];
+   char node_str[24];
+   int node_type;
+
+   if (ibv_read_sysfs_file(device->ibdev_path, "node_type",
+   node_desc, sizeof(node_desc)) < 0)
+   return IBV_NODE_UNKNOWN;
+
+   sscanf(node_desc, "%d: %s\n", (int*)&node_type, node_str);
+   return (enum ibv_node_type) node_type;
+}
+
 struct ibv_context *ibv_open_device(struct ibv_device *device)
 {
char *devpath;
@@ -125,6 +139,8 @@ struct ibv_context *ibv_open_device(stru
if (cmd_fd < 0)
return NULL;
 
+   device->node_type = query_node_type(device);
+
context = device->ops.alloc_context(device, cmd_fd);
if (!context)
goto err;

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [mvapich-discuss] mvapich xhpl memory usage

2006-06-20 Thread Matthew Koop
Brady,

It appears that the OFED 1.0 release uses a script other than the
make.mvapich.gen2 script to specify the CFLAGS before building the RPMs.
When using the default MVAPICH from our website/svn make.mvapich.gen2 is
still correct though. For this reason, your change did not update the
compilation flags.

To change the OFED 1.0 CFLAGS you will need to edit the "mvapich.make"
script (instead of make.mvapich.gen2) in mvapich-0.9.7-mlx2.1.0 and remove
"-DLAZY_MEM_UNREGISTER" from line 308.

Please let us know if you have any other questions or if this does not
solve your issue.

Thanks,
Matthew Koop
-
Network-Based Computing Laboratory
Ohio State University


> Hello, I installed OFED 1.0 (mvapich 0.97)and compile Linpack
> benchmark. When I run xhpl, the memory usage creeps up with each NB.
> and as each N changes the memory allocated is not freed.
> LAZY_MEM_REGISTER is not defined per
> http://mail.cse.ohio-state.edu/pipermail/mvapich-discuss/2006-March/57.html
> I removed it from Make.mvapich.gen2. tar it back up and reran the
> install.




___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] ib_gid lookup

2006-06-20 Thread Hal Rosenstock
Hi again Amit,

On Tue, 2006-06-20 at 06:08, Hal Rosenstock wrote:
> Hi Amit,
> 
> On Mon, 2006-06-19 at 20:36, Amit Byron wrote:
> > hello,
> >   i'm trying to find whether i can do a lookup of ib_gid by either
> > node name or node's ip address. is this information available from
> > the subnet manager?
> 
> The SM doesn't know the node name but you might be able to do this by
> NodeDescription depending on how the subnet was setup (the
> NodeDescriptions would need to be made unique on each node; a script for
> this was supplied for mthca; there is also a current standards issue
> with the SM detecting that these had changed which is being worked on).
> If that were to be done, the SA could be queried by NodeDescription
> which would return a NodeRecord which would obtain the NodeInfo which
> includes the NodeGUID and PortGUID. Note it also returns the base LID as
> well.
> 
> The SM does not know the IP addresses unless they are registered by DAPL
> (via ServiceRecords) but I'm not sure that is done anymore or whether
> DAPL runs in your environment.

Generating an ARP to the IP address could resolve the GID. This API is
exposed through the RDMA CM (in both kernel and user space).

That might be your best option.

-- Hal

> -- Hal
> 
> > thanks,
> > Amit.
> > 
> > 
> > ___
> > openib-general mailing list
> > openib-general@openib.org
> > http://openib.org/mailman/listinfo/openib-general
> > 
> > To unsubscribe, please visit 
> > http://openib.org/mailman/listinfo/openib-general
> > 
> 
> 
> ___
> openib-general mailing list
> openib-general@openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH] OpenSM/osm_sa_link_record.c: Only need base LID rather than LID range in __osm_lr_rcv_get_physp_link

2006-06-20 Thread Hal Rosenstock
OpenSM/osm_sa_link_record.c: Only need base LID rather than LID range in
__osm_lr_rcv_get_physp_link

Signed-off-by: Hal Rosenstock <[EMAIL PROTECTED]>

Index: opensm/osm_sa_link_record.c
===
--- opensm/osm_sa_link_record.c (revision 8140)
+++ opensm/osm_sa_link_record.c (working copy)
@@ -166,13 +166,10 @@ __osm_lr_rcv_build_physp_link(
 /**
  **/
 static void
-__get_lid_range(
+__get_base_lid(
   IN const osm_physp_t*  p_physp,
-  OUT uint16_t * p_base_lid,
-  OUT uint16_t * p_max_lid )
+  OUT uint16_t * p_base_lid )
 {
-  uint8_tlmc;
-
   if(p_physp->p_node->node_info.node_type == IB_NODE_TYPE_SWITCH)
   {
 *p_base_lid =
@@ -180,14 +177,11 @@ __get_lid_range(
 osm_physp_get_base_lid(
   osm_node_get_physp_ptr(p_physp->p_node, 0))
 );
-*p_max_lid = *p_base_lid;
   }
   else
   {
 *p_base_lid =
   cl_ntoh16(osm_physp_get_base_lid(p_physp));
-lmc = osm_physp_get_lmc( p_physp );
-*p_max_lid = (uint16_t)(*p_base_lid + (1

[openib-general] ipath verbs does not compile against the latest SVN trunk verbs

2006-06-20 Thread Woodruff, Robert J
Title: ipath verbs does not compile against the latest SVN trunk verbs






When I try to build  SVN 8112 I get the following errors trying

to build the ipath verbs. 


src/ipathverbs.c:148: warning: its scope is only this definition or declaration, which is probably not what you want

src/ipathverbs.c: In function `openib_driver_init':

src/ipathverbs.c:156: warning: implicit declaration of function `sysfs_get_classdev_device'

src/ipathverbs.c:156: warning: assignment makes pointer from integer without a cast

src/ipathverbs.c:160: warning: implicit declaration of function `sysfs_get_device_attr'

src/ipathverbs.c:160: warning: assignment makes pointer from integer without a cast

src/ipathverbs.c:163: error: dereferencing pointer to incomplete type

src/ipathverbs.c:164: warning: implicit declaration of function `sysfs_close_attribute'

src/ipathverbs.c:166: warning: assignment makes pointer from integer without a cast

src/ipathverbs.c:169: error: dereferencing pointer to incomplete type

src/ipathverbs.c:183: error: dereferencing pointer to incomplete type



___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Re: [openib-general] ib_gid lookup

2006-06-20 Thread Hal Rosenstock
Hi again Amit,

On Tue, 2006-06-20 at 12:27, amit byron wrote:
> > Hal Rosenstock  voltaire.com> writes:
> >
> > 
> > Hi Amit,
> > 
> > On Mon, 2006-06-19 at 20:36, Amit Byron wrote:
> > > hello,
> > >   i'm trying to find whether i can do a lookup of ib_gid by either
> > > node name or node's ip address. is this information available from
> > > the subnet manager?
> > 
> > The SM doesn't know the node name but you might be able to do this by
> > NodeDescription depending on how the subnet was setup (the
> > NodeDescriptions would need to be made unique on each node; a script for
> > this was supplied for mthca; there is also a current standards issue
> > with the SM detecting that these had changed which is being worked on).
> > If that were to be done, the SA could be queried by NodeDescription
> > which would return a NodeRecord which would obtain the NodeInfo which
> > includes the NodeGUID and PortGUID. Note it also returns the base LID as
> > well.
> 
> hi Hal,
>  thank you very much for your suggestions.
> 
>  do you mean to say setting up subnet through the topology file?

No (although the topology file does display this information).

>  are
> there any examples on how to setup the topology file? also, where can
> i find the mthca script that you mention above.

management/diags/scripts/set_mthca_nodedesc.sh

> > The SM does not know the IP addresses unless they are registered by DAPL
> > (via ServiceRecords) but I'm not sure that is done anymore or whether
> > DAPL runs in your environment.
> > 
> 
> if i run DAPL in my environment will it work or this is already made
> obsolete?

I don't know. James or maybe Arlin would be the ones to answer. You
could also look at the code to figure this out.

-- Hal

> thanks again,
> Amit
> 
> 
> 
> 
> 
> ___
> openib-general mailing list
> openib-general@openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH] OpenSM/SA:

2006-06-20 Thread Hal Rosenstock
OpenSM/SA: Properly handle non base LID requests per C15-0.1.11 on
remaining SA records where this hasn't been fixed already.

C15-0.1.11: Query responses shall contain a port's base LID in
any LID component of a RID. So when LMC is non 0, the only records that
appear are those with the base LID and not with any masked LIDs.
Furthermore, if a query comes in on a non base LID, the LID in the RID
returned is only with the base LID.

Also, fixed some error handling for SA GetTable requests in these SA
records.

Signed-off-by: Hal Rosenstock <[EMAIL PROTECTED]>

Index: opensm/osm_sa_guidinfo_record.c
===
--- opensm/osm_sa_guidinfo_record.c (revision 8140)
+++ opensm/osm_sa_guidinfo_record.c (working copy)
@@ -201,12 +201,10 @@ __osm_sa_gir_create_gir(
   uint8_t  port_num;
   uint8_t  num_ports;
   uint16_t match_lid_ho;
-  uint16_t lid_ho;
   ib_net16_t   base_lid_ho;
   ib_net16_t   max_lid_ho;
   uint8_t  lmc;
   ib_net64_t   port_guid;
-  ib_api_status_t  status;
   const ib_port_info_t*p_pi;
   uint8_t  block_num, start_block_num, end_block_num, 
num_blocks;
 
@@ -276,11 +274,12 @@ __osm_sa_gir_create_gir(
 }
 
 base_lid_ho = cl_ntoh16( osm_physp_get_base_lid( p_physp ) );
-lmc = osm_physp_get_lmc( p_physp );
-max_lid_ho = (uint16_t)( base_lid_ho + (1 << lmc) - 1 );
 match_lid_ho = cl_ntoh16( match_lid );
 if( match_lid_ho )
 {
+  lmc = osm_physp_get_lmc( p_physp );
+  max_lid_ho = (uint16_t)( base_lid_ho + (1 << lmc) - 1 );
+
   /*
 We validate that the lid belongs to this node.
   */
@@ -295,34 +294,15 @@ __osm_sa_gir_create_gir(
  );
   }
 
-  if( match_lid_ho <= max_lid_ho && match_lid_ho >= base_lid_ho )
-  {
-/*
-  Ignore return code for now.
-*/
-   for (block_num = start_block_num; block_num <= end_block_num; 
block_num++)
-  __osm_gir_rcv_new_gir( p_rcv, p_node, p_list,
- port_guid, match_lid,
- p_physp, block_num );
-  }
-}
-else
-{
-  /*
-For every lid value create the GUIDInfo record(s).
-  */
-  for( lid_ho = base_lid_ho; lid_ho <= max_lid_ho; lid_ho++ )
-  {
-for (block_num = start_block_num; block_num <= end_block_num; 
block_num++)
-{
-  status = __osm_gir_rcv_new_gir( p_rcv, p_node, p_list,
-  port_guid, cl_hton16( lid_ho ),
-  p_physp, block_num );
-  if( status != IB_SUCCESS )
-break;
-}
-  }
+  if ( match_lid_ho < base_lid_ho || match_lid_ho > max_lid_ho )
+continue;
 }
+
+for (block_num = start_block_num; block_num <= end_block_num; block_num++)
+  __osm_gir_rcv_new_gir( p_rcv, p_node, p_list,
+ port_guid, cl_ntoh16(base_lid_ho),
+ p_physp, block_num );
+
   }
 
   OSM_LOG_EXIT( p_rcv->p_log );
@@ -496,24 +476,32 @@ osm_gir_rcv_process(
* C15-0.1.30:
* If we do a SubnAdmGet and got more than one record it is an error !
*/
-  if ( (p_rcvd_mad->method == IB_MAD_METHOD_GET) &&
-   (num_rec > 1)) {
-osm_log( p_rcv->p_log, OSM_LOG_ERROR,
- "osm_gir_rcv_process: ERR 5103: "
- "Got more than one record for SubnAdmGet (%u)\n",
- num_rec );
-osm_sa_send_error( p_rcv->p_resp, p_madw,
-   IB_SA_MAD_STATUS_TOO_MANY_RECORDS );
-
-/* need to set the mem free ... */
-p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
-while( p_rec_item != (osm_gir_item_t*)cl_qlist_end( &rec_list ) )
+  if (p_rcvd_mad->method == IB_MAD_METHOD_GET)
+  {
+if (num_rec == 0)
 {
-  cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item );
-  p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+  osm_sa_send_error( p_rcv->p_resp, p_madw, IB_SA_MAD_STATUS_NO_RECORDS );
+  goto Exit;
 }
+if (num_rec > 1)
+{
+  osm_log( p_rcv->p_log, OSM_LOG_ERROR,
+   "osm_gir_rcv_process: ERR 5103: "
+   "Got more than one record for SubnAdmGet (%u)\n",
+   num_rec );
+  osm_sa_send_error( p_rcv->p_resp, p_madw,
+ IB_SA_MAD_STATUS_TOO_MANY_RECORDS );
 
-goto Exit;
+  /* need to set the mem free ... */
+  p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+  while( p_rec_item != (osm_gir_item_t*)cl_qlist_end( &rec_list ) )
+  {
+cl_qlock_pool_put( &p_rcv->pool, &p_rec_item->pool_item );
+p_rec_item = (osm_gir_item_t*)cl_qlist_remove_head( &rec_list );
+  }
+
+  goto Exit;
+}
   }
 
   pre_trim_num_rec = num_rec;
Index: op

Re: [openib-general] ib_gid lookup

2006-06-20 Thread amit byron
> Hal Rosenstock  voltaire.com> writes:
>
> 
> Hi Amit,
> 
> On Mon, 2006-06-19 at 20:36, Amit Byron wrote:
> > hello,
> >   i'm trying to find whether i can do a lookup of ib_gid by either
> > node name or node's ip address. is this information available from
> > the subnet manager?
> 
> The SM doesn't know the node name but you might be able to do this by
> NodeDescription depending on how the subnet was setup (the
> NodeDescriptions would need to be made unique on each node; a script for
> this was supplied for mthca; there is also a current standards issue
> with the SM detecting that these had changed which is being worked on).
> If that were to be done, the SA could be queried by NodeDescription
> which would return a NodeRecord which would obtain the NodeInfo which
> includes the NodeGUID and PortGUID. Note it also returns the base LID as
> well.

hi Hal,
 thank you very much for your suggestions.

 do you mean to say setting up subnet through the topology file? are
there any examples on how to setup the topology file? also, where can
i find the mthca script that you mention above.

> 
> The SM does not know the IP addresses unless they are registered by DAPL
> (via ServiceRecords) but I'm not sure that is done anymore or whether
> DAPL runs in your environment.
> 

if i run DAPL in my environment will it work or this is already made
obsolete?

thanks again,
Amit





___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] [PATCH 2/2] IB/iser: bugfix for the reconnect flow

2006-06-20 Thread Roland Dreier
Thanks, I rolled up both of these patches into what I have queued.

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] FW: mvapich xhpl memory usage

2006-06-20 Thread Brady Chang





 

Hello,
I installed OFED 1.0 (mvapich 0.97)and compile Linpack benchmark.
When I run xhpl, the memory usage creeps up with each NB. and as each N changes the memory allocated is not freed. 
LAZY_MEM_REGISTER is not defined per http://mail.cse.ohio-state.edu/pipermail/mvapich-discuss/2006-March/57.html  I removed it from Make.mvapich.gen2. tar it back up and reran the install.
 
Hardware:
dual core opteron.
4Gig mem
InfiniBand: Mellanox Technologies MT25204 [InfiniHost III Lx HCA] (rev a0)
xhpl compiled using libmpich.so
 
 
thanks
-Brady
 ___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Re: [openib-general] [librdmacm] check return value in operations of rping

2006-06-20 Thread Steve Wise
This is still balled up.  It's like the tabs have been converted to
spaces...

Go ahead and send it as an attachment and I'll review it...

Stevo.




On Tue, 2006-06-20 at 18:44 +0300, Dotan Barak wrote:
> On Tuesday 20 June 2006 18:23, Steve Wise wrote:
> > This patch is malformed, I think.  Did your mailer munge it?  
> > 
> 
> Sorry, i changed the mail client recently and it wasnt' configured properly 
> ...
> 
> i hope that this patch looks better ..
> 
> Added checks to the return values of all of the functions that may fail
> (in order to add this test to the regression system).
> 
> Signed-off-by: Dotan Barak <[EMAIL PROTECTED]>
> 
> Index: last_stable/src/userspace/librdmacm/examples/rping.c
> ===
> --- last_stable.orig/src/userspace/librdmacm/examples/rping.c 2006-06-20 
> 14:41:47.0 +0300
> +++ last_stable/src/userspace/librdmacm/examples/rping.c 2006-06-20 
> 14:42:12.0 +0300
> @@ -157,10 +157,10 @@ struct rping_cb {
>   struct rdma_cm_id *child_cm_id; /* connection on server side */
>  };
>  
> -static void rping_cma_event_handler(struct rdma_cm_id *cma_id,
> +static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
>  struct rdma_cm_event *event)
>  {
> - int ret;
> + int ret = 0;
>   struct rping_cb *cb = cma_id->context;
>  
>   DEBUG_LOG("cma_event type %d cma_id %p (%s)\n", event->event, cma_id,
> @@ -209,6 +209,7 @@ static void rping_cma_event_handler(stru
>fprintf(stderr, "cma event %d, error %d\n", event->event,
>   event->status);
>sem_post(&cb->sem);
> +  ret = -1;
>break;
>  
>   case RDMA_CM_EVENT_DISCONNECTED:
> @@ -218,13 +219,17 @@ static void rping_cma_event_handler(stru
>  
>   case RDMA_CM_EVENT_DEVICE_REMOVAL:
>fprintf(stderr, "cma detected device removal\n");
> +  ret = -1;
>break;
>  
>   default:
>fprintf(stderr, "oof bad type!\n");
>sem_post(&cb->sem);
> +  ret = -1;
>break;
>   }
> +
> + return ret;
>  }
>  
>  static int server_recv(struct rping_cb *cb, struct ibv_wc *wc)
> @@ -263,16 +268,20 @@ static int client_recv(struct rping_cb *
>   return 0;
>  }
>  
> -static void rping_cq_event_handler(struct rping_cb *cb)
> +static int rping_cq_event_handler(struct rping_cb *cb)
>  {
>   struct ibv_wc wc;
>   struct ibv_recv_wr *bad_wr;
>   int ret;
>  
>   while ((ret = ibv_poll_cq(cb->cq, 1, &wc)) == 1) {
> +  ret = 0;
> +
>if (wc.status) {
> fprintf(stderr, "cq completion failed status %d\n",
>  wc.status);
> +   if (wc.status != IBV_WC_WR_FLUSH_ERR)
> +ret = -1;
> goto error;
>}
>  
> @@ -312,6 +321,7 @@ static void rping_cq_event_handler(struc
>  
>default:
> DEBUG_LOG("unknown! completion\n");
> +   ret = -1;
> goto error;
>}
>   }
> @@ -319,11 +329,12 @@ static void rping_cq_event_handler(struc
>fprintf(stderr, "poll error %d\n", ret);
>goto error;
>   }
> - return;
> + return 0;
>  
>  error:
>   cb->state = ERROR;
>   sem_post(&cb->sem);
> + return ret;
>  }
>  
>  static int rping_accept(struct rping_cb *cb)
> @@ -560,7 +571,9 @@ static void *cm_thread(void *arg)
> fprintf(stderr, "rdma_get_cm_event err %d\n", ret);
> exit(ret);
>}
> -  rping_cma_event_handler(event->id, event);
> +  ret = rping_cma_event_handler(event->id, event);
> +  if (ret)
> +   exit(ret);
>rdma_ack_cm_event(event);
>   }
>  }
> @@ -589,7 +602,9 @@ static void *cq_thread(void *arg)
> fprintf(stderr, "Failed to set notify!\n");
> exit(ret);
>}
> -  rping_cq_event_handler(cb);
> +  ret = rping_cq_event_handler(cb);
> +  if (ret)
> +   exit(ret);
>ibv_ack_cq_events(cb->cq, 1);
>   }
>  }
> @@ -606,7 +621,7 @@ static void rping_format_send(struct rpi
>  info->buf, info->rkey, info->size);
>  }
>  
> -static void rping_test_server(struct rping_cb *cb)
> +static int rping_test_server(struct rping_cb *cb)
>  {
>   struct ibv_send_wr *bad_wr;
>   int ret;
> @@ -617,6 +632,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_READ_ADV) {
> fprintf(stderr, "wait for RDMA_READ_ADV state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>  
> @@ -640,6 +656,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_READ_COMPLETE) {
> fprintf(stderr, "wait for RDMA_READ_COMPLETE state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>DEBUG_LOG("server received read complete\n");
> @@ -661,6 +678,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_WRITE_ADV) {
> fprintf(stderr, "wait for RDMA_WRITE_ADV state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>DEBUG_LOG("server received sink adv\n");
> @@ -686,6 +704,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_WRITE_COMPLETE) {
> fprintf(stderr, "wait for RDMA_WRITE_COMPLETE state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>DEBUG_LOG("server rdma write complete \n");
> @@ -

Re: [openib-general] [librdmacm] check return value in operations of rping

2006-06-20 Thread Steve Wise
This patch is malformed, I think.  Did your mailer munge it?  



On Tue, 2006-06-20 at 17:30 +0300, Dotan Barak wrote:
> Added checks to the return values of all of the functions that may fail
> (in order to add this test to the regression system).
> 
> Signed-off-by: Dotan Barak <[EMAIL PROTECTED]>
> 
> Index: last_stable/src/userspace/librdmacm/examples/rping.c
> ===
> --- last_stable.orig/src/userspace/librdmacm/examples/rping.c 2006-06-20 
> 14:41:47.0 +0300
> +++ last_stable/src/userspace/librdmacm/examples/rping.c 2006-06-20 
> 14:42:12.0 +0300
> @@ -157,10 +157,10 @@ struct rping_cb {
>   struct rdma_cm_id *child_cm_id; /* connection on server side */
>  };
>  
> -static void rping_cma_event_handler(struct rdma_cm_id *cma_id,
> +static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
>  struct rdma_cm_event *event)
>  {
> - int ret;
> + int ret = 0;
>   struct rping_cb *cb = cma_id->context;
>  
>   DEBUG_LOG("cma_event type %d cma_id %p (%s)\n", event->event, cma_id,
> @@ -209,6 +209,7 @@ static void rping_cma_event_handler(stru
>fprintf(stderr, "cma event %d, error %d\n", event->event,
>   event->status);
>sem_post(&cb->sem);
> +  ret = -1;
>break;
>  
>   case RDMA_CM_EVENT_DISCONNECTED:
> @@ -218,13 +219,17 @@ static void rping_cma_event_handler(stru
>  
>   case RDMA_CM_EVENT_DEVICE_REMOVAL:
>fprintf(stderr, "cma detected device removal\n");
> +  ret = -1;
>break;
>  
>   default:
>fprintf(stderr, "oof bad type!\n");
>sem_post(&cb->sem);
> +  ret = -1;
>break;
>   }
> +
> + return ret;
>  }
>  
>  static int server_recv(struct rping_cb *cb, struct ibv_wc *wc)
> @@ -263,16 +268,20 @@ static int client_recv(struct rping_cb *
>   return 0;
>  }
>  
> -static void rping_cq_event_handler(struct rping_cb *cb)
> +static int rping_cq_event_handler(struct rping_cb *cb)
>  {
>   struct ibv_wc wc;
>   struct ibv_recv_wr *bad_wr;
>   int ret;
>  
>   while ((ret = ibv_poll_cq(cb->cq, 1, &wc)) == 1) {
> +  ret = 0;
> +
>if (wc.status) {
> fprintf(stderr, "cq completion failed status %d\n",
>  wc.status);
> +   if (wc.status != IBV_WC_WR_FLUSH_ERR)
> +ret = -1;
> goto error;
>}
>  
> @@ -312,6 +321,7 @@ static void rping_cq_event_handler(struc
>  
>default:
> DEBUG_LOG("unknown! completion\n");
> +   ret = -1;
> goto error;
>}
>   }
> @@ -319,11 +329,12 @@ static void rping_cq_event_handler(struc
>fprintf(stderr, "poll error %d\n", ret);
>goto error;
>   }
> - return;
> + return 0;
>  
>  error:
>   cb->state = ERROR;
>   sem_post(&cb->sem);
> + return ret;
>  }
>  
>  static int rping_accept(struct rping_cb *cb)
> @@ -560,7 +571,9 @@ static void *cm_thread(void *arg)
> fprintf(stderr, "rdma_get_cm_event err %d\n", ret);
> exit(ret);
>}
> -  rping_cma_event_handler(event->id, event);
> +  ret = rping_cma_event_handler(event->id, event);
> +  if (ret)
> +   exit(ret);
>rdma_ack_cm_event(event);
>   }
>  }
> @@ -589,7 +602,9 @@ static void *cq_thread(void *arg)
> fprintf(stderr, "Failed to set notify!\n");
> exit(ret);
>}
> -  rping_cq_event_handler(cb);
> +  ret = rping_cq_event_handler(cb);
> +  if (ret)
> +   exit(ret);
>ibv_ack_cq_events(cb->cq, 1);
>   }
>  }
> @@ -606,7 +621,7 @@ static void rping_format_send(struct rpi
>  info->buf, info->rkey, info->size);
>  }
>  
> -static void rping_test_server(struct rping_cb *cb)
> +static int rping_test_server(struct rping_cb *cb)
>  {
>   struct ibv_send_wr *bad_wr;
>   int ret;
> @@ -617,6 +632,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_READ_ADV) {
> fprintf(stderr, "wait for RDMA_READ_ADV state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>  
> @@ -640,6 +656,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_READ_COMPLETE) {
> fprintf(stderr, "wait for RDMA_READ_COMPLETE state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>DEBUG_LOG("server received read complete\n");
> @@ -661,6 +678,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_WRITE_ADV) {
> fprintf(stderr, "wait for RDMA_WRITE_ADV state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>DEBUG_LOG("server received sink adv\n");
> @@ -686,6 +704,7 @@ static void rping_test_server(struct rpi
>if (cb->state != RDMA_WRITE_COMPLETE) {
> fprintf(stderr, "wait for RDMA_WRITE_COMPLETE state %d\n",
>  cb->state);
> +   ret = -1;
> break;
>}
>DEBUG_LOG("server rdma write complete \n");
> @@ -698,6 +717,8 @@ static void rping_test_server(struct rpi
>}
>DEBUG_LOG("server posted go ahead\n");
>   }
> +
> + return ret;
>  }
>  
>  static int rping_bind_server(struct rping_cb *cb)
> @@ -734,19 +755,19 @@ static int rping_bind_server(struct rpin
>   return 0;
>  }
>  
> -static void rping_run_server(struct rping_cb *cb)
> +sta

Re: [openib-general] iSER updates

2006-06-20 Thread Roland Dreier
Or> I see that the patch is applied at the for-mm branch but not
Or> at the iser branch, is it fine?

Sorry, I forgot to push out an update the iser branch on
master.kernel.org.  It should be OK now.

 - R.

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [librdmacm] check return value in operations of rping

2006-06-20 Thread Dotan Barak
Added checks to the return values of all of the functions that may fail
(in order to add this test to the regression system).

Signed-off-by: Dotan Barak <[EMAIL PROTECTED]>

Index: last_stable/src/userspace/librdmacm/examples/rping.c
===
--- last_stable.orig/src/userspace/librdmacm/examples/rping.c 2006-06-20 
14:41:47.0 +0300
+++ last_stable/src/userspace/librdmacm/examples/rping.c 2006-06-20 
14:42:12.0 +0300
@@ -157,10 +157,10 @@ struct rping_cb {
  struct rdma_cm_id *child_cm_id; /* connection on server side */
 };
 
-static void rping_cma_event_handler(struct rdma_cm_id *cma_id,
+static int rping_cma_event_handler(struct rdma_cm_id *cma_id,
 struct rdma_cm_event *event)
 {
- int ret;
+ int ret = 0;
  struct rping_cb *cb = cma_id->context;
 
  DEBUG_LOG("cma_event type %d cma_id %p (%s)\n", event->event, cma_id,
@@ -209,6 +209,7 @@ static void rping_cma_event_handler(stru
   fprintf(stderr, "cma event %d, error %d\n", event->event,
  event->status);
   sem_post(&cb->sem);
+  ret = -1;
   break;
 
  case RDMA_CM_EVENT_DISCONNECTED:
@@ -218,13 +219,17 @@ static void rping_cma_event_handler(stru
 
  case RDMA_CM_EVENT_DEVICE_REMOVAL:
   fprintf(stderr, "cma detected device removal\n");
+  ret = -1;
   break;
 
  default:
   fprintf(stderr, "oof bad type!\n");
   sem_post(&cb->sem);
+  ret = -1;
   break;
  }
+
+ return ret;
 }
 
 static int server_recv(struct rping_cb *cb, struct ibv_wc *wc)
@@ -263,16 +268,20 @@ static int client_recv(struct rping_cb *
  return 0;
 }
 
-static void rping_cq_event_handler(struct rping_cb *cb)
+static int rping_cq_event_handler(struct rping_cb *cb)
 {
  struct ibv_wc wc;
  struct ibv_recv_wr *bad_wr;
  int ret;
 
  while ((ret = ibv_poll_cq(cb->cq, 1, &wc)) == 1) {
+  ret = 0;
+
   if (wc.status) {
fprintf(stderr, "cq completion failed status %d\n",
 wc.status);
+   if (wc.status != IBV_WC_WR_FLUSH_ERR)
+ret = -1;
goto error;
   }
 
@@ -312,6 +321,7 @@ static void rping_cq_event_handler(struc
 
   default:
DEBUG_LOG("unknown! completion\n");
+   ret = -1;
goto error;
   }
  }
@@ -319,11 +329,12 @@ static void rping_cq_event_handler(struc
   fprintf(stderr, "poll error %d\n", ret);
   goto error;
  }
- return;
+ return 0;
 
 error:
  cb->state = ERROR;
  sem_post(&cb->sem);
+ return ret;
 }
 
 static int rping_accept(struct rping_cb *cb)
@@ -560,7 +571,9 @@ static void *cm_thread(void *arg)
fprintf(stderr, "rdma_get_cm_event err %d\n", ret);
exit(ret);
   }
-  rping_cma_event_handler(event->id, event);
+  ret = rping_cma_event_handler(event->id, event);
+  if (ret)
+   exit(ret);
   rdma_ack_cm_event(event);
  }
 }
@@ -589,7 +602,9 @@ static void *cq_thread(void *arg)
fprintf(stderr, "Failed to set notify!\n");
exit(ret);
   }
-  rping_cq_event_handler(cb);
+  ret = rping_cq_event_handler(cb);
+  if (ret)
+   exit(ret);
   ibv_ack_cq_events(cb->cq, 1);
  }
 }
@@ -606,7 +621,7 @@ static void rping_format_send(struct rpi
 info->buf, info->rkey, info->size);
 }
 
-static void rping_test_server(struct rping_cb *cb)
+static int rping_test_server(struct rping_cb *cb)
 {
  struct ibv_send_wr *bad_wr;
  int ret;
@@ -617,6 +632,7 @@ static void rping_test_server(struct rpi
   if (cb->state != RDMA_READ_ADV) {
fprintf(stderr, "wait for RDMA_READ_ADV state %d\n",
 cb->state);
+   ret = -1;
break;
   }
 
@@ -640,6 +656,7 @@ static void rping_test_server(struct rpi
   if (cb->state != RDMA_READ_COMPLETE) {
fprintf(stderr, "wait for RDMA_READ_COMPLETE state %d\n",
 cb->state);
+   ret = -1;
break;
   }
   DEBUG_LOG("server received read complete\n");
@@ -661,6 +678,7 @@ static void rping_test_server(struct rpi
   if (cb->state != RDMA_WRITE_ADV) {
fprintf(stderr, "wait for RDMA_WRITE_ADV state %d\n",
 cb->state);
+   ret = -1;
break;
   }
   DEBUG_LOG("server received sink adv\n");
@@ -686,6 +704,7 @@ static void rping_test_server(struct rpi
   if (cb->state != RDMA_WRITE_COMPLETE) {
fprintf(stderr, "wait for RDMA_WRITE_COMPLETE state %d\n",
 cb->state);
+   ret = -1;
break;
   }
   DEBUG_LOG("server rdma write complete \n");
@@ -698,6 +717,8 @@ static void rping_test_server(struct rpi
   }
   DEBUG_LOG("server posted go ahead\n");
  }
+
+ return ret;
 }
 
 static int rping_bind_server(struct rping_cb *cb)
@@ -734,19 +755,19 @@ static int rping_bind_server(struct rpin
  return 0;
 }
 
-static void rping_run_server(struct rping_cb *cb)
+static int rping_run_server(struct rping_cb *cb)
 {
  struct ibv_recv_wr *bad_wr;
  int ret;
 
  ret = rping_bind_server(cb);
  if (ret)
-  return;
+  return ret;
 
  ret = rping_setup_qp(cb, cb->child_cm_id);
  if (ret) {
   fprintf(stderr, "setup_qp failed: %d\n", ret);
-  return;
+  return ret;
  }
 
  ret = rping_setup_buffers(cb);
@@ -776,11 +797,13 @@ err2:
  rping_free_buffers(cb);
 err1:
  rping_free_qp(cb);
+
+ return ret;
 }
 
-static void rping_test_cl

Re: [openib-general] [PATCHv5] osm: partition manager force policy

2006-06-20 Thread Hal Rosenstock
On Mon, 2006-06-19 at 15:05, Eitan Zahavi wrote:
> Hi Hal
> 
> This is a 5th take after incorporating Sasha's last reported bug 
> on bad assignment of the used_blocks.
> 
> This code was run again through my verification flow and also Sasha
> had run some tests too.
> 
> Eitan
> 
> Signed-off-by:  Eitan Zahavi <[EMAIL PROTECTED]>

[snip...]

> Index: opensm/osm_pkey.c
> ===
> --- opensm/osm_pkey.c (revision 8113)
> +++ opensm/osm_pkey.c (working copy)
> @@ -94,18 +94,22 @@ void osm_pkey_tbl_destroy( 
>  
>  /**
>   **/
> -int osm_pkey_tbl_init( 
> +ib_api_status_t
> +osm_pkey_tbl_init(
>IN osm_pkey_tbl_t *p_pkey_tbl)
>  {
>cl_ptr_vector_init( &p_pkey_tbl->blocks, 0, 1);
>cl_ptr_vector_init( &p_pkey_tbl->new_blocks, 0, 1);
>cl_map_init( &p_pkey_tbl->keys, 1 );
> + cl_qlist_init( &p_pkey_tbl->pending );
> + p_pkey_tbl->used_blocks = 0;
> + p_pkey_tbl->max_blocks = 0;
>return(IB_SUCCESS);
>  }
>  
>  /**
>   **/
> -void osm_pkey_tbl_sync_new_blocks(
> +void osm_pkey_tbl_init_new_blocks(
>IN const osm_pkey_tbl_t *p_pkey_tbl)
>  {
>ib_pkey_table_t *p_block, *p_new_block;
> @@ -123,16 +127,31 @@ void osm_pkey_tbl_sync_new_blocks(
>p_new_block = (ib_pkey_table_t *)malloc(sizeof(*p_new_block));
>if (!p_new_block)
>  break;
> + cl_ptr_vector_set(&((osm_pkey_tbl_t 
> *)p_pkey_tbl)->new_blocks, 
> + b, 
> p_new_block);
> + }
> +
>memset(p_new_block, 0, sizeof(*p_new_block));
> -  cl_ptr_vector_set(&((osm_pkey_tbl_t *)p_pkey_tbl)->new_blocks, b, 
> p_new_block);
>  }
> -memcpy(p_new_block, p_block, sizeof(*p_new_block));
> +}
> +
> +/**
> + **/
> +void osm_pkey_tbl_cleanup_pending(
> + IN osm_pkey_tbl_t *p_pkey_tbl)
> +{
> + cl_list_item_t  *p_item;
> + p_item = cl_qlist_remove_head( &p_pkey_tbl->pending );
> + while (p_item != cl_qlist_end( &p_pkey_tbl->pending ) )
> + {
> + free( (osm_pending_pkey_t *)p_item );
>}
>  }
>  
>  /**
>   **/
> -int osm_pkey_tbl_set( 
> +ib_api_status_t
> +osm_pkey_tbl_set(
>IN osm_pkey_tbl_t *p_pkey_tbl,
>IN uint16_t block, 
>IN ib_pkey_table_t *p_tbl)
> @@ -203,7 +222,138 @@ int osm_pkey_tbl_set( 
>  
>  /**
>   **/
> -static boolean_t __osm_match_pkey (
> +ib_api_status_t
> +osm_pkey_tbl_make_block_pair( 
> + osm_pkey_tbl_t   *p_pkey_tbl, 
> + uint16_t  block_idx,
> + ib_pkey_table_t **pp_old_block,
> + ib_pkey_table_t **pp_new_block)
> +{
> + if (block_idx >= p_pkey_tbl->max_blocks) return(IB_ERROR);
> +
> + if (pp_old_block)
> + {
> + *pp_old_block = osm_pkey_tbl_block_get( p_pkey_tbl, block_idx );
> + if (! *pp_old_block)
> + {
> + *pp_old_block = (ib_pkey_table_t 
> *)malloc(sizeof(ib_pkey_table_t));
> + if (!*pp_old_block) return(IB_ERROR);
> + memset(*pp_old_block, 0, sizeof(ib_pkey_table_t));
> + cl_ptr_vector_set(&p_pkey_tbl->blocks, block_idx, 
> *pp_old_block);
> + }
> + }
> + 
> + if (pp_new_block)
> + {
> + *pp_new_block = osm_pkey_tbl_new_block_get( p_pkey_tbl, 
> block_idx );
> + if (! *pp_new_block)
> + {
> + *pp_new_block = (ib_pkey_table_t 
> *)malloc(sizeof(ib_pkey_table_t));
> + if (!*pp_new_block) return(IB_ERROR);
> + memset(*pp_new_block, 0, sizeof(ib_pkey_table_t));
> + cl_ptr_vector_set(&p_pkey_tbl->new_blocks, block_idx, 
> *pp_new_block);
> + }
> + }
> + return( IB_SUCCESS );
> +}
> +
> +/**
> + **/
> +/*
> +  store the given pkey in the "new" blocks array 
> +  also makes sure the regular block exists.
> +*/
> +ib_api_status_t
> +osm_pkey_tbl_set_new_entry( 
> + IN osm_pkey_tbl_t *p_pkey_tbl,
> + IN uint16_tblock_idx,
> + IN uint8_t pkey_idx,
> + IN uint16_tpkey)
> +{  
> + ib_pkey_table_t *p_old_block;
> + ib

[openib-general] IB/iser upstream push for 2.6.18 awaiting for the SCSI/iscsi updates

2006-06-20 Thread Or Gerlitz
Hi James,

Roland is ready to push iSER for 2.6.18 through his tree but it can't be 
done before the 2.6.18 iscsi updates on which iSER is dependent upon 
(libiscsi etc) are pushed (and pulled by Linus), so ... just wondering 
when do you plan to push the iscsi updates?

Or.


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] ib_gid lookup

2006-06-20 Thread Hal Rosenstock
Hi Amit,

On Mon, 2006-06-19 at 20:36, Amit Byron wrote:
> hello,
>   i'm trying to find whether i can do a lookup of ib_gid by either
> node name or node's ip address. is this information available from
> the subnet manager?

The SM doesn't know the node name but you might be able to do this by
NodeDescription depending on how the subnet was setup (the
NodeDescriptions would need to be made unique on each node; a script for
this was supplied for mthca; there is also a current standards issue
with the SM detecting that these had changed which is being worked on).
If that were to be done, the SA could be queried by NodeDescription
which would return a NodeRecord which would obtain the NodeInfo which
includes the NodeGUID and PortGUID. Note it also returns the base LID as
well.

The SM does not know the IP addresses unless they are registered by DAPL
(via ServiceRecords) but I'm not sure that is done anymore or whether
DAPL runs in your environment.

-- Hal

> thanks,
> Amit.
> 
> 
> ___
> openib-general mailing list
> openib-general@openib.org
> http://openib.org/mailman/listinfo/openib-general
> 
> To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general
> 


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] resend [PATCH 1/2] IB/iser: don't access sc->request_buffer when sc->request_bufflen is zero

2006-06-20 Thread Or Gerlitz
Roland, there was an error in the changelog comment, here it's again.

calling sg_init_one on sc->request_buffer when sc->request_bufflen is zero is 
unsafe

Signed-off-by: Or Gerlitz <[EMAIL PROTECTED]>

Index: infiniband-git/drivers/infiniband/ulp/iser/iser_initiator.c
===
--- infiniband-git.orig/drivers/infiniband/ulp/iser/iser_initiator.c
2006-06-20 12:26:17.0 +0300
+++ infiniband-git/drivers/infiniband/ulp/iser/iser_initiator.c 2006-06-20 
12:27:42.0 +0300
@@ -391,7 +391,8 @@
if (sc->use_sg) { /* using a scatter list */
data_buf->buf  = sc->request_buffer;
data_buf->size = sc->use_sg;
-   } else { /* using a single buffer - convert it into one entry SG */
+   } else if (sc->request_bufflen) {
+   /* using a single buffer - convert it into one entry SG */
sg_init_one(&data_buf->sg_single,
sc->request_buffer, sc->request_bufflen);
data_buf->buf   = &data_buf->sg_single;


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH 2/2] IB/iser: bugfix for the reconnect flow

2006-06-20 Thread Or Gerlitz
for iscsi reconnect flow the sequence of calls would be conn stop/bind/start
i.e conn create is not called; fixed the post receive code to take that into
account, also moved setting conn->recv_lock into conn bind which is called for
both connect and reconnect flows.

Signed-off-by: Erez Zilber <[EMAIL PROTECTED]>
Signed-off-by: Or Gerlitz  <[EMAIL PROTECTED]>

Index: infiniband-git/drivers/infiniband/ulp/iser/iscsi_iser.c
===
--- infiniband-git.orig/drivers/infiniband/ulp/iser/iscsi_iser.c
2006-06-20 12:27:42.0 +0300
+++ infiniband-git/drivers/infiniband/ulp/iser/iscsi_iser.c 2006-06-20 
12:28:14.0 +0300
@@ -311,8 +311,6 @@
/* currently this is the only field which need to be initiated */
rwlock_init(&iser_conn->lock);

-   conn->recv_lock = &iser_conn->lock;
-
conn->dd_data = iser_conn;
iser_conn->iscsi_conn = conn;

@@ -363,6 +361,8 @@
ib_conn->iser_conn = iser_conn;
iser_conn->ib_conn  = ib_conn;

+   conn->recv_lock = &iser_conn->lock;
+
return 0;
 }

Index: infiniband-git/drivers/infiniband/ulp/iser/iser_initiator.c
===
--- infiniband-git.orig/drivers/infiniband/ulp/iser/iser_initiator.c
2006-06-20 12:27:42.0 +0300
+++ infiniband-git/drivers/infiniband/ulp/iser/iser_initiator.c 2006-06-20 
12:28:14.0 +0300
@@ -232,8 +232,11 @@
}
rx_desc->type = ISCSI_RX;

-   /* for the login sequence we must support rx of upto 8K */
-   if (conn->c_stage == ISCSI_CONN_INITIAL_STAGE)
+   /* for the login sequence we must support rx of upto 8K; login is done
+* after conn create/bind (connect) and conn stop/bind (reconnect),
+* what's common for both schemes is that the connection is not started
+*/
+   if (conn->c_stage != ISCSI_CONN_STARTED)
rx_data_size = DEFAULT_MAX_RECV_DATA_SEGMENT_LENGTH;
else /* FIXME till user space sets conn->max_recv_dlength correctly */
rx_data_size = 128;


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



[openib-general] [PATCH 1/2] IB/iser: don't access sc->request_buffer when sc->request_bufflen is zero

2006-06-20 Thread Or Gerlitz
calling scsi_init_one on sc->request_buffer when sc->request_bufflen is zero is 
unsafe

Signed-off-by: Or Gerlitz <[EMAIL PROTECTED]>

Index: infiniband-git/drivers/infiniband/ulp/iser/iser_initiator.c
===
--- infiniband-git.orig/drivers/infiniband/ulp/iser/iser_initiator.c
2006-06-20 12:26:17.0 +0300
+++ infiniband-git/drivers/infiniband/ulp/iser/iser_initiator.c 2006-06-20 
12:27:42.0 +0300
@@ -391,7 +391,8 @@
if (sc->use_sg) { /* using a scatter list */
data_buf->buf  = sc->request_buffer;
data_buf->size = sc->use_sg;
-   } else { /* using a single buffer - convert it into one entry SG */
+   } else if (sc->request_bufflen) {
+   /* using a single buffer - convert it into one entry SG */
sg_init_one(&data_buf->sg_single,
sc->request_buffer, sc->request_bufflen);
data_buf->buf   = &data_buf->sg_single;

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] MVAPICH failure on SGI Altix SLES10

2006-06-20 Thread Tziporet Koren
John Partridge wrote:
> I am trying to run the example from MPI_README.txt (and other MPI apps
> like pallas), but I keep getting a Couldn't modify SRQ limit error
> message :-
>
> mig129:~/OFED-1.0-pre1 # 
> /usr/local/ofed/mpi/gcc/mvapich-0.9.7-mlx2.1.0/bin/mpirun_rsh -rsh -np 2 
> -hostfile /root/cluster 
> /usr/local/ofed/mpi/gcc/mvapich-0.9.7-mlx2.1.0/tests/osutests-1.0/bw 1000 16
> [1] Abort: Couldn't modify SRQ limit
>   at line 995 in file viainit.c
> mpirun_rsh: Abort signaled from [1]
> [0] Abort: [mig125:0] Got completion with error, code=12
>   at line 2143 in file viacheck.c
> done.
>
> I am using OFED-1.0-pre1 (kernel modules are from OFED-1.0-pre1 also)
> OS is SLES10 SUSE Linux Enterprise Server 10 (ia64) VERSION = 10
>
> HW is SGI Altix ia64
>
> Can anyone help please ?
>
> Thanks
> John
>
>   
I guess you use older FW version. See in osu_mpi release notes:

- For users of Mellanox Technologies firmware fw-23108 or fw-25208 only:
  OSU MPI may fail in its default configuration if your HCA is burnt with an
  fw-23108 version that is earlier than 3.4.000, or with an fw-25208 version
  4.7.400 or earlier.
  Workaround:
  Option 1 - Update the firmware.
  Option 2 - In mvapich.conf, set VIADEV_SRQ_ENABLE=0


Tziporet

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] OFED 1.0-pre 1 build issues.

2006-06-20 Thread Tziporet Koren
Paul wrote:
> Michael,
>  I performed the same work-around in bash (not so good with perl 
> these days) it gets past the prior point. Thanks. Should something 
> that takes care of this be included in the build.sh or build_env.sh 
> scripts ? We would certainly need it covered in the docs at least.
>
> Now the build is dying on some undefined references. (log attached)
>
> Regards.
>

I will ask Vlad to look into it.

Tziporet

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] dapltest gets segfaulted in librdmacm init

2006-06-20 Thread Or Gerlitz
James Lentini wrote:
> I don't see this.
> 
> The gdb sharedlibrary output looks suspicious. /usr/local/ib isn't a 
> standard path for our binaries.

I have added --prefix=/usr/local/ib to the configure input, we do it all 
the time to test multiple things.

Or.


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] dapltest gets segfaulted in librdmacm init

2006-06-20 Thread Or Gerlitz
Arlin Davis wrote:
> Or Gerlitz wrote:
> 
>> After fixing the ucma/port space issue with the calls to rdma_create_id i
>> am now trying to run
>>
>> $ ./Target/dapltest -T S -D OpenIB-cma
>>
>> and getting an immediate segfault with the below trace, any idea?
>>  
>>
> Hmm, no idea. I just updated to 8112 and everything runs fine for me 
> (2.6.17).  

OK, sorry, i suspect to had some inconsistency between libibverbs and 
libmthca, recompiling & installing them things now work fine.

Or.


___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general



Re: [openib-general] iSER updates

2006-06-20 Thread Or Gerlitz
Or Gerlitz wrote:
> Roland Dreier wrote:
>> However, I had to add the patch below to keep iSER compiling in my
>> tree, since  is now gone from the upstream
>> kernel.  

I see that the patch is applied at the for-mm branch but not at the iser 
  branch, is it fine?

Or.



___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general