[ewg] [PATCH 1/6] Add 3.1 kernel support

Shawn Bohrer sbohrer at rgmadvisors.com
Wed Dec 7 16:56:50 PST 2011


Signed-off-by: Shawn Bohrer <sbohrer at rgmadvisors.com>
---
 kernel_addons/backport/3.1/include/asm/iomap.h     |    8 +
 .../backport/3.1/core_0010_to_2_6_36.patch         |   13 +
 ...0020_to_2_6_38-net-get-rid-of-rtable-idev.patch |   61 +
 .../backport/3.1/core_0030_to_2_6_39.patch         |   67 +
 .../backport/3.1/cxgb3_0010_to_2_6_32.patch        |   12 +
 .../backport/3.1/cxgb3_0020_to_2_6_36.patch        |  104 ++
 .../backport/3.1/cxgb3_0030_to_2_6_39.patch        |   13 +
 .../backport/3.1/cxgb3_0040_to_3.0.patch           |   13 +
 .../backport/3.1/ehca-010-remove_driver_data.patch |   60 +
 .../backport/3.1/ehca-020-fix_buswalk.patch        |   17 +
 .../ipoib_0010_unset_IFF_XMIT_DST_RELEASE.patch    |   24 +
 .../backport/3.1/ipoib_0020_to_2_6_34.patch        |   24 +
 .../backport/3.1/ipoib_0030_to_2.6.35.patch        |   44 +
 .../backport/3.1/ipoib_0040_to_2.6.35.patch        |   51 +
 .../backport/3.1/iw_cxgb3_to_2.6.33.patch          |  238 +++
 .../backport/3.1/iw_cxgb3_to_2.6.36.patch          |   21 +
 .../backport/3.1/iw_cxgb3_to_2.6.39.patch          |   33 +
 kernel_patches/backport/3.1/iw_cxgb3_to_3.0.patch  |   15 +
 .../backport/3.1/iw_cxgb4_0020_mpav2.patch         |   59 +
 .../backport/3.1/iw_cxgb4_to_2.6.39.patch          |   13 +
 .../backport/3.1/iw_nes_0700_to_2_6_33.patch       |   38 +
 .../backport/3.1/iw_nes_0710_to_2_6_35.patch       |  281 ++++
 .../backport/3.1/iw_nes_0720_to_2_6_36.patch       |   11 +
 .../backport/3.1/iw_nes_0730_to_2_6_39.patch       |   22 +
 .../backport/3.1/mlx4_0010_for_2_6_33.patch        |   12 +
 .../backport/3.1/mlx4_0020_for_2.6.35.patch        |   22 +
 .../backport/3.1/mlx4_0030_for_2.6.35.patch        |   37 +
 .../backport/3.1/mlx4_en_0010_for_2_6_35.patch     |  146 ++
 .../backport/3.1/mlx4_en_0030_lro_backport.patch   |  864 +++++++++++
 .../backport/3.1/mlx4_en_0040_to_2_6_37.patch      |   22 +
 .../backport/3.1/mlx4_semaphore_include.patch      |   14 +
 .../backport/3.1/mthca_0010_for_2.6.35.patch       |   51 +
 .../backport/3.1/net_skb-dst_accessors.patch       |  149 ++
 .../backport/3.1/new_frags_interface.patch         |  131 ++
 kernel_patches/backport/3.1/qib_to_3.0.patch       |  102 ++
 .../backport/3.1/rds_0010_for_2_6_33.patch         |  231 +++
 .../backport/3.1/rds_0020_to_2.6.35.patch          |   52 +
 .../backport/3.1/rds_0030_to_2.6.36.patch          |   59 +
 .../backport/3.1/rds_0040_to_2.6.39.patch          |   41 +
 .../backport/3.1/sdp_0160_fix_sdp_proto.patch      |   13 +
 .../backport/3.1/sdp_0170_to_2_6_33.patch          |   23 +
 .../backport/3.1/sdp_0180_for_2.6.35.patch         |  215 +++
 .../backport/3.1/sdp_0190_for_2.6.36.patch         |  136 ++
 .../backport/3.1/sdp_0200_for_2_6_38.patch         |  106 ++
 .../backport/3.1/sysfs_0010_to_2_6_32.patch        |   14 +
 .../backport/3.1/ucm_0010_to_2_6_32.patch          |   61 +
 .../backport/3.1/user_mad_mutex_init.patch         |   15 +
 .../backport/3.1/uverbs_0010_to_2_6_33.patch       |   34 +
 .../backport/3.1/uverbs_0020_to_2_6_35.patch       |   68 +
 ...pdate-gfp.h-and-slab.h-includes-to-2_6_34.patch | 1523 ++++++++++++++++++++
 ...7-switch-infiniband-uverbs-to-anon_inodes.patch |  256 ++++
 ofed_scripts/get_backport_dir.sh                   |    3 +
 52 files changed, 5642 insertions(+), 0 deletions(-)
 create mode 100644 kernel_addons/backport/3.1/include/asm/iomap.h
 create mode 100644 kernel_patches/backport/3.1/core_0010_to_2_6_36.patch
 create mode 100644 kernel_patches/backport/3.1/core_0020_to_2_6_38-net-get-rid-of-rtable-idev.patch
 create mode 100644 kernel_patches/backport/3.1/core_0030_to_2_6_39.patch
 create mode 100644 kernel_patches/backport/3.1/cxgb3_0010_to_2_6_32.patch
 create mode 100644 kernel_patches/backport/3.1/cxgb3_0020_to_2_6_36.patch
 create mode 100644 kernel_patches/backport/3.1/cxgb3_0030_to_2_6_39.patch
 create mode 100644 kernel_patches/backport/3.1/cxgb3_0040_to_3.0.patch
 create mode 100644 kernel_patches/backport/3.1/ehca-010-remove_driver_data.patch
 create mode 100644 kernel_patches/backport/3.1/ehca-020-fix_buswalk.patch
 create mode 100644 kernel_patches/backport/3.1/ipoib_0010_unset_IFF_XMIT_DST_RELEASE.patch
 create mode 100644 kernel_patches/backport/3.1/ipoib_0020_to_2_6_34.patch
 create mode 100644 kernel_patches/backport/3.1/ipoib_0030_to_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/ipoib_0040_to_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/iw_cxgb3_to_2.6.33.patch
 create mode 100644 kernel_patches/backport/3.1/iw_cxgb3_to_2.6.36.patch
 create mode 100644 kernel_patches/backport/3.1/iw_cxgb3_to_2.6.39.patch
 create mode 100644 kernel_patches/backport/3.1/iw_cxgb3_to_3.0.patch
 create mode 100644 kernel_patches/backport/3.1/iw_cxgb4_0020_mpav2.patch
 create mode 100644 kernel_patches/backport/3.1/iw_cxgb4_to_2.6.39.patch
 create mode 100644 kernel_patches/backport/3.1/iw_nes_0700_to_2_6_33.patch
 create mode 100644 kernel_patches/backport/3.1/iw_nes_0710_to_2_6_35.patch
 create mode 100644 kernel_patches/backport/3.1/iw_nes_0720_to_2_6_36.patch
 create mode 100644 kernel_patches/backport/3.1/iw_nes_0730_to_2_6_39.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_0010_for_2_6_33.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_0020_for_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_0030_for_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_en_0010_for_2_6_35.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_en_0030_lro_backport.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_en_0040_to_2_6_37.patch
 create mode 100644 kernel_patches/backport/3.1/mlx4_semaphore_include.patch
 create mode 100644 kernel_patches/backport/3.1/mthca_0010_for_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/net_skb-dst_accessors.patch
 create mode 100644 kernel_patches/backport/3.1/new_frags_interface.patch
 create mode 100644 kernel_patches/backport/3.1/qib_to_3.0.patch
 create mode 100644 kernel_patches/backport/3.1/rds_0010_for_2_6_33.patch
 create mode 100644 kernel_patches/backport/3.1/rds_0020_to_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/rds_0030_to_2.6.36.patch
 create mode 100644 kernel_patches/backport/3.1/rds_0040_to_2.6.39.patch
 create mode 100644 kernel_patches/backport/3.1/sdp_0160_fix_sdp_proto.patch
 create mode 100644 kernel_patches/backport/3.1/sdp_0170_to_2_6_33.patch
 create mode 100644 kernel_patches/backport/3.1/sdp_0180_for_2.6.35.patch
 create mode 100644 kernel_patches/backport/3.1/sdp_0190_for_2.6.36.patch
 create mode 100644 kernel_patches/backport/3.1/sdp_0200_for_2_6_38.patch
 create mode 100644 kernel_patches/backport/3.1/sysfs_0010_to_2_6_32.patch
 create mode 100644 kernel_patches/backport/3.1/ucm_0010_to_2_6_32.patch
 create mode 100644 kernel_patches/backport/3.1/user_mad_mutex_init.patch
 create mode 100644 kernel_patches/backport/3.1/uverbs_0010_to_2_6_33.patch
 create mode 100644 kernel_patches/backport/3.1/uverbs_0020_to_2_6_35.patch
 create mode 100644 kernel_patches/backport/3.1/zzz_all_0010-include-cleanup-Update-gfp.h-and-slab.h-includes-to-2_6_34.patch
 create mode 100644 kernel_patches/backport/3.1/zzz_uverbs_0030_to_2_6_37-switch-infiniband-uverbs-to-anon_inodes.patch

diff --git a/kernel_addons/backport/3.1/include/asm/iomap.h b/kernel_addons/backport/3.1/include/asm/iomap.h
new file mode 100644
index 0000000..398b687
--- /dev/null
+++ b/kernel_addons/backport/3.1/include/asm/iomap.h
@@ -0,0 +1,8 @@
+#ifndef __IOMAP__BACKPORT_H_TO_2_6_32___
+#define __IOMAP__BACKPORT_H_TO_2_6_32___
+
+#if !defined(CONFIG_PPC32) && !defined(CONFIG_PPC64)
+#include_next <asm/iomap.h>
+#endif
+
+#endif /* __IOMAP__BACKPORT_H_TO_2_6_32___ */
diff --git a/kernel_patches/backport/3.1/core_0010_to_2_6_36.patch b/kernel_patches/backport/3.1/core_0010_to_2_6_36.patch
new file mode 100644
index 0000000..24a344f
--- /dev/null
+++ b/kernel_patches/backport/3.1/core_0010_to_2_6_36.patch
@@ -0,0 +1,13 @@
+Index: ofed_kernel-2.6.36/drivers/infiniband/core/addr.c
+===================================================================
+--- ofed_kernel-2.6.36.orig/drivers/infiniband/core/addr.c	2010-11-09 10:48:13.891203204 +0200
++++ ofed_kernel-2.6.36/drivers/infiniband/core/addr.c	2010-11-09 10:48:45.332327230 +0200
+@@ -215,7 +215,7 @@
+ 
+ 	neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev);
+ 	if (!neigh || !(neigh->nud_state & NUD_VALID)) {
+-		neigh_event_send(rt->u.dst.neighbour, NULL);
++		neigh_event_send(rt->dst.neighbour, NULL);
+ 		ret = -ENODATA;
+ 		if (neigh)
+ 			goto release;
diff --git a/kernel_patches/backport/3.1/core_0020_to_2_6_38-net-get-rid-of-rtable-idev.patch b/kernel_patches/backport/3.1/core_0020_to_2_6_38-net-get-rid-of-rtable-idev.patch
new file mode 100644
index 0000000..40aa78d
--- /dev/null
+++ b/kernel_patches/backport/3.1/core_0020_to_2_6_38-net-get-rid-of-rtable-idev.patch
@@ -0,0 +1,61 @@
+From 72cdd1d971c0deb1619c5c339270570c43647a78 Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <eric.dumazet at gmail.com>
+Date: Thu, 11 Nov 2010 07:14:07 +0000
+Subject: [PATCH] net: get rid of rtable->idev
+
+It seems idev field in struct rtable has no special purpose, but adding
+extra atomic ops.
+
+We hold refcounts on the device itself (using percpu data, so pretty
+cheap in current kernel).
+
+infiniband case is solved using dst.dev instead of idev->dev
+
+Removal of this field means routing without route cache is now using
+shared data, percpu data, and only potential contention is a pair of
+atomic ops on struct neighbour per forwarded packet.
+
+About 5% speedup on routing test.
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Cc: Herbert Xu <herbert at gondor.apana.org.au>
+Cc: Roland Dreier <rolandd at cisco.com>
+Cc: Sean Hefty <sean.hefty at intel.com>
+Cc: Hal Rosenstock <hal.rosenstock at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/infiniband/core/addr.c |    8 ++++----
+ 1 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
+index a5ea1bc..c15fd2e 100644
+--- a/drivers/infiniband/core/addr.c
++++ b/drivers/infiniband/core/addr.c
+@@ -200,7 +200,7 @@ static int addr4_resolve(struct sockaddr_in *src_in,
+ 	src_in->sin_family = AF_INET;
+ 	src_in->sin_addr.s_addr = rt->rt_src;
+ 
+-	if (rt->idev->dev->flags & IFF_LOOPBACK) {
++	if (rt->dst.dev->flags & IFF_LOOPBACK) {
+ 		ret = rdma_translate_ip((struct sockaddr *) dst_in, addr);
+ 		if (!ret)
+ 			memcpy(addr->dst_dev_addr, addr->src_dev_addr, MAX_ADDR_LEN);
+@@ -208,12 +208,12 @@ static int addr4_resolve(struct sockaddr_in *src_in,
+ 	}
+ 
+ 	/* If the device does ARP internally, return 'done' */
+-	if (rt->idev->dev->flags & IFF_NOARP) {
+-		rdma_copy_addr(addr, rt->idev->dev, NULL);
++	if (rt->dst.dev->flags & IFF_NOARP) {
++		rdma_copy_addr(addr, rt->dst.dev, NULL);
+ 		goto put;
+ 	}
+ 
+-	neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->idev->dev);
++	neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->dst.dev);
+ 	if (!neigh || !(neigh->nud_state & NUD_VALID)) {
+ 		neigh_event_send(rt->dst.neighbour, NULL);
+ 		ret = -ENODATA;
+-- 
+1.7.0.4
+
diff --git a/kernel_patches/backport/3.1/core_0030_to_2_6_39.patch b/kernel_patches/backport/3.1/core_0030_to_2_6_39.patch
new file mode 100644
index 0000000..a6a32ea
--- /dev/null
+++ b/kernel_patches/backport/3.1/core_0030_to_2_6_39.patch
@@ -0,0 +1,67 @@
+diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
+index 7181742..f38840a 100644
+--- a/drivers/infiniband/core/addr.c
++++ b/drivers/infiniband/core/addr.c
+@@ -183,20 +183,15 @@ static int addr4_resolve(struct sockaddr_in *src_in,
+ {
+ 	__be32 src_ip = src_in->sin_addr.s_addr;
+ 	__be32 dst_ip = dst_in->sin_addr.s_addr;
+-	struct flowi fl;
+ 	struct rtable *rt;
+ 	struct neighbour *neigh;
+ 	int ret;
+ 
+-	memset(&fl, 0, sizeof fl);
+-	fl.nl_u.ip4_u.daddr = dst_ip;
+-	fl.nl_u.ip4_u.saddr = src_ip;
+-	fl.oif = addr->bound_dev_if;
+-
+-	ret = ip_route_output_key(&init_net, &rt, &fl);
+-	if (ret)
++	rt = ip_route_output(&init_net, dst_ip, src_ip, 0, addr->bound_dev_if);
++	if (IS_ERR(rt)) {
++		ret = PTR_ERR(rt);
+ 		goto out;
+-
++	}
+ 	src_in->sin_family = AF_INET;
+ 	src_in->sin_addr.s_addr = rt->rt_src;
+ 
+@@ -236,28 +231,28 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
+ 			 struct sockaddr_in6 *dst_in,
+ 			 struct rdma_dev_addr *addr)
+ {
+-	struct flowi fl;
++	struct flowi6 fl6;
+ 	struct neighbour *neigh;
+ 	struct dst_entry *dst;
+ 	int ret;
+ 
+-	memset(&fl, 0, sizeof fl);
+-	ipv6_addr_copy(&fl.fl6_dst, &dst_in->sin6_addr);
+-	ipv6_addr_copy(&fl.fl6_src, &src_in->sin6_addr);
+-	fl.oif = addr->bound_dev_if;
++	memset(&fl6, 0, sizeof fl6);
++	ipv6_addr_copy(&fl6.daddr, &dst_in->sin6_addr);
++	ipv6_addr_copy(&fl6.saddr, &src_in->sin6_addr);
++	fl6.flowi6_oif = addr->bound_dev_if;
+ 
+-	dst = ip6_route_output(&init_net, NULL, &fl);
++	dst = ip6_route_output(&init_net, NULL, &fl6);
+ 	if ((ret = dst->error))
+ 		goto put;
+ 
+-	if (ipv6_addr_any(&fl.fl6_src)) {
++	if (ipv6_addr_any(&fl6.saddr)) {
+ 		ret = ipv6_dev_get_saddr(&init_net, ip6_dst_idev(dst)->dev,
+-					 &fl.fl6_dst, 0, &fl.fl6_src);
++					 &fl6.daddr, 0, &fl6.saddr);
+ 		if (ret)
+ 			goto put;
+ 
+ 		src_in->sin6_family = AF_INET6;
+-		ipv6_addr_copy(&src_in->sin6_addr, &fl.fl6_src);
++		ipv6_addr_copy(&src_in->sin6_addr, &fl6.saddr);
+ 	}
+ 
+ 	if (dst->dev->flags & IFF_LOOPBACK) {
diff --git a/kernel_patches/backport/3.1/cxgb3_0010_to_2_6_32.patch b/kernel_patches/backport/3.1/cxgb3_0010_to_2_6_32.patch
new file mode 100644
index 0000000..1e782ed
--- /dev/null
+++ b/kernel_patches/backport/3.1/cxgb3_0010_to_2_6_32.patch
@@ -0,0 +1,12 @@
+Index: ofed_kernel/drivers/infiniband/hw/cxgb3/iwch.h
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/hw/cxgb3/iwch.h	2009-12-16 16:37:11.000000000 +0200
++++ ofed_kernel/drivers/infiniband/hw/cxgb3/iwch.h	2009-12-17 10:59:44.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/spinlock.h>
+ #include <linux/idr.h>
+ #include <linux/workqueue.h>
++#include <linux/sched.h>
+ 
+ #include <rdma/ib_verbs.h>
+ 
diff --git a/kernel_patches/backport/3.1/cxgb3_0020_to_2_6_36.patch b/kernel_patches/backport/3.1/cxgb3_0020_to_2_6_36.patch
new file mode 100644
index 0000000..217448d
--- /dev/null
+++ b/kernel_patches/backport/3.1/cxgb3_0020_to_2_6_36.patch
@@ -0,0 +1,104 @@
+diff -rup old/drivers/net/cxgb3/common.h new/drivers/net/cxgb3/common.h
+--- old/drivers/net/cxgb3/common.h	2011-01-31 12:19:37.000000000 -0600
++++ new/drivers/net/cxgb3/common.h	2011-01-31 12:20:05.000000000 -0600
+@@ -81,18 +81,6 @@ static inline void init_rx_mode(struct t
+ 	p->idx = 0;
+ }
+ 
+-static inline u8 *t3_get_next_mcaddr(struct t3_rx_mode *rm)
+-{
+-	u8 *addr = NULL;
+-
+-	if (rm->mclist && rm->idx < rm->dev->mc_count) {
+-		addr = rm->mclist->dmi_addr;
+-		rm->mclist = rm->mclist->next;
+-		rm->idx++;
+-	}
+-	return addr;
+-}
+-
+ enum {
+ 	MAX_NPORTS = 2,		/* max # of ports */
+ 	MAX_FRAME_SIZE = 10240,	/* max MAC frame size, including header + FCS */
+@@ -755,7 +743,7 @@ void t3_mac_enable_exact_filters(struct cmac *mac);
+ int t3_mac_enable(struct cmac *mac, int which);
+ int t3_mac_disable(struct cmac *mac, int which);
+ int t3_mac_set_mtu(struct cmac *mac, unsigned int mtu);
+-int t3_mac_set_rx_mode(struct cmac *mac, struct t3_rx_mode *rm);
++int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev);
+ int t3_mac_set_address(struct cmac *mac, unsigned int idx, u8 addr[6]);
+ int t3_mac_set_num_ucast(struct cmac *mac, int n);
+ const struct mac_stats *t3_mac_update_stats(struct cmac *mac);
+diff -rup old/drivers/net/cxgb3/cxgb3_main.c new/drivers/net/cxgb3/cxgb3_main.c
+--- old/drivers/net/cxgb3/cxgb3_main.c	2011-01-31 12:19:38.000000000 -0600
++++ new/drivers/net/cxgb3/cxgb3_main.c	2011-01-31 12:20:05.000000000 -0600
+@@ -325,11 +325,9 @@ void t3_os_phymod_changed(struct adapter
+ 
+ static void cxgb_set_rxmode(struct net_device *dev)
+ {
+-	struct t3_rx_mode rm;
+ 	struct port_info *pi = netdev_priv(dev);
+ 
+-	init_rx_mode(&rm, dev, dev->mc_list);
+-	t3_mac_set_rx_mode(&pi->mac, &rm);
++	t3_mac_set_rx_mode(&pi->mac, dev);
+ }
+ 
+ /**
+@@ -340,15 +338,13 @@ static void cxgb_set_rxmode(struct net_d
+  */
+ static void link_start(struct net_device *dev)
+ {
+-	struct t3_rx_mode rm;
+ 	struct port_info *pi = netdev_priv(dev);
+ 	struct cmac *mac = &pi->mac;
+ 
+-	init_rx_mode(&rm, dev, dev->mc_list);
+ 	t3_mac_reset(mac);
+ 	t3_mac_set_mtu(mac, dev->mtu);
+ 	t3_mac_set_address(mac, 0, dev->dev_addr);
+-	t3_mac_set_rx_mode(mac, &rm);
++	t3_mac_set_rx_mode(mac, dev);
+ 	t3_link_start(&pi->phy, mac, &pi->link_config);
+ 	t3_mac_enable(mac, MAC_DIRECTION_RX | MAC_DIRECTION_TX);
+ }
+diff -rup old/drivers/net/cxgb3/xgmac.c new/drivers/net/cxgb3/xgmac.c
+--- old/drivers/net/cxgb3/xgmac.c	2011-01-31 12:19:37.000000000 -0600
++++ new/drivers/net/cxgb3/xgmac.c	2011-01-31 12:20:05.000000000 -0600
+@@ -297,29 +297,29 @@ static int hash_hw_addr(const u8 * addr)
+ 	return hash;
+ }
+ 
+-int t3_mac_set_rx_mode(struct cmac *mac, struct t3_rx_mode *rm)
++int t3_mac_set_rx_mode(struct cmac *mac, struct net_device *dev)
+ {
+ 	u32 val, hash_lo, hash_hi;
+ 	struct adapter *adap = mac->adapter;
+ 	unsigned int oft = mac->offset;
+ 
+ 	val = t3_read_reg(adap, A_XGM_RX_CFG + oft) & ~F_COPYALLFRAMES;
+-	if (rm->dev->flags & IFF_PROMISC)
++	if (dev->flags & IFF_PROMISC)
+ 		val |= F_COPYALLFRAMES;
+ 	t3_write_reg(adap, A_XGM_RX_CFG + oft, val);
+ 
+-	if (rm->dev->flags & IFF_ALLMULTI)
++	if (dev->flags & IFF_ALLMULTI)
+ 		hash_lo = hash_hi = 0xffffffff;
+ 	else {
+-		u8 *addr;
++		struct netdev_hw_addr *ha;
+ 		int exact_addr_idx = mac->nucast;
+ 
+ 		hash_lo = hash_hi = 0;
+-		while ((addr = t3_get_next_mcaddr(rm)))
++		netdev_for_each_mc_addr(ha, dev)
+ 			if (exact_addr_idx < EXACT_ADDR_FILTERS)
+-				set_addr_filter(mac, exact_addr_idx++, addr);
++				set_addr_filter(mac, exact_addr_idx++, ha->addr);
+ 			else {
+-				int hash = hash_hw_addr(addr);
++				int hash = hash_hw_addr(ha->addr);
+ 
+ 				if (hash < 32)
+ 					hash_lo |= (1 << hash);
diff --git a/kernel_patches/backport/3.1/cxgb3_0030_to_2_6_39.patch b/kernel_patches/backport/3.1/cxgb3_0030_to_2_6_39.patch
new file mode 100644
index 0000000..6c02883
--- /dev/null
+++ b/kernel_patches/backport/3.1/cxgb3_0030_to_2_6_39.patch
@@ -0,0 +1,13 @@
+diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
+index 75064ee..630fddf 100644
+--- a/drivers/net/cxgb3/cxgb3_offload.c
++++ b/drivers/net/cxgb3/cxgb3_offload.c
+@@ -963,8 +963,6 @@ static int nb_callback(struct notifier_block *self, unsigned long event,
+ 		cxgb_neigh_update((struct neighbour *)ctx);
+ 		break;
+ 	}
+-	case (NETEVENT_PMTU_UPDATE):
+-		break;
+ 	case (NETEVENT_REDIRECT):{
+ 		struct netevent_redirect *nr = ctx;
+ 		cxgb_redirect(nr->old, nr->new);
diff --git a/kernel_patches/backport/3.1/cxgb3_0040_to_3.0.patch b/kernel_patches/backport/3.1/cxgb3_0040_to_3.0.patch
new file mode 100644
index 0000000..4058e42
--- /dev/null
+++ b/kernel_patches/backport/3.1/cxgb3_0040_to_3.0.patch
@@ -0,0 +1,13 @@
+diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
+index 75064ee..630fddf 100644
+--- a/drivers/net/cxgb3/cxgb3_main.c
++++ b/drivers/net/cxgb3/cxgb3_main.c
+@@ -2036,7 +2036,7 @@ static const struct ethtool_ops cxgb_eth
+        .set_sg = ethtool_op_set_sg,
+        .get_link = ethtool_op_get_link,
+        .get_strings = get_strings,
+-       .phys_id = cxgb3_phys_id,
++       .set_phys_id = cxgb3_phys_id,
+        .nway_reset = restart_autoneg,
+        .get_sset_count = get_sset_count,
+        .get_ethtool_stats = get_stats,
diff --git a/kernel_patches/backport/3.1/ehca-010-remove_driver_data.patch b/kernel_patches/backport/3.1/ehca-010-remove_driver_data.patch
new file mode 100644
index 0000000..914f5a5
--- /dev/null
+++ b/kernel_patches/backport/3.1/ehca-010-remove_driver_data.patch
@@ -0,0 +1,60 @@
+commit f899c2ddd45f2515deb446e2b143e4a686a49aee
+Author: Greg Kroah-Hartman <gregkh at suse.de>
+Date:   Mon May 4 12:40:54 2009 -0700
+
+    infiniband: ehca: remove driver_data direct access of struct device
+    
+    In the near future, the driver core is going to not allow direct access
+    to the driver_data pointer in struct device.  Instead, the functions
+    dev_get_drvdata() and dev_set_drvdata() should be used.  These functions
+    have been around since the beginning, so are backwards compatible with
+    all older kernel versions.
+    
+    Cc: Sean Hefty <sean.hefty at intel.com>
+    Cc: Roland Dreier <rolandd at cisco.com>
+    Cc: Hal Rosenstock <hal.rosenstock at gmail.com>
+    Cc: general at lists.openfabrics.org
+    Cc: Christoph Raisch <raisch at de.ibm.com>
+    Acked-by: Hoang-Nam Nguyen <hnguyen at de.ibm.com>
+    Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+
+diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/infiniband/hw/ehca/ehca_main.c
+index 85905ab..ce4e6ef 100644
+--- a/drivers/infiniband/hw/ehca/ehca_main.c
++++ b/drivers/infiniband/hw/ehca/ehca_main.c
+@@ -636,7 +636,7 @@ static ssize_t  ehca_show_##name(struct device *dev,                       \
+ 	struct hipz_query_hca *rblock;				           \
+ 	int data;                                                          \
+ 									   \
+-	shca = dev->driver_data;					   \
++	shca = dev_get_drvdata(dev);					   \
+ 									   \
+ 	rblock = ehca_alloc_fw_ctrlblock(GFP_KERNEL);			   \
+ 	if (!rblock) {						           \
+@@ -680,7 +680,7 @@ static ssize_t ehca_show_adapter_handle(struct device *dev,
+ 					struct device_attribute *attr,
+ 					char *buf)
+ {
+-	struct ehca_shca *shca = dev->driver_data;
++	struct ehca_shca *shca = dev_get_drvdata(dev);
+ 
+ 	return sprintf(buf, "%llx\n", shca->ipz_hca_handle.handle);
+ 
+@@ -749,7 +749,7 @@ static int __devinit ehca_probe(struct of_device *dev,
+ 
+ 	shca->ofdev = dev;
+ 	shca->ipz_hca_handle.handle = *handle;
+-	dev->dev.driver_data = shca;
++	dev_set_drvdata(&dev->dev, shca);
+ 
+ 	ret = ehca_sense_attributes(shca);
+ 	if (ret < 0) {
+@@ -878,7 +878,7 @@ probe1:
+ 
+ static int __devexit ehca_remove(struct of_device *dev)
+ {
+-	struct ehca_shca *shca = dev->dev.driver_data;
++	struct ehca_shca *shca = dev_get_drvdata(&dev->dev);
+ 	unsigned long flags;
+ 	int ret;
+ 
diff --git a/kernel_patches/backport/3.1/ehca-020-fix_buswalk.patch b/kernel_patches/backport/3.1/ehca-020-fix_buswalk.patch
new file mode 100644
index 0000000..1e044fa
--- /dev/null
+++ b/kernel_patches/backport/3.1/ehca-020-fix_buswalk.patch
@@ -0,0 +1,17 @@
+---
+ drivers/infiniband/hw/ehca/ehca_mrmw.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: ofa_kernel-1.5.1/drivers/infiniband/hw/ehca/ehca_mrmw.c
+===================================================================
+--- ofa_kernel-1.5.1.orig/drivers/infiniband/hw/ehca/ehca_mrmw.c
++++ ofa_kernel-1.5.1/drivers/infiniband/hw/ehca/ehca_mrmw.c
+@@ -2463,7 +2463,7 @@ int ehca_create_busmap(void)
+ 	int ret;
+ 
+ 	ehca_mr_len = 0;
+-	ret = walk_memory_resource(0, 1ULL << MAX_PHYSMEM_BITS, NULL,
++	ret = walk_system_ram_range(0, 1ULL << MAX_PHYSMEM_BITS, NULL,
+ 				   ehca_create_busmap_callback);
+ 	return ret;
+ }
diff --git a/kernel_patches/backport/3.1/ipoib_0010_unset_IFF_XMIT_DST_RELEASE.patch b/kernel_patches/backport/3.1/ipoib_0010_unset_IFF_XMIT_DST_RELEASE.patch
new file mode 100644
index 0000000..a1f32d5
--- /dev/null
+++ b/kernel_patches/backport/3.1/ipoib_0010_unset_IFF_XMIT_DST_RELEASE.patch
@@ -0,0 +1,24 @@
+ipoib: unset IFF_XMIT_DST_RELEASE
+
+IPoIB need skb->dst in its start_xmit() function
+
+Tell dev_hard_start_xmit() to no release it by unsetting  IFF_XMIT_DST_RELEASE
+
+Signed-off-by: Eric Dumazet <eric.dumazet at gmail.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/infiniband/ulp/ipoib/ipoib_main.c |    1 +
+ 1 files changed, 1 insertions(+)
+
+diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
+index ab2c192..69c6304 100644
+--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
+@@ -1053,6 +1053,7 @@ static void ipoib_setup(struct net_device *dev)
+	dev->tx_queue_len	 = ipoib_sendq_size * 2;
+	dev->features		 = (NETIF_F_VLAN_CHALLENGED	|
+				    NETIF_F_HIGHDMA);
++	dev->priv_flags		&= ~IFF_XMIT_DST_RELEASE;
+ 
+	memcpy(dev->broadcast, ipv4_bcast_addr, INFINIBAND_ALEN);
+
diff --git a/kernel_patches/backport/3.1/ipoib_0020_to_2_6_34.patch b/kernel_patches/backport/3.1/ipoib_0020_to_2_6_34.patch
new file mode 100644
index 0000000..57b1673
--- /dev/null
+++ b/kernel_patches/backport/3.1/ipoib_0020_to_2_6_34.patch
@@ -0,0 +1,24 @@
+commit 3ffe533c87281b68d469b279ff3a5056f9c75862
+Author: Alexey Dobriyan <adobriyan at gmail.com>
+Date:   Thu Feb 18 08:25:24 2010 +0000
+
+    ipv6: drop unused "dev" arg of icmpv6_send()
+    
+    Dunno, what was the idea, it wasn't used for a long time.
+    
+    Signed-off-by: Alexey Dobriyan <adobriyan at gmail.com>
+    Signed-off-by: David S. Miller <davem at davemloft.net>
+
+diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+index 30bdf42..83a7751 100644
+--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+@@ -1374,7 +1374,7 @@ static void ipoib_cm_skb_reap(struct work_struct *work)
+ 			icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
+ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+ 		else if (skb->protocol == htons(ETH_P_IPV6))
+-			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, priv->dev);
++			icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu);
+ #endif
+ 		dev_kfree_skb_any(skb);
+ 
diff --git a/kernel_patches/backport/3.1/ipoib_0030_to_2.6.35.patch b/kernel_patches/backport/3.1/ipoib_0030_to_2.6.35.patch
new file mode 100644
index 0000000..86a6653
--- /dev/null
+++ b/kernel_patches/backport/3.1/ipoib_0030_to_2.6.35.patch
@@ -0,0 +1,44 @@
+From fbf219f1c89b15e90ec2db5a3e9636376dc623db Mon Sep 17 00:00:00 2001
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Wed, 24 Feb 2010 05:11:08 +0000
+Subject: [PATCH] infiniband: convert to use netdev_for_each_mc_addr
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+ drivers/infiniband/ulp/ipoib/ipoib_multicast.c |    8 +--
+ 2 files changed, 51 insertions(+), 42 deletions(-)
+
+diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+index 8763c1e..19eba3c 100644
+--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+@@ -767,11 +767,8 @@ void ipoib_mcast_dev_flush(struct net_device *dev)
+ 	}
+ }
+ 
+-static int ipoib_mcast_addr_is_valid(const u8 *addr, unsigned int addrlen,
+-				     const u8 *broadcast)
++static int ipoib_mcast_addr_is_valid(const u8 *addr, const u8 *broadcast)
+ {
+-	if (addrlen != INFINIBAND_ALEN)
+-		return 0;
+ 	/* reserved QPN, prefix, scope */
+ 	if (memcmp(addr, broadcast, 6))
+ 		return 0;
+@@ -811,11 +808,10 @@ void ipoib_mcast_restart_task(struct work_struct *work)
+ 		clear_bit(IPOIB_MCAST_FLAG_FOUND, &mcast->flags);
+ 
+ 	/* Mark all of the entries that are found or don't exist */
+-	for (mclist = dev->mc_list; mclist; mclist = mclist->next) {
++	netdev_for_each_mc_addr(mclist, dev) {
+ 		union ib_gid mgid;
+ 
+ 		if (!ipoib_mcast_addr_is_valid(mclist->dmi_addr,
+-					       mclist->dmi_addrlen,
+ 					       dev->broadcast))
+ 			continue;
+ 
+-- 
+1.7.0.4
+
diff --git a/kernel_patches/backport/3.1/ipoib_0040_to_2.6.35.patch b/kernel_patches/backport/3.1/ipoib_0040_to_2.6.35.patch
new file mode 100644
index 0000000..0a33670
--- /dev/null
+++ b/kernel_patches/backport/3.1/ipoib_0040_to_2.6.35.patch
@@ -0,0 +1,51 @@
+From 22bedad3ce112d5ca1eaf043d4990fa2ed698c87 Mon Sep 17 00:00:00 2001
+From: Jiri Pirko <jpirko at redhat.com>
+Date: Thu, 1 Apr 2010 21:22:57 +0000
+Subject: [PATCH] ipoib: convert multicast list to list_head
+
+Converts the list and the core manipulating with it to be the same as uc_list.
+
++uses two functions for adding/removing mc address (normal and "global"
+ variant) instead of a function parameter.
++removes dev_mcast.c completely.
++exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for
+ manipulation with lists on a sandbox (used in bonding and 80211 drivers)
+
+Signed-off-by: Jiri Pirko <jpirko at redhat.com>
+Signed-off-by: David S. Miller <davem at davemloft.net>
+---
+
+diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+index 19eba3c..c8a0f7d 100644
+--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+@@ -783,7 +783,7 @@ void ipoib_mcast_restart_task(struct work_struct *work)
+ 	struct ipoib_dev_priv *priv =
+ 		container_of(work, struct ipoib_dev_priv, restart_task);
+ 	struct net_device *dev = priv->dev;
+-	struct dev_mc_list *mclist;
++	struct netdev_hw_addr *ha;
+ 	struct ipoib_mcast *mcast, *tmcast;
+ 	LIST_HEAD(remove_list);
+ 	unsigned long flags;
+@@ -808,14 +808,13 @@ void ipoib_mcast_restart_task(struct work_struct *work)
+ 		clear_bit(IPOIB_MCAST_FLAG_FOUND, &mcast->flags);
+ 
+ 	/* Mark all of the entries that are found or don't exist */
+-	netdev_for_each_mc_addr(mclist, dev) {
++	netdev_for_each_mc_addr(ha, dev) {
+ 		union ib_gid mgid;
+ 
+-		if (!ipoib_mcast_addr_is_valid(mclist->dmi_addr,
+-					       dev->broadcast))
++		if (!ipoib_mcast_addr_is_valid(ha->addr, dev->broadcast))
+ 			continue;
+ 
+-		memcpy(mgid.raw, mclist->dmi_addr + 4, sizeof mgid);
++		memcpy(mgid.raw, ha->addr + 4, sizeof mgid);
+ 
+ 		mcast = __ipoib_mcast_find(dev, &mgid);
+ 		if (!mcast || test_bit(IPOIB_MCAST_FLAG_SENDONLY, &mcast->flags)) {
+-- 
+1.7.0.4
+
diff --git a/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.33.patch b/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.33.patch
new file mode 100644
index 0000000..5114841
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.33.patch
@@ -0,0 +1,238 @@
+diff -up a/drivers/infiniband/hw/cxgb3/cxio_hal.h b/drivers/infiniband/hw/cxgb3/cxio_hal.h
+--- a/drivers/infiniband/hw/cxgb3/cxio_hal.h	2010-08-12 13:40:01.000000000 -0500
++++ b/drivers/infiniband/hw/cxgb3/cxio_hal.h	2010-08-12 11:18:49.000000000 -0500
+@@ -34,6 +34,7 @@
+ 
+ #include <linux/list.h>
+ #include <linux/mutex.h>
++#include <linux/kfifo.h>
+ 
+ #include "t3_cpl.h"
+ #include "t3cdev.h"
+@@ -75,13 +76,13 @@ struct cxio_hal_ctrl_qp {
+ };
+ 
+ struct cxio_hal_resource {
+-	struct kfifo *tpt_fifo;
++	struct kfifo tpt_fifo;
+ 	spinlock_t tpt_fifo_lock;
+-	struct kfifo *qpid_fifo;
++	struct kfifo qpid_fifo;
+ 	spinlock_t qpid_fifo_lock;
+-	struct kfifo *cqid_fifo;
++	struct kfifo cqid_fifo;
+ 	spinlock_t cqid_fifo_lock;
+-	struct kfifo *pdid_fifo;
++	struct kfifo pdid_fifo;
+ 	spinlock_t pdid_fifo_lock;
+ };
+ 
+diff -up a/drivers/infiniband/hw/cxgb3/cxio_resource.c b/drivers/infiniband/hw/cxgb3/cxio_resource.c
+--- a/drivers/infiniband/hw/cxgb3/cxio_resource.c	2010-08-12 13:40:01.000000000 -0500
++++ b/drivers/infiniband/hw/cxgb3/cxio_resource.c	2010-08-12 13:28:30.000000000 -0500
+@@ -41,12 +41,12 @@
+ 
+ #include "genalloc.c"
+ 
+-static struct kfifo *rhdl_fifo;
++static struct kfifo rhdl_fifo;
+ static spinlock_t rhdl_fifo_lock;
+ 
+ #define RANDOM_SIZE 16
+ 
+-static int __cxio_init_resource_fifo(struct kfifo **fifo,
++static int __cxio_init_resource_fifo(struct kfifo *fifo,
+ 				   spinlock_t *fifo_lock,
+ 				   u32 nr, u32 skip_low,
+ 				   u32 skip_high,
+@@ -57,12 +57,11 @@ static int __cxio_init_resource_fifo(str
+ 	u32 rarray[16];
+ 	spin_lock_init(fifo_lock);
+ 
+-	*fifo = kfifo_alloc(nr * sizeof(u32), GFP_KERNEL, fifo_lock);
+-	if (IS_ERR(*fifo))
++	if (kfifo_alloc(fifo, nr * sizeof(u32), GFP_KERNEL))
+ 		return -ENOMEM;
+ 
+ 	for (i = 0; i < skip_low + skip_high; i++)
+-		__kfifo_put(*fifo, (unsigned char *) &entry, sizeof(u32));
++		kfifo_in(fifo, (unsigned char *) &entry, sizeof(u32));
+ 	if (random) {
+ 		j = 0;
+ 		random_bytes = random32();
+@@ -74,33 +73,34 @@ static int __cxio_init_resource_fifo(str
+ 				random_bytes = random32();
+ 			}
+ 			idx = (random_bytes >> (j * 2)) & 0xF;
+-			__kfifo_put(*fifo,
+-				(unsigned char *) &rarray[idx],
+-				sizeof(u32));
++			kfifo_in(fifo, (unsigned char *) &rarray[idx],
++				 sizeof(u32));
+ 			rarray[idx] = i;
+ 			j++;
+ 		}
+ 		for (i = 0; i < RANDOM_SIZE; i++)
+-			__kfifo_put(*fifo,
++			kfifo_in(fifo,
+ 				(unsigned char *) &rarray[i],
+ 				sizeof(u32));
+ 	} else
+ 		for (i = skip_low; i < nr - skip_high; i++)
+-			__kfifo_put(*fifo, (unsigned char *) &i, sizeof(u32));
++			kfifo_in(fifo, (unsigned char *) &i, sizeof(u32));
+ 
+ 	for (i = 0; i < skip_low + skip_high; i++)
+-		kfifo_get(*fifo, (unsigned char *) &entry, sizeof(u32));
++		if (kfifo_out_locked(fifo, (unsigned char *) &entry,
++				     sizeof(u32), fifo_lock))
++			break;
+ 	return 0;
+ }
+ 
+-static int cxio_init_resource_fifo(struct kfifo **fifo, spinlock_t * fifo_lock,
++static int cxio_init_resource_fifo(struct kfifo *fifo, spinlock_t * fifo_lock,
+ 				   u32 nr, u32 skip_low, u32 skip_high)
+ {
+ 	return (__cxio_init_resource_fifo(fifo, fifo_lock, nr, skip_low,
+ 					  skip_high, 0));
+ }
+ 
+-static int cxio_init_resource_fifo_random(struct kfifo **fifo,
++static int cxio_init_resource_fifo_random(struct kfifo *fifo,
+ 				   spinlock_t * fifo_lock,
+ 				   u32 nr, u32 skip_low, u32 skip_high)
+ {
+@@ -115,16 +115,14 @@ static int cxio_init_qpid_fifo(struct cx
+ 
+ 	spin_lock_init(&rdev_p->rscp->qpid_fifo_lock);
+ 
+-	rdev_p->rscp->qpid_fifo = kfifo_alloc(T3_MAX_NUM_QP * sizeof(u32),
+-					      GFP_KERNEL,
+-					      &rdev_p->rscp->qpid_fifo_lock);
+-	if (IS_ERR(rdev_p->rscp->qpid_fifo))
++	if (kfifo_alloc(&rdev_p->rscp->qpid_fifo, T3_MAX_NUM_QP * sizeof(u32),
++		        GFP_KERNEL))
+ 		return -ENOMEM;
+ 
+ 	for (i = 16; i < T3_MAX_NUM_QP; i++)
+ 		if (!(i & rdev_p->qpmask))
+-			__kfifo_put(rdev_p->rscp->qpid_fifo,
+-				    (unsigned char *) &i, sizeof(u32));
++			kfifo_in(&rdev_p->rscp->qpid_fifo, (unsigned char *)&i,
++				 sizeof(u32));
+ 	return 0;
+ }
+ 
+@@ -136,7 +134,7 @@ int cxio_hal_init_rhdl_resource(u32 nr_r
+ 
+ void cxio_hal_destroy_rhdl_resource(void)
+ {
+-	kfifo_free(rhdl_fifo);
++	kfifo_free(&rhdl_fifo);
+ }
+ 
+ /* nr_* must be power of 2 */
+@@ -169,11 +167,11 @@ int cxio_hal_init_resource(struct cxio_r
+ 		goto pdid_err;
+ 	return 0;
+ pdid_err:
+-	kfifo_free(rscp->cqid_fifo);
++	kfifo_free(&rscp->cqid_fifo);
+ cqid_err:
+-	kfifo_free(rscp->qpid_fifo);
++	kfifo_free(&rscp->qpid_fifo);
+ qpid_err:
+-	kfifo_free(rscp->tpt_fifo);
++	kfifo_free(&rscp->tpt_fifo);
+ tpt_err:
+ 	return -ENOMEM;
+ }
+@@ -181,33 +179,35 @@ tpt_err:
+ /*
+  * returns 0 if no resource available
+  */
+-static u32 cxio_hal_get_resource(struct kfifo *fifo)
++static u32 cxio_hal_get_resource(struct kfifo *fifo, spinlock_t *lock)
+ {
+ 	u32 entry;
+-	if (kfifo_get(fifo, (unsigned char *) &entry, sizeof(u32)))
++	if (kfifo_out_locked(fifo, (unsigned char *) &entry, sizeof(u32), lock))
+ 		return entry;
+ 	else
+ 		return 0;	/* fifo emptry */
+ }
+ 
+-static void cxio_hal_put_resource(struct kfifo *fifo, u32 entry)
++static void cxio_hal_put_resource(struct kfifo *fifo, u32 entry,
++				  spinlock_t *lock)
+ {
+-	BUG_ON(kfifo_put(fifo, (unsigned char *) &entry, sizeof(u32)) == 0);
++	kfifo_in_locked(fifo, (unsigned char *) &entry, sizeof(u32), lock);
+ }
+ 
+ u32 cxio_hal_get_stag(struct cxio_hal_resource *rscp)
+ {
+-	return cxio_hal_get_resource(rscp->tpt_fifo);
++	return cxio_hal_get_resource(&rscp->tpt_fifo, &rscp->tpt_fifo_lock);
+ }
+ 
+ void cxio_hal_put_stag(struct cxio_hal_resource *rscp, u32 stag)
+ {
+-	cxio_hal_put_resource(rscp->tpt_fifo, stag);
++	cxio_hal_put_resource(&rscp->tpt_fifo, stag, &rscp->tpt_fifo_lock);
+ }
+ 
+ u32 cxio_hal_get_qpid(struct cxio_hal_resource *rscp)
+ {
+-	u32 qpid = cxio_hal_get_resource(rscp->qpid_fifo);
++	u32 qpid = cxio_hal_get_resource(&rscp->qpid_fifo,
++					 &rscp->qpid_fifo_lock);
+ 	PDBG("%s qpid 0x%x\n", __func__, qpid);
+ 	return qpid;
+ }
+@@ -215,35 +215,35 @@ u32 cxio_hal_get_qpid(struct cxio_hal_re
+ void cxio_hal_put_qpid(struct cxio_hal_resource *rscp, u32 qpid)
+ {
+ 	PDBG("%s qpid 0x%x\n", __func__, qpid);
+-	cxio_hal_put_resource(rscp->qpid_fifo, qpid);
++	cxio_hal_put_resource(&rscp->qpid_fifo, qpid, &rscp->qpid_fifo_lock);
+ }
+ 
+ u32 cxio_hal_get_cqid(struct cxio_hal_resource *rscp)
+ {
+-	return cxio_hal_get_resource(rscp->cqid_fifo);
++	return cxio_hal_get_resource(&rscp->cqid_fifo, &rscp->cqid_fifo_lock);
+ }
+ 
+ void cxio_hal_put_cqid(struct cxio_hal_resource *rscp, u32 cqid)
+ {
+-	cxio_hal_put_resource(rscp->cqid_fifo, cqid);
++	cxio_hal_put_resource(&rscp->cqid_fifo, cqid, &rscp->cqid_fifo_lock);
+ }
+ 
+ u32 cxio_hal_get_pdid(struct cxio_hal_resource *rscp)
+ {
+-	return cxio_hal_get_resource(rscp->pdid_fifo);
++	return cxio_hal_get_resource(&rscp->pdid_fifo, &rscp->pdid_fifo_lock);
+ }
+ 
+ void cxio_hal_put_pdid(struct cxio_hal_resource *rscp, u32 pdid)
+ {
+-	cxio_hal_put_resource(rscp->pdid_fifo, pdid);
++	cxio_hal_put_resource(&rscp->pdid_fifo, pdid, &rscp->pdid_fifo_lock);
+ }
+ 
+ void cxio_hal_destroy_resource(struct cxio_hal_resource *rscp)
+ {
+-	kfifo_free(rscp->tpt_fifo);
+-	kfifo_free(rscp->cqid_fifo);
+-	kfifo_free(rscp->qpid_fifo);
+-	kfifo_free(rscp->pdid_fifo);
++	kfifo_free(&rscp->tpt_fifo);
++	kfifo_free(&rscp->cqid_fifo);
++	kfifo_free(&rscp->qpid_fifo);
++	kfifo_free(&rscp->pdid_fifo);
+ 	kfree(rscp);
+ }
+ 
diff --git a/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.36.patch b/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.36.patch
new file mode 100644
index 0000000..a6d8205
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.36.patch
@@ -0,0 +1,21 @@
+diff -rup old/drivers/infiniband/hw/cxgb3/iwch_cm.c new/drivers/infiniband/hw/cxgb3/iwch_cm.c
+--- old/drivers/infiniband/hw/cxgb3/iwch_cm.c	2011-01-31 12:19:40.000000000 -0600
++++ new/drivers/infiniband/hw/cxgb3/iwch_cm.c	2011-01-31 12:20:05.000000000 -0600
+@@ -1397,7 +1397,7 @@ static int pass_accept_req(struct t3cdev
+ 		       __func__);
+ 		goto reject;
+ 	}
+-	dst = &rt->u.dst;
++	dst = &rt->dst;
+ 	l2t = t3_l2t_get(tdev, dst->neighbour, dst->neighbour->dev);
+ 	if (!l2t) {
+ 		printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
+@@ -1965,7 +1965,7 @@ int iwch_connect(struct iw_cm_id *cm_id,
+ 		err = -EHOSTUNREACH;
+ 		goto fail3;
+ 	}
+-	ep->dst = &rt->u.dst;
++	ep->dst = &rt->dst;
+ 
+ 	/* get a l2t entry */
+ 	ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst->neighbour,
diff --git a/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.39.patch b/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.39.patch
new file mode 100644
index 0000000..6df636a
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_cxgb3_to_2.6.39.patch
@@ -0,0 +1,33 @@
+diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
+index b3b54ac..18e51cc 100644
+--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
++++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
+@@ -362,23 +362,11 @@ static struct rtable *find_route(struct t3cdev *dev, __be32 local_ip,
+ 				 __be16 peer_port, u8 tos)
+ {
+ 	struct rtable *rt;
+-	struct flowi fl = {
+-		.oif = 0,
+-		.nl_u = {
+-			 .ip4_u = {
+-				   .daddr = peer_ip,
+-				   .saddr = local_ip,
+-				   .tos = tos}
+-			 },
+-		.proto = IPPROTO_TCP,
+-		.uli_u = {
+-			  .ports = {
+-				    .sport = local_port,
+-				    .dport = peer_port}
+-			  }
+-	};
+-
+-	if (ip_route_output_flow(&init_net, &rt, &fl, NULL, 0))
++
++	rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip,
++				   peer_port, local_port, IPPROTO_TCP,
++				   tos, 0);
++	if (IS_ERR(rt))
+ 		return NULL;
+ 	return rt;
+ }
diff --git a/kernel_patches/backport/3.1/iw_cxgb3_to_3.0.patch b/kernel_patches/backport/3.1/iw_cxgb3_to_3.0.patch
new file mode 100644
index 0000000..d877b7d
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_cxgb3_to_3.0.patch
@@ -0,0 +1,15 @@
+diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
+index b3b54ac..18e51cc 100644
+--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
++++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
+@@ -362,8 +362,9 @@ static struct rtable *find_route(struct
+                                 __be16 peer_port, u8 tos)
+ {
+        struct rtable *rt;
++       struct flowi4 fl4;
+
+-       rt = ip_route_output_ports(&init_net, NULL, peer_ip, local_ip,
++       rt = ip_route_output_ports(&init_net, &fl4, NULL, peer_ip, local_ip,
+                                   peer_port, local_port, IPPROTO_TCP,
+                                   tos, 0);
+        if (IS_ERR(rt))
diff --git a/kernel_patches/backport/3.1/iw_cxgb4_0020_mpav2.patch b/kernel_patches/backport/3.1/iw_cxgb4_0020_mpav2.patch
new file mode 100644
index 0000000..13d5453
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_cxgb4_0020_mpav2.patch
@@ -0,0 +1,59 @@
+diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
+index d10e475..9f0bc40 100644
+--- a/drivers/infiniband/hw/cxgb4/cm.c
++++ b/drivers/infiniband/hw/cxgb4/cm.c
+@@ -1813,7 +1813,6 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
+ 	int err = 0;
+ 	struct rtable *rt;
+ 	struct net_device *pdev;
+-	struct neighbour *neigh;
+ 	int step;
+
+ 	PDBG("%s qp %p cm_id %p\n", __func__, ep->com.qp, ep->com.cm_id);
+@@ -1842,15 +1841,14 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
+ 	}
+ 	ep->dst = &rt->dst;
+
+-	neigh = dst_get_neighbour(ep->dst);
+-
+ 	/* get a l2t entry */
+-	if (neigh->dev->flags & IFF_LOOPBACK) {
++	if (ep->dst->neighbour->dev->flags & IFF_LOOPBACK) {
+ 		PDBG("%s LOOPBACK\n", __func__);
+ 		pdev = ip_dev_find(&init_net,
+ 				   ep->com.cm_id->remote_addr.sin_addr.s_addr);
+ 		ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t,
+-					neigh, pdev, 0);
++					ep->dst->neighbour,
++					pdev, 0);
+ 		ep->mtu = pdev->mtu;
+ 		ep->tx_chan = cxgb4_port_chan(pdev);
+ 		ep->smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1;
+@@ -1865,18 +1863,20 @@ static int c4iw_reconnect(struct c4iw_ep *ep)
+ 		dev_put(pdev);
+ 	} else {
+ 		ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t,
+-					neigh, neigh->dev, 0);
++					ep->dst->neighbour,
++					ep->dst->neighbour->dev, 0);
+ 		ep->mtu = dst_mtu(ep->dst);
+-		ep->tx_chan = cxgb4_port_chan(neigh->dev);
+-		ep->smac_idx = (cxgb4_port_viid(neigh->dev) & 0x7F) << 1;
++		ep->tx_chan = cxgb4_port_chan(ep->dst->neighbour->dev);
++		ep->smac_idx = (cxgb4_port_viid(ep->dst->neighbour->dev) &
++				0x7F) << 1;
+ 		step = ep->com.dev->rdev.lldi.ntxq /
+ 			ep->com.dev->rdev.lldi.nchan;
+-		ep->txq_idx = cxgb4_port_idx(neigh->dev) * step;
+-		ep->ctrlq_idx = cxgb4_port_idx(neigh->dev);
++		ep->txq_idx = cxgb4_port_idx(ep->dst->neighbour->dev) * step;
++		ep->ctrlq_idx = cxgb4_port_idx(ep->dst->neighbour->dev);
+ 		step = ep->com.dev->rdev.lldi.nrxq /
+ 			ep->com.dev->rdev.lldi.nchan;
+ 		ep->rss_qid = ep->com.dev->rdev.lldi.rxq_ids[
+-			cxgb4_port_idx(neigh->dev) * step];
++			cxgb4_port_idx(ep->dst->neighbour->dev) * step];
+ 	}
+ 	if (!ep->l2t) {
+ 		printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__);
+
diff --git a/kernel_patches/backport/3.1/iw_cxgb4_to_2.6.39.patch b/kernel_patches/backport/3.1/iw_cxgb4_to_2.6.39.patch
new file mode 100644
index 0000000..a5b7733
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_cxgb4_to_2.6.39.patch
@@ -0,0 +1,13 @@
+diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
+index 5b9e422..92187a9 100644
+--- a/drivers/infiniband/hw/cxgb4/provider.c
++++ b/drivers/infiniband/hw/cxgb4/provider.c
+@@ -513,7 +513,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
+ 	dev->ibdev.iwcm->rem_ref = c4iw_qp_rem_ref;
+ 	dev->ibdev.iwcm->get_qp = c4iw_get_qp;
+
+-	ret = ib_register_device(&dev->ibdev, NULL);
++	ret = ib_register_device(&dev->ibdev);
+ 	if (ret)
+ 		goto bail1;
+
diff --git a/kernel_patches/backport/3.1/iw_nes_0700_to_2_6_33.patch b/kernel_patches/backport/3.1/iw_nes_0700_to_2_6_33.patch
new file mode 100644
index 0000000..c237bbb
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_nes_0700_to_2_6_33.patch
@@ -0,0 +1,38 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_nic.c nes.2_6_33_patch/drivers/infiniband/hw/nes/nes_nic.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_nic.c	2010-08-13 15:58:29.000000000 -0500
++++ nes.2_6_33_patch/drivers/infiniband/hw/nes/nes_nic.c	2010-08-13 16:22:24.000000000 -0500
+@@ -1080,11 +1080,14 @@ static int nes_netdev_set_rx_csum(struct
+ 
+ 
+ /**
+- * nes_netdev_get_stats_count
++ * nes_netdev_get_sset_count
+  */
+-static int nes_netdev_get_stats_count(struct net_device *netdev)
++static int nes_netdev_get_sset_count(struct net_device *netdev, int stringset)
+ {
+-	return NES_ETHTOOL_STAT_COUNT;
++	if (stringset == ETH_SS_STATS)
++		return NES_ETHTOOL_STAT_COUNT;
++	else
++		return -EINVAL;
+ }
+ 
+ 
+@@ -1303,7 +1306,6 @@ static void nes_netdev_get_drvinfo(struc
+ 	sprintf(drvinfo->fw_version, "%u.%u", nesadapter->firmware_version>>16,
+ 				nesadapter->firmware_version & 0x000000ff);
+ 	strcpy(drvinfo->version, DRV_VERSION);
+-	drvinfo->n_stats = nes_netdev_get_stats_count(netdev);
+ 	drvinfo->testinfo_len = 0;
+ 	drvinfo->eedump_len = 0;
+ 	drvinfo->regdump_len = 0;
+@@ -1561,7 +1563,7 @@ static struct ethtool_ops nes_ethtool_op
+ 	.get_rx_csum = nes_netdev_get_rx_csum,
+ 	.get_sg = ethtool_op_get_sg,
+ 	.get_strings = nes_netdev_get_strings,
+-	.get_stats_count = nes_netdev_get_stats_count,
++	.get_sset_count = nes_netdev_get_sset_count,
+ 	.get_ethtool_stats = nes_netdev_get_ethtool_stats,
+ 	.get_drvinfo = nes_netdev_get_drvinfo,
+ 	.get_coalesce = nes_netdev_get_coalesce,
diff --git a/kernel_patches/backport/3.1/iw_nes_0710_to_2_6_35.patch b/kernel_patches/backport/3.1/iw_nes_0710_to_2_6_35.patch
new file mode 100644
index 0000000..109b50b
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_nes_0710_to_2_6_35.patch
@@ -0,0 +1,281 @@
+diff -Naur ofa_kernel-1.5.3/drivers/infiniband/hw/nes/nes_nic.c ofa_kernel-1.5.3-35/drivers/infiniband/hw/nes/nes_nic.c
+--- ofa_kernel-1.5.3/drivers/infiniband/hw/nes/nes_nic.c	2011-01-17 08:26:09.000000000 +0100
++++ ofa_kernel-1.5.3-35/drivers/infiniband/hw/nes/nes_nic.c	2011-01-17 08:24:06.000000000 +0100
+@@ -841,6 +841,19 @@
+ 	return 0;
+ }
+ 
++static void set_allmulti(struct nes_device *nesdev, u32 nic_active_bit)
++{
++	u32 nic_active;
++
++	nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL);
++	nic_active |= nic_active_bit;
++	nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL, nic_active);
++	nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL);
++	nic_active &= ~nic_active_bit;
++	nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL, nic_active);
++}
++
++#define get_addr(addrs, index) ((addrs) + (index) * ETH_ALEN)
+ 
+ /**
+  * nes_netdev_set_multicast_list
+@@ -850,7 +863,6 @@
+ 	struct nes_vnic *nesvnic = netdev_priv(netdev);
+ 	struct nes_device *nesdev = nesvnic->nesdev;
+ 	struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter;
+-	struct dev_mc_list *multicast_addr;
+ 	u32 nic_active_bit;
+ 	u32 nic_active;
+ 	u32 perfect_filter_register_address;
+@@ -860,60 +872,78 @@
+ 	u8 mc_index;
+ 	int mc_nic_index = -1;
+ 	u8 pft_entries_preallocated = max(nesadapter->adapter_fcn_count *
+-					nics_per_function, 4);
++						nics_per_function, 4);
+ 	u8 max_pft_entries_avaiable = NES_PFT_SIZE - pft_entries_preallocated;
+ 	unsigned long flags;
++	int mc_count = netdev_mc_count(netdev);
+ 
+ 	spin_lock_irqsave(&nesadapter->resource_lock, flags);
+ 	nic_active_bit = 1 << nesvnic->nic_index;
+ 
+ 	if (netdev->flags & IFF_PROMISC) {
+-		nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL);
++		nic_active = nes_read_indexed(nesdev,
++						NES_IDX_NIC_MULTICAST_ALL);
+ 		nic_active |= nic_active_bit;
+-		nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL, nic_active);
++		nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL,
++								nic_active);
+ 		nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL);
+ 		nic_active |= nic_active_bit;
+ 		nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL, nic_active);
+ 		mc_all_on = 1;
+ 	} else if ((netdev->flags & IFF_ALLMULTI) ||
+-			   (nesvnic->nic_index > 3)) {
+-		nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL);
+-		nic_active |= nic_active_bit;
+-		nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL, nic_active);
+-		nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL);
+-		nic_active &= ~nic_active_bit;
+-		nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL, nic_active);
++		(nesvnic->nic_index > 3)) {
++		set_allmulti(nesdev, nic_active_bit);
+ 		mc_all_on = 1;
+ 	} else {
+-		nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL);
++		nic_active = nes_read_indexed(nesdev,
++						NES_IDX_NIC_MULTICAST_ALL);
+ 		nic_active &= ~nic_active_bit;
+-		nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL, nic_active);
+-		nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL);
++		nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL,
++								nic_active);
++		nic_active = nes_read_indexed(nesdev,
++						NES_IDX_NIC_UNICAST_ALL);
+ 		nic_active &= ~nic_active_bit;
+-		nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL, nic_active);
++		nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL,
++								nic_active);
+ 	}
+-
+-	nes_debug(NES_DBG_NIC_RX, "Number of MC entries = %d, Promiscous = %d, All Multicast = %d.\n",
+-		  netdev->mc_count, !!(netdev->flags & IFF_PROMISC),
+-		  !!(netdev->flags & IFF_ALLMULTI));
++	nes_debug(NES_DBG_NIC_RX, "Number of MC entries = %d,\
++				 Promiscous = %d, All Multicast = %d .\n",
++				mc_count, !!(netdev->flags & IFF_PROMISC),
++				!!(netdev->flags & IFF_ALLMULTI));
+ 	if (!mc_all_on) {
+-		multicast_addr = netdev->mc_list;
+-		perfect_filter_register_address = NES_IDX_PERFECT_FILTER_LOW +
++		char *addrs;
++		int i;
++		struct netdev_hw_addr *ha;
++
++		addrs = kmalloc(ETH_ALEN * mc_count, GFP_ATOMIC);
++		if (!addrs) {
++			set_allmulti(nesdev, nic_active_bit);
++			goto unlock;
++		}
++		i = 0;
++		netdev_for_each_mc_addr(ha, netdev) {
++			memcpy(get_addr(addrs, i), ha->addr, ETH_ALEN);
++			i++;
++		}
++		perfect_filter_register_address =
++						NES_IDX_PERFECT_FILTER_LOW +
+ 						pft_entries_preallocated * 0x8;
+-		for (mc_index = 0; mc_index < max_pft_entries_avaiable;
+-		mc_index++) {
+-			while (multicast_addr && nesvnic->mcrq_mcast_filter &&
+-			((mc_nic_index = nesvnic->mcrq_mcast_filter(nesvnic,
+-					multicast_addr->dmi_addr)) == 0)) {
+-				multicast_addr = multicast_addr->next;
+-			}
+-			if (mc_nic_index < 0)
+-				mc_nic_index = (1 << nesvnic->nic_index);
+-			while (nesadapter->pft_mcast_map[mc_index] < 16 &&
+-				nesadapter->pft_mcast_map[mc_index] !=
+-					nesvnic->nic_index &&
+-					mc_index < max_pft_entries_avaiable) {
+-						nes_debug(NES_DBG_NIC_RX,
++		for (i = 0, mc_index = 0;
++			mc_index < max_pft_entries_avaiable;
++			mc_index++) {
++			if (nesvnic->mcrq_mcast_filter)
++				mc_nic_index =
++					nesvnic->mcrq_mcast_filter(nesvnic,
++							get_addr(addrs, i));
++
++			if (mc_nic_index <= 0)
++				mc_nic_index = nesvnic->nic_index;
++
++			while ((nesadapter->pft_mcast_map[mc_index] < 16) &&
++				(nesadapter->pft_mcast_map[mc_index] !=
++							nesvnic->nic_index) &&
++				(mc_index < max_pft_entries_avaiable)) {
++				nes_debug(NES_DBG_NIC_RX,
+ 					"mc_index=%d skipping nic_index=%d,\
+ 					used for=%d \n", mc_index,
+ 					nesvnic->nic_index,
+@@ -922,47 +952,43 @@
+ 			}
+ 			if (mc_index >= max_pft_entries_avaiable)
+ 				break;
+-			if (multicast_addr) {
+-				macaddr_high  = ((u16)multicast_addr->dmi_addr[0]) << 8;
+-				macaddr_high += (u16)multicast_addr->dmi_addr[1];
+-				macaddr_low   = ((u32)multicast_addr->dmi_addr[2]) << 24;
+-				macaddr_low  += ((u32)multicast_addr->dmi_addr[3]) << 16;
+-				macaddr_low  += ((u32)multicast_addr->dmi_addr[4]) << 8;
+-				macaddr_low  += (u32)multicast_addr->dmi_addr[5];
++			if (i < mc_count) {
++				char *addr;
++
++				addr = get_addr(addrs, i);
++				i++;
++				macaddr_high  = ((u16) addr[0]) << 8;
++				macaddr_high += (u16) addr[1];
++				macaddr_low   = ((u32) addr[2]) << 24;
++				macaddr_low  += ((u32) addr[3]) << 16;
++				macaddr_low  += ((u32) addr[4]) << 8;
++				macaddr_low  += (u32) addr[5];
+ 				nes_write_indexed(nesdev,
+-						perfect_filter_register_address+(mc_index * 8),
+-						macaddr_low);
++					perfect_filter_register_address +
++								(mc_index * 8),
++								macaddr_low);
+ 				nes_write_indexed(nesdev,
+-						perfect_filter_register_address+4+(mc_index * 8),
+-						(u32)macaddr_high | NES_MAC_ADDR_VALID |
+-						((((u32)(mc_nic_index)) << 16)));
+-				multicast_addr = multicast_addr->next;
++					perfect_filter_register_address +
++							4 + (mc_index * 8),
++							(u32)macaddr_high |
++							NES_MAC_ADDR_VALID |
++					((((u32)(1<<mc_nic_index)) << 16)));
+ 				nesadapter->pft_mcast_map[mc_index] =
+ 							nesvnic->nic_index;
+ 			} else {
+-				nes_debug(NES_DBG_NIC_RX, "Clearing MC Address at register 0x%04X\n",
+-						  perfect_filter_register_address+(mc_index * 8));
+ 				nes_write_indexed(nesdev,
+-						perfect_filter_register_address+4+(mc_index * 8),
+-						0);
++					perfect_filter_register_address + 4
++							+ (mc_index * 8), 0);
+ 				nesadapter->pft_mcast_map[mc_index] = 255;
+ 			}
+ 		}
++
++		kfree(addrs);
+ 		/* PFT is not large enough */
+-		if (multicast_addr && multicast_addr->next) {
+-			nic_active = nes_read_indexed(nesdev,
+-						NES_IDX_NIC_MULTICAST_ALL);
+-			nic_active |= nic_active_bit;
+-			nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL,
+-								nic_active);
+-			nic_active = nes_read_indexed(nesdev,
+-						NES_IDX_NIC_UNICAST_ALL);
+-			nic_active &= ~nic_active_bit;
+-			nes_write_indexed(nesdev, NES_IDX_NIC_UNICAST_ALL,
+-								nic_active);
+-		}
++		if (i < mc_count)
++			set_allmulti(nesdev, nic_active_bit);
+ 	}
+-
++unlock:
+ 	spin_unlock_irqrestore(&nesadapter->resource_lock, flags);
+ }
+ 
+diff -Naur ofa_kernel-1.5.3/drivers/infiniband/hw/nes/nes_ud.c ofa_kernel-1.5.3-35/drivers/infiniband/hw/nes/nes_ud.c
+--- ofa_kernel-1.5.3/drivers/infiniband/hw/nes/nes_ud.c	2011-01-17 08:26:08.000000000 +0100
++++ ofa_kernel-1.5.3-35/drivers/infiniband/hw/nes/nes_ud.c	2011-01-17 08:24:00.000000000 +0100
+@@ -597,7 +597,7 @@
+ 
+ 	pRsc = locate_ud_adapter(nesvnic->nesdev->nesadapter);
+ 	if (pRsc == NULL)
+-		return 0;
++		return -1;
+ 
+ 	for (i = 0; i < NES_UD_MCAST_TBL_SZ; i++) {
+ 		if (pRsc->mcast[i].in_use &&
+@@ -614,6 +614,7 @@
+ 				dmi_addr[3], dmi_addr[4], dmi_addr[5], ret);
+ 		}
+ 	}
++
+ 	if (ret == 0)
+ 		return -1;
+ 	else
+@@ -1482,9 +1483,9 @@
+ 	unsigned addr = 0;
+ 	unsigned mqueue_ind_tbl;
+ 	struct nes_ud_resources *pRsc;
++	struct netdev_hw_addr *ha;
+ 
+ 	struct net_device *netdev = file->nesvnic->netdev;
+-	struct dev_mc_list *mc_list;
+ 	int	multicast_address_exist = 0;
+ 
+ 
+@@ -1495,23 +1496,16 @@
+ 	if (pRsc == NULL)
+ 		return -EFAULT;
+ 
+-	for (mc_list = netdev->mc_list;
+-		mc_list != NULL;
+-		mc_list = mc_list->next) {
+-		if (mc_list != NULL) {
+-			if ((mc_list->dmi_addr[3] == gid->raw[13]) &&
+-			    (mc_list->dmi_addr[4] == gid->raw[14]) &&
+-			    (mc_list->dmi_addr[5] == gid->raw[15]) &&
+-			    (mc_list->dmi_addr[0] == 0x01) &&
+-			    (mc_list->dmi_addr[1] == 0) &&
+-			    (mc_list->dmi_addr[2] == 0x5e)) {
+-				multicast_address_exist = 1;
+-				break;
+-			}
+-		} else {
++	netdev_for_each_mc_addr(ha, netdev)
++		if ((ha->addr[3] == gid->raw[13]) &&
++			(ha->addr[4] == gid->raw[14]) &&
++			(ha->addr[5] == gid->raw[15]) &&
++			(ha->addr[0] == 0x01) &&
++			(ha->addr[1] == 0) &&
++			(ha->addr[2] == 0x5e)) {
++			multicast_address_exist = 1;
+ 			break;
+ 		}
+-	}
+ 
+ 	if (multicast_address_exist == 0) {
+ 		nes_debug(NES_DBG_UD, "WARNING: multicast address not exist "
diff --git a/kernel_patches/backport/3.1/iw_nes_0720_to_2_6_36.patch b/kernel_patches/backport/3.1/iw_nes_0720_to_2_6_36.patch
new file mode 100644
index 0000000..4439597
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_nes_0720_to_2_6_36.patch
@@ -0,0 +1,11 @@
+--- ofa_kernel-1.5.3/drivers/infiniband/hw/nes/nes_cm.c	2011-01-13 08:13:21.000000000 +0100
++++ ofa_kernel-1.5.3-35/drivers/infiniband/hw/nes/nes_cm.c	2011-01-13 04:28:03.000000000 +0100
+@@ -1151,7 +1151,7 @@
+ 	}
+ 
+ 	if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID)))
+-		neigh_event_send(rt->u.dst.neighbour, NULL);
++		neigh_event_send(rt->dst.neighbour, NULL);
+ 
+ 	ip_rt_put(rt);
+ 	return rc;
diff --git a/kernel_patches/backport/3.1/iw_nes_0730_to_2_6_39.patch b/kernel_patches/backport/3.1/iw_nes_0730_to_2_6_39.patch
new file mode 100644
index 0000000..b73f090
--- /dev/null
+++ b/kernel_patches/backport/3.1/iw_nes_0730_to_2_6_39.patch
@@ -0,0 +1,22 @@
+diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
+index e0afdf9..f075d61 100644
+--- a/drivers/infiniband/hw/nes/nes_cm.c
++++ b/drivers/infiniband/hw/nes/nes_cm.c
+@@ -1106,15 +1106,13 @@ static inline int mini_cm_accelerated(struct nes_cm_core *cm_core,
+ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpindex)
+ {
+ 	struct rtable *rt;
+-	struct flowi fl;
+ 	struct neighbour *neigh;
+ 	int rc = arpindex;
+ 	struct net_device *netdev;
+ 	struct nes_adapter *nesadapter = nesvnic->nesdev->nesadapter;
+ 
+-	memset(&fl, 0, sizeof fl);
+-	fl.nl_u.ip4_u.daddr = htonl(dst_ip);
+-	if (ip_route_output_key(&init_net, &rt, &fl)) {
++	rt = ip_route_output(&init_net, htonl(dst_ip), 0, 0, 0);
++	if (IS_ERR(rt)) {
+ 		printk(KERN_ERR "%s: ip_route_output_key failed for 0x%08X\n",
+ 				__func__, dst_ip);
+ 		return rc;
diff --git a/kernel_patches/backport/3.1/mlx4_0010_for_2_6_33.patch b/kernel_patches/backport/3.1/mlx4_0010_for_2_6_33.patch
new file mode 100644
index 0000000..508ec1bd
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_0010_for_2_6_33.patch
@@ -0,0 +1,12 @@
+Index: ofed_kernel/drivers/net/mlx4/mlx4.h
+===================================================================
+--- ofed_kernel.orig/drivers/net/mlx4/mlx4.h	2010-08-09 17:36:40.000000000 +0300
++++ ofed_kernel/drivers/net/mlx4/mlx4.h	2010-08-09 20:00:07.000000000 +0300
+@@ -41,6 +41,7 @@
+ #include <linux/radix-tree.h>
+ #include <linux/timer.h>
+ #include <linux/workqueue.h>
++#include <linux/semaphore.h>
+ 
+ #include <linux/mlx4/device.h>
+ #include <linux/mlx4/driver.h>
diff --git a/kernel_patches/backport/3.1/mlx4_0020_for_2.6.35.patch b/kernel_patches/backport/3.1/mlx4_0020_for_2.6.35.patch
new file mode 100644
index 0000000..b2945d3
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_0020_for_2.6.35.patch
@@ -0,0 +1,22 @@
+Index: ofed_kernel-2.6.35/drivers/infiniband/hw/mlx4/main.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/hw/mlx4/main.c	2010-11-07 11:02:12.213418073 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/hw/mlx4/main.c	2010-11-07 11:03:00.368437782 +0200
+@@ -662,7 +662,7 @@
+ 	if (ndev) {
+ 		rdma_get_mcast_mac((struct in6_addr *)gid, mac);
+ 		rtnl_lock();
+-		dev_mc_add(mdev->iboe.netdevs[mqp->port - 1], mac, 6, 0);
++		dev_mc_add(mdev->iboe.netdevs[mqp->port - 1], mac);
+ 		ret = 1;
+ 		rtnl_unlock();
+ 		dev_put(ndev);
+@@ -739,7 +739,7 @@
+ 		rdma_get_mcast_mac((struct in6_addr *)gid, mac);
+ 		if (ndev) {
+ 			rtnl_lock();
+-			dev_mc_delete(mdev->iboe.netdevs[ge->port - 1], mac, 6, 0);
++			dev_mc_del(mdev->iboe.netdevs[ge->port - 1], mac);
+ 			rtnl_unlock();
+ 			dev_put(ndev);
+ 		}
diff --git a/kernel_patches/backport/3.1/mlx4_0030_for_2.6.35.patch b/kernel_patches/backport/3.1/mlx4_0030_for_2.6.35.patch
new file mode 100644
index 0000000..df6e8ae
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_0030_for_2.6.35.patch
@@ -0,0 +1,37 @@
+Index: ofed_kernel-2.6.35/drivers/net/mlx4/mr.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/net/mlx4/mr.c	2010-11-07 17:35:54.649434129 +0200
++++ ofed_kernel-2.6.35/drivers/net/mlx4/mr.c	2010-11-07 17:40:43.932472076 +0200
+@@ -441,10 +441,14 @@
+ 	if (!mtts)
+ 		return -ENOMEM;
+ 
++	dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle,
++				npages * sizeof (u64), DMA_TO_DEVICE);
++
+ 	for (i = 0; i < npages; ++i)
+ 		mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT);
+ 
+-	dma_sync_single(&dev->pdev->dev, dma_handle, npages * sizeof (u64), DMA_TO_DEVICE);
++	dma_sync_single_for_device(&dev->pdev->dev, dma_handle,
++				   npages * sizeof (u64), DMA_TO_DEVICE);
+ 
+ 	return 0;
+ }
+@@ -593,11 +597,14 @@
+ 	/* Make sure MPT status is visible before writing MTT entries */
+ 	wmb();
+ 
++	dma_sync_single_for_cpu(&dev->pdev->dev, fmr->dma_handle,
++				npages * sizeof(u64), DMA_TO_DEVICE);
++
+ 	for (i = 0; i < npages; ++i)
+ 		fmr->mtts[i] = cpu_to_be64(page_list[i] | MLX4_MTT_FLAG_PRESENT);
+ 
+-	dma_sync_single(&dev->pdev->dev, fmr->dma_handle,
+-			npages * sizeof(u64), DMA_TO_DEVICE);
++	dma_sync_single_for_device(&dev->pdev->dev, fmr->dma_handle,
++				   npages * sizeof(u64), DMA_TO_DEVICE);
+ 
+ 	fmr->mpt->key    = cpu_to_be32(key);
+ 	fmr->mpt->lkey   = cpu_to_be32(key);
diff --git a/kernel_patches/backport/3.1/mlx4_en_0010_for_2_6_35.patch b/kernel_patches/backport/3.1/mlx4_en_0010_for_2_6_35.patch
new file mode 100644
index 0000000..547843b
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_en_0010_for_2_6_35.patch
@@ -0,0 +1,146 @@
+Index: ofa_1_5_dev_kernel-20110224-1114_linux-2.6.35_check/drivers/net/mlx4/en_netdev.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110224-1114_linux-2.6.35_check.orig/drivers/net/mlx4/en_netdev.c	2011-02-24 11:42:18.000000000 +0200
++++ ofa_1_5_dev_kernel-20110224-1114_linux-2.6.35_check/drivers/net/mlx4/en_netdev.c	2011-02-24 11:55:13.000000000 +0200
+@@ -163,40 +163,29 @@ static void mlx4_en_do_set_mac(struct wo
+ static void mlx4_en_clear_list(struct net_device *dev)
+ {
+ 	struct mlx4_en_priv *priv = netdev_priv(dev);
+-	struct dev_mc_list *plist = priv->mc_list;
+-	struct dev_mc_list *next;
+ 
+-	while (plist) {
+-		next = plist->next;
+-		kfree(plist);
+-		plist = next;
+-	}
+-	priv->mc_list = NULL;
++	kfree(priv->mc_addrs);
++	priv->mc_addrs_cnt = 0;
+ }
+ 
+ static void mlx4_en_cache_mclist(struct net_device *dev)
+ {
+ 	struct mlx4_en_priv *priv = netdev_priv(dev);
+-	struct dev_mc_list *mclist;
+-	struct dev_mc_list *tmp;
+-	struct dev_mc_list *plist = NULL;
++	struct netdev_hw_addr *ha;
++	char *mc_addrs;
++	int mc_addrs_cnt = netdev_mc_count(dev);
++	int i;
+ 
+-	mlx4_en_clear_list(dev);
+-	for (mclist = dev->mc_list; mclist; mclist = mclist->next) {
+-		tmp = kmalloc(sizeof(struct dev_mc_list), GFP_ATOMIC);
+-		if (!tmp) {
+-			en_err(priv, "failed to allocate multicast list\n");
+-			mlx4_en_clear_list(dev);
+-			return;
+-		}
+-		memcpy(tmp, mclist, sizeof(struct dev_mc_list));
+-		tmp->next = NULL;
+-		if (plist)
+-			plist->next = tmp;
+-		else
+-			priv->mc_list = tmp;
+-		plist = tmp;
++	mc_addrs = kmalloc(mc_addrs_cnt * ETH_ALEN, GFP_ATOMIC);
++	if (!mc_addrs) {
++		en_err(priv, "failed to allocate multicast list\n");
++		return;
+ 	}
++	i = 0;
++	netdev_for_each_mc_addr(ha, dev)
++		memcpy(mc_addrs + i++ * ETH_ALEN, ha->addr, ETH_ALEN);
++	priv->mc_addrs = mc_addrs;
++	priv->mc_addrs_cnt = mc_addrs_cnt;
+ }
+ 
+ 
+@@ -216,7 +205,6 @@ static void mlx4_en_do_set_multicast(str
+ 						 mcast_task);
+ 	struct mlx4_en_dev *mdev = priv->mdev;
+ 	struct net_device *dev = priv->dev;
+-	struct dev_mc_list *mclist;
+ 	u64 mcast_addr = 0;
+ 	u8 mc_list[16] = {0};
+ 	int err;
+@@ -342,7 +330,7 @@ static void mlx4_en_do_set_multicast(str
+ 			priv->flags |= MLX4_EN_FLAG_MC_PROMISC;
+ 		}
+ 	} else {
+-
++		int i;
+ 		/* Disable Multicast promisc */
+ 		if (priv->flags & MLX4_EN_FLAG_MC_PROMISC) {
+ 			err = mlx4_multicast_promisc_remove(mdev->dev, priv->base_qpn,
+@@ -358,8 +346,8 @@ static void mlx4_en_do_set_multicast(str
+ 			en_err(priv, "Failed disabling multicast filter\n");
+ 
+ 		/* Detach our qp from all the multicast addresses */
+-		for (mclist = priv->mc_list; mclist; mclist = mclist->next) {
+-			memcpy(&mc_list[10], mclist->dmi_addr, ETH_ALEN);
++		for (i = 0; i < priv->mc_addrs_cnt; i++) {
++			memcpy(&mc_list[10], priv->mc_addrs + i * ETH_ALEN, ETH_ALEN);
+ 			mc_list[5] = priv->port;
+ 			mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp,
+ 					      mc_list, MLX4_PROT_ETH, 0);
+@@ -373,12 +361,13 @@ static void mlx4_en_do_set_multicast(str
+ 		netif_tx_lock_bh(dev);
+ 		mlx4_en_cache_mclist(dev);
+ 		netif_tx_unlock_bh(dev);
+-		for (mclist = priv->mc_list; mclist; mclist = mclist->next) {
+-			memcpy(&mc_list[10], mclist->dmi_addr, ETH_ALEN);
++ 		for (i = 0; i < priv->mc_addrs_cnt; i++) {
++ 			mcast_addr =
++ 			      mlx4_en_mac_to_u64(priv->mc_addrs + i * ETH_ALEN);
++ 			memcpy(&mc_list[10], priv->mc_addrs + i * ETH_ALEN, ETH_ALEN);
+ 			mc_list[5] = priv->port;
+ 			mlx4_multicast_attach(mdev->dev, &priv->rss_map.indir_qp,
+ 					      mc_list, 0, MLX4_PROT_ETH, 0);
+-			mcast_addr = mlx4_en_mac_to_u64(mclist->dmi_addr);
+ 			mlx4_SET_MCAST_FLTR(mdev->dev, priv->port,
+ 					    mcast_addr, 0, MLX4_MCAST_CONFIG);
+ 		}
+@@ -831,7 +820,6 @@ void mlx4_en_stop_port(struct net_device
+ {
+ 	struct mlx4_en_priv *priv = netdev_priv(dev);
+ 	struct mlx4_en_dev *mdev = priv->mdev;
+-	struct dev_mc_list *mclist;
+ 	int i;
+ 	u8 mc_list[16] = {0};
+ 
+@@ -853,8 +841,8 @@ void mlx4_en_stop_port(struct net_device
+ 	mc_list[5] = priv->port;
+ 	mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp, mc_list,
+ 			      MLX4_PROT_ETH, 0);
+-	for (mclist = priv->mc_list; mclist; mclist = mclist->next) {
+-		memcpy(&mc_list[10], mclist->dmi_addr, ETH_ALEN);
++	for (i = 0; i < priv->mc_addrs_cnt; i++) {
++		memcpy(&mc_list[10], priv->mc_addrs + i * ETH_ALEN, ETH_ALEN);
+ 		mc_list[5] = priv->port;
+ 		mlx4_multicast_detach(mdev->dev, &priv->rss_map.indir_qp,
+ 				      mc_list, MLX4_PROT_ETH, 0);
+@@ -1142,7 +1130,6 @@ int mlx4_en_init_netdev(struct mlx4_en_d
+ 	priv->tx_ring_num = prof->tx_ring_num;
+ 	priv->rx_ring_num = prof->rx_ring_num;
+ 	priv->udp_rings = mdev->profile.udp_rss ? prof->rx_ring_num / 2 : 1;
+-	priv->mc_list = NULL;
+ 	priv->mac_index = -1;
+ 	priv->msg_enable = MLX4_EN_MSG_LEVEL;
+ 	spin_lock_init(&priv->stats_lock);
+Index: ofa_1_5_dev_kernel-20110224-1114_linux-2.6.35_check/drivers/net/mlx4/mlx4_en.h
+===================================================================
+--- ofa_1_5_dev_kernel-20110224-1114_linux-2.6.35_check.orig/drivers/net/mlx4/mlx4_en.h	2011-02-24 11:42:18.000000000 +0200
++++ ofa_1_5_dev_kernel-20110224-1114_linux-2.6.35_check/drivers/net/mlx4/mlx4_en.h	2011-02-24 11:45:49.000000000 +0200
+@@ -548,7 +548,8 @@ struct mlx4_en_priv {
+ 	struct mlx4_en_perf_stats pstats;
+ 	struct mlx4_en_pkt_stats pkstats;
+ 	struct mlx4_en_port_stats port_stats;
+-	struct dev_mc_list *mc_list;
++	char *mc_addrs;
++	int mc_addrs_cnt;
+ 	struct mlx4_en_stat_out_mbox hw_stats;
+ 	int vids[128];
+ };
diff --git a/kernel_patches/backport/3.1/mlx4_en_0030_lro_backport.patch b/kernel_patches/backport/3.1/mlx4_en_0030_lro_backport.patch
new file mode 100644
index 0000000..ca45bd7
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_en_0030_lro_backport.patch
@@ -0,0 +1,864 @@
+From 7b8147a850d4b509b983dfa20afcbf7776a3b3a3 Mon Sep 17 00:00:00 2001
+From: Yevgeny Petrilin <yevgenyp at mellanox.co.il>
+Date: Tue, 4 Aug 2009 15:02:48 +0300
+Subject: [PATCH] mlx4_en: use own lro implemetation
+
+Signed-off-by: Yevgeny Petrilin <yevgenyp at mellanox.co.il>
+---
+ drivers/net/mlx4/Makefile     |    2 +-
+ drivers/net/mlx4/en_ethtool.c |   17 --
+ drivers/net/mlx4/en_lro.c     |  538 +++++++++++++++++++++++++++++++++++++++++
+ drivers/net/mlx4/en_rx.c      |  109 +++------
+ drivers/net/mlx4/mlx4_en.h    |   51 ++++-
+ 5 files changed, 619 insertions(+), 98 deletions(-)
+ create mode 100644 drivers/net/mlx4/en_lro.c
+
+Index: ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/Makefile
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check.orig/drivers/net/mlx4/Makefile	2011-02-02 12:38:18.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/Makefile	2011-02-02 14:23:41.000000000 +0200
+@@ -6,4 +6,4 @@ mlx4_core-y :=	alloc.o catas.o cmd.o cq.
+ obj-$(CONFIG_MLX4_EN)               += mlx4_en.o
+ 
+ mlx4_en-y := 	en_main.o en_tx.o en_rx.o en_ethtool.o en_port.o en_cq.o \
+-		en_resources.o en_netdev.o en_frag.o en_selftest.o
++		en_resources.o en_netdev.o en_frag.o en_selftest.o en_lro.o
+Index: ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/en_ethtool.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check.orig/drivers/net/mlx4/en_ethtool.c	2011-02-02 12:38:23.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/en_ethtool.c	2011-02-02 14:23:41.000000000 +0200
+@@ -40,21 +40,6 @@
+ #include "en_port.h"
+ 
+ 
+-static void mlx4_en_update_lro_stats(struct mlx4_en_priv *priv)
+-{
+-	int i;
+-
+-	priv->port_stats.lro_aggregated = 0;
+-	priv->port_stats.lro_flushed = 0;
+-	priv->port_stats.lro_no_desc = 0;
+-
+-	for (i = 0; i < priv->rx_ring_num; i++) {
+-		priv->port_stats.lro_aggregated += priv->rx_ring[i].lro.stats.aggregated;
+-		priv->port_stats.lro_flushed += priv->rx_ring[i].lro.stats.flushed;
+-		priv->port_stats.lro_no_desc += priv->rx_ring[i].lro.stats.no_desc;
+-	}
+-}
+-
+ static void
+ mlx4_en_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
+ {
+@@ -208,8 +193,6 @@ static void mlx4_en_get_ethtool_stats(st
+ 
+ 	spin_lock_bh(&priv->stats_lock);
+ 
+-	mlx4_en_update_lro_stats(priv);
+-
+ 	for (i = 0; i < NUM_MAIN_STATS; i++)
+ 		data[index++] = ((unsigned long *) &priv->stats)[i];
+ 	for (i = 0; i < NUM_PORT_STATS; i++)
+Index: ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/en_lro.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/en_lro.c	2011-02-02 14:23:41.000000000 +0200
+@@ -0,0 +1,539 @@
++/*
++ * Copyright (c) 2007 Mellanox Technologies. 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 <linux/netdevice.h>
++#include <linux/etherdevice.h>
++#include <linux/ip.h>
++#include <linux/tcp.h>
++#include <net/tcp.h>
++#include <linux/if_vlan.h>
++#include <linux/delay.h>
++
++#include "mlx4_en.h"
++
++/* LRO hash function - using sum of source and destination port LSBs is
++ * good enough */
++#define LRO_INDEX(th, size) \
++	((*((u8 *) &th->source + 1) + *((u8 *) &th->dest + 1)) & (size - 1))
++
++/* #define CONFIG_MLX4_EN_DEBUG_LRO */
++
++#ifdef CONFIG_MLX4_EN_DEBUG_LRO
++static void mlx4_en_lro_validate(struct mlx4_en_priv *priv, struct mlx4_en_lro *lro)
++{
++	int i;
++	int size, size2;
++	struct sk_buff *skb = lro->skb;
++	skb_frag_t *frags;
++	int len, len2;
++	int cur_skb = 0;
++
++	/* Sum fragment sizes of first skb */
++	len = skb->len;
++	size = skb_headlen(skb);
++	frags = skb_shinfo(skb)->frags;
++	for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
++		size += frags[i].size;
++
++	/* Add in fragments of linked skb's */
++	skb = skb_shinfo(skb)->frag_list;
++	while (skb) {
++		cur_skb++;
++		len2 = skb->len;
++		if (skb_headlen(skb)) {
++			mlx4_err(priv->mdev, "Bad LRO format: non-zero headlen "
++				  "in fraglist (skb:%d)\n", cur_skb);
++			return;
++		}
++
++		size2 = 0;
++		frags = skb_shinfo(skb)->frags;
++		for (i = 0; i < skb_shinfo(skb)->nr_frags; i++)
++			size2 += frags[i].size;
++
++		if (size2 != len2) {
++			mlx4_err(priv->mdev, "Bad skb size:%d in LRO fraglist. "
++				 "Expected:%d (skb:%d)\n", size2, len2, cur_skb);
++			return;
++		}
++		size += size2;
++		skb = skb->next;
++	}
++
++	if (size != len)
++		mlx4_err(priv->mdev, "Bad LRO size:%d expected:%d\n", size, len);
++}
++#endif /* MLX4_EN_DEBUG_LRO */
++
++static void mlx4_en_lro_flush_single(struct mlx4_en_priv *priv,
++		   struct mlx4_en_rx_ring *ring, struct mlx4_en_lro *lro)
++{
++	struct sk_buff *skb = lro->skb;
++	struct iphdr *iph = (struct iphdr *) skb->data;
++	struct tcphdr *th = (struct tcphdr *)(iph + 1);
++	unsigned int headlen = skb_headlen(skb);
++	__wsum tcp_hdr_csum;
++	u32 *ts;
++
++	/* Update IP length and checksum */
++	iph->tot_len = htons(lro->tot_len);
++	iph->check = 0;
++	iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
++
++	/* Update latest TCP ack, window, psh, and timestamp */
++	th->ack_seq = lro->ack_seq;
++	th->window = lro->window;
++	th->psh = !!lro->psh;
++	if (lro->has_timestamp) {
++		ts = (u32 *) (th + 1);
++		ts[1] = htonl(lro->tsval);
++		ts[2] = lro->tsecr;
++	}
++	th->check = 0;
++	tcp_hdr_csum = csum_partial((u8 *)th, th->doff << 2, 0);
++	lro->data_csum = csum_add(lro->data_csum, tcp_hdr_csum);
++	th->check = csum_tcpudp_magic(iph->saddr, iph->daddr,
++				      lro->tot_len - (iph->ihl << 2),
++				      IPPROTO_TCP, lro->data_csum);
++
++	/* Update skb */
++	skb->len = lro->tot_len;
++	skb->data_len = lro->tot_len - headlen;
++	skb->truesize = skb->len + sizeof(struct sk_buff);
++	skb_shinfo(skb)->gso_size = lro->mss;
++	skb_shinfo(skb)->gso_type |= SKB_GSO_TCPV4;
++
++#ifdef CONFIG_MLX4_EN_DEBUG_LRO
++	mlx4_en_lro_validate(priv, lro);
++#endif /* CONFIG_MLX4_EN_DEBUG_LRO */
++
++	/* Push it up the stack */
++	if (priv->vlgrp && lro->has_vlan)
++		vlan_hwaccel_receive_skb(skb, priv->vlgrp,
++					be16_to_cpu(lro->vlan_prio));
++	else
++		netif_receive_skb(skb);
++	priv->dev->last_rx = jiffies;
++
++	/* Increment stats */
++	priv->port_stats.lro_flushed++;
++
++	/* Move session back to the free list */
++	hlist_del(&lro->node);
++	hlist_del(&lro->flush_node);
++	hlist_add_head(&lro->node, &ring->lro_free);
++}
++
++void mlx4_en_lro_flush(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring, u8 all)
++{
++	struct mlx4_en_lro *lro;
++	struct hlist_node *node, *tmp;
++
++	hlist_for_each_entry_safe(lro, node, tmp, &ring->lro_flush, flush_node) {
++		if (all || time_after(jiffies, lro->expires))
++			mlx4_en_lro_flush_single(priv, ring, lro);
++	}
++}
++
++static inline int mlx4_en_lro_append(struct mlx4_en_priv *priv,
++				   struct mlx4_en_lro *lro,
++				   struct mlx4_en_rx_desc *rx_desc,
++				   struct skb_frag_struct *skb_frags,
++				   struct mlx4_en_rx_alloc *page_alloc,
++				   unsigned int data_len,
++				   int hlen)
++{
++	struct sk_buff *skb = lro->skb_last;
++	struct skb_shared_info *info;
++	struct skb_frag_struct *frags_copy;
++	int nr_frags;
++
++	if (skb_shinfo(skb)->nr_frags + priv->num_frags > MAX_SKB_FRAGS)
++		return -ENOMEM;
++
++	info = skb_shinfo(skb);
++
++	/* Copy fragments from descriptor ring to skb */
++	frags_copy = info->frags + info->nr_frags;
++	nr_frags = mlx4_en_complete_rx_desc(priv, rx_desc, skb_frags,
++						frags_copy,
++						page_alloc,
++						data_len + hlen);
++	if (!nr_frags) {
++		en_dbg(DRV, priv, "Failed completing rx desc during LRO append\n");
++		return -ENOMEM;
++	}
++
++	/* Skip over headers */
++	frags_copy[0].page_offset += hlen;
++
++	if (nr_frags == 1)
++		frags_copy[0].size = data_len;
++	else {
++		/* Adjust size of last fragment to match packet length.
++		 * Note: if this fragment is also the first one, the
++		 *       operation is completed in the next line */
++		frags_copy[nr_frags - 1].size = hlen + data_len -
++				priv->frag_info[nr_frags - 1].frag_prefix_size;
++
++		/* Adjust size of first fragment */
++		frags_copy[0].size -= hlen;
++	}
++
++	/* Update skb bookkeeping */
++	skb->len += data_len;
++	skb->data_len += data_len;
++	info->nr_frags += nr_frags;
++	return 0;
++}
++
++static inline struct mlx4_en_lro *mlx4_en_lro_find_session(struct mlx4_en_dev *mdev,
++						       struct mlx4_en_rx_ring *ring,
++						       struct iphdr *iph,
++						       struct tcphdr *th)
++{
++	struct mlx4_en_lro *lro;
++	struct hlist_node *node;
++	int index = LRO_INDEX(th, mdev->profile.num_lro);
++	struct hlist_head *list = &ring->lro_hash[index];
++
++	hlist_for_each_entry(lro, node, list, node) {
++		if (lro->sport_dport == *((u32 *) &th->source) &&
++		    lro->saddr == iph->saddr &&
++		    lro->daddr == iph->daddr)
++			return lro;
++	}
++	return NULL;
++}
++
++static inline struct mlx4_en_lro *mlx4_en_lro_alloc_session(struct mlx4_en_priv *priv,
++							struct mlx4_en_rx_ring *ring)
++{
++	return hlist_empty(&ring->lro_free) ? NULL :
++		hlist_entry(ring->lro_free.first, struct mlx4_en_lro, node);
++}
++
++static __wsum mlx4_en_lro_tcp_data_csum(struct iphdr *iph,
++					struct tcphdr *th, int len)
++{
++	__wsum tcp_csum;
++	__wsum tcp_hdr_csum;
++	__wsum tcp_ps_hdr_csum;
++
++	tcp_csum = ~csum_unfold(th->check);
++	tcp_hdr_csum = csum_partial((u8 *)th, th->doff << 2, tcp_csum);
++
++	tcp_ps_hdr_csum = csum_tcpudp_nofold(iph->saddr, iph->daddr,
++					     len + (th->doff << 2),
++					     IPPROTO_TCP, 0);
++
++	return csum_sub(csum_sub(tcp_csum, tcp_hdr_csum),
++			tcp_ps_hdr_csum);
++}
++
++int mlx4_en_lro_rx(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring,
++					  struct mlx4_en_rx_desc *rx_desc,
++					  struct skb_frag_struct *skb_frags,
++					  unsigned int length,
++					  struct mlx4_cqe *cqe)
++{
++	struct mlx4_en_dev *mdev = priv->mdev;
++	struct mlx4_en_lro *lro;
++	struct sk_buff *skb;
++	struct iphdr *iph;
++	struct tcphdr *th;
++	dma_addr_t dma;
++	int tcp_hlen;
++	int tcp_data_len;
++	int hlen;
++	u16 ip_len;
++	void *va;
++	u32 *ts;
++	u32 seq;
++	u32 tsval = (u32) ~0UL;
++	u32 tsecr = 0;
++	u32 ack_seq;
++	u16 window;
++
++	/* This packet is eligible for LRO if it is:
++	 * - DIX Ethernet (type interpretation)
++	 * - TCP/IP (v4)
++	 * - without IP options
++	 * - not an IP fragment */
++	if (!mlx4_en_can_lro(cqe->status))
++			return -1;
++
++	/* Get pointer to TCP header. We already know that the packet is DIX Ethernet/IPv4/TCP
++	 * with no VLAN (HW stripped it) and no IP options */
++	va = page_address(skb_frags[0].page) + skb_frags[0].page_offset;
++	iph = va + ETH_HLEN;
++	th = (struct tcphdr *)(iph + 1);
++
++	/* Synchronsize headers for processing */
++	dma = be64_to_cpu(rx_desc->data[0].addr);
++#define MAX_LRO_HEADER		(ETH_HLEN + \
++				 sizeof(*iph) + \
++				 sizeof(*th) + \
++				 TCPOLEN_TSTAMP_ALIGNED)
++	dma_sync_single_range_for_cpu(&mdev->pdev->dev, dma, 0,
++				      MAX_LRO_HEADER, DMA_FROM_DEVICE);
++
++	/* We only handle aligned timestamp options */
++	tcp_hlen = (th->doff << 2);
++	if (tcp_hlen == sizeof(*th) + TCPOLEN_TSTAMP_ALIGNED) {
++		ts = (u32 *) (th + 1);
++		if (unlikely(*ts != htonl((TCPOPT_NOP << 24) |
++					  (TCPOPT_NOP << 16) |
++					  (TCPOPT_TIMESTAMP << 8) |
++					  TCPOLEN_TIMESTAMP)))
++			goto sync_device;
++		tsval = ntohl(ts[1]);
++		tsecr = ts[2];
++	} else if (tcp_hlen != sizeof(*th))
++		goto sync_device;
++
++
++	/* At this point we know we have a TCP packet that is likely to be
++	 * eligible for LRO. Therefore, see now if we have an oustanding
++	 * session that corresponds to this packet so we could flush it if
++	 * something still prevents LRO */
++	lro = mlx4_en_lro_find_session(mdev, ring, iph, th);
++
++	/* ensure no bits set besides ack or psh */
++	if (th->fin || th->syn || th->rst || th->urg || th->ece ||
++	    th->cwr || !th->ack) {
++		if (lro) {
++			/* First flush session to keep packets in-order */
++			mlx4_en_lro_flush_single(priv, ring, lro);
++		}
++		goto sync_device;
++	}
++
++	/* Get ip length and verify that the frame is big enough */
++	ip_len = ntohs(iph->tot_len);
++	if (unlikely(length < ETH_HLEN + ip_len)) {
++		en_warn(priv, "Cannot LRO - ip payload exceeds frame!\n");
++		goto sync_device;
++	}
++
++	/* Get TCP payload length */
++	tcp_data_len = ip_len - tcp_hlen - sizeof(struct iphdr);
++	seq = ntohl(th->seq);
++	if (!tcp_data_len)
++		goto flush_session;
++
++	if (lro) {
++		/* Check VLAN tag */
++		if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) {
++			if (cqe->sl_vid != lro->vlan_prio || !lro->has_vlan) {
++				mlx4_en_lro_flush_single(priv, ring, lro);
++				goto sync_device;
++			}
++		} else if (lro->has_vlan) {
++			mlx4_en_lro_flush_single(priv, ring, lro);
++			goto sync_device;
++		}
++
++		/* Check sequence number */
++		if (unlikely(seq != lro->next_seq)) {
++			mlx4_en_lro_flush_single(priv, ring, lro);
++			goto sync_device;
++		}
++
++		/* If the cummulative IP length is over 64K, flush and start
++		 * a new session */
++		if (lro->tot_len + tcp_data_len > 0xffff) {
++			mlx4_en_lro_flush_single(priv, ring, lro);
++			goto new_session;
++		}
++
++		/* Check timestamps */
++		if (tcp_hlen != sizeof(*th)) {
++			if (unlikely(lro->tsval > tsval || !tsecr))
++				goto sync_device;
++		}
++
++		window = th->window;
++		ack_seq = th->ack_seq;
++		if (likely(tcp_data_len)) {
++			/* Append the data! */
++			hlen = ETH_HLEN + sizeof(struct iphdr) + tcp_hlen;
++			if (mlx4_en_lro_append(priv, lro, rx_desc, skb_frags,
++							ring->page_alloc,
++							tcp_data_len, hlen)) {
++				mlx4_en_lro_flush_single(priv, ring, lro);
++				goto sync_device;
++			}
++		} else {
++			/* No data */
++			dma_sync_single_range_for_device(&mdev->dev->pdev->dev, dma,
++							 0, MAX_LRO_HEADER,
++							 DMA_FROM_DEVICE);
++		}
++
++		/* Update session */
++		lro->psh |= th->psh;
++		lro->next_seq += tcp_data_len;
++		lro->data_csum = csum_block_add(lro->data_csum,
++					mlx4_en_lro_tcp_data_csum(iph, th,
++								  tcp_data_len),
++					lro->tot_len);
++		lro->tot_len += tcp_data_len;
++		lro->tsval = tsval;
++		lro->tsecr = tsecr;
++		lro->ack_seq = ack_seq;
++		lro->window = window;
++		if (tcp_data_len > lro->mss)
++			lro->mss = tcp_data_len;
++		priv->port_stats.lro_aggregated++;
++		if (th->psh)
++			mlx4_en_lro_flush_single(priv, ring, lro);
++		return 0;
++	}
++
++new_session:
++	if (th->psh)
++		goto sync_device;
++	lro = mlx4_en_lro_alloc_session(priv, ring);
++	if (lro) {
++		skb = mlx4_en_rx_skb(priv, rx_desc, skb_frags, ring->page_alloc,
++							     ETH_HLEN + ip_len);
++		if (skb) {
++			int index;
++
++			/* Add in the skb */
++			lro->skb = skb;
++			lro->skb_last = skb;
++			skb->protocol = eth_type_trans(skb, priv->dev);
++			skb->ip_summed = CHECKSUM_UNNECESSARY;
++
++			/* Initialize session */
++			lro->saddr = iph->saddr;
++			lro->daddr = iph->daddr;
++			lro->sport_dport = *((u32 *) &th->source);
++
++			lro->next_seq = seq + tcp_data_len;
++			lro->tot_len = ip_len;
++			lro->psh = th->psh;
++			lro->ack_seq = th->ack_seq;
++			lro->window = th->window;
++			lro->mss = tcp_data_len;
++			lro->data_csum = mlx4_en_lro_tcp_data_csum(iph, th,
++						tcp_data_len);
++
++			/* Handle vlans */
++			if (be32_to_cpu(cqe->vlan_my_qpn) & MLX4_CQE_VLAN_PRESENT_MASK) {
++				lro->vlan_prio = cqe->sl_vid;
++				lro->has_vlan = 1;
++			} else
++				lro->has_vlan = 0;
++
++			/* Handle timestamps */
++			if (tcp_hlen != sizeof(*th)) {
++				lro->tsval = tsval;
++				lro->tsecr = tsecr;
++				lro->has_timestamp = 1;
++			} else {
++				lro->tsval = (u32) ~0UL;
++				lro->has_timestamp = 0;
++			}
++
++			/* Activate this session */
++			lro->expires = jiffies + HZ / 25;
++			hlist_del(&lro->node);
++			index = LRO_INDEX(th, mdev->profile.num_lro);
++
++			hlist_add_head(&lro->node, &ring->lro_hash[index]);
++			hlist_add_head(&lro->flush_node, &ring->lro_flush);
++			priv->port_stats.lro_aggregated++;
++			return 0;
++		} else {
++			/* Packet is dropped because we were not able to allocate new
++			 * page for fragments */
++			dma_sync_single_range_for_device(&mdev->pdev->dev, dma,
++							 0, MAX_LRO_HEADER,
++							 DMA_FROM_DEVICE);
++			return 0;
++		}
++	} else {
++		priv->port_stats.lro_no_desc++;
++	}
++
++flush_session:
++	if (lro)
++		mlx4_en_lro_flush_single(priv, ring, lro);
++sync_device:
++	dma_sync_single_range_for_device(&mdev->pdev->dev, dma, 0,
++					 MAX_LRO_HEADER, DMA_FROM_DEVICE);
++	return -1;
++}
++
++void mlx4_en_lro_destroy(struct mlx4_en_rx_ring *ring)
++{
++	struct mlx4_en_lro *lro;
++	struct hlist_node *node, *tmp;
++
++	hlist_for_each_entry_safe(lro, node, tmp, &ring->lro_free, node) {
++		hlist_del(&lro->node);
++		kfree(lro);
++	}
++	kfree(ring->lro_hash);
++}
++
++int mlx4_en_lro_init(struct mlx4_en_rx_ring *ring, int num_lro)
++{
++	struct mlx4_en_lro *lro;
++	int i;
++
++	INIT_HLIST_HEAD(&ring->lro_free);
++	INIT_HLIST_HEAD(&ring->lro_flush);
++	ring->lro_hash = kmalloc(sizeof(struct hlist_head) * num_lro,
++				 GFP_KERNEL);
++	if (!ring->lro_hash)
++		return -ENOMEM;
++
++	for (i = 0; i < num_lro; i++) {
++		INIT_HLIST_HEAD(&ring->lro_hash[i]);
++		lro = kzalloc(sizeof(struct mlx4_en_lro), GFP_KERNEL);
++		if (!lro) {
++			mlx4_en_lro_destroy(ring);
++			return -ENOMEM;
++		}
++		INIT_HLIST_NODE(&lro->node);
++		INIT_HLIST_NODE(&lro->flush_node);
++		hlist_add_head(&lro->node, &ring->lro_free);
++	}
++	return 0;
++}
++
++
+Index: ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/en_rx.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check.orig/drivers/net/mlx4/en_rx.c	2011-02-02 12:38:26.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/en_rx.c	2011-02-02 14:23:41.000000000 +0200
+@@ -41,18 +41,6 @@
+ #include "mlx4_en.h"
+ 
+ 
+-static int mlx4_en_get_frag_header(struct skb_frag_struct *frags, void **mac_hdr,
+-				   void **ip_hdr, void **tcpudp_hdr,
+-				   u64 *hdr_flags, void *priv)
+-{
+-	*mac_hdr = page_address(frags->page) + frags->page_offset;
+-	*ip_hdr = *mac_hdr + ETH_HLEN;
+-	*tcpudp_hdr = (struct tcphdr *)(*ip_hdr + sizeof(struct iphdr));
+-	*hdr_flags = LRO_IPV4 | LRO_TCP;
+-
+-	return 0;
+-}
+-
+ enum {
+ 	MIN_RX_ARM = 1024,
+ };
+@@ -381,23 +369,14 @@ int mlx4_en_create_rx_ring(struct mlx4_e
+ 	}
+ 	ring->buf = ring->wqres.buf.direct.buf;
+ 
+-	/* Configure lro mngr */
+-	memset(&ring->lro, 0, sizeof(struct net_lro_mgr));
+-	ring->lro.dev = priv->dev;
+-	ring->lro.features = LRO_F_NAPI;
+-	ring->lro.frag_align_pad = NET_IP_ALIGN;
+-	ring->lro.ip_summed = CHECKSUM_UNNECESSARY;
+-	ring->lro.ip_summed_aggr = CHECKSUM_UNNECESSARY;
+-	ring->lro.max_desc = mdev->profile.num_lro;
+-	ring->lro.max_aggr = MAX_SKB_FRAGS;
+-	ring->lro.lro_arr = kzalloc(mdev->profile.num_lro *
+-				    sizeof(struct net_lro_desc),
+-				    GFP_KERNEL);
+-	if (!ring->lro.lro_arr) {
+-		en_err(priv, "Failed to allocate lro array\n");
+-		goto err_map;
++	/* Allocate LRO sessions */
++	if (mdev->profile.num_lro) {
++		err =  mlx4_en_lro_init(ring, mdev->profile.num_lro);
++		if (err) {
++			en_err(priv, "Failed allocating lro sessions\n");
++			goto err_map;
++		}
+ 	}
+-	ring->lro.get_frag_header = mlx4_en_get_frag_header;
+ 
+ 	return 0;
+ 
+@@ -488,7 +467,8 @@ void mlx4_en_destroy_rx_ring(struct mlx4
+ {
+ 	struct mlx4_en_dev *mdev = priv->mdev;
+ 
+-	kfree(ring->lro.lro_arr);
++	if (mdev->profile.num_lro)
++		mlx4_en_lro_destroy(ring);
+ 	mlx4_en_unmap_buffer(&ring->wqres.buf);
+ 	mlx4_free_hwq_res(mdev->dev, &ring->wqres, ring->buf_size + TXBB_SIZE);
+ 	vfree(ring->rx_info);
+@@ -507,12 +487,12 @@ void mlx4_en_deactivate_rx_ring(struct m
+ 
+ 
+ /* Unmap a completed descriptor and free unused pages */
+-static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
+-				    struct mlx4_en_rx_desc *rx_desc,
+-				    struct skb_frag_struct *skb_frags,
+-				    struct skb_frag_struct *skb_frags_rx,
+-				    struct mlx4_en_rx_alloc *page_alloc,
+-				    int length)
++int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
++			     struct mlx4_en_rx_desc *rx_desc,
++			     struct skb_frag_struct *skb_frags,
++			     struct skb_frag_struct *skb_frags_rx,
++			     struct mlx4_en_rx_alloc *page_alloc,
++			     int length)
+ {
+ 	struct mlx4_en_dev *mdev = priv->mdev;
+ 	struct mlx4_en_frag_info *frag_info;
+@@ -555,11 +535,11 @@ fail:
+ }
+ 
+ 
+-static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
+-				      struct mlx4_en_rx_desc *rx_desc,
+-				      struct skb_frag_struct *skb_frags,
+-				      struct mlx4_en_rx_alloc *page_alloc,
+-				      unsigned int length)
++struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
++			       struct mlx4_en_rx_desc *rx_desc,
++			       struct skb_frag_struct *skb_frags,
++			       struct mlx4_en_rx_alloc *page_alloc,
++			       unsigned int length)
+ {
+ 	struct mlx4_en_dev *mdev = priv->mdev;
+ 	struct sk_buff *skb;
+@@ -793,14 +773,13 @@ out:
+ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int budget)
+ {
+ 	struct mlx4_en_priv *priv = netdev_priv(dev);
++	struct mlx4_en_dev *mdev = priv->mdev;
+ 	struct mlx4_cqe *cqe;
+ 	struct mlx4_en_rx_ring *ring = &priv->rx_ring[cq->ring];
+ 	struct skb_frag_struct *skb_frags;
+-	struct skb_frag_struct lro_frags[MLX4_EN_MAX_RX_FRAGS];
+ 	struct mlx4_en_rx_desc *rx_desc;
+ 	struct sk_buff *skb;
+ 	int index;
+-	int nr;
+ 	unsigned int length;
+ 	int polled = 0;
+ 	int ip_summed;
+@@ -838,40 +817,12 @@ int mlx4_en_process_rx_cq(struct net_dev
+ 
+ 		if (likely(priv->rx_csum)) {
+ 			if ((cqe->status & cpu_to_be16(MLX4_CQE_STATUS_IPOK)) &&
+-			    (cqe->checksum == cpu_to_be16(0xffff))) {
++			    (cqe->checksum == 0xffff)) {
+ 				priv->port_stats.rx_chksum_good++;
+-				/* This packet is eligible for LRO if it is:
+-				 * - DIX Ethernet (type interpretation)
+-				 * - TCP/IP (v4)
+-				 * - without IP options
+-				 * - not an IP fragment */
+-				if (mlx4_en_can_lro(cqe->status) &&
+-				    dev->features & NETIF_F_LRO) {
+-
+-					nr = mlx4_en_complete_rx_desc(
+-						priv, rx_desc,
+-						skb_frags, lro_frags,
+-						ring->page_alloc, length);
+-					if (!nr)
+-						goto next;
+-
+-					if (priv->vlgrp && (cqe->vlan_my_qpn &
+-							    cpu_to_be32(MLX4_CQE_VLAN_PRESENT_MASK))) {
+-						lro_vlan_hwaccel_receive_frags(
+-						       &ring->lro, lro_frags,
+-						       length, length,
+-						       priv->vlgrp,
+-						       be16_to_cpu(cqe->sl_vid),
+-						       NULL, 0);
+-					} else
+-						lro_receive_frags(&ring->lro,
+-								  lro_frags,
+-								  length,
+-								  length,
+-								  NULL, 0);
+-
+-					goto next;
+-				}
++				if (mdev->profile.num_lro &&
++				    !mlx4_en_lro_rx(priv, ring, rx_desc,
++						    skb_frags, length, cqe))
++                                        goto next;
+ 
+ 				/* LRO not possible, complete processing here */
+ 				ip_summed = CHECKSUM_UNNECESSARY;
+@@ -899,7 +850,6 @@ int mlx4_en_process_rx_cq(struct net_dev
+ 
+ 		skb->ip_summed = ip_summed;
+ 		skb->protocol = eth_type_trans(skb, dev);
+-		skb_record_rx_queue(skb, cq->ring);
+ 
+ 		/* Push it up the stack */
+ 		if (priv->vlgrp && (be32_to_cpu(cqe->vlan_my_qpn) &
+@@ -916,13 +866,15 @@ next:
+ 		if (++polled == budget) {
+ 			/* We are here because we reached the NAPI budget -
+ 			 * flush only pending LRO sessions */
+-			lro_flush_all(&ring->lro);
++			if (mdev->profile.num_lro)
++				mlx4_en_lro_flush(priv, ring, 0);
+ 			goto out;
+ 		}
+ 	}
+ 
+ 	/* If CQ is empty flush all LRO sessions unconditionally */
+-	lro_flush_all(&ring->lro);
++	if (mdev->profile.num_lro)
++		mlx4_en_lro_flush(priv, ring, 1);
+ 
+ out:
+ 	AVG_PERF_COUNTER(priv->pstats.rx_coal_avg, polled);
+Index: ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/mlx4_en.h
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check.orig/drivers/net/mlx4/mlx4_en.h	2011-02-02 12:38:26.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1215_linux-2.6.34_check/drivers/net/mlx4/mlx4_en.h	2011-02-02 14:43:28.000000000 +0200
+@@ -302,10 +302,40 @@ struct mlx4_en_rx_desc {
+ 	struct mlx4_wqe_data_seg data[0];
+ };
+ 
++struct mlx4_en_lro {
++	struct hlist_node node;
++	struct hlist_node flush_node;
++
++	/* Id fields come first: */
++	u32 saddr;
++	u32 daddr;
++	u32 sport_dport;
++	u32 next_seq;
++	u16 tot_len;
++	u8 psh;
++
++	u32 tsval;
++	u32 tsecr;
++	u32 ack_seq;
++	u16 window;
++	__be16 vlan_prio;
++	u16 has_vlan;
++	u16 has_timestamp;
++	u16 mss;
++	__wsum  data_csum;
++
++	unsigned long expires;
++	struct sk_buff *skb;
++	struct sk_buff *skb_last;
++};
++
+ struct mlx4_en_rx_ring {
+ 	struct mlx4_hwq_resources wqres;
+ 	struct mlx4_en_rx_alloc page_alloc[MLX4_EN_MAX_RX_FRAGS];
+-	struct net_lro_mgr lro;
++	struct mlx4_en_lro lro;
++	struct hlist_head *lro_hash;
++	struct hlist_head lro_free;
++	struct hlist_head lro_flush;
+ 	u32 size ;	/* number of Rx descs*/
+ 	u32 actual_size;
+ 	u32 size_mask;
+@@ -618,6 +648,25 @@ void mlx4_en_release_rss_steer(struct ml
+ int mlx4_en_free_tx_buf(struct net_device *dev, struct mlx4_en_tx_ring *ring);
+ void mlx4_en_rx_irq(struct mlx4_cq *mcq);
+ 
++struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv,
++			       struct mlx4_en_rx_desc *rx_desc,
++			       struct skb_frag_struct *skb_frags,
++			       struct mlx4_en_rx_alloc *page_alloc,
++			       unsigned int length);
++int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
++			     struct mlx4_en_rx_desc *rx_desc,
++			     struct skb_frag_struct *skb_frags,
++			     struct skb_frag_struct *skb_frags_rx,
++			     struct mlx4_en_rx_alloc *page_alloc,
++			     int length);
++void mlx4_en_lro_flush(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring, u8 all);
++int mlx4_en_lro_rx(struct mlx4_en_priv *priv, struct mlx4_en_rx_ring *ring,
++		   struct mlx4_en_rx_desc *rx_desc,
++		   struct skb_frag_struct *skb_frags,
++		   unsigned int length, struct mlx4_cqe *cqe);
++void mlx4_en_lro_destroy(struct mlx4_en_rx_ring *ring);
++int mlx4_en_lro_init(struct mlx4_en_rx_ring *ring, int num_lro);
++
+ int mlx4_SET_VLAN_FLTR(struct mlx4_dev *dev, u8 port, struct vlan_group *grp);
+ int mlx4_SET_PORT_general(struct mlx4_dev *dev, u8 port, int mtu,
+ 			  u8 pptx, u8 pfctx, u8 pprx, u8 pfcrx);
diff --git a/kernel_patches/backport/3.1/mlx4_en_0040_to_2_6_37.patch b/kernel_patches/backport/3.1/mlx4_en_0040_to_2_6_37.patch
new file mode 100644
index 0000000..55e6ba0
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_en_0040_to_2_6_37.patch
@@ -0,0 +1,22 @@
+Index: ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/net/mlx4/en_ethtool.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check.orig/drivers/net/mlx4/en_ethtool.c	2011-06-17 21:49:32.000000000 +0300
++++ ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/net/mlx4/en_ethtool.c	2011-06-17 21:51:06.000000000 +0300
+@@ -77,7 +77,7 @@ static int mlx4_en_set_tso(struct net_de
+ 		if (priv->vlgrp) {
+ 			int i;
+ 			struct net_device *vdev;
+-			for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
++			for (i = 0; i < VLAN_N_VID; i++) {
+ 				vdev = vlan_group_get_device(priv->vlgrp, i);
+ 				if (vdev) {
+ 					vdev->features |= (NETIF_F_TSO | NETIF_F_TSO6);
+@@ -94,7 +94,7 @@ static int mlx4_en_set_tso(struct net_de
+ 		if (priv->vlgrp) {
+ 			int i;
+ 			struct net_device *vdev;
+-			for (i = 0; i < VLAN_GROUP_ARRAY_LEN; i++) {
++			for (i = 0; i < VLAN_N_VID; i++) {
+ 				vdev = vlan_group_get_device(priv->vlgrp, i);
+ 				if (vdev) {
+ 					vdev->features &= ~(NETIF_F_TSO | NETIF_F_TSO6);
diff --git a/kernel_patches/backport/3.1/mlx4_semaphore_include.patch b/kernel_patches/backport/3.1/mlx4_semaphore_include.patch
new file mode 100644
index 0000000..011d364
--- /dev/null
+++ b/kernel_patches/backport/3.1/mlx4_semaphore_include.patch
@@ -0,0 +1,14 @@
+From: Sven-Thorsten Dietrich <sdietrich at suse.de>
+Subject: Include semaphore.h explicitly.
+
+Signed-off-by: Sven-Thorsten Dietrich <sdietrich at suse.de>
+--- a/drivers/net/mlx4/cmd.c	2012-09-01 10:14:58.000000000 -0700
++++ b/drivers/net/mlx4//cmd.c	2012-09-01 13:19:46.000000000 -0700
+@@ -35,6 +35,7 @@
+ #include <linux/sched.h>
+ #include <linux/pci.h>
+ #include <linux/errno.h>
++#include <linux/semaphore.h>
+ 
+ #include <linux/mlx4/cmd.h>
+ 
diff --git a/kernel_patches/backport/3.1/mthca_0010_for_2.6.35.patch b/kernel_patches/backport/3.1/mthca_0010_for_2.6.35.patch
new file mode 100644
index 0000000..271508c
--- /dev/null
+++ b/kernel_patches/backport/3.1/mthca_0010_for_2.6.35.patch
@@ -0,0 +1,51 @@
+From 99987bea474ceca8ec6fb05f81d7d188634cdffd Mon Sep 17 00:00:00 2001
+From: Roland Dreier <rolandd at cisco.com>
+Date: Mon, 22 Jun 2009 23:04:13 -0700
+Subject: [PATCH] IB/mthca: Replace dma_sync_single() use with proper functions
+
+dma_sync_single() is deprecated now, and the use in mthca is wrong:
+there should be a dma_sync_single_for_cpu() before touching the memory
+from the CPU, and a dma_sync_single_for_device() afterwards.  Fix 
+this, prompted by a kick in the pants from a patch from FUJITA
+Tomonori <fujita.tomonori at lab.ntt.co.jp>.
+
+Signed-off-by: Roland Dreier <rolandd at cisco.com>
+
+Index: ofed_kernel-2.6.35/drivers/infiniband/hw/mthca/mthca_mr.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/hw/mthca/mthca_mr.c	2010-11-07 11:10:44.344409335 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/hw/mthca/mthca_mr.c	2010-11-07 11:12:09.629667974 +0200
+@@ -352,10 +352,14 @@
+ 
+ 	BUG_ON(!mtts);
+ 
++	dma_sync_single_for_cpu(&dev->pdev->dev, dma_handle,
++				list_len * sizeof (u64), DMA_TO_DEVICE);
++
+ 	for (i = 0; i < list_len; ++i)
+ 		mtts[i] = cpu_to_be64(buffer_list[i] | MTHCA_MTT_FLAG_PRESENT);
+ 
+-	dma_sync_single(&dev->pdev->dev, dma_handle, list_len * sizeof (u64), DMA_TO_DEVICE);
++	dma_sync_single_for_device(&dev->pdev->dev, dma_handle,
++				   list_len * sizeof (u64), DMA_TO_DEVICE);
+ }
+ 
+ int mthca_write_mtt(struct mthca_dev *dev, struct mthca_mtt *mtt,
+@@ -803,12 +807,15 @@
+ 
+ 	wmb();
+ 
++	dma_sync_single_for_cpu(&dev->pdev->dev, fmr->mem.arbel.dma_handle,
++				list_len * sizeof(u64), DMA_TO_DEVICE);
++
+ 	for (i = 0; i < list_len; ++i)
+ 		fmr->mem.arbel.mtts[i] = cpu_to_be64(page_list[i] |
+ 						     MTHCA_MTT_FLAG_PRESENT);
+ 
+-	dma_sync_single(&dev->pdev->dev, fmr->mem.arbel.dma_handle,
+-			list_len * sizeof(u64), DMA_TO_DEVICE);
++	dma_sync_single_for_device(&dev->pdev->dev, fmr->mem.arbel.dma_handle,
++				   list_len * sizeof(u64), DMA_TO_DEVICE);
+ 
+ 	fmr->mem.arbel.mpt->key    = cpu_to_be32(key);
+ 	fmr->mem.arbel.mpt->lkey   = cpu_to_be32(key);
diff --git a/kernel_patches/backport/3.1/net_skb-dst_accessors.patch b/kernel_patches/backport/3.1/net_skb-dst_accessors.patch
new file mode 100644
index 0000000..c742dad
--- /dev/null
+++ b/kernel_patches/backport/3.1/net_skb-dst_accessors.patch
@@ -0,0 +1,149 @@
+From: Sven-Thorsten Dietrich <sdietrich at suse.de>
+Subject: Forward-port new accessor for net: dst.
+
+See Kernel.org:
+commit adf30907d63893e4208dfe3f5c88ae12bc2f25d5
+Author: Eric Dumazet <eric.dumazet at gmail.com>
+Date:   Tue Jun 2 05:19:30 2009 +0000
+Subject: net: skb->dst accessors
+
+Signed-off-by: Sven-Thorsten Dietrich <sdietrich at suse.de>
+--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+@@ -1394,8 +1394,8 @@ void ipoib_cm_skb_too_long(struct net_device *dev, struct sk_buff *skb,
+ 	struct ipoib_dev_priv *priv = netdev_priv(dev);
+ 	int e = skb_queue_empty(&priv->cm.skb_queue);
+ 
+-	if (skb->dst)
+-		skb->dst->ops->update_pmtu(skb->dst, mtu);
++	if (skb_dst(skb))
++		skb_dst(skb)->ops->update_pmtu(skb_dst(skb), mtu);
+ 
+ 	skb_queue_tail(&priv->cm.skb_queue, skb);
+ 	if (e)
+--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
+@@ -561,7 +561,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
+ 	struct ipoib_neigh *neigh;
+ 	unsigned long flags;
+ 
+-	neigh = ipoib_neigh_alloc(skb->dst->neighbour, skb->dev);
++	neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour, skb->dev);
+ 	if (!neigh) {
+ 		++dev->stats.tx_dropped;
+ 		dev_kfree_skb_any(skb);
+@@ -570,9 +570,9 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
+ 
+ 	spin_lock_irqsave(&priv->lock, flags);
+ 
+-	path = __path_find(dev, skb->dst->neighbour->ha + 4);
++	path = __path_find(dev, skb_dst(skb)->neighbour->ha + 4);
+ 	if (!path) {
+-		path = path_rec_create(dev, skb->dst->neighbour->ha + 4);
++		path = path_rec_create(dev, skb_dst(skb)->neighbour->ha + 4);
+ 		if (!path)
+ 			goto err_path;
+ 
+@@ -605,7 +605,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
+ 				goto err_drop;
+ 			}
+ 		} else
+-			ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb->dst->neighbour->ha));
++			ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha));
+ 	} else {
+ 		neigh->ah  = NULL;
+ 
+@@ -635,15 +635,15 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev)
+ 	struct ipoib_dev_priv *priv = netdev_priv(skb->dev);
+ 
+ 	/* Look up path record for unicasts */
+-	if (skb->dst->neighbour->ha[4] != 0xff) {
++	if (skb_dst(skb)->neighbour->ha[4] != 0xff) {
+ 		neigh_add_path(skb, dev);
+ 		return;
+ 	}
+ 
+ 	/* Add in the P_Key for multicasts */
+-	skb->dst->neighbour->ha[8] = (priv->pkey >> 8) & 0xff;
+-	skb->dst->neighbour->ha[9] = priv->pkey & 0xff;
+-	ipoib_mcast_send(dev, skb->dst->neighbour->ha + 4, skb);
++	skb_dst(skb)->neighbour->ha[8] = (priv->pkey >> 8) & 0xff;
++	skb_dst(skb)->neighbour->ha[9] = priv->pkey & 0xff;
++	ipoib_mcast_send(dev, skb_dst(skb)->neighbour->ha + 4, skb);
+ }
+ 
+ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
+@@ -708,16 +708,16 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ 	struct ipoib_neigh *neigh;
+ 	unsigned long flags;
+ 
+-	if (likely(skb->dst && skb->dst->neighbour)) {
+-		if (unlikely(!*to_ipoib_neigh(skb->dst->neighbour))) {
++	if (likely(skb_dst(skb) && skb_dst(skb)->neighbour)) {
++		if (unlikely(!*to_ipoib_neigh(skb_dst(skb)->neighbour))) {
+ 			ipoib_path_lookup(skb, dev);
+ 			return NETDEV_TX_OK;
+ 		}
+ 
+-		neigh = *to_ipoib_neigh(skb->dst->neighbour);
++		neigh = *to_ipoib_neigh(skb_dst(skb)->neighbour);
+ 
+ 		if (unlikely((memcmp(&neigh->dgid.raw,
+-				     skb->dst->neighbour->ha + 4,
++				     skb_dst(skb)->neighbour->ha + 4,
+ 				     sizeof(union ib_gid))) ||
+ 			     (neigh->dev != dev))) {
+ 			spin_lock_irqsave(&priv->lock, flags);
+@@ -743,7 +743,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ 				return NETDEV_TX_OK;
+ 			}
+ 		} else if (neigh->ah) {
+-			ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb->dst->neighbour->ha));
++			ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha));
+ 			return NETDEV_TX_OK;
+ 		}
+ 
+@@ -772,7 +772,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
+ 			if ((be16_to_cpup((__be16 *) skb->data) != ETH_P_ARP) &&
+ 			    (be16_to_cpup((__be16 *) skb->data) != ETH_P_RARP)) {
+ 				ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
+-					   skb->dst ? "neigh" : "dst",
++					   skb_dst(skb) ? "neigh" : "dst",
+ 					   be16_to_cpup((__be16 *) skb->data),
+ 					   IPOIB_QPN(phdr->hwaddr),
+ 					   phdr->hwaddr + 4);
+@@ -817,7 +817,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
+ 	 * destination address onto the front of the skb so we can
+ 	 * figure out where to send the packet later.
+ 	 */
+-	if ((!skb->dst || !skb->dst->neighbour) && daddr) {
++	if ((!skb_dst(skb) || !skb_dst(skb)->neighbour) && daddr) {
+ 		struct ipoib_pseudoheader *phdr =
+ 			(struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
+ 		memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
+--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
++++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+@@ -261,7 +261,7 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
+ 
+ 		skb->dev = dev;
+ 
+-		if (!skb->dst || !skb->dst->neighbour) {
++		if (!skb_dst(skb) || !skb_dst(skb)->neighbour) {
+ 			/* put pseudoheader back on for next time */
+ 			skb_push(skb, sizeof (struct ipoib_pseudoheader));
+ 		}
+@@ -707,10 +707,10 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
+ 
+ out:
+ 	if (mcast && mcast->ah) {
+-		if (skb->dst		&&
+-		    skb->dst->neighbour &&
+-		    !*to_ipoib_neigh(skb->dst->neighbour)) {
+-			struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb->dst->neighbour,
++		if (skb_dst(skb)		&&
++		    skb_dst(skb)->neighbour &&
++		    !*to_ipoib_neigh(skb_dst(skb)->neighbour)) {
++			struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour,
+ 									skb->dev);
+ 
+ 			if (neigh) {
diff --git a/kernel_patches/backport/3.1/new_frags_interface.patch b/kernel_patches/backport/3.1/new_frags_interface.patch
new file mode 100644
index 0000000..7025736
--- /dev/null
+++ b/kernel_patches/backport/3.1/new_frags_interface.patch
@@ -0,0 +1,131 @@
+From: Sven-Thorsten Dietrich <sdietrich at suse.de>
+
+See Kernel.org:
+commit 76620aafd66f0004829764940c5466144969cffc
+Author: Herbert Xu <herbert at gondor.apana.org.au>
+Date:   Thu Apr 16 02:02:07 2009 -0700
+Subject: gro: New frags interface to avoid copying shinfo
+
+
+Signed-off-by: Sven-Thorsten Dietrich <sdietrich at suse.de>
+--- a/drivers/net/cxgb3/adapter.h
++++ b/drivers/net/cxgb3/adapter.h
+@@ -195,7 +195,7 @@ struct sge_qset {		/* an SGE queue set */
+ 	struct sge_rspq rspq;
+ 	struct sge_fl fl[SGE_RXQ_PER_SET];
+ 	struct sge_txq txq[SGE_TXQ_PER_SET];
+-	struct napi_gro_fraginfo lro_frag_tbl;
++	int nomem;
+ 	int lro_enabled;
+ 	void *lro_va;
+ 	struct net_device *netdev;
+--- a/drivers/net/cxgb3/sge.c
++++ b/drivers/net/cxgb3/sge.c
+@@ -654,7 +654,8 @@ static void t3_reset_qset(struct sge_qset *q)
+ 	q->txq_stopped = 0;
+ 	q->tx_reclaim_timer.function = NULL; /* for t3_stop_sge_timers() */
+ 	q->rx_reclaim_timer.function = NULL;
+-	q->lro_frag_tbl.nr_frags = q->lro_frag_tbl.len = 0;
++	q->nomem = 0;
++	napi_free_frags(&q->napi);
+ }
+ 
+ 
+@@ -2074,20 +2075,19 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
+ 			 struct sge_fl *fl, int len, int complete)
+ {
+ 	struct rx_sw_desc *sd = &fl->sdesc[fl->cidx];
++	struct sk_buff *skb = NULL;
+ 	struct cpl_rx_pkt *cpl;
+-	struct skb_frag_struct *rx_frag = qs->lro_frag_tbl.frags;
+-	int nr_frags = qs->lro_frag_tbl.nr_frags;
+-	int frag_len = qs->lro_frag_tbl.len;
++	struct skb_frag_struct *rx_frag;
++	int nr_frags;
+ 	int offset = 0;
+ 
+-	if (!nr_frags) {
+-		offset = 2 + sizeof(struct cpl_rx_pkt);
+-		qs->lro_va = cpl = sd->pg_chunk.va + 2;
++	if (!qs->nomem) {
++		skb = napi_get_frags(&qs->napi);
++		qs->nomem = !skb;
+ 	}
+ 
+ 	fl->credits--;
+ 
+-	len -= offset;
+ 	pci_dma_sync_single_for_cpu(adap->pdev,
+ 				    pci_unmap_addr(sd, dma_addr),
+ 				    fl->buf_size - SGE_PG_RSVD,
+@@ -2100,21 +2100,38 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
+ 			       fl->alloc_size,
+ 			       PCI_DMA_FROMDEVICE);
+ 
++	if (!skb) {
++		put_page(sd->pg_chunk.page);
++		if (complete)
++			qs->nomem = 0;
++		return;
++	}
++
++	rx_frag = skb_shinfo(skb)->frags;
++	nr_frags = skb_shinfo(skb)->nr_frags;
++
++	if (!nr_frags) {
++		offset = 2 + sizeof(struct cpl_rx_pkt);
++		qs->lro_va = sd->pg_chunk.va + 2;
++	}
++	len -= offset;
++
+ 	prefetch(qs->lro_va);
+ 
+ 	rx_frag += nr_frags;
+ 	rx_frag->page = sd->pg_chunk.page;
+ 	rx_frag->page_offset = sd->pg_chunk.offset + offset;
+ 	rx_frag->size = len;
+-	frag_len += len;
+-	qs->lro_frag_tbl.nr_frags++;
+-	qs->lro_frag_tbl.len = frag_len;
+ 
++	skb->len += len;
++	skb->data_len += len;
++	skb->truesize += len;
++	skb_shinfo(skb)->nr_frags++;
+ 
+ 	if (!complete)
+ 		return;
+ 
+-	qs->lro_frag_tbl.ip_summed = CHECKSUM_UNNECESSARY;
++	skb->ip_summed = CHECKSUM_UNNECESSARY;
+ 	cpl = qs->lro_va;
+ 
+ 	if (unlikely(cpl->vlan_valid)) {
+@@ -2123,15 +2140,11 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
+ 		struct vlan_group *grp = pi->vlan_grp;
+ 
+ 		if (likely(grp != NULL)) {
+-			vlan_gro_frags(&qs->napi, grp, ntohs(cpl->vlan),
+-				       &qs->lro_frag_tbl);
+-			goto out;
++			vlan_gro_frags(&qs->napi, grp, ntohs(cpl->vlan));
++			return;
+ 		}
+ 	}
+-	napi_gro_frags(&qs->napi, &qs->lro_frag_tbl);
+-
+-out:
+-	qs->lro_frag_tbl.nr_frags = qs->lro_frag_tbl.len = 0;
++	napi_gro_frags(&qs->napi);
+ }
+ 
+ /**
+@@ -2300,8 +2313,6 @@ no_mem:
+ 			if (fl->use_pages) {
+ 				void *addr = fl->sdesc[fl->cidx].pg_chunk.va;
+ 
+-				prefetch(&qs->lro_frag_tbl);
+-
+ 				prefetch(addr);
+ #if L1_CACHE_BYTES < 128
+ 				prefetch(addr + L1_CACHE_BYTES);
diff --git a/kernel_patches/backport/3.1/qib_to_3.0.patch b/kernel_patches/backport/3.1/qib_to_3.0.patch
new file mode 100644
index 0000000..f9dc5a8
--- /dev/null
+++ b/kernel_patches/backport/3.1/qib_to_3.0.patch
@@ -0,0 +1,102 @@
+diff -rcp a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
+*** a/drivers/infiniband/hw/qib/qib.h	2011-09-23 11:11:54.000000000 -0400
+--- b/drivers/infiniband/hw/qib/qib.h	2011-09-23 11:25:24.449434000 -0400
+*************** struct qib_msix_entry {
+*** 429,434 ****
+--- 429,435 ----
+  	struct msix_entry msix;
+  	void *arg;
+  	char name[MAX_NAME_SIZE];
++ 	cpumask_var_t mask;
+  };
+  
+  /* Below is an opaque struct. Each chip (device) can maintain
+diff -rcp a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
+*** a/drivers/infiniband/hw/qib/qib_iba7322.c	2011-09-23 11:11:54.000000000 -0400
+--- b/drivers/infiniband/hw/qib/qib_iba7322.c	2011-09-23 11:25:37.415892000 -0400
+*************** static void qib_7322_nomsix(struct qib_d
+*** 2841,2849 ****
+  		int i;
+  
+  		dd->cspec->num_msix_entries = 0;
+! 		for (i = 0; i < n; i++)
+  			free_irq(dd->cspec->msix_entries[i].msix.vector,
+  			   dd->cspec->msix_entries[i].arg);
+  		qib_nomsix(dd);
+  	}
+  	/* make sure no MSIx interrupts are left pending */
+--- 2841,2853 ----
+  		int i;
+  
+  		dd->cspec->num_msix_entries = 0;
+! 		for (i = 0; i < n; i++) {
+! 			irq_set_affinity_hint(
+! 			  dd->cspec->msix_entries[i].msix.vector, NULL);
+! 			free_cpumask_var(dd->cspec->msix_entries[i].mask);
+  			free_irq(dd->cspec->msix_entries[i].msix.vector,
+  			   dd->cspec->msix_entries[i].arg);
++ 		}
+  		qib_nomsix(dd);
+  	}
+  	/* make sure no MSIx interrupts are left pending */
+*************** static void qib_setup_7322_interrupt(str
+*** 3413,3418 ****
+--- 3417,3424 ----
+  	int ret, i, msixnum;
+  	u64 redirect[6];
+  	u64 mask;
++ 	const struct cpumask *local_mask;
++ 	int firstcpu, secondcpu = 0, currrcvcpu = 0;
+  
+  	if (!dd->num_pports) {
+  		qib_dbg("No ports, skipping interrupt setup\n");
+*************** try_intx:
+*** 3463,3468 ****
+--- 3469,3487 ----
+  	memset(redirect, 0, sizeof redirect);
+  	mask = ~0ULL;
+  	msixnum = 0;
++ 	local_mask = cpumask_of_pcibus(dd->pcidev->bus);
++ 	firstcpu = cpumask_first(local_mask);
++ 	if (firstcpu >= nr_cpu_ids ||
++ 			cpumask_weight(local_mask) == num_online_cpus()) {
++ 		local_mask = topology_core_cpumask(0);
++ 		firstcpu = cpumask_first(local_mask);
++ 	}
++ 	if (firstcpu < nr_cpu_ids) {
++ 		secondcpu = cpumask_next(firstcpu, local_mask);
++ 		if (secondcpu >= nr_cpu_ids)
++ 			secondcpu = firstcpu;
++ 		currrcvcpu = secondcpu;
++ 	}
+  	for (i = 0; msixnum < dd->cspec->num_msix_entries; i++) {
+  		irq_handler_t handler;
+  		void *arg;
+*************** try_intx:
+*** 3537,3542 ****
+--- 3556,3580 ----
+  		}
+  		val = qib_read_kreg64(dd, 2 * msixnum + 1 +
+  			(QIB_7322_MsixTable_OFFS / sizeof(u64)));
++ 		if (firstcpu < nr_cpu_ids &&
++ 			zalloc_cpumask_var(
++ 				&dd->cspec->msix_entries[msixnum].mask,
++ 				GFP_KERNEL)) {
++ 			if (handler == qib_7322pintr) {
++ 				cpumask_set_cpu(currrcvcpu,
++ 					dd->cspec->msix_entries[msixnum].mask);
++ 				currrcvcpu = cpumask_next(currrcvcpu,
++ 					local_mask);
++ 				if (currrcvcpu >= nr_cpu_ids)
++ 					currrcvcpu = secondcpu;
++ 			} else {
++ 				cpumask_set_cpu(firstcpu,
++ 					dd->cspec->msix_entries[msixnum].mask);
++ 			}
++ 			irq_set_affinity_hint(
++ 				dd->cspec->msix_entries[msixnum].msix.vector,
++ 				dd->cspec->msix_entries[msixnum].mask);
++ 		}
+  		msixnum++;
+  	}
+  	/* Initialize the vector mapping */
diff --git a/kernel_patches/backport/3.1/rds_0010_for_2_6_33.patch b/kernel_patches/backport/3.1/rds_0010_for_2_6_33.patch
new file mode 100644
index 0000000..72185f0
--- /dev/null
+++ b/kernel_patches/backport/3.1/rds_0010_for_2_6_33.patch
@@ -0,0 +1,231 @@
+Index: ofed_kernel/net/rds/sysctl.c
+===================================================================
+--- ofed_kernel.orig/net/rds/sysctl.c	2010-08-09 14:24:43.000000000 +0300
++++ ofed_kernel/net/rds/sysctl.c	2010-08-09 20:06:21.000000000 +0300
+@@ -58,7 +58,6 @@
+ 
+ static ctl_table rds_sysctl_rds_table[] = {
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "reconnect_min_delay_ms",
+ 		.data		= &rds_sysctl_reconnect_min_jiffies,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -68,7 +67,6 @@
+ 		.extra2		= &rds_sysctl_reconnect_max_jiffies,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "reconnect_max_delay_ms",
+ 		.data		= &rds_sysctl_reconnect_max_jiffies,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -78,7 +76,6 @@
+ 		.extra2		= &rds_sysctl_reconnect_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "pf_rds",
+ 		.data		= &rds_sysctl_pf_rds,
+ 		.maxlen         = sizeof(int),
+@@ -86,7 +83,6 @@
+ 		.proc_handler   = &proc_dointvec,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "sol_rds",
+ 		.data		= &rds_sysctl_sol_rds,
+ 		.maxlen         = sizeof(int),
+@@ -94,7 +90,6 @@
+ 		.proc_handler   = &proc_dointvec,
+ 	},
+ 	{
+-		.ctl_name	= CTL_UNNUMBERED,
+ 		.procname	= "max_unacked_packets",
+ 		.data		= &rds_sysctl_max_unacked_packets,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -102,7 +97,6 @@
+ 		.proc_handler   = &proc_dointvec,
+ 	},
+ 	{
+-		.ctl_name	= CTL_UNNUMBERED,
+ 		.procname	= "max_unacked_bytes",
+ 		.data		= &rds_sysctl_max_unacked_bytes,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -110,19 +104,18 @@
+ 		.proc_handler   = &proc_dointvec,
+ 	},
+ 	{
+-		.ctl_name	= CTL_UNNUMBERED,
+ 		.procname	= "ping_enable",
+ 		.data		= &rds_sysctl_ping_enable,
+ 		.maxlen         = sizeof(int),
+ 		.mode           = 0644,
+ 		.proc_handler   = &proc_dointvec,
+ 	},
+-	{ .ctl_name = 0}
++	{ }
+ };
+ 
+ static struct ctl_path rds_sysctl_path[] = {
+-	{ .procname = "net", .ctl_name = CTL_NET, },
+-	{ .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
++	{ .procname = "net", },
++	{ .procname = "rds", },
+ 	{ }
+ };
+ 
+Index: ofed_kernel/net/rds/ib_sysctl.c
+===================================================================
+--- ofed_kernel.orig/net/rds/ib_sysctl.c	2010-08-09 14:24:43.000000000 +0300
++++ ofed_kernel/net/rds/ib_sysctl.c	2010-08-09 20:10:33.000000000 +0300
+@@ -67,7 +67,6 @@
+ 
+ ctl_table rds_ib_sysctl_table[] = {
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_send_wr",
+ 		.data		= &rds_ib_sysctl_max_send_wr,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -77,7 +76,6 @@
+ 		.extra2		= &rds_ib_sysctl_max_wr_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_recv_wr",
+ 		.data		= &rds_ib_sysctl_max_recv_wr,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -87,7 +85,6 @@
+ 		.extra2		= &rds_ib_sysctl_max_wr_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_unsignaled_wr",
+ 		.data		= &rds_ib_sysctl_max_unsig_wrs,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -97,7 +94,6 @@
+ 		.extra2		= &rds_ib_sysctl_max_unsig_wr_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_unsignaled_bytes",
+ 		.data		= &rds_ib_sysctl_max_unsig_bytes,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -107,7 +103,6 @@
+ 		.extra2		= &rds_ib_sysctl_max_unsig_bytes_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_recv_allocation",
+ 		.data		= &rds_ib_sysctl_max_recv_allocation,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -115,20 +110,19 @@
+ 		.proc_handler   = &proc_doulongvec_minmax,
+ 	},
+ 	{
+-		.ctl_name	= CTL_UNNUMBERED,
+ 		.procname	= "flow_control",
+ 		.data		= &rds_ib_sysctl_flow_control,
+ 		.maxlen		= sizeof(rds_ib_sysctl_flow_control),
+ 		.mode		= 0644,
+ 		.proc_handler	= &proc_dointvec,
+ 	},
+-	{ .ctl_name = 0}
++	{ }
+ };
+ 
+ static struct ctl_path rds_ib_sysctl_path[] = {
+-	{ .procname = "net", .ctl_name = CTL_NET, },
+-	{ .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
+-	{ .procname = "ib", .ctl_name = CTL_UNNUMBERED, },
++	{ .procname = "net", },
++	{ .procname = "rds", },
++	{ .procname = "ib", },
+ 	{ }
+ };
+ 
+Index: ofed_kernel/net/rds/iw_sysctl.c
+===================================================================
+--- ofed_kernel.orig/net/rds/iw_sysctl.c	2010-08-09 14:24:43.000000000 +0300
++++ ofed_kernel/net/rds/iw_sysctl.c	2010-08-09 20:26:35.000000000 +0300
+@@ -57,7 +57,6 @@
+ 
+ ctl_table rds_iw_sysctl_table[] = {
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_send_wr",
+ 		.data		= &rds_iw_sysctl_max_send_wr,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -67,7 +66,6 @@
+ 		.extra2		= &rds_iw_sysctl_max_wr_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_recv_wr",
+ 		.data		= &rds_iw_sysctl_max_recv_wr,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -77,7 +75,6 @@
+ 		.extra2		= &rds_iw_sysctl_max_wr_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_unsignaled_wr",
+ 		.data		= &rds_iw_sysctl_max_unsig_wrs,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -87,7 +84,6 @@
+ 		.extra2		= &rds_iw_sysctl_max_unsig_wr_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_unsignaled_bytes",
+ 		.data		= &rds_iw_sysctl_max_unsig_bytes,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -97,7 +93,6 @@
+ 		.extra2		= &rds_iw_sysctl_max_unsig_bytes_max,
+ 	},
+ 	{
+-		.ctl_name       = CTL_UNNUMBERED,
+ 		.procname       = "max_recv_allocation",
+ 		.data		= &rds_iw_sysctl_max_recv_allocation,
+ 		.maxlen         = sizeof(unsigned long),
+@@ -105,20 +100,19 @@
+ 		.proc_handler   = &proc_doulongvec_minmax,
+ 	},
+ 	{
+-		.ctl_name	= CTL_UNNUMBERED,
+ 		.procname	= "flow_control",
+ 		.data		= &rds_iw_sysctl_flow_control,
+ 		.maxlen		= sizeof(rds_iw_sysctl_flow_control),
+ 		.mode		= 0644,
+ 		.proc_handler	= &proc_dointvec,
+ 	},
+-	{ .ctl_name = 0}
++	{ }
+ };
+ 
+ static struct ctl_path rds_iw_sysctl_path[] = {
+-	{ .procname = "net", .ctl_name = CTL_NET, },
+-	{ .procname = "rds", .ctl_name = CTL_UNNUMBERED, },
+-	{ .procname = "iw", .ctl_name = CTL_UNNUMBERED, },
++	{ .procname = "net", },
++	{ .procname = "rds", },
++	{ .procname = "iw", },
+ 	{ }
+ };
+ 
+Index: ofed_kernel/net/rds/tcp_listen.c
+===================================================================
+--- ofed_kernel.orig/net/rds/tcp_listen.c	2010-08-09 14:24:43.000000000 +0300
++++ ofed_kernel/net/rds/tcp_listen.c	2010-08-09 20:35:13.000000000 +0300
+@@ -67,10 +67,10 @@
+ 	inet = inet_sk(new_sock->sk);
+ 
+ 	rdsdebug("accepted tcp %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n",
+-		  NIPQUAD(inet->saddr), ntohs(inet->sport),
+-		  NIPQUAD(inet->daddr), ntohs(inet->dport));
++		  NIPQUAD(inet->inet_saddr), ntohs(inet->inet_sport),
++		  NIPQUAD(inet->inet_daddr), ntohs(inet->inet_dport));
+ 
+-	conn = rds_conn_create(inet->saddr, inet->daddr, &rds_tcp_transport,
++	conn = rds_conn_create(inet->inet_saddr, inet->inet_daddr, &rds_tcp_transport,
+ 			       GFP_KERNEL);
+ 	if (IS_ERR(conn)) {
+ 		ret = PTR_ERR(conn);
diff --git a/kernel_patches/backport/3.1/rds_0020_to_2.6.35.patch b/kernel_patches/backport/3.1/rds_0020_to_2.6.35.patch
new file mode 100644
index 0000000..5d1e19f
--- /dev/null
+++ b/kernel_patches/backport/3.1/rds_0020_to_2.6.35.patch
@@ -0,0 +1,52 @@
+Index: ofed_kernel-2.6.35/net/rds/af_rds.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/net/rds/af_rds.c	2010-11-07 17:47:56.385408880 +0200
++++ ofed_kernel-2.6.35/net/rds/af_rds.c	2010-11-07 17:49:34.844588530 +0200
+@@ -159,7 +159,7 @@
+ 	unsigned int mask = 0;
+ 	unsigned long flags;
+ 
+-	poll_wait(file, sk->sk_sleep, wait);
++	poll_wait(file, sk_sleep(sk), wait);
+ 
+ 	if (rs->rs_seen_congestion)
+ 		poll_wait(file, &rds_poll_waitq, wait);
+Index: ofed_kernel-2.6.35/net/rds/rds.h
+===================================================================
+--- ofed_kernel-2.6.35.orig/net/rds/rds.h	2010-11-07 17:47:56.697428522 +0200
++++ ofed_kernel-2.6.35/net/rds/rds.h	2010-11-07 17:49:24.756486240 +0200
+@@ -492,7 +492,7 @@
+ void rds_wake_sk_sleep(struct rds_sock *rs);
+ static inline void __rds_wake_sk_sleep(struct sock *sk)
+ {
+-	wait_queue_head_t *waitq = sk->sk_sleep;
++	wait_queue_head_t *waitq = sk_sleep(sk);
+ 
+ 	if (!sock_flag(sk, SOCK_DEAD) && waitq)
+ 		wake_up(waitq);
+Index: ofed_kernel-2.6.35/net/rds/recv.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/net/rds/recv.c	2010-11-07 17:52:33.848407505 +0200
++++ ofed_kernel-2.6.35/net/rds/recv.c	2010-11-07 17:54:04.648465518 +0200
+@@ -432,7 +432,7 @@
+ 				break;
+ 			}
+ 
+-			timeo = wait_event_interruptible_timeout(*sk->sk_sleep,
++			timeo = wait_event_interruptible_timeout(*sk_sleep(sk),
+ 						(!list_empty(&rs->rs_notify_queue)
+ 						|| rs->rs_cong_notify
+ 						|| rds_next_incoming(rs, &inc)),
+Index: ofed_kernel-2.6.35/net/rds/send.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/net/rds/send.c	2010-11-07 17:52:34.112404006 +0200
++++ ofed_kernel-2.6.35/net/rds/send.c	2010-11-07 17:54:21.093549854 +0200
+@@ -911,7 +911,7 @@
+ 			goto out;
+ 		}
+ 
+-		timeo = wait_event_interruptible_timeout(*sk->sk_sleep,
++		timeo = wait_event_interruptible_timeout(*sk_sleep(sk),
+ 					rds_send_queue_rm(rs, conn, rm,
+ 							  rs->rs_bound_port,
+ 							  dport,
diff --git a/kernel_patches/backport/3.1/rds_0030_to_2.6.36.patch b/kernel_patches/backport/3.1/rds_0030_to_2.6.36.patch
new file mode 100644
index 0000000..342504a
--- /dev/null
+++ b/kernel_patches/backport/3.1/rds_0030_to_2.6.36.patch
@@ -0,0 +1,59 @@
+Index: ofed_kernel-2.6.36/net/rds/tcp_connect.c
+===================================================================
+--- ofed_kernel-2.6.36.orig/net/rds/tcp_connect.c	2010-11-09 14:40:59.100203850 +0200
++++ ofed_kernel-2.6.36/net/rds/tcp_connect.c	2010-11-09 14:44:49.763275968 +0200
+@@ -90,8 +90,8 @@
+ 
+ 	ret = sock->ops->bind(sock, (struct sockaddr *)&src, sizeof(src));
+ 	if (ret) {
+-		rdsdebug("bind failed with %d at address %u.%u.%u.%u\n",
+-		     ret, NIPQUAD(conn->c_laddr));
++		rdsdebug("bind failed with %d at address %pI4\n",
++		     ret, &conn->c_laddr);
+ 		goto out;
+ 	}
+ 
+@@ -108,8 +108,8 @@
+ 				 O_NONBLOCK);
+ 	sock = NULL;
+ 
+-	rdsdebug("connect to address %u.%u.%u.%u returned %d\n",
+-		 NIPQUAD(conn->c_faddr), ret);
++	rdsdebug("connect to address %pI4 returned %d\n",
++		 &conn->c_faddr, ret);
+ 	if (ret == -EINPROGRESS)
+ 		ret = 0;
+ 
+Index: ofed_kernel-2.6.36/net/rds/tcp_listen.c
+===================================================================
+--- ofed_kernel-2.6.36.orig/net/rds/tcp_listen.c	2010-11-09 14:40:59.324208098 +0200
++++ ofed_kernel-2.6.36/net/rds/tcp_listen.c	2010-11-09 14:47:51.663697076 +0200
+@@ -67,9 +67,9 @@
+ 
+ 	inet = inet_sk(new_sock->sk);
+ 
+-	rdsdebug("accepted tcp %u.%u.%u.%u:%u -> %u.%u.%u.%u:%u\n",
+-		  NIPQUAD(inet->inet_saddr), ntohs(inet->inet_sport),
+-		  NIPQUAD(inet->inet_daddr), ntohs(inet->inet_dport));
++	rdsdebug("accepted tcp %pI4:%u -> %pI4:%u\n",
++		  &inet->inet_saddr, ntohs(inet->inet_sport),
++		  &inet->inet_daddr, ntohs(inet->inet_dport));
+ 
+ 	conn = rds_conn_create(inet->inet_saddr, inet->inet_daddr, &rds_tcp_transport,
+ 			       GFP_KERNEL);
+Index: ofed_kernel-2.6.36/net/rds/tcp_send.c
+===================================================================
+--- ofed_kernel-2.6.36.orig/net/rds/tcp_send.c	2010-11-09 14:40:59.525291259 +0200
++++ ofed_kernel-2.6.36/net/rds/tcp_send.c	2010-11-09 14:48:32.603253363 +0200
+@@ -193,9 +193,9 @@
+ 			rds_tcp_stats_inc(s_tcp_sndbuf_full);
+ 			ret = 0;
+ 		} else {
+-			printk(KERN_WARNING "RDS/tcp: send to %u.%u.%u.%u "
++			printk(KERN_WARNING "RDS/tcp: send to %pI4 "
+ 			       "returned %d, disconnecting and reconnecting\n",
+-			       NIPQUAD(conn->c_faddr), ret);
++			       &conn->c_faddr, ret);
+ 			rds_conn_drop(conn);
+ 		}
+ 	}
diff --git a/kernel_patches/backport/3.1/rds_0040_to_2.6.39.patch b/kernel_patches/backport/3.1/rds_0040_to_2.6.39.patch
new file mode 100644
index 0000000..f48ad26
--- /dev/null
+++ b/kernel_patches/backport/3.1/rds_0040_to_2.6.39.patch
@@ -0,0 +1,41 @@
+diff --git a/net/rds/cong.c b/net/rds/cong.c
+index 0871a29..be4e1b1 100644
+--- a/net/rds/cong.c
++++ b/net/rds/cong.c
+@@ -33,8 +33,7 @@
+ #include <linux/slab.h>
+ #include <linux/types.h>
+ #include <linux/rbtree.h>
+-
+-#include <asm-generic/bitops/le.h>
++#include <linux/bitops.h>
+ 
+ #include "rds.h"
+ 
+@@ -285,7 +284,7 @@ void rds_cong_set_bit(struct rds_cong_map *map, __be16 port)
+ 	i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
+ 	off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
+ 
+-	generic___set_le_bit(off, (void *)map->m_page_addrs[i]);
++	__set_bit_le(off, (void *)map->m_page_addrs[i]);
+ }
+ 
+ void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
+@@ -299,7 +298,7 @@ void rds_cong_clear_bit(struct rds_cong_map *map, __be16 port)
+ 	i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
+ 	off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
+ 
+-	generic___clear_le_bit(off, (void *)map->m_page_addrs[i]);
++	__clear_bit_le(off, (void *)map->m_page_addrs[i]);
+ }
+ 
+ static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
+@@ -310,7 +309,7 @@ static int rds_cong_test_bit(struct rds_cong_map *map, __be16 port)
+ 	i = be16_to_cpu(port) / RDS_CONG_MAP_PAGE_BITS;
+ 	off = be16_to_cpu(port) % RDS_CONG_MAP_PAGE_BITS;
+ 
+-	return generic_test_le_bit(off, (void *)map->m_page_addrs[i]);
++	return test_bit_le(off, (void *)map->m_page_addrs[i]);
+ }
+ 
+ void rds_cong_add_socket(struct rds_sock *rs)
diff --git a/kernel_patches/backport/3.1/sdp_0160_fix_sdp_proto.patch b/kernel_patches/backport/3.1/sdp_0160_fix_sdp_proto.patch
new file mode 100644
index 0000000..03fd895
--- /dev/null
+++ b/kernel_patches/backport/3.1/sdp_0160_fix_sdp_proto.patch
@@ -0,0 +1,13 @@
+Index: ofed_kernel/drivers/infiniband/ulp/sdp/sdp_main.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/ulp/sdp/sdp_main.c	2010-07-24 04:33:07.000000000 -0700
++++ ofed_kernel/drivers/infiniband/ulp/sdp/sdp_main.c	2010-07-24 04:33:38.000000000 -0700
+@@ -1171,7 +1171,7 @@
+ 
+ /* SOL_SOCKET level options are handled by sock_setsockopt */
+ static int sdp_setsockopt(struct sock *sk, int level, int optname,
+-			  char __user *optval, int optlen)
++			  char __user *optval, unsigned optlen)
+ {
+ 	struct sdp_sock *ssk = sdp_sk(sk);
+ 	int val;
diff --git a/kernel_patches/backport/3.1/sdp_0170_to_2_6_33.patch b/kernel_patches/backport/3.1/sdp_0170_to_2_6_33.patch
new file mode 100644
index 0000000..4162064
--- /dev/null
+++ b/kernel_patches/backport/3.1/sdp_0170_to_2_6_33.patch
@@ -0,0 +1,23 @@
+Index: ofed_kernel-2.6.33/drivers/infiniband/ulp/sdp/sdp.h
+===================================================================
+--- ofed_kernel-2.6.33.orig/drivers/infiniband/ulp/sdp/sdp.h	2011-01-05 13:27:06.000000000 +0200
++++ ofed_kernel-2.6.33/drivers/infiniband/ulp/sdp/sdp.h	2011-01-05 13:36:19.000000000 +0200
+@@ -42,12 +42,12 @@
+ #endif
+ #endif
+ 
+-#define inet_num(sk) inet_sk(sk)->num
+-#define inet_sport(sk) inet_sk(sk)->sport
+-#define inet_dport(sk) inet_sk(sk)->dport
+-#define inet_saddr(sk) inet_sk(sk)->saddr
+-#define inet_daddr(sk) inet_sk(sk)->daddr
+-#define inet_rcv_saddr(sk) inet_sk(sk)->rcv_saddr
++#define inet_num(sk) inet_sk(sk)->inet_num
++#define inet_sport(sk) inet_sk(sk)->inet_sport
++#define inet_dport(sk) inet_sk(sk)->inet_dport
++#define inet_saddr(sk) inet_sk(sk)->inet_saddr
++#define inet_daddr(sk) inet_sk(sk)->inet_daddr
++#define inet_rcv_saddr(sk) inet_sk(sk)->inet_rcv_saddr
+ 
+ #define sk_ssk(ssk) ((struct sock *)ssk)
+ 
diff --git a/kernel_patches/backport/3.1/sdp_0180_for_2.6.35.patch b/kernel_patches/backport/3.1/sdp_0180_for_2.6.35.patch
new file mode 100644
index 0000000..fb8ffb2
--- /dev/null
+++ b/kernel_patches/backport/3.1/sdp_0180_for_2.6.35.patch
@@ -0,0 +1,215 @@
+Index: ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_main.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/ulp/sdp/sdp_main.c	2010-11-07 11:51:23.846000613 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_main.c	2010-11-07 11:52:07.724428655 +0200
+@@ -873,7 +873,7 @@
+ 	 * having to remove and re-insert us on the wait queue.
+ 	 */
+ 	for (;;) {
+-		prepare_to_wait_exclusive(sk->sk_sleep, &wait,
++		prepare_to_wait_exclusive(sk_sleep(sk), &wait,
+ 					  TASK_INTERRUPTIBLE);
+ 		release_sock(sk);
+ 		if (list_empty(&ssk->accept_queue)) {
+@@ -893,7 +893,7 @@
+ 		if (!timeo)
+ 			break;
+ 	}
+-	finish_wait(sk->sk_sleep, &wait);
++	finish_wait(sk_sleep(sk), &wait);
+ 	sdp_dbg(sk, "%s returns %d\n", __func__, err);
+ 	return err;
+ }
+@@ -1845,7 +1845,7 @@
+ 	while (1) {
+ 		set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
+ 
+-		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
++		prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+ 
+ 		if (sk->sk_err || (sk->sk_shutdown & SEND_SHUTDOWN))
+ 			goto do_error;
+@@ -1913,7 +1913,7 @@
+ 		*timeo_p = current_timeo;
+ 	}
+ out:
+-	finish_wait(sk->sk_sleep, &wait);
++	finish_wait(sk_sleep(sk), &wait);
+ 	return err;
+ 
+ do_error:
+Index: ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_bcopy.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/ulp/sdp/sdp_bcopy.c	2010-11-07 11:53:51.985409157 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_bcopy.c	2010-11-07 11:54:04.012463937 +0200
+@@ -169,7 +169,7 @@
+ 	ssk->nagle_last_unacked = 0;
+ 	sdp_post_sends(ssk, GFP_ATOMIC);
+ 
+-	if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
++	if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk)))
+ 		sk_stream_write_space(sk);
+ out:
+ 	bh_unlock_sock(sk);
+Index: ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_tx.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/ulp/sdp/sdp_tx.c	2010-11-07 11:55:54.729415378 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_tx.c	2010-11-07 11:56:17.266853040 +0200
+@@ -227,7 +227,7 @@
+ 					"probably was canceled already\n");
+ 		}
+ 
+-		wake_up(sk->sk_sleep);
++		wake_up(sk_sleep(sk));
+ 	} else {
+ 		/* Keepalive probe sent cleanup */
+ 		sdp_cnt(sdp_keepalive_probes_sent);
+@@ -292,14 +292,14 @@
+ 
+ 	if (sk->sk_write_pending) {
+ 		/* Do the TX posts from sender context */
+-		if (sk->sk_sleep && waitqueue_active(sk->sk_sleep)) {
++		if (sk_sleep(sk) && waitqueue_active(sk_sleep(sk))) {
+ 			sdp_prf1(sk, NULL, "Waking up pending sendmsg");
+-			wake_up_interruptible(sk->sk_sleep);
++			wake_up_interruptible(sk_sleep(sk));
+ 			return 0;
+ 		} else
+ 			sdp_prf1(sk, NULL, "Unexpected: sk_sleep=%p, "
+ 				"waitqueue_active: %d\n",
+-				sk->sk_sleep, waitqueue_active(sk->sk_sleep));
++				sk_sleep(sk), waitqueue_active(sk_sleep(sk)));
+ 	}
+ 
+ 	if (posts_handler(ssk)) {
+Index: ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_rx.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/ulp/sdp/sdp_rx.c	2010-11-07 11:57:33.457408121 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_rx.c	2010-11-07 17:22:25.380474105 +0200
+@@ -31,6 +31,7 @@
+  */
+ #include <linux/interrupt.h>
+ #include <linux/dma-mapping.h>
++#include <linux/rcupdate.h>
+ #include <rdma/ib_verbs.h>
+ #include <rdma/rdma_cm.h>
+ #include "sdp.h"
+@@ -338,7 +339,7 @@
+ 			sdp_dbg_data(sk_ssk(ssk), "got RX SrcAvail while waiting "
+ 					"for TX SrcAvail. waking up TX SrcAvail"
+ 					"to be aborted\n");
+-			wake_up(sk->sk_sleep);
++			wake_up(sk_sleep(sk));
+ 		}
+ 
+ 		atomic_add(skb->len, &ssk->rcv_nxt);
+@@ -597,7 +598,7 @@
+ 			ssk->sa_cancel_mseq = ntohl(h->mseq);
+ 			ssk->sa_cancel_arrived = 1;
+ 			if (ssk->rx_sa)
+-				wake_up(sk->sk_sleep);
++				wake_up(sk_sleep(sk));
+ 
+ 			skb_queue_tail(&ssk->rx_ctl_q, skb);
+ 		} else if (h->mid == SDP_MID_RDMARDCOMPL) {
+@@ -685,6 +686,7 @@
+ {
+ 	struct sock *sk = sk_ssk(ssk);
+ 	struct socket *sock = sk->sk_socket;
++	struct socket_wq *wq;
+ 
+ 	if (tx_credits(ssk) < ssk->min_bufs || !sock)
+ 		return;
+@@ -692,10 +694,13 @@
+ 	clear_bit(SOCK_NOSPACE, &sock->flags);
+ 	sdp_prf1(sk, NULL, "Waking up sleepers");
+ 
+-	if (sk->sk_sleep && waitqueue_active(sk->sk_sleep))
+-		wake_up_interruptible(sk->sk_sleep);
+-	if (sock->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
++	rcu_read_lock();
++	wq = rcu_dereference(sk->sk_wq);
++	if (wq_has_sleeper(wq))
++		wake_up_interruptible(&wq->wait);
++	if (wq && wq->fasync_list && !(sk->sk_shutdown & SEND_SHUTDOWN))
+ 		sock_wake_async(sock, 2, POLL_OUT);
++	rcu_read_unlock();
+ }
+ 
+ int sdp_poll_rx_cq(struct sdp_sock *ssk)
+@@ -810,7 +815,7 @@
+ 
+ static inline int should_wake_up(struct sock *sk)
+ {
+-	return sk->sk_sleep && waitqueue_active(sk->sk_sleep) &&
++	return sk_sleep(sk) && waitqueue_active(sk_sleep(sk)) &&
+ 		(posts_handler(sdp_sk(sk)) || somebody_is_waiting(sk));
+ }
+ 
+@@ -829,7 +834,7 @@
+ 	sdp_prf(sk, NULL, "rx irq");
+ 
+ 	if (should_wake_up(sk)) {
+-		wake_up_interruptible(sk->sk_sleep);
++		wake_up_interruptible(sk_sleep(sk));
+ 		SDPSTATS_COUNTER_INC(rx_int_wake_up);
+ 	} else {
+ 		if (queue_work_on(ssk->cpu, rx_comp_wq, &ssk->rx_comp_work))
+Index: ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_zcopy.c
+===================================================================
+--- ofed_kernel-2.6.35.orig/drivers/infiniband/ulp/sdp/sdp_zcopy.c	2010-11-07 11:57:37.472406105 +0200
++++ ofed_kernel-2.6.35/drivers/infiniband/ulp/sdp/sdp_zcopy.c	2010-11-07 11:58:02.808761736 +0200
+@@ -156,7 +156,7 @@
+ 	sdp_dbg_data(sk, "sleep till RdmaRdCompl. timeo = %ld.\n", *timeo_p);
+ 	sdp_prf1(sk, NULL, "Going to sleep");
+ 	while (ssk->qp_active) {
+-		prepare_to_wait(sk->sk_sleep, &wait, TASK_INTERRUPTIBLE);
++		prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE);
+ 
+ 		if (unlikely(!*timeo_p)) {
+ 			err = -ETIME;
+@@ -213,7 +213,7 @@
+ 		*timeo_p = current_timeo;
+ 	}
+ 
+-	finish_wait(sk->sk_sleep, &wait);
++	finish_wait(sk_sleep(sk), &wait);
+ 
+ 	sdp_dbg_data(sk, "Finished waiting - RdmaRdCompl: %d/%d bytes, flags: 0x%x\n",
+ 			tx_sa->bytes_acked, tx_sa->bytes_sent, tx_sa->abort_flags);
+@@ -234,7 +234,7 @@
+ 
+ 	sdp_dbg_data(sk, "Sleep till RDMA wr finished.\n");
+ 	while (1) {
+-		prepare_to_wait(sk->sk_sleep, &wait, TASK_UNINTERRUPTIBLE);
++		prepare_to_wait(sk_sleep(sk), &wait, TASK_UNINTERRUPTIBLE);
+ 
+ 		if (!ssk->tx_ring.rdma_inflight->busy) {
+ 			sdp_dbg_data(sk, "got rdma cqe\n");
+@@ -266,7 +266,7 @@
+ 		posts_handler_get(ssk);
+ 	}
+ 
+-	finish_wait(sk->sk_sleep, &wait);
++	finish_wait(sk_sleep(sk), &wait);
+ 
+ 	sdp_dbg_data(sk, "Finished waiting\n");
+ 	return rc;
+@@ -358,7 +358,7 @@
+ 	sdp_dbg_data(sk, "Got SendSM - aborting SrcAvail\n");
+ 
+ 	ssk->tx_sa->abort_flags |= TX_SA_SENDSM;
+-	wake_up(sk->sk_sleep);
++	wake_up(sk_sleep(sk));
+ 	sdp_dbg_data(sk, "woke up sleepers\n");
+ 
+ out:
+@@ -390,7 +390,7 @@
+ 
+ 	ssk->tx_sa->bytes_acked += bytes_completed;
+ 
+-	wake_up(sk->sk_sleep);
++	wake_up(sk_sleep(sk));
+ 	sdp_dbg_data(sk, "woke up sleepers\n");
+ 
+ out:
diff --git a/kernel_patches/backport/3.1/sdp_0190_for_2.6.36.patch b/kernel_patches/backport/3.1/sdp_0190_for_2.6.36.patch
new file mode 100644
index 0000000..5c051e0
--- /dev/null
+++ b/kernel_patches/backport/3.1/sdp_0190_for_2.6.36.patch
@@ -0,0 +1,136 @@
+Index: ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp_main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check.orig/drivers/infiniband/ulp/sdp/sdp_main.c	2011-01-09 14:32:46.000000000 +0200
++++ ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp_main.c	2011-01-09 14:44:43.000000000 +0200
+@@ -897,7 +897,7 @@
+ 		return rc;
+ 	}
+ 
+-	sdp_dbg(sk, "%s " NIPQUAD_FMT ":%hu -> " NIPQUAD_FMT ":%hu\n", __func__,
++ 	sdp_dbg(sk, "%s " NIPQUAD_FMT ":%hu -> " NIPQUAD_FMT ":%hu\n", __func__,
+ 		NIPQUAD(src_addr.sin_addr.s_addr),
+ 		ntohs(src_addr.sin_port),
+ 		NIPQUAD(((struct sockaddr_in *)uaddr)->sin_addr.s_addr),
+@@ -1332,7 +1332,7 @@
+ 
+ static void sdp_mark_push(struct sdp_sock *ssk, struct sk_buff *skb)
+ {
+-	SDP_SKB_CB(skb)->flags |= TCPCB_FLAG_PSH;
++	SDP_SKB_CB(skb)->flags |= TCPHDR_PSH;
+ 	sdp_do_posts(ssk);
+ }
+ 
+@@ -1608,7 +1608,7 @@
+ {
+ 	if (unlikely(flags & MSG_OOB)) {
+ 		struct sk_buff *skb = sk->sk_write_queue.prev;
+-		SDP_SKB_CB(skb)->flags |= TCPCB_FLAG_URG;
++		SDP_SKB_CB(skb)->flags |= TCPHDR_URG;
+ 	}
+ }
+ 
+@@ -2215,7 +2215,7 @@
+ 			}
+ 
+ 			if (!copied)
+-				SDP_SKB_CB(skb)->flags &= ~TCPCB_FLAG_PSH;
++				SDP_SKB_CB(skb)->flags &= ~TCPHDR_PSH;
+ 
+ 			ssk->write_seq += copy;
+ 			SDP_SKB_CB(skb)->end_seq += copy;
+@@ -2976,13 +2976,15 @@
+ }
+ 
+ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+-static int sdp_create_v6_socket(struct net *net, struct socket *sock, int protocol)
++static int sdp_create_v6_socket(struct net *net, struct socket *sock, int protocol,
++			int kern)
+ {
+ 	return sdp_create_ipvx_socket(net, sock, protocol, &sdp_ipv6_proto_ops);
+ }
+ #endif
+ 
+-static int sdp_create_v4_socket(struct net *net, struct socket *sock, int protocol)
++static int sdp_create_v4_socket(struct net *net, struct socket *sock, int protocol,
++			int kern)
+ {
+ 	return sdp_create_ipvx_socket(net, sock, protocol, &sdp_ipv4_proto_ops);
+ }
+Index: ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp_bcopy.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check.orig/drivers/infiniband/ulp/sdp/sdp_bcopy.c	2011-01-09 14:32:46.000000000 +0200
++++ ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp_bcopy.c	2011-01-09 14:43:44.000000000 +0200
+@@ -124,8 +124,8 @@
+ 		!ssk->nagle_last_unacked ||
+ 		skb->next != (struct sk_buff *)&sk_ssk(ssk)->sk_write_queue ||
+ 		skb->len + sizeof(struct sdp_bsdh) >= ssk->xmit_size_goal ||
+-		(SDP_SKB_CB(skb)->flags & TCPCB_FLAG_PSH) ||
+-		(SDP_SKB_CB(skb)->flags & TCPCB_FLAG_URG);
++		(SDP_SKB_CB(skb)->flags & TCPHDR_PSH) ||
++		(SDP_SKB_CB(skb)->flags & TCPHDR_URG);
+ 
+ 	if (send_now) {
+ 		unsigned long mseq = ring_head(ssk->tx_ring);
+Index: ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp_tx.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check.orig/drivers/infiniband/ulp/sdp/sdp_tx.c	2011-01-09 14:32:46.000000000 +0200
++++ ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp_tx.c	2011-01-09 14:43:44.000000000 +0200
+@@ -99,7 +99,7 @@
+ 		TX_SRCAVAIL_STATE(skb)->mseq = mseq;
+ 	}
+ 
+-	if (unlikely(SDP_SKB_CB(skb)->flags & TCPCB_FLAG_URG))
++	if (unlikely(SDP_SKB_CB(skb)->flags & TCPHDR_URG))
+ 		h->flags = SDP_OOB_PRES | SDP_OOB_PEND;
+ 	else
+ 		h->flags = 0;
+@@ -159,7 +159,7 @@
+ 	tx_wr.num_sge = frags + 1;
+ 	tx_wr.opcode = IB_WR_SEND;
+ 	tx_wr.send_flags = send_flags;
+-	if (unlikely(SDP_SKB_CB(skb)->flags & TCPCB_FLAG_URG))
++	if (unlikely(SDP_SKB_CB(skb)->flags & TCPHDR_URG))
+ 		tx_wr.send_flags |= IB_SEND_SOLICITED;
+ 
+ 	rc = ib_post_send(ssk->qp, &tx_wr, &bad_wr);
+Index: ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp.h
+===================================================================
+--- ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check.orig/drivers/infiniband/ulp/sdp/sdp.h	2011-01-09 14:32:46.000000000 +0200
++++ ofa_1_5_dev_kernel-20110109-1430_linux-2.6.36_check/drivers/infiniband/ulp/sdp/sdp.h	2011-01-09 14:47:02.000000000 +0200
+@@ -13,32 +13,20 @@
+ #include "sdp_dbg.h"
+ 
+ #ifndef NIPQUAD
+-#define NIPQUAD(addr) \
+-        ((unsigned char *)&(addr))[0], \
+-        ((unsigned char *)&(addr))[1], \
+-        ((unsigned char *)&(addr))[2], \
+-        ((unsigned char *)&(addr))[3]
++#define NIPQUAD(addr) &(addr)
+ #endif
+ 
+ #ifndef NIPQUAD_FMT
+-#define NIPQUAD_FMT "%u.%u.%u.%u"
++#define NIPQUAD_FMT "%pI4"
+ #endif
+ 
+ #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
+ #ifndef NIP6
+-#define NIP6(addr) \
+-        ntohs((addr).s6_addr16[0]), \
+-        ntohs((addr).s6_addr16[1]), \
+-        ntohs((addr).s6_addr16[2]), \
+-        ntohs((addr).s6_addr16[3]), \
+-        ntohs((addr).s6_addr16[4]), \
+-        ntohs((addr).s6_addr16[5]), \
+-        ntohs((addr).s6_addr16[6]), \
+-        ntohs((addr).s6_addr16[7])
++#define NIP6(addr) &(addr)
+ #endif
+ 
+ #ifndef NIP6_FMT
+-#define NIP6_FMT "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x"
++#define NIP6_FMT "%pI6"
+ #endif
+ #endif
+ 
diff --git a/kernel_patches/backport/3.1/sdp_0200_for_2_6_38.patch b/kernel_patches/backport/3.1/sdp_0200_for_2_6_38.patch
new file mode 100644
index 0000000..92dfe35
--- /dev/null
+++ b/kernel_patches/backport/3.1/sdp_0200_for_2_6_38.patch
@@ -0,0 +1,106 @@
+diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h
+index c74aab7..6387e32 100644
+--- a/drivers/infiniband/ulp/sdp/sdp.h
++++ b/drivers/infiniband/ulp/sdp/sdp.h
+@@ -34,8 +34,8 @@
+ #define inet_sport(sk) inet_sk(sk)->inet_sport
+ #define inet_dport(sk) inet_sk(sk)->inet_dport
+ #define inet_saddr(sk) inet_sk(sk)->inet_saddr
+-#define inet_daddr(sk) inet_sk(sk)->inet_daddr
+-#define inet_rcv_saddr(sk) inet_sk(sk)->inet_rcv_saddr
++#define sdp_inet_daddr(sk) inet_sk(sk)->inet_daddr
++#define sdp_inet_rcv_saddr(sk) inet_sk(sk)->inet_rcv_saddr
+ 
+ #define sk_ssk(ssk) ((struct sock *)ssk)
+ 
+diff --git a/drivers/infiniband/ulp/sdp/sdp_cma.c b/drivers/infiniband/ulp/sdp/sdp_cma.c
+index 8e4d569..76a5e12 100644
+--- a/drivers/infiniband/ulp/sdp/sdp_cma.c
++++ b/drivers/infiniband/ulp/sdp/sdp_cma.c
+@@ -192,7 +192,7 @@ static int sdp_connect_handler(struct sock *sk, struct rdma_cm_id *id,
+ 
+ 		if ((h->ipv_cap & HH_IPV_MASK) == HH_IPV4) {
+ 			/* V6 mapped */
+-			inet_daddr(child) = dst_addr->sin_addr.s_addr;
++			sdp_inet_daddr(child) = dst_addr->sin_addr.s_addr;
+ 			ipv6_addr_set(&newnp->daddr, 0, 0, htonl(0x0000FFFF),
+ 					h->src_addr.ip4.addr);
+ 
+@@ -212,11 +212,11 @@ static int sdp_connect_handler(struct sock *sk, struct rdma_cm_id *id,
+ 			sdp_warn(child, "Bad IPV field: 0x%x\n", h->ipv_cap & HH_IPV_MASK);
+ 		}
+ 
+-		inet_daddr(child) =inet_saddr(child) = inet_rcv_saddr(child) = LOOPBACK4_IPV6;
++		sdp_inet_daddr(child) =inet_saddr(child) = sdp_inet_rcv_saddr(child) = LOOPBACK4_IPV6;
+ 	} else 
+ #endif
+ 	{
+-		inet_daddr(child) = dst_addr->sin_addr.s_addr;
++		sdp_inet_daddr(child) = dst_addr->sin_addr.s_addr;
+ 	}
+ 
+ #ifdef SDP_SOCK_HISTORY
+@@ -302,7 +302,7 @@ static int sdp_response_handler(struct sock *sk, struct rdma_cm_id *id,
+ 
+ 	dst_addr = (struct sockaddr_in *)&id->route.addr.dst_addr;
+ 	inet_dport(sk) = dst_addr->sin_port;
+-	inet_daddr(sk) = dst_addr->sin_addr.s_addr;
++	sdp_inet_daddr(sk) = dst_addr->sin_addr.s_addr;
+ 
+ #ifdef SDP_SOCK_HISTORY
+ 	sdp_ssk_hist_rename(sk);
+@@ -455,7 +455,7 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
+ 			else 
+ #endif
+ 		{
+-			inet_saddr(sk) = inet_rcv_saddr(sk) =
++			inet_saddr(sk) = sdp_inet_rcv_saddr(sk) =
+ 				((struct sockaddr_in *)&id->route.addr.src_addr)->sin_addr.s_addr;
+ 		}
+ 		memset(&conn_param, 0, sizeof conn_param);
+@@ -522,7 +522,7 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
+ 		rc = -ECONNREFUSED;
+ 		break;
+ 	case RDMA_CM_EVENT_ESTABLISHED:
+-		inet_saddr(sk) = inet_rcv_saddr(sk) =
++		inet_saddr(sk) = sdp_inet_rcv_saddr(sk) =
+ 			((struct sockaddr_in *)&id->route.addr.src_addr)->sin_addr.s_addr;
+ 		rc = sdp_connected_handler(sk);
+ 		break;
+diff --git a/drivers/infiniband/ulp/sdp/sdp_main.c b/drivers/infiniband/ulp/sdp/sdp_main.c
+index 026632e..cac16be 100644
+--- a/drivers/infiniband/ulp/sdp/sdp_main.c
++++ b/drivers/infiniband/ulp/sdp/sdp_main.c
+@@ -187,7 +187,7 @@ static int sdp_get_port(struct sock *sk, unsigned short snum)
+ 
+ 		addr4->sin_family = AF_INET;
+ 		addr4->sin_port = htons(snum);
+-		addr4->sin_addr.s_addr = inet_rcv_saddr(sk);
++		addr4->sin_addr.s_addr = sdp_inet_rcv_saddr(sk);
+ 
+ 		addr_len = sizeof(*addr4);
+ 
+@@ -2854,7 +2854,7 @@ void sdp_urg(struct sdp_sock *ssk, struct sk_buff *skb)
+ }
+ 
+ static struct percpu_counter *sockets_allocated;
+-static atomic_t memory_allocated;
++static atomic_long_t memory_allocated;
+ static struct percpu_counter *orphan_count;
+ static int memory_pressure;
+ struct proto sdp_proto = {
+diff --git a/drivers/infiniband/ulp/sdp/sdp_proc.c b/drivers/infiniband/ulp/sdp/sdp_proc.c
+index b57e218..0e30b81 100644
+--- a/drivers/infiniband/ulp/sdp/sdp_proc.c
++++ b/drivers/infiniband/ulp/sdp/sdp_proc.c
+@@ -150,8 +150,8 @@ static int sdp_v4_seq_show(struct seq_file *seq, int num, struct sock *sk)
+ 	__u16 srcp;
+ 	__u32 rx_queue, tx_queue;
+ 
+-	dest = inet_daddr(sk);
+-	src = inet_rcv_saddr(sk);
++	dest = sdp_inet_daddr(sk);
++	src = sdp_inet_rcv_saddr(sk);
+ 	destp = ntohs(inet_dport(sk));
+ 	srcp = ntohs(inet_sport(sk));
+ 	uid = sock_i_uid(sk);
diff --git a/kernel_patches/backport/3.1/sysfs_0010_to_2_6_32.patch b/kernel_patches/backport/3.1/sysfs_0010_to_2_6_32.patch
new file mode 100644
index 0000000..64f9896
--- /dev/null
+++ b/kernel_patches/backport/3.1/sysfs_0010_to_2_6_32.patch
@@ -0,0 +1,14 @@
+Index: ofed_kernel/drivers/infiniband/core/sysfs.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/sysfs.c	2009-12-17 10:05:07.000000000 +0200
++++ ofed_kernel/drivers/infiniband/core/sysfs.c	2009-12-17 10:39:43.000000000 +0200
+@@ -767,8 +767,8 @@
+ 	int i;
+ 
+ 	class_dev->class      = &ib_class;
+-	class_dev->driver_data = device;
+ 	class_dev->parent     = device->dma_device;
++	dev_set_drvdata(class_dev, device);
+ 	dev_set_name(class_dev, device->name);
+ 
+ 	INIT_LIST_HEAD(&device->port_list);
diff --git a/kernel_patches/backport/3.1/ucm_0010_to_2_6_32.patch b/kernel_patches/backport/3.1/ucm_0010_to_2_6_32.patch
new file mode 100644
index 0000000..658c2b1
--- /dev/null
+++ b/kernel_patches/backport/3.1/ucm_0010_to_2_6_32.patch
@@ -0,0 +1,61 @@
+Index: ofed_kernel/drivers/infiniband/core/ucm.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/ucm.c	2009-12-16 16:37:11.000000000 +0200
++++ ofed_kernel/drivers/infiniband/core/ucm.c	2009-12-17 10:48:44.000000000 +0200
+@@ -43,6 +43,7 @@
+ #include <linux/cdev.h>
+ #include <linux/idr.h>
+ #include <linux/mutex.h>
++#include <linux/sched.h>
+ 
+ #include <asm/uaccess.h>
+ 
+Index: ofed_kernel/drivers/infiniband/core/uverbs_main.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/uverbs_main.c	2009-12-17 10:05:07.000000000 +0200
++++ ofed_kernel/drivers/infiniband/core/uverbs_main.c	2009-12-17 10:50:09.000000000 +0200
+@@ -43,6 +43,7 @@
+ #include <linux/file.h>
+ #include <linux/mount.h>
+ #include <linux/cdev.h>
++#include <linux/sched.h>
+ 
+ #include <asm/uaccess.h>
+ 
+Index: ofed_kernel/drivers/infiniband/core/ucma.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/ucma.c	2009-12-16 16:37:11.000000000 +0200
++++ ofed_kernel/drivers/infiniband/core/ucma.c	2009-12-17 10:53:59.000000000 +0200
+@@ -38,6 +38,7 @@
+ #include <linux/in.h>
+ #include <linux/in6.h>
+ #include <linux/miscdevice.h>
++#include <linux/sched.h>
+ 
+ #include <rdma/rdma_user_cm.h>
+ #include <rdma/ib_marshall.h>
+
+Index: ofed_kernel/drivers/infiniband/core/iwcm.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/iwcm.c	2009-12-17 12:27:11.000000000 +0200
++++ ofed_kernel/drivers/infiniband/core/iwcm.c	2009-12-17 12:32:25.000000000 +0200
+@@ -43,6 +43,7 @@
+ #include <linux/spinlock.h>
+ #include <linux/workqueue.h>
+ #include <linux/completion.h>
++#include <linux/sched.h>
+ 
+ #include <rdma/iw_cm.h>
+ #include <rdma/ib_addr.h>
+Index: ofed_kernel/drivers/infiniband/core/user_mad.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/user_mad.c	2010-03-22 13:15:06.000000000 +0200
++++ ofed_kernel/drivers/infiniband/core/user_mad.c	2010-03-22 13:16:08.000000000 +0200
+@@ -45,6 +45,7 @@
+ #include <linux/kref.h>
+ #include <linux/compat.h>
+ #include <linux/semaphore.h>
++#include <linux/sched.h>
+ 
+ #include <asm/uaccess.h>
+ 
diff --git a/kernel_patches/backport/3.1/user_mad_mutex_init.patch b/kernel_patches/backport/3.1/user_mad_mutex_init.patch
new file mode 100644
index 0000000..3054f1e
--- /dev/null
+++ b/kernel_patches/backport/3.1/user_mad_mutex_init.patch
@@ -0,0 +1,15 @@
+From: Sven-Thorsten Dietrich <sdietrich at suse.de>
+Subject: use updated mutex_init.
+
+Signed-off-by: Sven-Thorsten Dietrich <sdietrich at suse.de>
+--- a/drivers/infiniband/core/user_mad.c	2009-11-24 07:52:27.000000000 -0800
++++ b/drivers/infiniband/core//user_mad.c	2012-09-01 13:06:26.000000000 -0700
+@@ -1003,7 +1003,7 @@
+ 
+ 	port->ib_dev   = device;
+ 	port->port_num = port_num;
+-	init_MUTEX(&port->sm_sem);
++	sema_init(&port->sm_sem, 1);
+ 	mutex_init(&port->file_mutex);
+ 	INIT_LIST_HEAD(&port->file_list);
+ 
diff --git a/kernel_patches/backport/3.1/uverbs_0010_to_2_6_33.patch b/kernel_patches/backport/3.1/uverbs_0010_to_2_6_33.patch
new file mode 100644
index 0000000..3092d49
--- /dev/null
+++ b/kernel_patches/backport/3.1/uverbs_0010_to_2_6_33.patch
@@ -0,0 +1,34 @@
+Index: ofed_kernel/drivers/infiniband/core/uverbs_main.c
+===================================================================
+--- ofed_kernel.orig/drivers/infiniband/core/uverbs_main.c	2010-08-09 17:37:03.000000000 +0300
++++ ofed_kernel/drivers/infiniband/core/uverbs_main.c	2010-08-09 18:33:10.000000000 +0300
+@@ -531,6 +531,7 @@
+ 					int is_async, int *fd)
+ {
+ 	struct ib_uverbs_event_file *ev_file;
++	struct path path;
+ 	struct file *filp;
+ 	int ret;
+ 
+@@ -558,8 +559,10 @@
+ 	 * system call on a uverbs file, which will already have a
+ 	 * module reference.
+ 	 */
+-	filp = alloc_file(uverbs_event_mnt, dget(uverbs_event_mnt->mnt_root),
+-			  FMODE_READ, fops_get(&uverbs_event_fops));
++	path.mnt = uverbs_event_mnt;
++	path.dentry = uverbs_event_mnt->mnt_root;
++	path_get(&path);
++	filp = alloc_file(&path, FMODE_READ, fops_get(&uverbs_event_fops));
+ 	if (!filp) {
+ 		ret = -ENFILE;
+ 		goto err_fd;
+@@ -570,6 +573,8 @@
+ 	return filp;
+ 
+ err_fd:
++	fops_put(&uverbs_event_fops);
++	path_put(&path);
+ 	put_unused_fd(*fd);
+ 
+ err:
diff --git a/kernel_patches/backport/3.1/uverbs_0020_to_2_6_35.patch b/kernel_patches/backport/3.1/uverbs_0020_to_2_6_35.patch
new file mode 100644
index 0000000..813e7b4
--- /dev/null
+++ b/kernel_patches/backport/3.1/uverbs_0020_to_2_6_35.patch
@@ -0,0 +1,68 @@
+commit 28812fe11a21826ba4c97c6c7971a619987cd912
+Author: Andi Kleen <andi at firstfloor.org>
+Date:   Tue Jan 5 12:48:07 2010 +0100
+
+    driver-core: Add attribute argument to class_attribute show/store
+    
+    Passing the attribute to the low level IO functions allows all kinds
+    of cleanups, by sharing low level IO code without requiring
+    an own function for every piece of data.
+    
+    Also drivers can extend the attributes with own data fields
+    and use that in the low level function.
+    
+    This makes the class attributes the same as sysdev_class attributes
+    and plain attributes.
+    
+    This will allow further cleanups in drivers.
+    
+    Full tree sweep converting all users.
+    
+    Signed-off-by: Andi Kleen <ak at linux.intel.com>
+    Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
+
+diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
+index 1b09b73..02e209f 100644
+--- a/drivers/infiniband/core/ucm.c
++++ b/drivers/infiniband/core/ucm.c
+@@ -1336,7 +1336,9 @@ static void ib_ucm_remove_one(struct ib_device *device)
+ 	device_unregister(&ucm_dev->dev);
+ }
+ 
+-static ssize_t show_abi_version(struct class *class, char *buf)
++static ssize_t show_abi_version(struct class *class,
++				struct class_attribute *attr,
++				char *buf)
+ {
+ 	return sprintf(buf, "%d\n", IB_USER_CM_ABI_VERSION);
+ }
+diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
+index 02d360c..d0de8f2 100644
+--- a/drivers/infiniband/core/user_mad.c
++++ b/drivers/infiniband/core/user_mad.c
+@@ -965,7 +965,9 @@ static ssize_t show_port(struct device *dev, struct device_attribute *attr,
+ }
+ static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
+ 
+-static ssize_t show_abi_version(struct class *class, char *buf)
++static ssize_t show_abi_version(struct class *class,
++				struct class_attribute *attr,
++				char *buf)
+ {
+ 	return sprintf(buf, "%d\n", IB_USER_MAD_ABI_VERSION);
+ }
+diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
+index 4fa2e65..6087939 100644
+--- a/drivers/infiniband/core/uverbs_main.c
++++ b/drivers/infiniband/core/uverbs_main.c
+@@ -691,7 +691,9 @@ static ssize_t show_dev_abi_version(struct device *device,
+ }
+ static DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL);
+ 
+-static ssize_t show_abi_version(struct class *class, char *buf)
++static ssize_t show_abi_version(struct class *class,
++				struct class_attribute *attr,
++				char *buf)
+ {
+ 	return sprintf(buf, "%d\n", IB_USER_VERBS_ABI_VERSION);
+ }
diff --git a/kernel_patches/backport/3.1/zzz_all_0010-include-cleanup-Update-gfp.h-and-slab.h-includes-to-2_6_34.patch b/kernel_patches/backport/3.1/zzz_all_0010-include-cleanup-Update-gfp.h-and-slab.h-includes-to-2_6_34.patch
new file mode 100644
index 0000000..7f98050
--- /dev/null
+++ b/kernel_patches/backport/3.1/zzz_all_0010-include-cleanup-Update-gfp.h-and-slab.h-includes-to-2_6_34.patch
@@ -0,0 +1,1523 @@
+commit 5a0e3ad6af8660be21ca98a971cd00f331318c05
+Author: Tejun Heo <tj at kernel.org>
+Date:   Wed Mar 24 17:04:11 2010 +0900
+
+    include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
+    
+    percpu.h is included by sched.h and module.h and thus ends up being
+    included when building most .c files.  percpu.h includes slab.h which
+    in turn includes gfp.h making everything defined by the two files
+    universally available and complicating inclusion dependencies.
+    
+    percpu.h -> slab.h dependency is about to be removed.  Prepare for
+    this change by updating users of gfp and slab facilities include those
+    headers directly instead of assuming availability.  As this conversion
+    needs to touch large number of source files, the following script is
+    used as the basis of conversion.
+    
+      http://userweb.kernel.org/~tj/misc/slabh-sweep.py
+    
+    The script does the followings.
+    
+    * Scan files for gfp and slab usages and update includes such that
+      only the necessary includes are there.  ie. if only gfp is used,
+      gfp.h, if slab is used, slab.h.
+    
+    * When the script inserts a new include, it looks at the include
+      blocks and try to put the new include such that its order conforms
+      to its surrounding.  It's put in the include block which contains
+      core kernel includes, in the same order that the rest are ordered -
+      alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
+      doesn't seem to be any matching order.
+    
+    * If the script can't find a place to put a new include (mostly
+      because the file doesn't have fitting include block), it prints out
+      an error message indicating which .h file needs to be added to the
+      file.
+    
+    The conversion was done in the following steps.
+    
+    1. The initial automatic conversion of all .c files updated slightly
+       over 4000 files, deleting around 700 includes and adding ~480 gfp.h
+       and ~3000 slab.h inclusions.  The script emitted errors for ~400
+       files.
+    
+    2. Each error was manually checked.  Some didn't need the inclusion,
+       some needed manual addition while adding it to implementation .h or
+       embedding .c file was more appropriate for others.  This step added
+       inclusions to around 150 files.
+    
+    3. The script was run again and the output was compared to the edits
+       from #2 to make sure no file was left behind.
+    
+    4. Several build tests were done and a couple of problems were fixed.
+       e.g. lib/decompress_*.c used malloc/free() wrappers around slab
+       APIs requiring slab.h to be added manually.
+    
+    5. The script was run on all .h files but without automatically
+       editing them as sprinkling gfp.h and slab.h inclusions around .h
+       files could easily lead to inclusion dependency hell.  Most gfp.h
+       inclusion directives were ignored as stuff from gfp.h was usually
+       wildly available and often used in preprocessor macros.  Each
+       slab.h inclusion directive was examined and added manually as
+       necessary.
+    
+    6. percpu.h was updated not to include slab.h.
+    
+    7. Build test were done on the following configurations and failures
+       were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
+       distributed build env didn't work with gcov compiles) and a few
+       more options had to be turned off depending on archs to make things
+       build (like ipr on powerpc/64 which failed due to missing writeq).
+    
+       * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
+       * powerpc and powerpc64 SMP allmodconfig
+       * sparc and sparc64 SMP allmodconfig
+       * ia64 SMP allmodconfig
+       * s390 SMP allmodconfig
+       * alpha SMP allmodconfig
+       * um on x86_64 SMP allmodconfig
+    
+    8. percpu.h modifications were reverted so that it could be applied as
+       a separate patch and serve as bisection point.
+    
+    Given the fact that I had only a couple of failures from tests on step
+    6, I'm fairly confident about the coverage of this conversion patch.
+    If there is a breakage, it's likely to be something in one of the arch
+    headers which should be easily discoverable easily on most builds of
+    the specific arch.
+    
+    Signed-off-by: Tejun Heo <tj at kernel.org>
+    Guess-its-ok-by: Christoph Lameter <cl at linux-foundation.org>
+    Cc: Ingo Molnar <mingo at redhat.com>
+    Cc: Lee Schermerhorn <Lee.Schermerhorn at hp.com>
+
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/addr.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/addr.c	2011-02-02 15:18:50.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/addr.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,7 @@
+ 
+ #include <linux/mutex.h>
+ #include <linux/inetdevice.h>
++#include <linux/slab.h>
+ #include <linux/workqueue.h>
+ #include <net/arp.h>
+ #include <net/neighbour.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/cm.c	2011-02-02 15:20:29.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/cm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -42,6 +42,7 @@
+ #include <linux/random.h>
+ #include <linux/rbtree.h>
+ #include <linux/spinlock.h>
++#include <linux/slab.h>
+ #include <linux/sysfs.h>
+ #include <linux/workqueue.h>
+ #include <linux/kdev_t.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/cma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/cma.c	2011-02-02 15:18:55.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/cma.c	2011-02-02 15:31:16.000000000 +0200
+@@ -40,6 +40,7 @@
+ #include <linux/random.h>
+ #include <linux/idr.h>
+ #include <linux/inetdevice.h>
++#include <linux/slab.h>
+ 
+ #include <net/tcp.h>
+ #include <net/ipv6.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/iwcm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/iwcm.c	2011-02-02 15:20:37.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/iwcm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include <linux/workqueue.h>
+ #include <linux/completion.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include <rdma/iw_cm.h>
+ #include <rdma/ib_addr.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/mad.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/mad.c	2011-02-02 15:18:55.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/mad.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+  *
+  */
+ #include <linux/dma-mapping.h>
++#include <linux/slab.h>
+ #include <rdma/ib_cache.h>
+ 
+ #include "mad_priv.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/mad_rmpp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/mad_rmpp.c	2011-02-02 15:18:47.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/mad_rmpp.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "mad_priv.h"
+ #include "mad_rmpp.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/multicast.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/multicast.c	2011-02-02 15:20:30.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/multicast.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/err.h>
+ #include <linux/interrupt.h>
++#include <linux/slab.h>
+ #include <linux/bitops.h>
+ #include <linux/random.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/ucm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/ucm.c	2011-02-02 15:20:37.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/ucm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include <linux/idr.h>
+ #include <linux/mutex.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include <asm/uaccess.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/ucma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/ucma.c	2011-02-02 15:20:37.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/ucma.c	2011-02-02 15:31:16.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include <linux/in6.h>
+ #include <linux/miscdevice.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include <rdma/rdma_user_cm.h>
+ #include <rdma/ib_marshall.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/umem.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/umem.c	2011-02-02 15:18:46.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/umem.c	2011-02-02 15:31:16.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/sched.h>
+ #include <linux/hugetlb.h>
+ #include <linux/dma-attrs.h>
++#include <linux/slab.h>
+ 
+ #include "uverbs.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/user_mad.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/user_mad.c	2011-02-02 15:20:37.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/user_mad.c	2011-02-02 15:31:16.000000000 +0200
+@@ -46,6 +46,7 @@
+ #include <linux/compat.h>
+ #include <linux/semaphore.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include <asm/uaccess.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/uverbs_cmd.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/uverbs_cmd.c	2011-02-02 15:18:55.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/uverbs_cmd.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,7 @@
+ 
+ #include <linux/file.h>
+ #include <linux/fs.h>
++#include <linux/slab.h>
+ 
+ #include <asm/uaccess.h>
+ #include <asm/fcntl.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/uverbs_main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/core/uverbs_main.c	2011-02-02 15:20:37.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/core/uverbs_main.c	2011-02-02 15:31:16.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include <linux/mount.h>
+ #include <linux/cdev.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include <asm/uaccess.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2.c	2011-02-02 15:31:16.000000000 +0200
+@@ -46,6 +46,7 @@
+ #include <linux/tcp.h>
+ #include <linux/init.h>
+ #include <linux/dma-mapping.h>
++#include <linux/slab.h>
+ 
+ #include <asm/io.h>
+ #include <asm/irq.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_alloc.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_alloc.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_alloc.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,7 +32,6 @@
+  */
+ 
+ #include <linux/errno.h>
+-#include <linux/slab.h>
+ #include <linux/bitmap.h>
+ 
+ #include "c2.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_cm.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_cm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,8 @@
+  * SOFTWARE.
+  *
+  */
++#include <linux/slab.h>
++
+ #include "c2.h"
+ #include "c2_wr.h"
+ #include "c2_vq.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_cq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_cq.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_cq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,8 @@
+  * SOFTWARE.
+  *
+  */
++#include <linux/gfp.h>
++
+ #include "c2.h"
+ #include "c2_vq.h"
+ #include "c2_status.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_mm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_mm.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_mm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -30,6 +30,8 @@
+  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  * SOFTWARE.
+  */
++#include <linux/slab.h>
++
+ #include "c2.h"
+ #include "c2_vq.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_pd.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_pd.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_pd.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+  */
+ 
+ #include <linux/init.h>
++#include <linux/slab.h>
+ #include <linux/errno.h>
+ 
+ #include "c2.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_provider.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_provider.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_provider.c	2011-02-02 15:31:16.000000000 +0200
+@@ -50,6 +50,7 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/if_arp.h>
+ #include <linux/vmalloc.h>
++#include <linux/slab.h>
+ 
+ #include <asm/io.h>
+ #include <asm/irq.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_qp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_qp.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_qp.c	2011-02-02 15:31:16.000000000 +0200
+@@ -36,6 +36,7 @@
+  */
+ 
+ #include <linux/delay.h>
++#include <linux/gfp.h>
+ 
+ #include "c2.h"
+ #include "c2_vq.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_rnic.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/amso1100/c2_rnic.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/amso1100/c2_rnic.c	2011-02-02 15:31:16.000000000 +0200
+@@ -51,6 +51,7 @@
+ #include <linux/mm.h>
+ #include <linux/inet.h>
+ #include <linux/vmalloc.h>
++#include <linux/slab.h>
+ 
+ #include <linux/route.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/cxio_dbg.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/cxio_dbg.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/cxio_dbg.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,7 @@
+  */
+ #ifdef DEBUG
+ #include <linux/types.h>
++#include <linux/slab.h>
+ #include "common.h"
+ #include "cxgb3_ioctl.h"
+ #include "cxio_hal.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/cxio_hal.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/cxio_hal.c	2011-02-02 15:19:17.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/cxio_hal.c	2011-02-02 15:31:16.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/spinlock.h>
+ #include <linux/pci.h>
+ #include <linux/dma-mapping.h>
++#include <linux/slab.h>
+ #include <net/net_namespace.h>
+ 
+ #include "cxio_resource.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/iwch_cm.c	2011-02-02 15:19:18.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_cm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,7 @@
+  */
+ #include <linux/module.h>
+ #include <linux/list.h>
++#include <linux/slab.h>
+ #include <linux/workqueue.h>
+ #include <linux/skbuff.h>
+ #include <linux/timer.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_ev.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/iwch_ev.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_ev.c	2011-02-02 15:31:16.000000000 +0200
+@@ -29,7 +29,7 @@
+  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  * SOFTWARE.
+  */
+-#include <linux/slab.h>
++#include <linux/gfp.h>
+ #include <linux/mman.h>
+ #include <net/sock.h>
+ #include "iwch_provider.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_mem.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/iwch_mem.c	2011-02-02 15:19:15.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_mem.c	2011-02-02 15:31:16.000000000 +0200
+@@ -29,6 +29,7 @@
+  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  * SOFTWARE.
+  */
++#include <linux/slab.h>
+ #include <asm/byteorder.h>
+ 
+ #include <rdma/iw_cm.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_provider.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/iwch_provider.c	2011-02-02 15:19:16.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_provider.c	2011-02-02 15:31:16.000000000 +0200
+@@ -41,6 +41,7 @@
+ #include <linux/ethtool.h>
+ #include <linux/rtnetlink.h>
+ #include <linux/inetdevice.h>
++#include <linux/slab.h>
+ 
+ #include <asm/io.h>
+ #include <asm/irq.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_qp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/cxgb3/iwch_qp.c	2011-02-02 15:19:16.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/cxgb3/iwch_qp.c	2011-02-02 15:31:16.000000000 +0200
+@@ -29,6 +29,8 @@
+  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+  * SOFTWARE.
+  */
++#include <linux/sched.h>
++#include <linux/gfp.h>
+ #include "iwch_provider.h"
+ #include "iwch.h"
+ #include "iwch_cm.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_av.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_av.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_av.c	2011-02-02 15:31:16.000000000 +0200
+@@ -41,6 +41,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_tools.h"
+ #include "ehca_iverbs.h"
+ #include "hcp_if.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_cq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_cq.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_cq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -43,6 +43,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_iverbs.h"
+ #include "ehca_classes.h"
+ #include "ehca_irq.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_hca.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_hca.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_hca.c	2011-02-02 15:31:16.000000000 +0200
+@@ -39,6 +39,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/gfp.h>
++
+ #include "ehca_tools.h"
+ #include "ehca_iverbs.h"
+ #include "hcp_if.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_irq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_irq.c	2011-02-02 15:19:07.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_irq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -41,6 +41,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_classes.h"
+ #include "ehca_irq.h"
+ #include "ehca_iverbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_mrmw.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_mrmw.c	2011-02-02 15:20:32.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_mrmw.c	2011-02-02 15:31:16.000000000 +0200
+@@ -40,6 +40,7 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
+ #include <rdma/ib_umem.h>
+ 
+ #include "ehca_iverbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_pd.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_pd.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_pd.c	2011-02-02 15:31:16.000000000 +0200
+@@ -38,6 +38,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_tools.h"
+ #include "ehca_iverbs.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_qp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_qp.c	2011-02-02 15:19:07.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_qp.c	2011-02-02 15:31:16.000000000 +0200
+@@ -43,6 +43,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_classes.h"
+ #include "ehca_tools.h"
+ #include "ehca_qes.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_uverbs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ehca_uverbs.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ehca_uverbs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -40,6 +40,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_classes.h"
+ #include "ehca_iverbs.h"
+ #include "ehca_mrmw.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ipz_pt_fn.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ehca/ipz_pt_fn.c	2011-02-02 15:19:05.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ehca/ipz_pt_fn.c	2011-02-02 15:31:16.000000000 +0200
+@@ -38,6 +38,8 @@
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ehca_tools.h"
+ #include "ipz_pt_fn.h"
+ #include "ehca_classes.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_cq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_cq.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_cq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ 
+ #include <linux/err.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "ipath_verbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_dma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_dma.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_dma.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,7 @@
+  */
+ 
+ #include <linux/scatterlist.h>
++#include <linux/gfp.h>
+ #include <rdma/ib_verbs.h>
+ 
+ #include "ipath_verbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_driver.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_driver.c	2011-02-02 15:19:09.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_driver.c	2011-02-02 15:31:16.000000000 +0200
+@@ -38,6 +38,8 @@
+ #include <linux/delay.h>
+ #include <linux/netdevice.h>
+ #include <linux/vmalloc.h>
++#include <linux/bitmap.h>
++#include <linux/slab.h>
+ 
+ #include "ipath_kernel.h"
+ #include "ipath_verbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_file_ops.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_file_ops.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_file_ops.c	2011-02-02 15:31:16.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/cdev.h>
+ #include <linux/swap.h>
+ #include <linux/vmalloc.h>
++#include <linux/slab.h>
+ #include <linux/highmem.h>
+ #include <linux/io.h>
+ #include <linux/jiffies.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_fs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_fs.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_fs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/pagemap.h>
+ #include <linux/init.h>
+ #include <linux/namei.h>
++#include <linux/slab.h>
+ 
+ #include "ipath_kernel.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_init_chip.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_init_chip.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_init_chip.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <linux/pci.h>
+ #include <linux/netdevice.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "ipath_kernel.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_mmap.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_mmap.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_mmap.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,7 @@
+ 
+ #include <linux/module.h>
+ #include <linux/vmalloc.h>
++#include <linux/slab.h>
+ #include <linux/mm.h>
+ #include <linux/errno.h>
+ #include <asm/pgtable.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_mr.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_mr.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_mr.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include <rdma/ib_umem.h>
+ #include <rdma/ib_pack.h>
+ #include <rdma/ib_smi.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_qp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_qp.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_qp.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,8 @@
+  */
+ 
+ #include <linux/err.h>
++#include <linux/sched.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "ipath_verbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_sdma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_sdma.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_sdma.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,7 @@
+  */
+ 
+ #include <linux/spinlock.h>
++#include <linux/gfp.h>
+ 
+ #include "ipath_kernel.h"
+ #include "ipath_verbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_srq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_srq.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_srq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ 
+ #include <linux/err.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "ipath_verbs.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_user_pages.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_user_pages.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_user_pages.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,6 +33,8 @@
+ 
+ #include <linux/mm.h>
+ #include <linux/device.h>
++#include <linux/slab.h>
++#include <linux/sched.h>
+ 
+ #include "ipath_kernel.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_verbs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_verbs.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_verbs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <rdma/ib_mad.h>
+ #include <rdma/ib_user_verbs.h>
+ #include <linux/io.h>
++#include <linux/slab.h>
+ #include <linux/utsname.h>
+ #include <linux/rculist.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/ipath/ipath_verbs_mcast.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,8 @@
+  */
+ 
+ #include <linux/rculist.h>
++#include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include "ipath_verbs.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/ah.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/ah.c	2011-02-02 15:19:51.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/ah.c	2011-02-02 15:31:16.000000000 +0200
+@@ -30,6 +30,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "mlx4_ib.h"
+ #include <rdma/ib_addr.h>
+ #include <linux/inet.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/cq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/cq.c	2011-02-02 15:19:52.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/cq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <linux/mlx4/cq.h>
+ #include <linux/mlx4/qp.h>
+ #include <linux/mlx4/srq.h>
++#include <linux/slab.h>
+ 
+ #include "mlx4_ib.h"
+ #include "user.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/mad.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/mad.c	2011-02-02 15:19:37.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/mad.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <rdma/ib_smi.h>
+ 
+ #include <linux/mlx4/cmd.h>
++#include <linux/gfp.h>
+ 
+ #include "mlx4_ib.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/main.c	2011-02-02 15:19:53.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/main.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <linux/module.h>
+ #include <linux/init.h>
++#include <linux/slab.h>
+ #include <linux/errno.h>
+ #include <linux/netdevice.h>
+ #include <linux/inetdevice.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/mr.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/mr.c	2011-02-02 15:19:38.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/mr.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "mlx4_ib.h"
+ 
+ static u32 convert_access(int acc)
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/qp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/qp.c	2011-02-02 15:19:52.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/qp.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <linux/log2.h>
+ #include <linux/netdevice.h>
++#include <linux/slab.h>
+ 
+ #include <rdma/ib_cache.h>
+ #include <rdma/ib_pack.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/srq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mlx4/srq.c	2011-02-02 15:19:35.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mlx4/srq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <linux/mlx4/qp.h>
+ #include <linux/mlx4/srq.h>
++#include <linux/slab.h>
+ 
+ #include "mlx4_ib.h"
+ #include "user.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_cmd.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_cmd.c	2011-02-02 15:19:54.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_cmd.c	2011-02-02 15:31:16.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include <linux/pci.h>
+ #include <linux/errno.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ #include <asm/io.h>
+ #include <rdma/ib_mad.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_cq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_cq.c	2011-02-02 15:19:54.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_cq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/gfp.h>
+ #include <linux/hardirq.h>
+ #include <linux/sched.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_eq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_eq.c	2011-02-02 15:19:54.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_eq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <linux/errno.h>
+ #include <linux/interrupt.h>
+ #include <linux/pci.h>
++#include <linux/slab.h>
+ 
+ #include "mthca_dev.h"
+ #include "mthca_cmd.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_main.c	2011-02-02 15:19:55.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_main.c	2011-02-02 15:31:16.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/errno.h>
+ #include <linux/pci.h>
+ #include <linux/interrupt.h>
++#include <linux/gfp.h>
+ 
+ #include "mthca_dev.h"
+ #include "mthca_config_reg.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_mcg.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_mcg.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_mcg.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,7 +31,7 @@
+  */
+ 
+ #include <linux/string.h>
+-#include <linux/slab.h>
++#include <linux/gfp.h>
+ 
+ #include "mthca_dev.h"
+ #include "mthca_cmd.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_memfree.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_memfree.c	2011-02-02 14:55:03.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_memfree.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/mm.h>
+ #include <linux/scatterlist.h>
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ 
+ #include <asm/page.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_provider.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/mthca/mthca_provider.c	2011-02-02 15:19:55.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/mthca/mthca_provider.c	2011-02-02 15:31:16.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include <rdma/ib_user_verbs.h>
+ 
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ #include <linux/mm.h>
+ 
+ #include "mthca_dev.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/nes/nes.c	2011-02-02 15:20:09.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes.c	2011-02-02 15:31:16.000000000 +0200
+@@ -44,6 +44,7 @@
+ #include <linux/init.h>
+ #include <linux/if_arp.h>
+ #include <linux/highmem.h>
++#include <linux/slab.h>
+ #include <asm/io.h>
+ #include <asm/irq.h>
+ #include <asm/byteorder.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/nes/nes_cm.c	2011-02-02 15:20:09.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_cm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -53,6 +53,7 @@
+ #include <linux/list.h>
+ #include <linux/threads.h>
+ #include <linux/highmem.h>
++#include <linux/slab.h>
+ #include <net/arp.h>
+ #include <net/neighbour.h>
+ #include <net/route.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_hw.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/nes/nes_hw.c	2011-02-02 15:20:11.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_hw.c	2011-02-02 15:31:16.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include <linux/tcp.h>
+ #include <linux/if_vlan.h>
+ #include <linux/inet_lro.h>
++#include <linux/slab.h>
+ 
+ #include "nes.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_nic.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/nes/nes_nic.c	2011-02-02 15:20:34.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_nic.c	2011-02-02 15:31:16.000000000 +0200
+@@ -40,6 +40,7 @@
+ #include <linux/if_arp.h>
+ #include <linux/if_vlan.h>
+ #include <linux/ethtool.h>
++#include <linux/slab.h>
+ #include <net/tcp.h>
+ 
+ #include <net/inet_common.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_utils.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/nes/nes_utils.c	2011-02-02 15:20:05.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_utils.c	2011-02-02 15:31:16.000000000 +0200
+@@ -38,6 +38,7 @@
+ #include <linux/ethtool.h>
+ #include <linux/mii.h>
+ #include <linux/if_vlan.h>
++#include <linux/slab.h>
+ #include <linux/crc32.h>
+ #include <linux/in.h>
+ #include <linux/ip.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_verbs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/hw/nes/nes_verbs.c	2011-02-02 15:20:10.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/hw/nes/nes_verbs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/moduleparam.h>
+ #include <linux/random.h>
+ #include <linux/highmem.h>
++#include <linux/slab.h>
+ #include <asm/byteorder.h>
+ 
+ #include <rdma/ib_verbs.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2011-02-02 15:20:35.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_cm.c	2011-02-02 15:31:16.000000000 +0200
+@@ -36,6 +36,7 @@
+ #include <net/icmp.h>
+ #include <linux/icmpv6.h>
+ #include <linux/delay.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "ipoib.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_fs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/ipoib/ipoib_fs.c	2011-02-02 14:55:04.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_fs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,7 @@
+ 
+ #include <linux/err.h>
+ #include <linux/seq_file.h>
++#include <linux/slab.h>
+ 
+ struct file_operations;
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_ib.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2011-02-02 15:19:10.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_ib.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,7 @@
+ 
+ #include <linux/delay.h>
+ #include <linux/dma-mapping.h>
++#include <linux/slab.h>
+ 
+ #include <rdma/ib_cache.h>
+ #include <linux/ip.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2011-02-02 15:20:35.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_multicast.c	2011-02-02 15:31:16.000000000 +0200
+@@ -40,6 +40,7 @@
+ #include <linux/inetdevice.h>
+ #include <linux/delay.h>
+ #include <linux/completion.h>
++#include <linux/slab.h>
+ 
+ #include <net/dst.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_verbs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/ipoib/ipoib_verbs.c	2011-02-02 15:19:09.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_verbs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -31,6 +31,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "ipoib.h"
+ #include <linux/ethtool.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_vlan.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/ipoib/ipoib_vlan.c	2011-02-02 14:55:04.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/ipoib/ipoib_vlan.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,7 +33,6 @@
+ #include <linux/module.h>
+ 
+ #include <linux/init.h>
+-#include <linux/slab.h>
+ #include <linux/seq_file.h>
+ 
+ #include <asm/uaccess.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/iser/iscsi_iser.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/iser/iscsi_iser.c	2011-02-02 14:55:04.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/iser/iscsi_iser.c	2011-02-02 15:31:16.000000000 +0200
+@@ -56,6 +56,7 @@
+ #include <linux/net.h>
+ #include <linux/scatterlist.h>
+ #include <linux/delay.h>
++#include <linux/slab.h>
+ 
+ #include <net/sock.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/iser/iser_verbs.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/infiniband/ulp/iser/iser_verbs.c	2011-02-02 14:55:04.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/infiniband/ulp/iser/iser_verbs.c	2011-02-02 15:31:16.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ #include <linux/kernel.h>
+ #include <linux/module.h>
++#include <linux/slab.h>
+ #include <linux/delay.h>
+ 
+ #include "iscsi_iser.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/cmd.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/cmd.c	2011-02-02 15:20:35.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/cmd.c	2011-02-02 15:31:16.000000000 +0200
+@@ -33,6 +33,7 @@
+  */
+ 
+ #include <linux/sched.h>
++#include <linux/slab.h>
+ #include <linux/pci.h>
+ #include <linux/errno.h>
+ #include <linux/semaphore.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/cq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/cq.c	2011-02-02 15:19:34.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/cq.c	2011-02-02 15:31:16.000000000 +0200
+@@ -36,6 +36,7 @@
+ 
+ #include <linux/init.h>
+ #include <linux/hardirq.h>
++#include <linux/gfp.h>
+ 
+ #include <linux/mlx4/cmd.h>
+ #include <linux/mlx4/cq.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/en_main.c	2011-02-02 15:19:47.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_main.c	2011-02-02 15:31:16.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/module.h>
+ #include <linux/delay.h>
+ #include <linux/netdevice.h>
++#include <linux/slab.h>
+ 
+ #include <linux/mlx4/driver.h>
+ #include <linux/mlx4/device.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_netdev.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/en_netdev.c	2011-02-02 15:19:52.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_netdev.c	2011-02-02 15:31:17.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/tcp.h>
+ #include <linux/if_vlan.h>
+ #include <linux/delay.h>
++#include <linux/slab.h>
+ 
+ #include <linux/mlx4/driver.h>
+ #include <linux/mlx4/device.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_resources.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/en_resources.c	2011-02-02 15:19:42.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_resources.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ 
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ #include <linux/mlx4/qp.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_rx.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/en_rx.c	2011-02-02 15:20:34.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_rx.c	2011-02-02 15:31:17.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ 
+ #include <linux/mlx4/cq.h>
++#include <linux/slab.h>
+ #include <linux/mlx4/qp.h>
+ #include <linux/skbuff.h>
+ #include <linux/if_ether.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_tx.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/en_tx.c	2011-02-02 15:19:52.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/en_tx.c	2011-02-02 15:31:17.000000000 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <asm/page.h>
+ #include <linux/mlx4/cq.h>
++#include <linux/slab.h>
+ #include <linux/mlx4/qp.h>
+ #include <linux/skbuff.h>
+ #include <linux/if_vlan.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/eq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/eq.c	2011-02-02 15:19:35.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/eq.c	2011-02-02 15:31:17.000000000 +0200
+@@ -33,6 +33,7 @@
+ 
+ #include <linux/init.h>
+ #include <linux/interrupt.h>
++#include <linux/slab.h>
+ #include <linux/mm.h>
+ #include <linux/dma-mapping.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/icm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/icm.c	2011-02-02 15:19:36.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/icm.c	2011-02-02 15:31:17.000000000 +0200
+@@ -35,6 +35,7 @@
+ #include <linux/errno.h>
+ #include <linux/mm.h>
+ #include <linux/scatterlist.h>
++#include <linux/slab.h>
+ 
+ #include <linux/mlx4/cmd.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/intf.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/intf.c	2011-02-02 15:19:46.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/intf.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <linux/slab.h>
++
+ #include "mlx4.h"
+ 
+ struct mlx4_device_context {
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/main.c	2011-02-02 15:19:53.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/main.c	2011-02-02 15:31:17.000000000 +0200
+@@ -39,6 +39,7 @@
+ #include <linux/pci.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/io-mapping.h>
++#include <linux/slab.h>
+ 
+ #include <linux/mlx4/device.h>
+ #include <linux/mlx4/doorbell.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/mcg.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/mcg.c	2011-02-02 15:19:53.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/mcg.c	2011-02-02 15:32:10.000000000 +0200
+@@ -33,7 +33,6 @@
+ 
+ #include <linux/init.h>
+ #include <linux/string.h>
+-#include <linux/slab.h>
+ #include <linux/etherdevice.h>
+ 
+ #include <linux/mlx4/cmd.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/mr.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/mr.c	2011-02-02 15:20:34.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/mr.c	2011-02-02 15:31:17.000000000 +0200
+@@ -34,6 +34,7 @@
+ 
+ #include <linux/init.h>
+ #include <linux/errno.h>
++#include <linux/slab.h>
+ 
+ #include <linux/mlx4/cmd.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/profile.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/profile.c	2011-02-02 15:19:24.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/profile.c	2011-02-02 15:31:17.000000000 +0200
+@@ -34,6 +34,8 @@
+ 
+ #include <linux/init.h>
+ 
++#include <linux/slab.h>
++
+ #include "mlx4.h"
+ #include "fw.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/qp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/qp.c	2011-02-02 15:19:52.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/qp.c	2011-02-02 15:31:17.000000000 +0200
+@@ -35,6 +35,7 @@
+ 
+ #include <linux/init.h>
+ 
++#include <linux/gfp.h>
+ #include <linux/mlx4/cmd.h>
+ #include <linux/mlx4/qp.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/srq.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/drivers/net/mlx4/srq.c	2011-02-02 15:19:21.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/drivers/net/mlx4/srq.c	2011-02-02 15:31:17.000000000 +0200
+@@ -34,6 +34,7 @@
+ #include <linux/init.h>
+ 
+ #include <linux/mlx4/cmd.h>
++#include <linux/gfp.h>
+ 
+ #include "mlx4.h"
+ #include "icm.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/af_rds.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/af_rds.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/af_rds.c	2011-02-02 15:31:17.000000000 +0200
+@@ -33,6 +33,7 @@
+ #include <linux/module.h>
+ #include <linux/errno.h>
+ #include <linux/kernel.h>
++#include <linux/gfp.h>
+ #include <linux/in.h>
+ #include <linux/poll.h>
+ #include <linux/version.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/cong.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/cong.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/cong.c	2011-02-02 15:31:17.000000000 +0200
+@@ -30,6 +30,7 @@
+  * SOFTWARE.
+  *
+  */
++#include <linux/slab.h>
+ #include <linux/types.h>
+ #include <linux/rbtree.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/connection.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/connection.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/connection.c	2011-02-02 15:31:17.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ #include <linux/kernel.h>
+ #include <linux/list.h>
++#include <linux/slab.h>
+ #include <net/inet_hashtables.h>
+ 
+ #include "rds.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/ib.c	2011-02-02 15:18:49.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib.c	2011-02-02 15:31:17.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/inetdevice.h>
+ #include <linux/if_arp.h>
+ #include <linux/delay.h>
++#include <linux/slab.h>
+ 
+ #include "rds.h"
+ #include "ib.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib_cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/ib_cm.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib_cm.c	2011-02-02 15:31:17.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ #include <linux/kernel.h>
+ #include <linux/in.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "rds.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib_rdma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/ib_rdma.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib_rdma.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ 
+ #include "rds.h"
+ #include "rdma.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib_recv.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/ib_recv.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/ib_recv.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ #include <linux/pci.h>
+ #include <linux/dma-mapping.h>
+ #include <rdma/rdma_cm.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/info.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/info.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/info.c	2011-02-02 15:31:17.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ #include <linux/percpu.h>
+ #include <linux/seq_file.h>
++#include <linux/slab.h>
+ #include <linux/proc_fs.h>
+ 
+ #include "rds.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/iw.c	2011-02-02 15:18:49.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw.c	2011-02-02 15:31:17.000000000 +0200
+@@ -37,6 +37,7 @@
+ #include <linux/inetdevice.h>
+ #include <linux/if_arp.h>
+ #include <linux/delay.h>
++#include <linux/slab.h>
+ 
+ #include "rds.h"
+ #include "iw.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw_cm.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/iw_cm.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw_cm.c	2011-02-02 15:31:17.000000000 +0200
+@@ -32,6 +32,7 @@
+  */
+ #include <linux/kernel.h>
+ #include <linux/in.h>
++#include <linux/slab.h>
+ #include <linux/vmalloc.h>
+ 
+ #include "rds.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw_rdma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/iw_rdma.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw_rdma.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ 
+ #include "rds.h"
+ #include "rdma.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw_recv.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/iw_recv.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/iw_recv.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ #include <linux/pci.h>
+ #include <linux/dma-mapping.h>
+ #include <rdma/rdma_cm.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/loop.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/loop.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/loop.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ #include <linux/in.h>
+ 
+ #include "rds.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/message.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/message.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/message.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ 
+ #include "rds.h"
+ #include "rdma.h"
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/page.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/page.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/page.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/highmem.h>
++#include <linux/gfp.h>
+ 
+ #include "rds.h"
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/rdma.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/rdma.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/rdma.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/pagemap.h>
++#include <linux/slab.h>
+ #include <linux/rbtree.h>
+ #include <linux/dma-mapping.h> /* for DMA_*_DEVICE */
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/recv.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/recv.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/recv.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ #include <net/sock.h>
+ #include <linux/in.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/send.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/send.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/send.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/gfp.h>
+ #include <net/sock.h>
+ #include <linux/in.h>
+ #include <linux/list.h>
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/tcp.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/tcp.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/tcp.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ #include <linux/in.h>
+ #include <net/tcp.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/tcp_listen.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/tcp_listen.c	2011-02-02 15:20:36.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/tcp_listen.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/gfp.h>
+ #include <linux/in.h>
+ #include <net/tcp.h>
+ 
+Index: ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/tcp_recv.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check.orig/net/rds/tcp_recv.c	2011-02-02 14:55:13.000000000 +0200
++++ ofa_1_5_dev_kernel-20110202-1454_linux-2.6.34_check/net/rds/tcp_recv.c	2011-02-02 15:31:17.000000000 +0200
+@@ -31,6 +31,7 @@
+  *
+  */
+ #include <linux/kernel.h>
++#include <linux/slab.h>
+ #include <net/tcp.h>
+ 
+ #include "rds.h"
diff --git a/kernel_patches/backport/3.1/zzz_uverbs_0030_to_2_6_37-switch-infiniband-uverbs-to-anon_inodes.patch b/kernel_patches/backport/3.1/zzz_uverbs_0030_to_2_6_37-switch-infiniband-uverbs-to-anon_inodes.patch
new file mode 100644
index 0000000..bf823e9
--- /dev/null
+++ b/kernel_patches/backport/3.1/zzz_uverbs_0030_to_2_6_37-switch-infiniband-uverbs-to-anon_inodes.patch
@@ -0,0 +1,256 @@
+From b1e4594ba097634e9436cc4c6ba95f70a2d627ff Mon Sep 17 00:00:00 2001
+From: Al Viro <viro at zeniv.linux.org.uk>
+Date: Mon, 18 Jan 2010 01:38:00 -0500
+Subject: [PATCH] switch infiniband uverbs to anon_inodes
+
+Signed-off-by: Al Viro <viro at zeniv.linux.org.uk>
+---
+ drivers/infiniband/Kconfig            |    1 +
+ drivers/infiniband/core/uverbs.h      |    2 +-
+ drivers/infiniband/core/uverbs_cmd.c  |   25 ++++++++--
+ drivers/infiniband/core/uverbs_main.c |   82 +++------------------------------
+ 4 files changed, 29 insertions(+), 81 deletions(-)
+
+Index: ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/Kconfig
+===================================================================
+--- ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check.orig/drivers/infiniband/Kconfig	2011-06-17 21:32:51.000000000 +0300
++++ ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/Kconfig	2011-06-19 14:07:21.000000000 +0300
+@@ -20,6 +20,7 @@ config INFINIBAND_USER_MAD
+ 
+ config INFINIBAND_USER_ACCESS
+ 	tristate "InfiniBand userspace access (verbs and CM)"
++	select ANON_INODES
+ 	---help---
+ 	  Userspace InfiniBand access support.  This enables the
+ 	  kernel side of userspace verbs and the userspace
+Index: ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/core/uverbs.h
+===================================================================
+--- ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check.orig/drivers/infiniband/core/uverbs.h	2011-06-19 14:06:52.000000000 +0300
++++ ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/core/uverbs.h	2011-06-19 14:07:21.000000000 +0300
+@@ -151,7 +151,7 @@ extern struct idr ib_uverbs_xrc_domain_i
+ void idr_remove_uobj(struct idr *idp, struct ib_uobject *uobj);
+ 
+ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
+-					int is_async, int *fd);
++					int is_async);
+ struct ib_uverbs_event_file *ib_uverbs_lookup_comp_file(int fd);
+ 
+ void ib_uverbs_release_ucq(struct ib_uverbs_file *file,
+Index: ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/core/uverbs_cmd.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check.orig/drivers/infiniband/core/uverbs_cmd.c	2011-06-17 21:33:05.000000000 +0300
++++ ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/core/uverbs_cmd.c	2011-06-19 14:07:21.000000000 +0300
+@@ -318,10 +318,15 @@ ssize_t ib_uverbs_get_context(struct ib_
+ 
+ 	resp.num_comp_vectors = file->device->num_comp_vectors;
+ 
+-	filp = ib_uverbs_alloc_event_file(file, 1, &resp.async_fd);
++	ret = get_unused_fd();
++	if (ret < 0)
++		goto err_free;
++	resp.async_fd = ret;
++
++	filp = ib_uverbs_alloc_event_file(file, 1);
+ 	if (IS_ERR(filp)) {
+ 		ret = PTR_ERR(filp);
+-		goto err_free;
++		goto err_fd;
+ 	}
+ 
+ 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
+@@ -349,9 +354,11 @@ ssize_t ib_uverbs_get_context(struct ib_
+ 	return in_len;
+ 
+ err_file:
+-	put_unused_fd(resp.async_fd);
+ 	fput(filp);
+ 
++err_fd:
++	put_unused_fd(resp.async_fd);
++
+ err_free:
+ 	ibdev->dealloc_ucontext(ucontext);
+ 
+@@ -733,6 +740,7 @@ ssize_t ib_uverbs_create_comp_channel(st
+ 	struct ib_uverbs_create_comp_channel	   cmd;
+ 	struct ib_uverbs_create_comp_channel_resp  resp;
+ 	struct file				  *filp;
++	int ret;
+ 
+ 	if (out_len < sizeof resp)
+ 		return -ENOSPC;
+@@ -740,9 +748,16 @@ ssize_t ib_uverbs_create_comp_channel(st
+ 	if (copy_from_user(&cmd, buf, sizeof cmd))
+ 		return -EFAULT;
+ 
+-	filp = ib_uverbs_alloc_event_file(file, 0, &resp.fd);
+-	if (IS_ERR(filp))
++	ret = get_unused_fd();
++	if (ret < 0)
++		return ret;
++	resp.fd = ret;
++
++	filp = ib_uverbs_alloc_event_file(file, 0);
++	if (IS_ERR(filp)) {
++		put_unused_fd(resp.fd);
+ 		return PTR_ERR(filp);
++	}
+ 
+ 	if (copy_to_user((void __user *) (unsigned long) cmd.response,
+ 			 &resp, sizeof resp)) {
+Index: ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/core/uverbs_main.c
+===================================================================
+--- ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check.orig/drivers/infiniband/core/uverbs_main.c	2011-06-19 14:06:52.000000000 +0300
++++ ofa_1_5_dev_kernel-20110617-2130_linux-2.6.37_check/drivers/infiniband/core/uverbs_main.c	2011-06-19 14:07:49.000000000 +0300
+@@ -41,9 +41,9 @@
+ #include <linux/fs.h>
+ #include <linux/poll.h>
+ #include <linux/file.h>
+-#include <linux/mount.h>
+ #include <linux/cdev.h>
+ #include <linux/sched.h>
++#include <linux/anon_inodes.h>
+ #include <linux/slab.h>
+ 
+ #include <asm/uaccess.h>
+@@ -54,8 +54,6 @@ MODULE_AUTHOR("Roland Dreier");
+ MODULE_DESCRIPTION("InfiniBand userspace verbs access");
+ MODULE_LICENSE("Dual BSD/GPL");
+ 
+-#define INFINIBANDEVENTFS_MAGIC	0x49426576	/* "IBev" */
+-
+ enum {
+ 	IB_UVERBS_MAJOR       = 231,
+ 	IB_UVERBS_BASE_MINOR  = 192,
+@@ -121,8 +119,6 @@ static ssize_t (*uverbs_cmd_table[])(str
+ 	[IB_USER_VERBS_CMD_UNREG_XRC_RCV_QP]	= ib_uverbs_unreg_xrc_rcv_qp,
+ };
+ 
+-static struct vfsmount *uverbs_event_mnt;
+-
+ static void ib_uverbs_add_one(struct ib_device *device);
+ static void ib_uverbs_remove_one(struct ib_device *device);
+ 
+@@ -528,12 +524,10 @@ void ib_uverbs_xrc_rcv_qp_event_handler(
+ }
+ 
+ struct file *ib_uverbs_alloc_event_file(struct ib_uverbs_file *uverbs_file,
+-					int is_async, int *fd)
++					int is_async)
+ {
+ 	struct ib_uverbs_event_file *ev_file;
+-	struct path path;
+ 	struct file *filp;
+-	int ret;
+ 
+ 	ev_file = kmalloc(sizeof *ev_file, GFP_KERNEL);
+ 	if (!ev_file)
+@@ -548,38 +542,12 @@ struct file *ib_uverbs_alloc_event_file(
+ 	ev_file->is_async    = is_async;
+ 	ev_file->is_closed   = 0;
+ 
+-	*fd = get_unused_fd();
+-	if (*fd < 0) {
+-		ret = *fd;
+-		goto err;
+-	}
+-
+-	/*
+-	 * fops_get() can't fail here, because we're coming from a
+-	 * system call on a uverbs file, which will already have a
+-	 * module reference.
+-	 */
+-	path.mnt = uverbs_event_mnt;
+-	path.dentry = uverbs_event_mnt->mnt_root;
+-	path_get(&path);
+-	filp = alloc_file(&path, FMODE_READ, fops_get(&uverbs_event_fops));
+-	if (!filp) {
+-		ret = -ENFILE;
+-		goto err_fd;
+-	}
+-
+-	filp->private_data = ev_file;
++	filp = anon_inode_getfile("[infinibandevent]", &uverbs_event_fops,
++				  ev_file, O_RDONLY);
++	if (IS_ERR(filp))
++		kfree(ev_file);
+ 
+ 	return filp;
+-
+-err_fd:
+-	fops_put(&uverbs_event_fops);
+-	path_put(&path);
+-	put_unused_fd(*fd);
+-
+-err:
+-	kfree(ev_file);
+-	return ERR_PTR(ret);
+ }
+ 
+ /*
+@@ -864,21 +832,6 @@ static void ib_uverbs_remove_one(struct 
+ 	kfree(uverbs_dev);
+ }
+ 
+-static int uverbs_event_get_sb(struct file_system_type *fs_type, int flags,
+-			       const char *dev_name, void *data,
+-			       struct vfsmount *mnt)
+-{
+-	return get_sb_pseudo(fs_type, "infinibandevent:", NULL,
+-			     INFINIBANDEVENTFS_MAGIC, mnt);
+-}
+-
+-static struct file_system_type uverbs_event_fs = {
+-	/* No owner field so module can be unloaded */
+-	.name    = "infinibandeventfs",
+-	.get_sb  = uverbs_event_get_sb,
+-	.kill_sb = kill_litter_super
+-};
+-
+ static int __init ib_uverbs_init(void)
+ {
+ 	int ret;
+@@ -905,33 +858,14 @@ static int __init ib_uverbs_init(void)
+ 		goto out_class;
+ 	}
+ 
+-	ret = register_filesystem(&uverbs_event_fs);
+-	if (ret) {
+-		printk(KERN_ERR "user_verbs: couldn't register infinibandeventfs\n");
+-		goto out_class;
+-	}
+-
+-	uverbs_event_mnt = kern_mount(&uverbs_event_fs);
+-	if (IS_ERR(uverbs_event_mnt)) {
+-		ret = PTR_ERR(uverbs_event_mnt);
+-		printk(KERN_ERR "user_verbs: couldn't mount infinibandeventfs\n");
+-		goto out_fs;
+-	}
+-
+ 	ret = ib_register_client(&uverbs_client);
+ 	if (ret) {
+ 		printk(KERN_ERR "user_verbs: couldn't register client\n");
+-		goto out_mnt;
++		goto out_class;
+ 	}
+ 
+ 	return 0;
+ 
+-out_mnt:
+-	mntput(uverbs_event_mnt);
+-
+-out_fs:
+-	unregister_filesystem(&uverbs_event_fs);
+-
+ out_class:
+ 	class_destroy(uverbs_class);
+ 
+@@ -945,8 +879,6 @@ out:
+ static void __exit ib_uverbs_cleanup(void)
+ {
+ 	ib_unregister_client(&uverbs_client);
+-	mntput(uverbs_event_mnt);
+-	unregister_filesystem(&uverbs_event_fs);
+ 	class_destroy(uverbs_class);
+ 	unregister_chrdev_region(IB_UVERBS_BASE_DEV, IB_UVERBS_MAX_DEVICES);
+ 	idr_destroy(&ib_uverbs_pd_idr);
diff --git a/ofed_scripts/get_backport_dir.sh b/ofed_scripts/get_backport_dir.sh
index c60358c..a30a2a8 100755
--- a/ofed_scripts/get_backport_dir.sh
+++ b/ofed_scripts/get_backport_dir.sh
@@ -216,6 +216,9 @@ get_backport_dir()
         3.0* | 2.6.40*)
                 echo 3.0
         ;;
+        3.1*)
+                echo 3.1
+        ;;
         *)
                 echo
         ;;
-- 
1.7.6



---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.




More information about the ewg mailing list