* [PATCH][1/6] IB: Keep MAD work completion valid
@ 2005-04-01 18:23 Roland Dreier
2005-04-01 18:23 ` [PATCH][2/6] IB: remove unneeded includes Roland Dreier
0 siblings, 1 reply; 6+ messages in thread
From: Roland Dreier @ 2005-04-01 18:23 UTC (permalink / raw)
To: akpm; +Cc: linux-kernel, openib-general
From: Sean Hefty <sean.hefty@intel.com>
Replace the *wc field in ib_mad_recv_wc from pointing to a structure
on the stack to one allocated with the received MAD buffer. This
allows a client to access the *wc field after their receive completion
handler has returned.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
Signed-off-by: Roland Dreier <roland@topspin.com>
--- linux-export.orig/drivers/infiniband/core/mad.c 2005-03-31 19:07:01.000000000 -0800
+++ linux-export/drivers/infiniband/core/mad.c 2005-04-01 10:08:54.939957801 -0800
@@ -1600,7 +1600,8 @@
DMA_FROM_DEVICE);
/* Setup MAD receive work completion from "normal" work completion */
- recv->header.recv_wc.wc = wc;
+ recv->header.wc = *wc;
+ recv->header.recv_wc.wc = &recv->header.wc;
recv->header.recv_wc.mad_len = sizeof(struct ib_mad);
recv->header.recv_wc.recv_buf.mad = &recv->mad.mad;
recv->header.recv_wc.recv_buf.grh = &recv->grh;
--- linux-export.orig/drivers/infiniband/core/mad_priv.h 2005-03-31 19:07:14.000000000 -0800
+++ linux-export/drivers/infiniband/core/mad_priv.h 2005-04-01 10:08:54.961953027 -0800
@@ -69,6 +69,7 @@
struct ib_mad_private_header {
struct ib_mad_list_head mad_list;
struct ib_mad_recv_wc recv_wc;
+ struct ib_wc wc;
DECLARE_PCI_UNMAP_ADDR(mapping)
} __attribute__ ((packed));
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH][2/6] IB: remove unneeded includes 2005-04-01 18:23 [PATCH][1/6] IB: Keep MAD work completion valid Roland Dreier @ 2005-04-01 18:23 ` Roland Dreier 2005-04-01 18:23 ` [PATCH][3/6] IB: Fix FMR pool crash Roland Dreier 0 siblings, 1 reply; 6+ messages in thread From: Roland Dreier @ 2005-04-01 18:23 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, openib-general From: Hal Rosenstock <halr@voltaire.com> Eliminate no longer needed include files Signed-off-by: Hal Rosenstock <halr@voltaire.com> Signed-off-by: Roland Dreier <roland@topspin.com> --- linux-export.orig/drivers/infiniband/core/mad.c 2005-04-01 10:08:54.939957801 -0800 +++ linux-export/drivers/infiniband/core/mad.c 2005-04-01 10:08:56.473624910 -0800 @@ -33,9 +33,6 @@ */ #include <linux/dma-mapping.h> -#include <linux/interrupt.h> - -#include <ib_mad.h> #include "mad_priv.h" #include "smi.h" ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH][3/6] IB: Fix FMR pool crash 2005-04-01 18:23 ` [PATCH][2/6] IB: remove unneeded includes Roland Dreier @ 2005-04-01 18:23 ` Roland Dreier 2005-04-01 18:23 ` [PATCH][4/6] IB: Trivial FMR printk cleanup Roland Dreier 0 siblings, 1 reply; 6+ messages in thread From: Roland Dreier @ 2005-04-01 18:23 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, openib-general Mask bits correctly from jhash result in ib_fmr_hash() so that the computed bucket index is within our hash table. This fixes an SDP crash. Signed-off-by: Roland Dreier <roland@topspin.com> --- linux-export.orig/drivers/infiniband/core/fmr_pool.c 2005-03-31 19:07:05.000000000 -0800 +++ linux-export/drivers/infiniband/core/fmr_pool.c 2005-04-01 10:08:58.240241456 -0800 @@ -103,9 +103,8 @@ static inline u32 ib_fmr_hash(u64 first_page) { - return jhash_2words((u32) first_page, - (u32) (first_page >> 32), - 0); + return jhash_2words((u32) first_page, (u32) (first_page >> 32), 0) & + (IB_FMR_HASH_SIZE - 1); } /* Caller must hold pool_lock */ ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH][4/6] IB: Trivial FMR printk cleanup 2005-04-01 18:23 ` [PATCH][3/6] IB: Fix FMR pool crash Roland Dreier @ 2005-04-01 18:23 ` Roland Dreier 2005-04-01 18:23 ` [PATCH][5/6] IB: Fix user MAD registrations with class 0 Roland Dreier 0 siblings, 1 reply; 6+ messages in thread From: Roland Dreier @ 2005-04-01 18:23 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, openib-general From: Libor Michalek <libor@topspin.com> Add missing newline in printk. Signed-off-by: Libor Michalek <libor@topspin.com> Signed-off-by: Roland Dreier <roland@topspin.com> --- linux-export.orig/drivers/infiniband/core/fmr_pool.c 2005-04-01 10:08:58.240241456 -0800 +++ linux-export/drivers/infiniband/core/fmr_pool.c 2005-04-01 10:08:59.539959345 -0800 @@ -442,7 +442,7 @@ list_add(&fmr->list, &pool->free_list); spin_unlock_irqrestore(&pool->pool_lock, flags); - printk(KERN_WARNING "fmr_map returns %d", + printk(KERN_WARNING "fmr_map returns %d\n", result); return ERR_PTR(result); ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH][5/6] IB: Fix user MAD registrations with class 0 2005-04-01 18:23 ` [PATCH][4/6] IB: Trivial FMR printk cleanup Roland Dreier @ 2005-04-01 18:23 ` Roland Dreier 2005-04-01 18:23 ` [PATCH][6/6] IB: Remove incorrect comments Roland Dreier 0 siblings, 1 reply; 6+ messages in thread From: Roland Dreier @ 2005-04-01 18:23 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, openib-general Fix handling of MAD agent registrations with mgmt_class == 0. In this case ib_umad should pass a NULL registration request to the MAD core rather than a request with mgmt_class set to 0. Signed-off-by: Roland Dreier <roland@topspin.com> --- linux-export.orig/drivers/infiniband/core/user_mad.c 2005-03-31 19:06:42.000000000 -0800 +++ linux-export/drivers/infiniband/core/user_mad.c 2005-04-01 10:09:01.250588043 -0800 @@ -389,15 +389,17 @@ goto out; found: - req.mgmt_class = ureq.mgmt_class; - req.mgmt_class_version = ureq.mgmt_class_version; - memcpy(req.method_mask, ureq.method_mask, sizeof req.method_mask); - memcpy(req.oui, ureq.oui, sizeof req.oui); + if (ureq.mgmt_class) { + req.mgmt_class = ureq.mgmt_class; + req.mgmt_class_version = ureq.mgmt_class_version; + memcpy(req.method_mask, ureq.method_mask, sizeof req.method_mask); + memcpy(req.oui, ureq.oui, sizeof req.oui); + } agent = ib_register_mad_agent(file->port->ib_dev, file->port->port_num, ureq.qpn ? IB_QPT_GSI : IB_QPT_SMI, - &req, 0, send_handler, recv_handler, - file); + ureq.mgmt_class ? &req : NULL, + 0, send_handler, recv_handler, file); if (IS_ERR(agent)) { ret = PTR_ERR(agent); goto out; ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH][6/6] IB: Remove incorrect comments 2005-04-01 18:23 ` [PATCH][5/6] IB: Fix user MAD registrations with class 0 Roland Dreier @ 2005-04-01 18:23 ` Roland Dreier 0 siblings, 0 replies; 6+ messages in thread From: Roland Dreier @ 2005-04-01 18:23 UTC (permalink / raw) To: akpm; +Cc: linux-kernel, openib-general From: Hal Rosenstock <halr@voltaire.com> Eliminate unneeded and misleading comments Signed-off-by: Hal Rosenstock <halr@voltaire.com> Signed-off-by: Roland Dreier <roland@topspin.com> --- linux-export.orig/drivers/infiniband/core/agent.c 2005-03-31 19:06:48.000000000 -0800 +++ linux-export/drivers/infiniband/core/agent.c 2005-04-01 10:09:02.621290525 -0800 @@ -129,7 +129,6 @@ goto out; agent_send_wr->mad = mad_priv; - /* PCI mapping */ gather_list.addr = dma_map_single(mad_agent->device->dma_device, &mad_priv->mad, sizeof(mad_priv->mad), @@ -261,7 +260,6 @@ list_del(&agent_send_wr->send_list); spin_unlock_irqrestore(&port_priv->send_list_lock, flags); - /* Unmap PCI */ dma_unmap_single(mad_agent->device->dma_device, pci_unmap_addr(agent_send_wr, mapping), sizeof(agent_send_wr->mad->mad), --- linux-export.orig/drivers/infiniband/core/mad.c 2005-04-01 10:08:56.473624910 -0800 +++ linux-export/drivers/infiniband/core/mad.c 2005-04-01 10:09:02.768258624 -0800 @@ -2283,7 +2283,6 @@ /* Remove from posted receive MAD list */ list_del(&mad_list->list); - /* Undo PCI mapping */ dma_unmap_single(qp_info->port_priv->device->dma_device, pci_unmap_addr(&recv->header, mapping), sizeof(struct ib_mad_private) - ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-04-01 18:51 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-04-01 18:23 [PATCH][1/6] IB: Keep MAD work completion valid Roland Dreier 2005-04-01 18:23 ` [PATCH][2/6] IB: remove unneeded includes Roland Dreier 2005-04-01 18:23 ` [PATCH][3/6] IB: Fix FMR pool crash Roland Dreier 2005-04-01 18:23 ` [PATCH][4/6] IB: Trivial FMR printk cleanup Roland Dreier 2005-04-01 18:23 ` [PATCH][5/6] IB: Fix user MAD registrations with class 0 Roland Dreier 2005-04-01 18:23 ` [PATCH][6/6] IB: Remove incorrect comments Roland Dreier
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®