Re: [openib-general] [PATCH RFC 04/10] ofed_1_2 Chelsio backport to 2.6.16

2007-01-18 Thread Vladimir Sokolovsky
Applied.

Regards,
Vladimir

On Wed, 2007-01-17 at 13:49 -0600, Steve Wise wrote:
 Chelsio backport to 2.6.16
 
 Signed-off-by: Steve Wise [EMAIL PROTECTED]
 ---
 
  .../backport/2.6.16/include/linux/genalloc.h   |   42 +
  .../backport/2.6.16/include/linux/interrupt.h  |   17 ++
  .../backport/2.6.16/include/linux/netdevice.h  |4 
  .../backport/2.6.16/include/linux/random.h |   15 ++
  .../backport/2.6.16/include/linux/skbuff.h |3 
  .../backport/2.6.16/include/linux/workqueue.h  |9 +
  .../backport/2.6.16/include/net/netevent.h |   33 
  .../backport/2.6.16/include/src/genalloc.c |  198 
 +++
  .../backport/2.6.16/include/src/netevent.c |   71 
  .../backport/2.6.16/cxgb3_makefile_to_2_6_19.patch |   12 +
  .../backport/2.6.16/linux_stuff_to_2_6_17.patch|   24 +++
  11 files changed, 427 insertions(+), 1 deletions(-)
 
 diff --git a/kernel_addons/backport/2.6.16/include/linux/genalloc.h 
 b/kernel_addons/backport/2.6.16/include/linux/genalloc.h
 new file mode 100644
 index 000..3c23c68
 --- /dev/null
 +++ b/kernel_addons/backport/2.6.16/include/linux/genalloc.h
 @@ -0,0 +1,42 @@
 +/*
 + * Basic general purpose allocator for managing special purpose memory
 + * not managed by the regular kmalloc/kfree interface.
 + * Uses for this includes on-device special memory, uncached memory
 + * etc.
 + *
 + * This source code is licensed under the GNU General Public License,
 + * Version 2.  See the file COPYING for more details.
 + */
 +
 +
 +/*
 + *  General purpose special memory pool descriptor.
 + */
 +struct gen_pool {
 + rwlock_t lock;
 + struct list_head chunks;/* list of chunks in this pool */
 + int min_alloc_order;/* minimum allocation order */
 +};
 +
 +/*
 + *  General purpose special memory pool chunk descriptor.
 + */
 +struct gen_pool_chunk {
 + spinlock_t lock;
 + struct list_head next_chunk;/* next chunk in pool */
 + unsigned long start_addr;   /* starting address of memory chunk */
 + unsigned long end_addr; /* ending address of memory chunk */
 + unsigned long bits[0];  /* bitmap for allocating memory chunk */
 +};
 +
 +extern struct gen_pool *ib_gen_pool_create(int, int);
 +extern int ib_gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
 +extern void ib_gen_pool_destroy(struct gen_pool *);
 +extern unsigned long ib_gen_pool_alloc(struct gen_pool *, size_t);
 +extern void ib_gen_pool_free(struct gen_pool *, unsigned long, size_t);
 +
 +#define gen_pool_create ib_gen_pool_create
 +#define gen_pool_add ib_gen_pool_add
 +#define gen_pool_destroy ib_gen_pool_destroy
 +#define gen_pool_alloc ib_gen_pool_alloc
 +#define gen_pool_free ib_gen_pool_free
 diff --git a/kernel_addons/backport/2.6.16/include/linux/interrupt.h 
 b/kernel_addons/backport/2.6.16/include/linux/interrupt.h
 new file mode 100644
 index 000..66e66a9
 --- /dev/null
 +++ b/kernel_addons/backport/2.6.16/include/linux/interrupt.h
 @@ -0,0 +1,17 @@
 +#ifndef BACKPORT_LINUX_INTERRUPT_TO_2_6_18
 +#define BACKPORT_LINUX_INTERRUPT_TO_2_6_18
 +#include_next linux/interrupt.h
 +
 +static inline int 
 +backport_request_irq(unsigned int irq,
 + irqreturn_t (*handler)(int, void *),
 + unsigned long flags, const char *dev_name, void *dev_id)
 +{
 + return request_irq(irq, 
 +(irqreturn_t (*)(int, void *, struct pt_regs 
 *))handler, 
 +flags, dev_name, dev_id);
 +}
 +
 +#define request_irq backport_request_irq
 +
 +#endif
 diff --git a/kernel_addons/backport/2.6.16/include/linux/netdevice.h 
 b/kernel_addons/backport/2.6.16/include/linux/netdevice.h
 index 5641019..225eeda 100644
 --- a/kernel_addons/backport/2.6.16/include/linux/netdevice.h
 +++ b/kernel_addons/backport/2.6.16/include/linux/netdevice.h
 @@ -15,4 +15,8 @@ static inline void netif_tx_unlock(struc
   spin_unlock(dev-xmit_lock);
  }
  
 +#undef SET_ETHTOOL_OPS
 +#define SET_ETHTOOL_OPS(netdev, ops) \
 + (netdev)-ethtool_ops = (struct ethtool_ops *)(ops)
 +
  #endif
 diff --git a/kernel_addons/backport/2.6.16/include/linux/random.h 
 b/kernel_addons/backport/2.6.16/include/linux/random.h
 new file mode 100644
 index 000..2ea2e1f
 --- /dev/null
 +++ b/kernel_addons/backport/2.6.16/include/linux/random.h
 @@ -0,0 +1,15 @@
 +#ifndef BACKPORT_LINUX_RANDOM_TO_2_6_18
 +#define BACKPORT_LINUX_RANDOM_TO_2_6_18
 +#include_next linux/random.h
 +
 +static inline u32 backport_random32(void)
 +{
 + u32 v;
 +
 + get_random_bytes(v, sizeof(u32));
 + return v;
 +}
 +
 +#define random32 backport_random32
 +
 +#endif
 diff --git a/kernel_addons/backport/2.6.16/include/linux/skbuff.h 
 b/kernel_addons/backport/2.6.16/include/linux/skbuff.h
 index 4845283..70bf011 100644
 --- a/kernel_addons/backport/2.6.16/include/linux/skbuff.h
 +++ 

[openib-general] [PATCH RFC 04/10] ofed_1_2 Chelsio backport to 2.6.16

2007-01-17 Thread Steve Wise

Chelsio backport to 2.6.16

Signed-off-by: Steve Wise [EMAIL PROTECTED]
---

 .../backport/2.6.16/include/linux/genalloc.h   |   42 +
 .../backport/2.6.16/include/linux/interrupt.h  |   17 ++
 .../backport/2.6.16/include/linux/netdevice.h  |4 
 .../backport/2.6.16/include/linux/random.h |   15 ++
 .../backport/2.6.16/include/linux/skbuff.h |3 
 .../backport/2.6.16/include/linux/workqueue.h  |9 +
 .../backport/2.6.16/include/net/netevent.h |   33 
 .../backport/2.6.16/include/src/genalloc.c |  198 
+++
 .../backport/2.6.16/include/src/netevent.c |   71 
 .../backport/2.6.16/cxgb3_makefile_to_2_6_19.patch |   12 +
 .../backport/2.6.16/linux_stuff_to_2_6_17.patch|   24 +++
 11 files changed, 427 insertions(+), 1 deletions(-)

diff --git a/kernel_addons/backport/2.6.16/include/linux/genalloc.h 
b/kernel_addons/backport/2.6.16/include/linux/genalloc.h
new file mode 100644
index 000..3c23c68
--- /dev/null
+++ b/kernel_addons/backport/2.6.16/include/linux/genalloc.h
@@ -0,0 +1,42 @@
+/*
+ * Basic general purpose allocator for managing special purpose memory
+ * not managed by the regular kmalloc/kfree interface.
+ * Uses for this includes on-device special memory, uncached memory
+ * etc.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2.  See the file COPYING for more details.
+ */
+
+
+/*
+ *  General purpose special memory pool descriptor.
+ */
+struct gen_pool {
+   rwlock_t lock;
+   struct list_head chunks;/* list of chunks in this pool */
+   int min_alloc_order;/* minimum allocation order */
+};
+
+/*
+ *  General purpose special memory pool chunk descriptor.
+ */
+struct gen_pool_chunk {
+   spinlock_t lock;
+   struct list_head next_chunk;/* next chunk in pool */
+   unsigned long start_addr;   /* starting address of memory chunk */
+   unsigned long end_addr; /* ending address of memory chunk */
+   unsigned long bits[0];  /* bitmap for allocating memory chunk */
+};
+
+extern struct gen_pool *ib_gen_pool_create(int, int);
+extern int ib_gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
+extern void ib_gen_pool_destroy(struct gen_pool *);
+extern unsigned long ib_gen_pool_alloc(struct gen_pool *, size_t);
+extern void ib_gen_pool_free(struct gen_pool *, unsigned long, size_t);
+
+#define gen_pool_create ib_gen_pool_create
+#define gen_pool_add ib_gen_pool_add
+#define gen_pool_destroy ib_gen_pool_destroy
+#define gen_pool_alloc ib_gen_pool_alloc
+#define gen_pool_free ib_gen_pool_free
diff --git a/kernel_addons/backport/2.6.16/include/linux/interrupt.h 
b/kernel_addons/backport/2.6.16/include/linux/interrupt.h
new file mode 100644
index 000..66e66a9
--- /dev/null
+++ b/kernel_addons/backport/2.6.16/include/linux/interrupt.h
@@ -0,0 +1,17 @@
+#ifndef BACKPORT_LINUX_INTERRUPT_TO_2_6_18
+#define BACKPORT_LINUX_INTERRUPT_TO_2_6_18
+#include_next linux/interrupt.h
+
+static inline int 
+backport_request_irq(unsigned int irq,
+ irqreturn_t (*handler)(int, void *),
+ unsigned long flags, const char *dev_name, void *dev_id)
+{
+   return request_irq(irq, 
+  (irqreturn_t (*)(int, void *, struct pt_regs 
*))handler, 
+  flags, dev_name, dev_id);
+}
+
+#define request_irq backport_request_irq
+
+#endif
diff --git a/kernel_addons/backport/2.6.16/include/linux/netdevice.h 
b/kernel_addons/backport/2.6.16/include/linux/netdevice.h
index 5641019..225eeda 100644
--- a/kernel_addons/backport/2.6.16/include/linux/netdevice.h
+++ b/kernel_addons/backport/2.6.16/include/linux/netdevice.h
@@ -15,4 +15,8 @@ static inline void netif_tx_unlock(struc
spin_unlock(dev-xmit_lock);
 }
 
+#undef SET_ETHTOOL_OPS
+#define SET_ETHTOOL_OPS(netdev, ops) \
+   (netdev)-ethtool_ops = (struct ethtool_ops *)(ops)
+
 #endif
diff --git a/kernel_addons/backport/2.6.16/include/linux/random.h 
b/kernel_addons/backport/2.6.16/include/linux/random.h
new file mode 100644
index 000..2ea2e1f
--- /dev/null
+++ b/kernel_addons/backport/2.6.16/include/linux/random.h
@@ -0,0 +1,15 @@
+#ifndef BACKPORT_LINUX_RANDOM_TO_2_6_18
+#define BACKPORT_LINUX_RANDOM_TO_2_6_18
+#include_next linux/random.h
+
+static inline u32 backport_random32(void)
+{
+   u32 v;
+
+   get_random_bytes(v, sizeof(u32));
+   return v;
+}
+
+#define random32 backport_random32
+
+#endif
diff --git a/kernel_addons/backport/2.6.16/include/linux/skbuff.h 
b/kernel_addons/backport/2.6.16/include/linux/skbuff.h
index 4845283..70bf011 100644
--- a/kernel_addons/backport/2.6.16/include/linux/skbuff.h
+++ b/kernel_addons/backport/2.6.16/include/linux/skbuff.h
@@ -4,5 +4,8 @@ #define LINUX_SKBUFF_H_BACKPORT
 #include_next linux/skbuff.h
 
 #define CHECKSUM_PARTIAL CHECKSUM_HW 
+#define CHECKSUM_COMPLETE CHECKSUM_HW 
+
+#define gso_size