[openib-general] OFED ipoib_8111_to_2_6_16.patch

Or Gerlitz ogerlitz at voltaire.com
Tue Jan 16 03:36:26 PST 2007


Hi Michael,

I have just realized that

a) this patch was not pushed upstream

and

b) the --same-- instance of it is kept on all backports of both OFED 1.1 & 1.2 staging

It also does not have a changelog comment and Signed-Off-By signature...

Can you shed some light on what's going on here?

thanks,

Or.


# pwd

/home/ogerlitz/OFED-1.1/SOURCES/openib-1.1/kernel_patches

# find . -name \*ipoib\* | grep 8111 | xargs ls -l
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.11_FC4/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.11/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.12/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.13/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.13_suse10_0_u/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.14/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.15/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.16/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.16_sles10/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.9/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.9_U3/ipoib_8111_to_2_6_16.patch
-rw-r--r--  1 1078 101 2616 Oct 19 16:21 ./backport/2.6.9_U4/ipoib_8111_to_2_6_16.patch

Index: openib_branch1.0/drivers/infiniband/ulp/ipoib/ipoib_main.c
===================================================================
--- openib_branch1.0.orig/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ openib_branch1.0/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -82,6 +82,9 @@ static const u8 ipv4_bcast_addr[] = {

 struct workqueue_struct *ipoib_workqueue;

+static DEFINE_SPINLOCK(ipoib_all_neigh_list_lock);
+static LIST_HEAD(ipoib_all_neigh_list);
+
 static void ipoib_add_one(struct ib_device *device);
 static void ipoib_remove_one(struct ib_device *device);

@@ -751,6 +754,17 @@ static void ipoib_neigh_destructor(struc
 	unsigned long flags;
 	struct ipoib_ah *ah = NULL;

+	struct ipoib_neigh *tn, *nn = NULL;
+	spin_lock(&ipoib_all_neigh_list_lock);
+	list_for_each_entry(tn, &ipoib_all_neigh_list, all_neigh_list)
+		if (tn->neighbour == n) {
+			nn = tn;
+			break;
+		}
+	spin_unlock(&ipoib_all_neigh_list_lock);
+	if (!nn)
+		return;
+
 	ipoib_dbg(priv,
 		  "neigh_destructor for %06x " IPOIB_GID_FMT "\n",
 		  be32_to_cpup((__be32 *) n->ha),
@@ -783,19 +797,33 @@ struct ipoib_neigh *ipoib_neigh_alloc(st
 	neigh->neighbour = neighbour;
 	*to_ipoib_neigh(neighbour) = neigh;

+	spin_lock(&ipoib_all_neigh_list_lock);
+	list_add_tail(&neigh->all_neigh_list, &ipoib_all_neigh_list);
+	neigh->neighbour->ops->destructor = ipoib_neigh_destructor;
+	spin_unlock(&ipoib_all_neigh_list_lock);
+
 	return neigh;
 }

 void ipoib_neigh_free(struct ipoib_neigh *neigh)
 {
+	struct ipoib_neigh *nn;
+	spin_lock(&ipoib_all_neigh_list_lock);
+	list_del(&neigh->all_neigh_list);
+	list_for_each_entry(nn, &ipoib_all_neigh_list, all_neigh_list)
+		if (nn->neighbour->ops == neigh->neighbour->ops)
+			goto found;
+
+	neigh->neighbour->ops->destructor = NULL;
+found:
+	spin_unlock(&ipoib_all_neigh_list_lock);
+
 	*to_ipoib_neigh(neigh->neighbour) = NULL;
 	kfree(neigh);
 }

 static int ipoib_neigh_setup_dev(struct net_device *dev, struct neigh_parms *parms)
 {
-	parms->neigh_destructor = ipoib_neigh_destructor;
-
 	return 0;
 }

Index: openib_branch1.0/drivers/infiniband/ulp/ipoib/ipoib.h
===================================================================
--- openib_branch1.0.orig/drivers/infiniband/ulp/ipoib/ipoib.h
+++ openib_branch1.0/drivers/infiniband/ulp/ipoib/ipoib.h
@@ -47,6 +47,8 @@
 #include <linux/if_infiniband.h>
 #include <linux/mutex.h>

+#include <linux/version.h>
+
 #include <net/neighbour.h>

 #include <asm/atomic.h>
@@ -217,6 +219,7 @@ struct ipoib_neigh {

 	struct neighbour   *neighbour;

+	struct list_head    all_neigh_list;
 	struct list_head    list;
 };





More information about the general mailing list