From: Vladimir Sokolovsky Date: Mon, 16 Jul 2012 14:12:01 +0000 (+0300) Subject: backport dst_fetch_ha: Add SLES11.2 support X-Git-Tag: vofed-3.5-x~55 X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=866d7d9d9e69d2e56531f5a0c42536356b02a087;p=~emulex%2Ffor-vlad%2Fcompat-rdma.git backport dst_fetch_ha: Add SLES11.2 support Signed-off-by: Vladimir Sokolovsky --- diff --git a/patches/0001-ib_core-backport-dst_fetch_ha.patch b/patches/0001-ib_core-backport-dst_fetch_ha.patch index 3f033b3..19d514d 100644 --- a/patches/0001-ib_core-backport-dst_fetch_ha.patch +++ b/patches/0001-ib_core-backport-dst_fetch_ha.patch @@ -9,26 +9,48 @@ Signed-off-by: Vladimir Sokolovsky 1 files changed, 36 insertions(+), 0 deletions(-) diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c -index 6ef660c..e00422b 100644 +index 9c9ac92..16147cc 100644 --- a/drivers/infiniband/core/addr.c +++ b/drivers/infiniband/core/addr.c -@@ -38,6 +38,7 @@ - #include - #include - #include -+#include - #include - #include - #include -@@ -178,6 +179,7 @@ static void queue_req(struct addr_req *req) +@@ -178,28 +178,45 @@ static void queue_req(struct addr_req *req) mutex_unlock(&lock); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr, void *daddr) ++#else ++static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *addr) ++#endif { struct neighbour *n; -@@ -200,6 +202,7 @@ static int dst_fetch_ha(struct dst_entry *dst, struct rdma_dev_addr *dev_addr, v + int ret; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) + n = dst_neigh_lookup(dst, daddr); ++#endif + + rcu_read_lock(); ++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,3,0) ++ n = dst_get_neighbour(dst); ++#endif + if (!n || !(n->nud_state & NUD_VALID)) { + if (n) + neigh_event_send(n, NULL); + ret = -ENODATA; + } else { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) + ret = rdma_copy_addr(dev_addr, dst->dev, n->ha); ++#else ++ ret = rdma_copy_addr(addr, dst->dev, n->ha); ++#endif + } + rcu_read_unlock(); + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) + if (n) + neigh_release(n); ++#endif return ret; } @@ -36,7 +58,7 @@ index 6ef660c..e00422b 100644 static int addr4_resolve(struct sockaddr_in *src_in, struct sockaddr_in *dst_in, -@@ -231,12 +234,33 @@ static int addr4_resolve(struct sockaddr_in *src_in, +@@ -250,12 +267,37 @@ static int addr4_resolve(struct sockaddr_in *src_in, } /* If the device does ARP internally, return 'done' */ @@ -46,8 +68,12 @@ index 6ef660c..e00422b 100644 goto put; } ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) ret = dst_fetch_ha(&rt->dst, addr, &fl4.daddr); +#else ++ ret = dst_fetch_ha(&rt->dst, addr); ++#endif ++#else + if (rt->idev->dev->flags & IFF_NOARP) { + ret = rdma_copy_addr(addr, rt->idev->dev, NULL); + goto put; @@ -70,13 +96,17 @@ index 6ef660c..e00422b 100644 put: ip_rt_put(rt); out: -@@ -284,7 +308,19 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, +@@ -329,7 +371,23 @@ static int addr6_resolve(struct sockaddr_in6 *src_in, goto put; } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,39) ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,1,0) ret = dst_fetch_ha(dst, addr, &fl6.daddr); +#else ++ ret = dst_fetch_ha(dst, addr); ++#endif ++#else + neigh = dst->neighbour; + if (!neigh || !(neigh->nud_state & NUD_VALID)) { + neigh_event_send(dst->neighbour, NULL);