[openib-general] [PATCH RFC 16/21] ofed_1_2 Backport infinband/hw/cxgb3/iwch_cm.[ch] to sles9sp3

Steve WIse swise at opengridcomputing.com
Tue Jan 16 06:11:34 PST 2007


On Tue, 2007-01-16 at 10:06 +0200, Michael S. Tsirkin wrote:
> > Quoting Steve Wise <swise at opengridcomputing.com>:
> > Subject: [PATCH  RFC 16/21] ofed_1_2 Backport infinband/hw/cxgb3/iwch_cm.[ch] to sles9sp3
> > 
> > 
> > Backport infinband/hw/cxgb3/iwch_cm.[ch] to sles9sp3
> > 
> > Signed-off-by: Steve Wise <swise at opengridcomputing.com>
> > ---
> > 
> >  .../2.6.5_sles9_sp3/iwch_cm_to_2_6_5-7_244.patch   |   35 +++++++++++++++++++++++
> >  1 files changed, 35 insertions(+), 0 deletions(-)
> > 
> > diff --git a/kernel_patches/backport/2.6.5_sles9_sp3/iwch_cm_to_2_6_5-7_244.patch b/kernel_patches/backport/2.6.5_sles9_sp3/iwch_cm_to_2_6_5-7_244.patch
> > new file mode 100644
> > index 0000000..af468f7
> > --- /dev/null
> > +++ b/kernel_patches/backport/2.6.5_sles9_sp3/iwch_cm_to_2_6_5-7_244.patch
> > @@ -0,0 +1,35 @@
> > +diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
> > +index 3237fc8..2a38953 100644
> > +--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
> > ++++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
> > +@@ -234,7 +234,7 @@ static void *alloc_ep(int size, gfp_t gf
> > + 	epc = kmalloc(size, gfp);
> > + 	if (epc) {
> > + 		memset(epc, 0, size);
> > +-		kref_init(&epc->kref);
> > ++		kref_init(&epc->kref, __free_ep);
> > + 		spin_lock_init(&epc->lock);
> > + 		init_waitqueue_head(&epc->waitq);
> > + 	}
> > +@@ -338,7 +338,7 @@ static struct rtable *find_route(struct 
> > + 			  }
> > + 	};
> > + 
> > +-	if (ip_route_output_flow(&rt, &fl, NULL, 0))
> > ++	if (ip_route_output_key(&rt, &fl))
> > + 		return NULL;
> > + 	return rt;
> > + }
> > +diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.h b/drivers/infiniband/hw/cxgb3/iwch_cm.h
> > +index 893f9d0..e54e202 100644
> > +--- a/drivers/infiniband/hw/cxgb3/iwch_cm.h
> > ++++ b/drivers/infiniband/hw/cxgb3/iwch_cm.h
> > +@@ -57,7 +57,7 @@ #define MPA_FLAGS_MASK		0xE0
> > + #define put_ep(ep) { \
> > + 	PDBG("put_ep (via %s:%u) ep %p refcnt %d\n", __FUNCTION__, __LINE__,  \
> > + 	     ep, atomic_read(&((ep)->kref.refcount))); \
> > +-	kref_put(&((ep)->kref), __free_ep); \
> > ++	kref_put(&((ep)->kref)); \
> > + }
> > + 
> > + #define get_ep(ep) { \
> 
> It's not easy to do something abou t kref_put (we'd need to define our own struct
> for it, like we did for work_struct).
> But surely ip_route_output_key can just be a macro in kernel_addons?
> 

It could, but I was worried that if we did that and someone used it
expecting the sock and flags parameters to mean something, then they'd
get hosed.  

And since the kref stuff was already being patched, I just went ahead
and used ip_route_output_key directly.

But I'll go ahead and add a ip_route_output_flow() backport.  





More information about the general mailing list