***SPAM*** Re: ***SPAM*** [ofa-general][PATCH v1] compiling OFED-1.2 with RHEL5.1
Devesh Sharma
devesh28 at gmail.com
Tue Feb 3 06:09:01 PST 2009
Following is the patch that must be applied to ofa_kernel-1.2 to be
able to compile it
with RHEL5.1, whole there is one more patch I will be posting after
this. It deals with
the declarations of kmem_cache_create().
One configuration script also written, derived from ofed_patch.sh to
add backport directory 2.6.28-EL5.1
in ofa_kernel-1.2 and build rpm with changes. The scripts assumes the
names of patches are
OFED-1.2_RHEL5.1_fix.patch for this patch
kmem_cache_create_fix.patch for kmem_cache related patch.
diff -ruN ofa_kernel-1.2/configure ofa_kernel-1.2_try2/configure
--- ofa_kernel-1.2/configure 2009-02-03 02:12:23.000000000 +0530
+++ ofa_kernel-1.2_try2/configure 2009-02-03 00:46:15.000000000 +0530
@@ -218,9 +218,12 @@
2.6.17*)
echo 2.6.17
;;
- 2.6.18-*fc[56]*|2.6.18-*el5*)
+ 2.6.18-*fc[56]*|2.6.18-8.el5)
echo 2.6.18_FC6
;;
+ 2.6.18-53.el5)
+ echo 2.6.18-EL5.1
+ ;;
2.6.18*)
echo 2.6.18
;;
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/asm/prom.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/asm/prom.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/asm/prom.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/asm/prom.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,8 @@
+#ifndef ASM_PROM_BACKPORT_TO_2_6_21_H
+#define ASM_PROM_BACKPORT_TO_2_6_21_H
+
+#include_next <asm/prom.h>
+
+#define of_get_property(a, b, c) get_property((a), (b), (c))
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/asm/scatterlist.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/asm/scatterlist.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/asm/scatterlist.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/asm/scatterlist.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,5 @@
+#if defined(__ia64__)
+#include <linux/pci.h>
+#endif
+#include <asm/types.h>
+#include_next <asm/scatterlist.h>
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/compiler.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/compiler.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/compiler.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/compiler.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,8 @@
+#ifndef BACKPORT_LINUX_COMPILER_TO_2_6_22_H
+#define BACKPORT_LINUX_COMPILER_TO_2_6_22_H
+
+#include_next <linux/compiler.h>
+
+#define uninitialized_var(x) x = x
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/crypto.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/crypto.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/crypto.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/crypto.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,54 @@
+#ifndef BACKPORT_LINUX_CRYPTO_H
+#define BACKPORT_LINUX_CRYPTO_H
+
+#include_next <linux/crypto.h>
+
+#define CRYPTO_ALG_ASYNC 0x00000080
+
+struct hash_desc
+{
+ struct crypto_tfm *tfm;
+ u32 flags;
+};
+
+static inline int crypto_hash_init(struct hash_desc *desc)
+{
+ crypto_digest_init(desc->tfm);
+ return 0;
+}
+
+static inline int crypto_hash_digest(struct hash_desc *desc,
+ struct scatterlist *sg,
+ unsigned int nbytes, u8 *out)
+{
+ crypto_digest_digest(desc->tfm, sg, 1, out);
+ return nbytes;
+}
+
+static inline int crypto_hash_update(struct hash_desc *desc,
+ struct scatterlist *sg,
+ unsigned int nbytes)
+{
+ crypto_digest_update(desc->tfm, sg, 1);
+ return nbytes;
+}
+
+static inline int crypto_hash_final(struct hash_desc *desc, u8 *out)
+{
+ crypto_digest_final(desc->tfm, out);
+ return 0;
+}
+
+static inline struct crypto_tfm *crypto_alloc_hash(const char *alg_name,
+ u32 type, u32 mask)
+{
+ struct crypto_tfm *ret = crypto_alloc_tfm(alg_name ,type);
+ return ret ? ret : ERR_PTR(-ENOMEM);
+}
+
+static inline void crypto_free_hash(struct crypto_tfm *tfm)
+{
+ crypto_free_tfm(tfm);
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/etherdevice.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/etherdevice.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/etherdevice.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/etherdevice.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,15 @@
+#ifndef BACKPORT_LINUX_ETHERDEVICE
+#define BACKPORT_LINUX_ETHERDEVICE
+
+#include_next <linux/etherdevice.h>
+
+static inline unsigned short backport_eth_type_trans(struct sk_buff *skb,
+ struct net_device *dev)
+{
+ skb->dev = dev;
+ return eth_type_trans(skb, dev);
+}
+
+#define eth_type_trans backport_eth_type_trans
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/genalloc.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/genalloc.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/genalloc.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/genalloc.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,42 @@
+/*
+ * Basic general purpose allocator for managing special purpose memory
+ * not managed by the regular kmalloc/kfree interface.
+ * Uses for this includes on-device special memory, uncached memory
+ * etc.
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2. See the file COPYING for more details.
+ */
+
+
+/*
+ * General purpose special memory pool descriptor.
+ */
+struct gen_pool {
+ rwlock_t lock;
+ struct list_head chunks; /* list of chunks in this pool */
+ int min_alloc_order; /* minimum allocation order */
+};
+
+/*
+ * General purpose special memory pool chunk descriptor.
+ */
+struct gen_pool_chunk {
+ spinlock_t lock;
+ struct list_head next_chunk; /* next chunk in pool */
+ unsigned long start_addr; /* starting address of memory chunk */
+ unsigned long end_addr; /* ending address of memory chunk */
+ unsigned long bits[0]; /* bitmap for allocating memory chunk */
+};
+
+extern struct gen_pool *ib_gen_pool_create(int, int);
+extern int ib_gen_pool_add(struct gen_pool *, unsigned long, size_t, int);
+extern void ib_gen_pool_destroy(struct gen_pool *);
+extern unsigned long ib_gen_pool_alloc(struct gen_pool *, size_t);
+extern void ib_gen_pool_free(struct gen_pool *, unsigned long, size_t);
+
+#define gen_pool_create ib_gen_pool_create
+#define gen_pool_add ib_gen_pool_add
+#define gen_pool_destroy ib_gen_pool_destroy
+#define gen_pool_alloc ib_gen_pool_alloc
+#define gen_pool_free ib_gen_pool_free
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_ether.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_ether.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_ether.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_ether.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_LINUX_IF_ETHER_H_TO_2_6_21__
+#define __BACKPORT_LINUX_IF_ETHER_H_TO_2_6_21__
+
+#include_next <linux/if_ether.h>
+
+#define ETH_FCS_LEN 4 /* Octets in the FCS */
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_vlan.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_vlan.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_vlan.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/if_vlan.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,17 @@
+#ifndef __BACKPORT_LINUX_IF_VLAN_H_TO_2_6_20__
+#define __BACKPORT_LINUX_IF_VLAN_H_TO_2_6_20__
+
+#include_next <linux/if_vlan.h>
+
+static inline struct net_device *vlan_group_get_device(struct
vlan_group *vg, int vlan_id)
+{
+ return vg->vlan_devices[vlan_id];
+}
+
+static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id,
+ struct net_device *dev)
+{
+ vg->vlan_devices[vlan_id] = dev;
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/interrupt.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/interrupt.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/interrupt.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/interrupt.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,20 @@
+#ifndef BACKPORT_LINUX_INTERRUPT_TO_2_6_18
+#define BACKPORT_LINUX_INTERRUPT_TO_2_6_18
+#include_next <linux/interrupt.h>
+
+typedef irqreturn_t (*backport_irq_handler_t)(int, void *);
+
+static inline int
+backport_request_irq(unsigned int irq,
+ irqreturn_t (*handler)(int, void *),
+ unsigned long flags, const char *dev_name, void *dev_id)
+{
+ return request_irq(irq,
+ (irqreturn_t (*)(int, void *, struct pt_regs *))handler,
+ flags, dev_name, dev_id);
+}
+
+#define request_irq backport_request_irq
+#define irq_handler_t backport_irq_handler_t
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/ip.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/ip.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/ip.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/ip.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,11 @@
+#ifndef __LINUX_IP_BACKPORT_TO_2_6_21__
+#define __LINUX_IP_BACKPORT_TO_2_6_21__
+
+#include_next <linux/ip.h>
+
+static inline struct iphdr *ip_hdr(const struct sk_buff *skb)
+{
+ return (struct iphdr *)skb_network_header(skb);
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/kernel.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/kernel.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/kernel.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/kernel.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,14 @@
+#ifndef BACKPORT_KERNEL_H_2_6_22
+#define BACKPORT_KERNEL_H_2_6_22
+
+#include_next <linux/kernel.h>
+
+#define upper_32_bits(n) ((u32)(((n) >> 16) >> 16))
+
+#endif
+#ifndef BACKPORT_KERNEL_H_2_6_19
+#define BACKPORT_KERNEL_H_2_6_19
+
+#include <linux/log2.h>
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/log2.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/log2.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/log2.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/log2.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,169 @@
+/* Integer base 2 logarithm calculation
+ *
+ * Copyright (C) 2006 Red Hat, Inc. All Rights Reserved.
+ * Written by David Howells (dhowells at redhat.com)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version
+ * 2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_LOG2_H
+#define _LINUX_LOG2_H
+
+#include_next <linux/kernel.h>
+#include <linux/types.h>
+#include <linux/bitops.h>
+
+/*
+ * deal with unrepresentable constant logarithms
+ */
+extern __attribute__((const, noreturn))
+int ____ilog2_NaN(void);
+
+/*
+ * non-constant log of base 2 calculators
+ * - the arch may override these in asm/bitops.h if they can be implemented
+ * more efficiently than using fls() and fls64()
+ * - the arch is not required to handle n==0 if implementing the fallback
+ */
+#ifndef CONFIG_ARCH_HAS_ILOG2_U32
+static inline __attribute__((const))
+int __ilog2_u32(u32 n)
+{
+ return fls(n) - 1;
+}
+#endif
+
+#ifndef CONFIG_ARCH_HAS_ILOG2_U64
+static inline __attribute__((const))
+int __ilog2_u64(u64 n)
+{
+ return fls64(n) - 1;
+}
+#endif
+
+/*
+ * Determine whether some value is a power of two, where zero is
+ * *not* considered a power of two.
+ */
+
+static inline __attribute__((const))
+bool is_power_of_2(unsigned long n)
+{
+ return (n != 0 && ((n & (n - 1)) == 0));
+}
+
+/*
+ * round up to nearest power of two
+ */
+static inline __attribute__((const))
+unsigned long __roundup_pow_of_two(unsigned long n)
+{
+ return 1UL << fls_long(n - 1);
+}
+
+/**
+ * ilog2 - log of base 2 of 32-bit or a 64-bit unsigned value
+ * @n - parameter
+ *
+ * constant-capable log of base 2 calculation
+ * - this can be used to initialise global variables from constant data, hence
+ * the massive ternary operator construction
+ *
+ * selects the appropriately-sized optimised version depending on sizeof(n)
+ */
+#define ilog2(n) \
+( \
+ __builtin_constant_p(n) ? ( \
+ (n) < 1 ? ____ilog2_NaN() : \
+ (n) & (1ULL << 63) ? 63 : \
+ (n) & (1ULL << 62) ? 62 : \
+ (n) & (1ULL << 61) ? 61 : \
+ (n) & (1ULL << 60) ? 60 : \
+ (n) & (1ULL << 59) ? 59 : \
+ (n) & (1ULL << 58) ? 58 : \
+ (n) & (1ULL << 57) ? 57 : \
+ (n) & (1ULL << 56) ? 56 : \
+ (n) & (1ULL << 55) ? 55 : \
+ (n) & (1ULL << 54) ? 54 : \
+ (n) & (1ULL << 53) ? 53 : \
+ (n) & (1ULL << 52) ? 52 : \
+ (n) & (1ULL << 51) ? 51 : \
+ (n) & (1ULL << 50) ? 50 : \
+ (n) & (1ULL << 49) ? 49 : \
+ (n) & (1ULL << 48) ? 48 : \
+ (n) & (1ULL << 47) ? 47 : \
+ (n) & (1ULL << 46) ? 46 : \
+ (n) & (1ULL << 45) ? 45 : \
+ (n) & (1ULL << 44) ? 44 : \
+ (n) & (1ULL << 43) ? 43 : \
+ (n) & (1ULL << 42) ? 42 : \
+ (n) & (1ULL << 41) ? 41 : \
+ (n) & (1ULL << 40) ? 40 : \
+ (n) & (1ULL << 39) ? 39 : \
+ (n) & (1ULL << 38) ? 38 : \
+ (n) & (1ULL << 37) ? 37 : \
+ (n) & (1ULL << 36) ? 36 : \
+ (n) & (1ULL << 35) ? 35 : \
+ (n) & (1ULL << 34) ? 34 : \
+ (n) & (1ULL << 33) ? 33 : \
+ (n) & (1ULL << 32) ? 32 : \
+ (n) & (1ULL << 31) ? 31 : \
+ (n) & (1ULL << 30) ? 30 : \
+ (n) & (1ULL << 29) ? 29 : \
+ (n) & (1ULL << 28) ? 28 : \
+ (n) & (1ULL << 27) ? 27 : \
+ (n) & (1ULL << 26) ? 26 : \
+ (n) & (1ULL << 25) ? 25 : \
+ (n) & (1ULL << 24) ? 24 : \
+ (n) & (1ULL << 23) ? 23 : \
+ (n) & (1ULL << 22) ? 22 : \
+ (n) & (1ULL << 21) ? 21 : \
+ (n) & (1ULL << 20) ? 20 : \
+ (n) & (1ULL << 19) ? 19 : \
+ (n) & (1ULL << 18) ? 18 : \
+ (n) & (1ULL << 17) ? 17 : \
+ (n) & (1ULL << 16) ? 16 : \
+ (n) & (1ULL << 15) ? 15 : \
+ (n) & (1ULL << 14) ? 14 : \
+ (n) & (1ULL << 13) ? 13 : \
+ (n) & (1ULL << 12) ? 12 : \
+ (n) & (1ULL << 11) ? 11 : \
+ (n) & (1ULL << 10) ? 10 : \
+ (n) & (1ULL << 9) ? 9 : \
+ (n) & (1ULL << 8) ? 8 : \
+ (n) & (1ULL << 7) ? 7 : \
+ (n) & (1ULL << 6) ? 6 : \
+ (n) & (1ULL << 5) ? 5 : \
+ (n) & (1ULL << 4) ? 4 : \
+ (n) & (1ULL << 3) ? 3 : \
+ (n) & (1ULL << 2) ? 2 : \
+ (n) & (1ULL << 1) ? 1 : \
+ (n) & (1ULL << 0) ? 0 : \
+ ____ilog2_NaN() \
+ ) : \
+ (sizeof(n) <= 4) ? \
+ __ilog2_u32(n) : \
+ __ilog2_u64(n) \
+ )
+
+/**
+ * roundup_pow_of_two - round the given value up to nearest power of two
+ * @n - parameter
+ *
+ * round the given balue up to the nearest power of two
+ * - the result is undefined when n == 0
+ * - this can be used to initialise global variables from constant data
+ */
+#define roundup_pow_of_two(n) \
+( \
+ __builtin_constant_p(n) ? ( \
+ (n == 1) ? 0 : \
+ (1UL << (ilog2((n) - 1) + 1)) \
+ ) : \
+ __roundup_pow_of_two(n) \
+ )
+
+#endif /* _LINUX_LOG2_H */
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netdevice.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netdevice.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netdevice.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netdevice.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,16 @@
+#ifndef BACKPORT_LINUX_NETDEVICE_TO_2_6_18
+#define BACKPORT_LINUX_NETDEVICE_TO_2_6_18
+#include_next <linux/netdevice.h>
+
+static inline int skb_checksum_help_to_2_6_18(struct sk_buff *skb)
+{
+ return skb_checksum_help(skb, 0);
+}
+
+#define skb_checksum_help skb_checksum_help_to_2_6_18
+
+#undef SET_ETHTOOL_OPS
+#define SET_ETHTOOL_OPS(netdev, ops) \
+ (netdev)->ethtool_ops = (struct ethtool_ops *)(ops)
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/net.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/net.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/net.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/net.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,7 @@
+#ifndef BACKPORT_LINUX_NET_H
+#define BACKPORT_LINUX_NET_H
+
+#include_next <linux/net.h>
+#include <linux/random.h>
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netlink.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netlink.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netlink.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/netlink.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,14 @@
+#ifndef BACKPORT_LINUX_NETLINK_H
+#define BACKPORT_LINUX_NETLINK_H
+
+#include_next <linux/netlink.h>
+
+/*#define netlink_kernel_create(net, uint, groups, input, mutex, mod) \
+ netlink_kernel_create(uint, groups, input, mod)*/
+
+static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb)
+{
+ return (struct nlmsghdr *)skb->data;
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/notifier.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/notifier.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/notifier.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/notifier.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,19 @@
+#ifndef LINUX_NOTIFIER_BACKPORT_TO_2_6_21_H
+#define LINUX_NOTIFIER_BACKPORT_TO_2_6_21_H
+
+#include_next <linux/notifier.h>
+
+
+/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend
+ * operation in progress
+ */
+#define CPU_TASKS_FROZEN 0x0010
+
+#define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN)
+#define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN)
+#define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN)
+#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
+#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
+#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/pci.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/pci.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/pci.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/pci.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,21 @@
+#ifndef __BACKPORT_LINUX_PCI_TO_2_6_19__
+#define __BACKPORT_LINUX_PCI_TO_2_6_19__
+
+#include_next <linux/pci.h>
+
+/**
+ * PCI_VDEVICE - macro used to describe a specific pci device in short form
+ * @vend: the vendor name
+ * @dev: the 16 bit PCI Device ID
+ *
+ * This macro is used to create a struct pci_device_id that matches a
+ * specific PCI device. The subvendor, and subdevice fields will be set
+ * to PCI_ANY_ID. The macro allows the next field to follow as the device
+ * private data.
+ */
+
+#define PCI_VDEVICE(vendor, device) \
+ PCI_VENDOR_ID_##vendor, (device), \
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/random.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/random.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/random.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/random.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,8 @@
+#ifndef BACKPORT_LINUX_RANDOM_TO_2_6_18
+#define BACKPORT_LINUX_RANDOM_TO_2_6_18
+#include_next <linux/random.h>
+#include_next <linux/net.h>
+
+#define random32() net_random()
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/rbtree.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/rbtree.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/rbtree.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/rbtree.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_LINUX_RBTREE_TO_2_6_18
+#define BACKPORT_LINUX_RBTREE_TO_2_6_18
+#include_next <linux/rbtree.h>
+
+/* Band-aid for buggy rbtree.h */
+#undef RB_EMPTY_NODE
+#define RB_EMPTY_NODE(node) (rb_parent(node) == node)
+
+#endif
+
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/scatterlist.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/scatterlist.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/scatterlist.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/scatterlist.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,33 @@
+#ifndef __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__
+#define __BACKPORT_LINUX_SCATTERLIST_H_TO_2_6_23__
+#include_next<linux/scatterlist.h>
+
+static inline void sg_set_page(struct scatterlist *sg, struct page *page,
+ unsigned int len, unsigned int offset)
+{
+ sg->page = page;
+ sg->offset = offset;
+ sg->length = len;
+}
+
+static inline void sg_assign_page(struct scatterlist *sg, struct page *page)
+{
+ sg->page = page;
+}
+
+#define sg_page(a) (a)->page
+#define sg_init_table(a, b)
+
+#define for_each_sg(sglist, sg, nr, __i) \
+ for (__i = 0, sg = (sglist); __i < (nr); __i++, sg++)
+
+static inline struct scatterlist *sg_next(struct scatterlist *sg)
+{
+ if (!sg) {
+ BUG();
+ return NULL;
+ }
+ return sg + 1;
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/skbuff.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/skbuff.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/skbuff.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/skbuff.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,85 @@
+#ifndef LINUX_SKBUFF_H_BACKPORT
+#define LINUX_SKBUFF_H_BACKPORT
+
+#include_next <linux/skbuff.h>
+
+#define CHECKSUM_PARTIAL CHECKSUM_HW
+#define CHECKSUM_COMPLETE CHECKSUM_HW
+
+#endif
+#ifndef __BACKPORT_LINUX_SKBUFF_H_TO_2_6_21__
+#define __BACKPORT_LINUX_SKBUFF_H_TO_2_6_21__
+
+#include_next <linux/skbuff.h>
+
+#define transport_header h.raw
+#define network_header nh.raw
+
+static inline void skb_reset_mac_header(struct sk_buff *skb)
+{
+ skb->mac.raw = skb->data;
+}
+
+static inline void skb_reset_network_header(struct sk_buff *skb)
+{
+ skb->network_header = skb->data;
+}
+
+#if 0
+static inline void skb_copy_from_linear_data(const struct sk_buff *skb,
+ void *to,
+ const unsigned int len)
+{
+ memcpy(to, skb->data, len);
+}
+
+static inline void skb_copy_to_linear_data(struct sk_buff *skb,
+ const void *from,
+ const unsigned int len)
+{
+ memcpy(skb->data, from, len);
+}
+#endif
+
+static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
+{
+ return skb->end;
+}
+
+static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
+{
+ return skb->transport_header;
+}
+
+static inline unsigned char *skb_network_header(const struct sk_buff *skb)
+{
+ return skb->network_header;
+}
+
+static inline void skb_reset_transport_header(struct sk_buff *skb)
+{
+ skb->transport_header = skb->data;
+}
+
+static inline int skb_transport_offset(const struct sk_buff *skb)
+{
+ return skb_transport_header(skb) - skb->data;
+}
+
+static inline int skb_network_offset(const struct sk_buff *skb)
+{
+ return skb_network_header(skb) - skb->data;
+}
+static inline void skb_set_transport_header(struct sk_buff *skb,
+ const int offset)
+{
+ skb->h.raw = skb->data + offset;
+}
+
+static inline void skb_set_network_header(struct sk_buff *skb,
+ const int offset)
+{
+ skb->nh.raw = skb->data + offset;
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/slab.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/slab.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/slab.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/slab.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,20 @@
+#include_next <linux/slab.h>
+
+#ifndef LINUX_SLAB_BACKPORT_tO_2_6_22_H
+#define LINUX_SLAB_BACKPORT_tO_2_6_22_H
+
+#include_next <linux/slab.h>
+
+static inline
+struct kmem_cache *
+kmem_cache_create_for_2_6_22 (const char *name, size_t size, size_t align,
+ unsigned long flags,
+ void (*ctor)(void*, struct kmem_cache *, unsigned long)
+ )
+{
+ return kmem_cache_create(name, size, align, flags, ctor, NULL);
+}
+
+#define kmem_cache_create kmem_cache_create_for_2_6_22
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/tcp.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/tcp.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/tcp.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/tcp.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,11 @@
+#ifndef __BACKPORT_LINUX_TCP_TO_2_6_21__
+#define __BACKPORT_LINUX_TCP_TO_2_6_21__
+
+#include_next <linux/tcp.h>
+
+static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb)
+{
+ return (struct tcphdr *)skb_transport_header(skb);
+}
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/types.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/types.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/types.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/types.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,9 @@
+#ifndef BACKPORT_LINUX_TYPES_TO_2_6_19
+#define BACKPORT_LINUX_TYPES_TO_2_6_19
+
+#include_next <linux/types.h>
+
+typedef _Bool bool;
+typedef __u16 __sum16;
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/workqueue.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/workqueue.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/linux/workqueue.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/linux/workqueue.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,62 @@
+#ifndef BACKPORT_LINUX_WORKQUEUE_TO_2_6_19
+#define BACKPORT_LINUX_WORKQUEUE_TO_2_6_19
+
+#include_next <linux/workqueue.h>
+
+struct delayed_work {
+ struct work_struct work;
+};
+
+static inline void
+backport_INIT_WORK(struct work_struct *work, void *func)
+{
+ INIT_WORK(work, func, work);
+}
+
+static inline int backport_queue_delayed_work(struct workqueue_struct *wq,
+ struct delayed_work *work,
+ unsigned long delay)
+{
+ if (likely(!delay))
+ return queue_work(wq, &work->work);
+ else
+ return queue_delayed_work(wq, &work->work, delay);
+}
+
+static inline int
+backport_cancel_delayed_work(struct delayed_work *work)
+{
+ return cancel_delayed_work(&work->work);
+}
+
+static inline void
+backport_cancel_rearming_delayed_workqueue(struct workqueue_struct
*wq, struct delayed_work *work)
+{
+ cancel_rearming_delayed_workqueue(wq, &work->work);
+}
+
+static inline
+int backport_schedule_delayed_work(struct delayed_work *work,
unsigned long delay)
+{
+ if (likely(!delay))
+ return schedule_work(&work->work);
+ else
+ return schedule_delayed_work(&work->work, delay);
+}
+
+#undef INIT_WORK
+#define INIT_WORK(_work, _func) backport_INIT_WORK(_work, _func)
+#define INIT_DELAYED_WORK(_work, _func) INIT_WORK(&(_work)->work, _func)
+
+#undef DECLARE_WORK
+#define DECLARE_WORK(n, f) \
+ struct work_struct n = __WORK_INITIALIZER(n, (void (*)(void *))f, &(n))
+#define DECLARE_DELAYED_WORK(n, f) \
+ struct delayed_work n = { .work = __WORK_INITIALIZER(n.work, (void
(*)(void *))f, &(n.work)) }
+
+#define queue_delayed_work backport_queue_delayed_work
+#define cancel_delayed_work backport_cancel_delayed_work
+#define cancel_rearming_delayed_workqueue
backport_cancel_rearming_delayed_workqueue
+#define schedule_delayed_work backport_schedule_delayed_work
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/net/ip.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/net/ip.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/net/ip.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/net/ip.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,7 @@
+#ifndef __BACKPORT_NET_IP_H_TO_2_6_23__
+#define __BACKPORT_NET_IP_H_TO_2_6_23__
+
+#include_next<net/ip.h>
+#define inet_get_local_port_range(a, b) { *(a) =
sysctl_local_port_range[0]; *(b) = sysctl_local_port_range[1]; }
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/net/neighbour.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/net/neighbour.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/net/neighbour.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/net/neighbour.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,8 @@
+#ifndef __BACKPORT_NET_NEIGHBOUR_TO_2_6_20__
+#define __BACKPORT_NET_NEIGHBOUR_TO_2_6_20__
+
+#include_next <net/neighbour.h>
+
+#define neigh_cleanup neigh_destructor
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/scsi/scsi_cmnd.h
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/scsi/scsi_cmnd.h
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/scsi/scsi_cmnd.h 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/scsi/scsi_cmnd.h 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,23 @@
+#ifndef SCSI_SCSI_CMND_BACKPORT_TO_2_6_22_H
+#define SCSI_SCSI_CMND_BACKPORT_TO_2_6_22_H
+
+#include_next <scsi/scsi_cmnd.h>
+
+#define scsi_sg_count(cmd) ((cmd)->use_sg)
+#define scsi_sglist(cmd) ((struct scatterlist *)(cmd)->request_buffer)
+#define scsi_bufflen(cmd) ((cmd)->request_bufflen)
+
+static inline void scsi_set_resid(struct scsi_cmnd *cmd, int resid)
+{
+ cmd->resid = resid;
+}
+
+static inline int scsi_get_resid(struct scsi_cmnd *cmd)
+{
+ return cmd->resid;
+}
+
+#define scsi_for_each_sg(cmd, sg, nseg, __i) \
+ for (__i = 0, sg = scsi_sglist(cmd); __i < (nseg); __i++, (sg)++)
+
+#endif
diff -ruN ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/src/genalloc.c
ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/src/genalloc.c
--- ofa_kernel-1.2/kernel_addons/backport/2.6.18-EL5.1/include/src/genalloc.c 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_addons/backport/2.6.18-EL5.1/include/src/genalloc.c 2009-02-03
00:42:05.000000000 +0530
@@ -0,0 +1,198 @@
+/*
+ * Basic general purpose allocator for managing special purpose memory
+ * not managed by the regular kmalloc/kfree interface.
+ * Uses for this includes on-device special memory, uncached memory
+ * etc.
+ *
+ * Copyright 2005 (C) Jes Sorensen <jes at trained-monkey.org>
+ *
+ * This source code is licensed under the GNU General Public License,
+ * Version 2. See the file COPYING for more details.
+ */
+
+#include <linux/module.h>
+#include <linux/genalloc.h>
+
+
+/**
+ * gen_pool_create - create a new special memory pool
+ * @min_alloc_order: log base 2 of number of bytes each bitmap bit represents
+ * @nid: node id of the node the pool structure should be allocated on, or -1
+ *
+ * Create a new special memory pool that can be used to manage special purpose
+ * memory not managed by the regular kmalloc/kfree interface.
+ */
+struct gen_pool *gen_pool_create(int min_alloc_order, int nid)
+{
+ struct gen_pool *pool;
+
+ pool = kmalloc_node(sizeof(struct gen_pool), GFP_KERNEL, nid);
+ if (pool != NULL) {
+ rwlock_init(&pool->lock);
+ INIT_LIST_HEAD(&pool->chunks);
+ pool->min_alloc_order = min_alloc_order;
+ }
+ return pool;
+}
+EXPORT_SYMBOL(gen_pool_create);
+
+/**
+ * gen_pool_add - add a new chunk of special memory to the pool
+ * @pool: pool to add new memory chunk to
+ * @addr: starting address of memory chunk to add to pool
+ * @size: size in bytes of the memory chunk to add to pool
+ * @nid: node id of the node the chunk structure and bitmap should be
+ * allocated on, or -1
+ *
+ * Add a new chunk of special memory to the specified pool.
+ */
+int gen_pool_add(struct gen_pool *pool, unsigned long addr, size_t size,
+ int nid)
+{
+ struct gen_pool_chunk *chunk;
+ int nbits = size >> pool->min_alloc_order;
+ int nbytes = sizeof(struct gen_pool_chunk) +
+ (nbits + BITS_PER_BYTE - 1) / BITS_PER_BYTE;
+
+ chunk = kmalloc_node(nbytes, GFP_KERNEL, nid);
+ if (unlikely(chunk == NULL))
+ return -1;
+
+ memset(chunk, 0, nbytes);
+ spin_lock_init(&chunk->lock);
+ chunk->start_addr = addr;
+ chunk->end_addr = addr + size;
+
+ write_lock(&pool->lock);
+ list_add(&chunk->next_chunk, &pool->chunks);
+ write_unlock(&pool->lock);
+
+ return 0;
+}
+EXPORT_SYMBOL(gen_pool_add);
+
+/**
+ * gen_pool_destroy - destroy a special memory pool
+ * @pool: pool to destroy
+ *
+ * Destroy the specified special memory pool. Verifies that there are no
+ * outstanding allocations.
+ */
+void gen_pool_destroy(struct gen_pool *pool)
+{
+ struct list_head *_chunk, *_next_chunk;
+ struct gen_pool_chunk *chunk;
+ int order = pool->min_alloc_order;
+ int bit, end_bit;
+
+
+ write_lock(&pool->lock);
+ list_for_each_safe(_chunk, _next_chunk, &pool->chunks) {
+ chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
+ list_del(&chunk->next_chunk);
+
+ end_bit = (chunk->end_addr - chunk->start_addr) >> order;
+ bit = find_next_bit(chunk->bits, end_bit, 0);
+ BUG_ON(bit < end_bit);
+
+ kfree(chunk);
+ }
+ kfree(pool);
+ return;
+}
+EXPORT_SYMBOL(gen_pool_destroy);
+
+/**
+ * gen_pool_alloc - allocate special memory from the pool
+ * @pool: pool to allocate from
+ * @size: number of bytes to allocate from the pool
+ *
+ * Allocate the requested number of bytes from the specified pool.
+ * Uses a first-fit algorithm.
+ */
+unsigned long gen_pool_alloc(struct gen_pool *pool, size_t size)
+{
+ struct list_head *_chunk;
+ struct gen_pool_chunk *chunk;
+ unsigned long addr, flags;
+ int order = pool->min_alloc_order;
+ int nbits, bit, start_bit, end_bit;
+
+ if (size == 0)
+ return 0;
+
+ nbits = (size + (1UL << order) - 1) >> order;
+
+ read_lock(&pool->lock);
+ list_for_each(_chunk, &pool->chunks) {
+ chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
+
+ end_bit = (chunk->end_addr - chunk->start_addr) >> order;
+ end_bit -= nbits + 1;
+
+ spin_lock_irqsave(&chunk->lock, flags);
+ bit = -1;
+ while (bit + 1 < end_bit) {
+ bit = find_next_zero_bit(chunk->bits, end_bit, bit + 1);
+ if (bit >= end_bit)
+ break;
+
+ start_bit = bit;
+ if (nbits > 1) {
+ bit = find_next_bit(chunk->bits, bit + nbits,
+ bit + 1);
+ if (bit - start_bit < nbits)
+ continue;
+ }
+
+ addr = chunk->start_addr +
+ ((unsigned long)start_bit << order);
+ while (nbits--)
+ __set_bit(start_bit++, &chunk->bits);
+ spin_unlock_irqrestore(&chunk->lock, flags);
+ read_unlock(&pool->lock);
+ return addr;
+ }
+ spin_unlock_irqrestore(&chunk->lock, flags);
+ }
+ read_unlock(&pool->lock);
+ return 0;
+}
+EXPORT_SYMBOL(gen_pool_alloc);
+
+/**
+ * gen_pool_free - free allocated special memory back to the pool
+ * @pool: pool to free to
+ * @addr: starting address of memory to free back to pool
+ * @size: size in bytes of memory to free
+ *
+ * Free previously allocated special memory back to the specified pool.
+ */
+void gen_pool_free(struct gen_pool *pool, unsigned long addr, size_t size)
+{
+ struct list_head *_chunk;
+ struct gen_pool_chunk *chunk;
+ unsigned long flags;
+ int order = pool->min_alloc_order;
+ int bit, nbits;
+
+ nbits = (size + (1UL << order) - 1) >> order;
+
+ read_lock(&pool->lock);
+ list_for_each(_chunk, &pool->chunks) {
+ chunk = list_entry(_chunk, struct gen_pool_chunk, next_chunk);
+
+ if (addr >= chunk->start_addr && addr < chunk->end_addr) {
+ BUG_ON(addr + size > chunk->end_addr);
+ spin_lock_irqsave(&chunk->lock, flags);
+ bit = (addr - chunk->start_addr) >> order;
+ while (nbits--)
+ __clear_bit(bit++, &chunk->bits);
+ spin_unlock_irqrestore(&chunk->lock, flags);
+ break;
+ }
+ }
+ BUG_ON(nbits > 0);
+ read_unlock(&pool->lock);
+}
+EXPORT_SYMBOL(gen_pool_free);
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/1_struct_path_revert_to_2_6_19.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/1_struct_path_revert_to_2_6_19.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/1_struct_path_revert_to_2_6_19.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/1_struct_path_revert_to_2_6_19.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,82 @@
+diff --git a/drivers/infiniband/core/uverbs_main.c
b/drivers/infiniband/core/uverbs_main.c
+index a617ca7..4e16314 100644
+--- a/drivers/infiniband/core/uverbs_main.c
++++ b/drivers/infiniband/core/uverbs_main.c
+@@ -534,9 +534,9 @@ struct file *ib_uverbs_alloc_event_file(struct
ib_uverbs_file *uverbs_file,
+ * module reference.
+ */
+ filp->f_op = fops_get(&uverbs_event_fops);
+- filp->f_path.mnt = mntget(uverbs_event_mnt);
+- filp->f_path.dentry = dget(uverbs_event_mnt->mnt_root);
+- filp->f_mapping = filp->f_path.dentry->d_inode->i_mapping;
++ filp->f_vfsmnt = mntget(uverbs_event_mnt);
++ filp->f_dentry = dget(uverbs_event_mnt->mnt_root);
++ filp->f_mapping = filp->f_dentry->d_inode->i_mapping;
+ filp->f_flags = O_RDONLY;
+ filp->f_mode = FMODE_READ;
+ filp->private_data = ev_file;
+diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c
b/drivers/infiniband/hw/ipath/ipath_file_ops.c
+index b932bcb..ddbcabd 100644
+--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
++++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
+@@ -1744,9 +1744,9 @@ static int ipath_assign_port(struct file *fp,
+ goto done;
+ }
+
+- i_minor = iminor(fp->f_path.dentry->d_inode) - IPATH_USER_MINOR_BASE;
++ i_minor = iminor(fp->f_dentry->d_inode) - IPATH_USER_MINOR_BASE;
+ ipath_cdbg(VERBOSE, "open on dev %lx (minor %d)\n",
+- (long)fp->f_path.dentry->d_inode->i_rdev, i_minor);
++ (long)fp->f_dentry->d_inode->i_rdev, i_minor);
+
+ if (i_minor)
+ ret = find_free_port(i_minor - 1, fp, uinfo);
+diff --git a/drivers/infiniband/hw/ipath/ipath_fs.c
b/drivers/infiniband/hw/ipath/ipath_fs.c
+index 79a60f0..d9ff283 100644
+--- a/drivers/infiniband/hw/ipath/ipath_fs.c
++++ b/drivers/infiniband/hw/ipath/ipath_fs.c
+@@ -118,7 +118,7 @@ static ssize_t atomic_counters_read(struct file
*file, char __user *buf,
+ u16 i;
+ struct ipath_devdata *dd;
+
+- dd = file->f_path.dentry->d_inode->i_private;
++ dd = file->f_dentry->d_inode->i_private;
+
+ for (i = 0; i < NUM_COUNTERS; i++)
+ counters[i] = ipath_snap_cntr(dd, i);
+@@ -138,7 +138,7 @@ static ssize_t atomic_node_info_read(struct file
*file, char __user *buf,
+ struct ipath_devdata *dd;
+ u64 guid;
+
+- dd = file->f_path.dentry->d_inode->i_private;
++ dd = file->f_dentry->d_inode->i_private;
+
+ guid = be64_to_cpu(dd->ipath_guid);
+
+@@ -177,7 +177,7 @@ static ssize_t atomic_port_info_read(struct file
*file, char __user *buf,
+ u32 tmp, tmp2;
+ struct ipath_devdata *dd;
+
+- dd = file->f_path.dentry->d_inode->i_private;
++ dd = file->f_dentry->d_inode->i_private;
+
+ /* so we only initialize non-zero fields. */
+ memset(portinfo, 0, sizeof portinfo);
+@@ -324,7 +324,7 @@ static ssize_t flash_read(struct file *file, char
__user *buf,
+ goto bail;
+ }
+
+- dd = file->f_path.dentry->d_inode->i_private;
++ dd = file->f_dentry->d_inode->i_private;
+ if (ipath_eeprom_read(dd, pos, tmp, count)) {
+ ipath_dev_err(dd, "failed to read from flash\n");
+ ret = -ENXIO;
+@@ -377,7 +377,7 @@ static ssize_t flash_write(struct file *file,
const char __user *buf,
+ goto bail_tmp;
+ }
+
+- dd = file->f_path.dentry->d_inode->i_private;
++ dd = file->f_dentry->d_inode->i_private;
+ if (ipath_eeprom_write(dd, pos, tmp, count)) {
+ ret = -ENXIO;
+ ipath_dev_err(dd, "failed to write to flash\n");
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/2_misc_device_to_2_6_19.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/2_misc_device_to_2_6_19.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/2_misc_device_to_2_6_19.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/2_misc_device_to_2_6_19.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,50 @@
+>Post a replacement to 2_misc_device_to_2_6_19.patch, we'll test.
+
+I did not test this patch, but you can try replacing the contents of
+the 2_misc_device_to_2_6_19.patch with the changes below. (It's
+possible that this may lead to some conflict further down in the patch
+chain...) The function prototype for show_abi_version changed between
+2.6.20 to 2.6.19; this was the missing piece in the original backport
+patch. I would have expected a build warning for this.
+
+Signed-off-by: Sean Hefty <sean.hefty at intel.com>
+
+---
+--- ofa_kernel-1.2/drivers/infiniband/core/ucma.c 2007-03-08
12:11:37.000000000 -0800
++++ b/drivers/infiniband/core/ucma.c 2007-03-08 12:13:13.000000000 -0800
+@@ -847,13 +847,11 @@ static struct miscdevice ucma_misc = {
+ .fops = &ucma_fops,
+ };
+
+-static ssize_t show_abi_version(struct device *dev,
+- struct device_attribute *attr,
+- char *buf)
++static ssize_t show_abi_version(struct class_device *class_dev, char *buf)
+ {
+ return sprintf(buf, "%d\n", RDMA_USER_CM_ABI_VERSION);
+ }
+-static DEVICE_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
++static CLASS_DEVICE_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+
+ static int __init ucma_init(void)
+ {
+@@ -863,7 +861,8 @@ static int __init ucma_init(void)
+ if (ret)
+ return ret;
+
+- ret = device_create_file(ucma_misc.this_device, &dev_attr_abi_version);
++ ret = class_device_create_file(ucma_misc.class,
++ &class_device_attr_abi_version);
+ if (ret) {
+ printk(KERN_ERR "rdma_ucm: couldn't create abi_version attr\n");
+ goto err;
+@@ -876,7 +875,8 @@ err:
+
+ static void __exit ucma_cleanup(void)
+ {
+- device_remove_file(ucma_misc.this_device, &dev_attr_abi_version);
++ class_device_remove_file(ucma_misc.class,
++ &class_device_attr_abi_version);
+ misc_deregister(&ucma_misc);
+ idr_destroy(&ctx_idr);
+ }
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/cxgb3_makefile_to_2_6_19.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/cxgb3_makefile_to_2_6_19.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/cxgb3_makefile_to_2_6_19.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/cxgb3_makefile_to_2_6_19.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,12 @@
+diff --git a/drivers/net/cxgb3/Makefile b/drivers/net/cxgb3/Makefile
+index 3434679..bb008b6 100755
+--- a/drivers/net/cxgb3/Makefile
++++ b/drivers/net/cxgb3/Makefile
+@@ -1,6 +1,7 @@
+ #
+ # Chelsio T3 driver
+ #
++NOSTDINC_FLAGS:= $(NOSTDINC_FLAGS) $(LINUXINCLUDE)
+
+ obj-$(CONFIG_CHELSIO_T3) += cxgb3.o
+
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/ipath-16-htirq-2.6.18.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/ipath-16-htirq-2.6.18.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/ipath-16-htirq-2.6.18.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/ipath-16-htirq-2.6.18.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,352 @@
+BACKPORT - use old IRQ infrastructure on 2.6.18 and earlier
+
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/Kconfig
+--- a/drivers/infiniband/hw/ipath/Kconfig Thu Mar 08 14:02:44 2007 -0800
++++ b/drivers/infiniband/hw/ipath/Kconfig Thu Mar 08 14:04:08 2007 -0800
+@@ -1,6 +1,6 @@ config INFINIBAND_IPATH
+ config INFINIBAND_IPATH
+ tristate "QLogic InfiniPath Driver"
+- depends on (PCI_MSI || HT_IRQ) && 64BIT && INFINIBAND && NET
++ depends on PCI_MSI && 64BIT && INFINIBAND && NET
+ ---help---
+ This is a driver for QLogic InfiniPath host channel adapters,
+ including InfiniBand verbs support. This driver allows these
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/Makefile
+--- a/drivers/infiniband/hw/ipath/Makefile Thu Mar 08 14:02:44 2007 -0800
++++ b/drivers/infiniband/hw/ipath/Makefile Thu Mar 08 14:04:08 2007 -0800
+@@ -32,7 +32,7 @@ ib_ipath-y := \
+ ipath_verbs_mcast.o \
+ ipath_verbs.o
+
+-ib_ipath-$(CONFIG_HT_IRQ) += ipath_iba6110.o
++ib_ipath-y += ipath_iba6110.o
+ ib_ipath-$(CONFIG_PCI_MSI) += ipath_iba6120.o
+
+ ib_ipath-$(CONFIG_X86_64) += ipath_wc_x86_64.o
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/ipath_driver.c
+--- a/drivers/infiniband/hw/ipath/ipath_driver.c Thu Mar 08 14:02:44 2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_driver.c Thu Mar 08 14:04:08 2007 -0800
+@@ -42,6 +42,8 @@
+ #include "ipath_verbs.h"
+ #include "ipath_common.h"
+
++#define CONFIG_HT_IRQ
++
+ static void ipath_update_pio_bufs(struct ipath_devdata *);
+
+ const char *ipath_get_unit_name(int unit)
+@@ -347,7 +349,7 @@ static int __devinit ipath_init_one(stru
+ }
+ addr = pci_resource_start(pdev, 0);
+ len = pci_resource_len(pdev, 0);
+- ipath_cdbg(VERBOSE, "regbase (0) %llx len %d pdev->irq %d, vend %x/%x "
++ ipath_cdbg(VERBOSE, "regbase (0) %llx len %d irq %x, vend %x/%x "
+ "driver_data %lx\n", addr, len, pdev->irq, ent->vendor,
+ ent->device, ent->driver_data);
+
+@@ -530,15 +532,15 @@ static int __devinit ipath_init_one(stru
+ * check 0 irq after we return from chip-specific bus setup, since
+ * that can affect this due to setup
+ */
+- if (!dd->ipath_irq)
++ if (!pdev->irq)
+ ipath_dev_err(dd, "irq is 0, BIOS error? Interrupts won't "
+ "work\n");
+ else {
+- ret = request_irq(dd->ipath_irq, ipath_intr, IRQF_SHARED,
++ ret = request_irq(pdev->irq, ipath_intr, IRQF_SHARED,
+ IPATH_DRV_NAME, dd);
+ if (ret) {
+ ipath_dev_err(dd, "Couldn't setup irq handler, "
+- "irq=%d: %d\n", dd->ipath_irq, ret);
++ "irq=%d: %d\n", pdev->irq, ret);
+ goto bail_iounmap;
+ }
+ }
+@@ -709,10 +711,11 @@ static void __devexit ipath_remove_one(s
+ * free up port 0 (kernel) rcvhdr, egr bufs, and eventually tid bufs
+ * for all versions of the driver, if they were allocated
+ */
+- if (dd->ipath_irq) {
+- ipath_cdbg(VERBOSE, "unit %u free irq %d\n",
+- dd->ipath_unit, dd->ipath_irq);
+- dd->ipath_f_free_irq(dd);
++ if (pdev->irq) {
++ ipath_cdbg(VERBOSE,
++ "unit %u free_irq of irq %x\n",
++ dd->ipath_unit, pdev->irq);
++ free_irq(pdev->irq, dd);
+ } else
+ ipath_dbg("irq is 0, not doing free_irq "
+ "for unit %u\n", dd->ipath_unit);
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/ipath_iba6110.c
+--- a/drivers/infiniband/hw/ipath/ipath_iba6110.c Thu Mar 08 14:02:44
2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_iba6110.c Thu Mar 08 14:04:08
2007 -0800
+@@ -38,7 +38,6 @@
+
+ #include <linux/pci.h>
+ #include <linux/delay.h>
+-#include <linux/htirq.h>
+
+ #include "ipath_kernel.h"
+ #include "ipath_registers.h"
+@@ -914,40 +913,49 @@ static void slave_or_pri_blk(struct ipat
+ }
+ }
+
+-static int ipath_ht_intconfig(struct ipath_devdata *dd)
+-{
+- int ret;
+-
+- if (dd->ipath_intconfig) {
+- ipath_write_kreg(dd, dd->ipath_kregs->kr_interruptconfig,
+- dd->ipath_intconfig); /* interrupt address */
+- ret = 0;
+- } else {
+- ipath_dev_err(dd, "No interrupts enabled, couldn't setup "
+- "interrupt address\n");
+- ret = -EINVAL;
+- }
+-
+- return ret;
+-}
+-
+-static void ipath_ht_irq_update(struct pci_dev *dev, int irq,
+- struct ht_irq_msg *msg)
+-{
+- struct ipath_devdata *dd = pci_get_drvdata(dev);
+- u64 prev_intconfig = dd->ipath_intconfig;
+-
+- dd->ipath_intconfig = msg->address_lo;
+- dd->ipath_intconfig |= ((u64) msg->address_hi) << 32;
+-
+- /*
+- * If the previous value of dd->ipath_intconfig is zero, we're
+- * getting configured for the first time, and must not program the
+- * intconfig register here (it will be programmed later, when the
+- * hardware is ready). Otherwise, we should.
+- */
+- if (prev_intconfig)
+- ipath_ht_intconfig(dd);
++static int set_int_handler(struct ipath_devdata *dd, struct pci_dev *pdev,
++ int pos)
++{
++ u32 int_handler_addr_lower;
++ u32 int_handler_addr_upper;
++ u64 ihandler;
++ u32 intvec;
++
++ /* use indirection register to get the intr handler */
++ pci_write_config_byte(pdev, pos + HT_INTR_REG_INDEX, 0x10);
++ pci_read_config_dword(pdev, pos + 4, &int_handler_addr_lower);
++ pci_write_config_byte(pdev, pos + HT_INTR_REG_INDEX, 0x11);
++ pci_read_config_dword(pdev, pos + 4, &int_handler_addr_upper);
++
++ ihandler = (u64) int_handler_addr_lower |
++ ((u64) int_handler_addr_upper << 32);
++
++ /*
++ * kernels with CONFIG_PCI_MSI set the vector in the irq field of
++ * struct pci_device, so we use that to program the internal
++ * interrupt register (not config space) with that value. The BIOS
++ * must still have done the basic MSI setup.
++ */
++ intvec = pdev->irq;
++ /*
++ * clear any vector bits there; normally not set but we'll overload
++ * this for some debug purposes (setting the HTC debug register
++ * value from software, rather than GPIOs), so it might be set on a
++ * driver reload.
++ */
++ ihandler &= ~0xff0000;
++ /* x86 vector goes in intrinfo[23:16] */
++ ihandler |= intvec << 16;
++ ipath_cdbg(VERBOSE, "ihandler lower %x, upper %x, intvec %x, "
++ "interruptconfig %llx\n", int_handler_addr_lower,
++ int_handler_addr_upper, intvec,
++ (unsigned long long) ihandler);
++
++ /* can't program yet, so save for interrupt setup */
++ dd->ipath_intconfig = ihandler;
++ /* keep going, so we find link control stuff also */
++
++ return ihandler != 0;
+ }
+
+ /**
+@@ -963,19 +971,12 @@ static int ipath_setup_ht_config(struct
+ static int ipath_setup_ht_config(struct ipath_devdata *dd,
+ struct pci_dev *pdev)
+ {
+- int pos, ret;
+-
+- ret = __ht_create_irq(pdev, 0, ipath_ht_irq_update);
+- if (ret < 0) {
+- ipath_dev_err(dd, "Couldn't create interrupt handler: "
+- "err %d\n", ret);
+- goto bail;
+- }
+- dd->ipath_irq = ret;
+- ret = 0;
+-
+- /*
+- * Handle clearing CRC errors in linkctrl register if necessary. We
++ int pos, ret = 0;
++ int ihandler = 0;
++
++ /*
++ * Read the capability info to find the interrupt info, and also
++ * handle clearing CRC errors in linkctrl register if necessary. We
+ * do this early, before we ever enable errors or hardware errors,
+ * mostly to avoid causing the chip to enter freeze mode.
+ */
+@@ -999,8 +1000,16 @@ static int ipath_setup_ht_config(struct
+ }
+ if (!(cap_type & 0xE0))
+ slave_or_pri_blk(dd, pdev, pos, cap_type);
++ else if (cap_type == HT_INTR_DISC_CONFIG)
++ ihandler = set_int_handler(dd, pdev, pos);
+ } while ((pos = pci_find_next_capability(pdev, pos,
+ PCI_CAP_ID_HT)));
++
++ if (!ihandler) {
++ ipath_dev_err(dd, "Couldn't find interrupt handler in "
++ "config space\n");
++ ret = -ENODEV;
++ }
+
+ bail:
+ return ret;
+@@ -1351,6 +1360,25 @@ static void ipath_ht_quiet_serdes(struct
+ ipath_write_kreg(dd, dd->ipath_kregs->kr_serdesconfig0, val);
+ }
+
++static int ipath_ht_intconfig(struct ipath_devdata *dd)
++{
++ int ret;
++
++ if (!dd->ipath_intconfig) {
++ ipath_dev_err(dd, "No interrupts enabled, couldn't setup "
++ "interrupt address\n");
++ ret = 1;
++ goto bail;
++ }
++
++ ipath_write_kreg(dd, dd->ipath_kregs->kr_interruptconfig,
++ dd->ipath_intconfig); /* interrupt address */
++ ret = 0;
++
++bail:
++ return ret;
++}
++
+ /**
+ * ipath_pe_put_tid - write a TID in chip
+ * @dd: the infinipath device
+@@ -1546,14 +1574,6 @@ static int ipath_ht_get_base_info(struct
+ return 0;
+ }
+
+-static void ipath_ht_free_irq(struct ipath_devdata *dd)
+-{
+- free_irq(dd->ipath_irq, dd);
+- ht_destroy_irq(dd->ipath_irq);
+- dd->ipath_irq = 0;
+- dd->ipath_intconfig = 0;
+-}
+-
+ /**
+ * ipath_init_iba6110_funcs - set up the chip-specific function pointers
+ * @dd: the infinipath device
+@@ -1577,7 +1597,6 @@ void ipath_init_iba6110_funcs(struct ipa
+ dd->ipath_f_cleanup = ipath_setup_ht_cleanup;
+ dd->ipath_f_setextled = ipath_setup_ht_setextled;
+ dd->ipath_f_get_base_info = ipath_ht_get_base_info;
+- dd->ipath_f_free_irq = ipath_ht_free_irq;
+
+ /*
+ * initialize chip-specific variables
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/ipath_iba6120.c
+--- a/drivers/infiniband/hw/ipath/ipath_iba6120.c Thu Mar 08 14:02:44
2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_iba6120.c Thu Mar 08 14:04:08
2007 -0800
+@@ -856,7 +856,6 @@ static int ipath_setup_pe_config(struct
+ ipath_dev_err(dd, "pci_enable_msi failed: %d, "
+ "interrupts may not work\n", ret);
+ /* continue even if it fails, we may still be OK... */
+- dd->ipath_irq = pdev->irq;
+
+ if ((pos = pci_find_capability(dd->pcidev, PCI_CAP_ID_MSI))) {
+ u16 control;
+@@ -1324,12 +1323,6 @@ done:
+ return 0;
+ }
+
+-static void ipath_pe_free_irq(struct ipath_devdata *dd)
+-{
+- free_irq(dd->ipath_irq, dd);
+- dd->ipath_irq = 0;
+-}
+-
+ /**
+ * ipath_init_iba6120_funcs - set up the chip-specific function pointers
+ * @dd: the infinipath device
+@@ -1356,7 +1349,6 @@ void ipath_init_iba6120_funcs(struct ipa
+ dd->ipath_f_cleanup = ipath_setup_pe_cleanup;
+ dd->ipath_f_setextled = ipath_setup_pe_setextled;
+ dd->ipath_f_get_base_info = ipath_pe_get_base_info;
+- dd->ipath_f_free_irq = ipath_pe_free_irq;
+
+ /* initialize chip-specific variables */
+ dd->ipath_f_tidtemplate = ipath_pe_tidtemplate;
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/ipath_intr.c
+--- a/drivers/infiniband/hw/ipath/ipath_intr.c Thu Mar 08 14:02:44 2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_intr.c Thu Mar 08 14:04:08 2007 -0800
+@@ -732,14 +732,14 @@ static void ipath_bad_intr(struct ipath_
+ * linuxbios development work, and it may happen in
+ * the future again.
+ */
+- if (dd->pcidev && dd->ipath_irq) {
++ if (dd->pcidev && dd->pcidev->irq) {
+ ipath_dev_err(dd, "Now %u unexpected "
+ "interrupts, unregistering "
+ "interrupt handler\n",
+ *unexpectp);
+- ipath_dbg("free_irq of irq %d\n",
+- dd->ipath_irq);
+- dd->ipath_f_free_irq(dd);
++ ipath_dbg("free_irq of irq %x\n",
++ dd->pcidev->irq);
++ free_irq(dd->pcidev->irq, dd);
+ }
+ }
+ if (ipath_read_kreg32(dd, dd->ipath_kregs->kr_intmask)) {
+@@ -775,7 +775,7 @@ static void ipath_bad_regread(struct ipa
+ if (allbits == 2) {
+ ipath_dev_err(dd, "Still bad interrupt status, "
+ "unregistering interrupt\n");
+- dd->ipath_f_free_irq(dd);
++ free_irq(dd->pcidev->irq, dd);
+ } else if (allbits > 2) {
+ if ((allbits % 10000) == 0)
+ printk(".");
+diff -r 0a8c1ca4ad6d drivers/infiniband/hw/ipath/ipath_kernel.h
+--- a/drivers/infiniband/hw/ipath/ipath_kernel.h Thu Mar 08 14:02:44 2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_kernel.h Thu Mar 08 14:04:08 2007 -0800
+@@ -213,8 +213,6 @@ struct ipath_devdata {
+ void (*ipath_f_setextled)(struct ipath_devdata *, u64, u64);
+ /* fill out chip-specific fields */
+ int (*ipath_f_get_base_info)(struct ipath_portdata *, void *);
+- /* free irq */
+- void (*ipath_f_free_irq)(struct ipath_devdata *);
+ struct ipath_ibdev *verbs_dev;
+ struct timer_list verbs_timer;
+ /* total dwords sent (summed from counter) */
+@@ -332,8 +330,6 @@ struct ipath_devdata {
+ /* so we can rewrite it after a chip reset */
+ u32 ipath_pcibar1;
+
+- /* interrupt number */
+- int ipath_irq;
+ /* HT/PCI Vendor ID (here for NodeInfo) */
+ u16 ipath_vendorid;
+ /* HT/PCI Device ID (here for NodeInfo) */
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/ipath-17-ipath_intr-2.6.18.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/ipath-17-ipath_intr-2.6.18.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/ipath-17-ipath_intr-2.6.18.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/ipath-17-ipath_intr-2.6.18.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,26 @@
+BACKPORT - interrupt handler signature changed in 2.6.19
+
+diff -r 8e3a2c4c9490 drivers/infiniband/hw/ipath/ipath_intr.c
+--- a/drivers/infiniband/hw/ipath/ipath_intr.c Wed Jan 31 16:04:27 2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_intr.c Wed Jan 31 16:11:22 2007 -0800
+@@ -897,7 +897,7 @@ static void handle_urcv(struct ipath_dev
+ }
+ }
+
+-irqreturn_t ipath_intr(int irq, void *data)
++irqreturn_t ipath_intr(int irq, void *data, struct pt_regs *ignored)
+ {
+ struct ipath_devdata *dd = data;
+ u32 istat, chk0rcv = 0;
+diff -r 8e3a2c4c9490 drivers/infiniband/hw/ipath/ipath_kernel.h
+--- a/drivers/infiniband/hw/ipath/ipath_kernel.h Wed Jan 31 16:04:27 2007 -0800
++++ b/drivers/infiniband/hw/ipath/ipath_kernel.h Wed Jan 31 16:11:22 2007 -0800
+@@ -637,7 +637,7 @@ struct sk_buff *ipath_alloc_skb(struct i
+
+ extern int ipath_diag_inuse;
+
+-irqreturn_t ipath_intr(int irq, void *devid);
++irqreturn_t ipath_intr(int irq, void *devid, struct pt_regs *);
+ int ipath_decode_err(char *buf, size_t blen, ipath_err_t err);
+ #if __IPATH_INFO || __IPATH_DBG
+ extern const char *ipath_ibcstatus_str[];
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/linux_genalloc_to_2_6_20.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/linux_genalloc_to_2_6_20.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/linux_genalloc_to_2_6_20.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/linux_genalloc_to_2_6_20.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,17 @@
+diff --git a/drivers/infiniband/core/Makefile
b/drivers/infiniband/core/Makefile
+index 163d991..2cd239f 100644
+--- a/drivers/infiniband/core/Makefile
++++ b/drivers/infiniband/core/Makefile
+@@ -30,3 +30,5 @@ ib_ucm-y := ucm.o
+
+ ib_uverbs-y := uverbs_main.o uverbs_cmd.o uverbs_mem.o \
+ uverbs_marshall.o
++
++ib_core-y += genalloc.o
+diff --git a/drivers/infiniband/core/genalloc.c
b/drivers/infiniband/core/genalloc.c
+new file mode 100644
+index 0000000..96a48fe
+--- /dev/null
++++ b/drivers/infiniband/core/genalloc.c
+@@ -0,0 +1 @@
++#include "src/genalloc.c"
diff -ruN ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/open-iscsi-tx-hash-fixes.patch
ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/open-iscsi-tx-hash-fixes.patch
--- ofa_kernel-1.2/kernel_patches/backport/2.6.18-EL5.1/open-iscsi-tx-hash-fixes.patch 1970-01-01
05:30:00.000000000 +0530
+++ ofa_kernel-1.2_try2/kernel_patches/backport/2.6.18-EL5.1/open-iscsi-tx-hash-fixes.patch 2009-02-03
00:44:23.000000000 +0530
@@ -0,0 +1,277 @@
+Index: gen2_devel_kernel-20070129-1858_linux-2.6.18.6_check/drivers/scsi/iscsi_tcp.c
+===================================================================
+--- gen2_devel_kernel-20070129-1858_linux-2.6.18.6_check.orig/drivers/scsi/iscsi_tcp.c
++++ gen2_devel_kernel-20070129-1858_linux-2.6.18.6_check/drivers/scsi/iscsi_tcp.c
+@@ -108,8 +108,8 @@ iscsi_hdr_digest(struct iscsi_conn *conn
+ {
+ struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
+
+- crypto_hash_digest(&tcp_conn->tx_hash, &buf->sg, buf->sg.length, crc);
+- buf->sg.length = tcp_conn->hdr_size;
++ crypto_digest_digest(tcp_conn->tx_tfm, &buf->sg, 1, crc);
++ buf->sg.length += sizeof(uint32_t);
+ }
+
+ static inline int
+@@ -468,8 +468,7 @@ iscsi_tcp_hdr_recv(struct iscsi_conn *co
+
+ sg_init_one(&sg, (u8 *)hdr,
+ sizeof(struct iscsi_hdr) + ahslen);
+- crypto_hash_digest(&tcp_conn->rx_hash, &sg, sg.length,
+- (u8 *)&cdgst);
++ crypto_digest_digest(tcp_conn->rx_tfm, &sg, 1, (u8 *)&cdgst);
+ rdgst = *(uint32_t*)((char*)hdr + sizeof(struct iscsi_hdr) +
+ ahslen);
+ if (cdgst != rdgst) {
+@@ -649,9 +648,10 @@ iscsi_ctask_copy(struct iscsi_tcp_conn *
+ * byte counters.
+ **/
+ static inline int
+-iscsi_tcp_copy(struct iscsi_conn *conn, int buf_size)
++iscsi_tcp_copy(struct iscsi_conn *conn)
+ {
+ struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
++ int buf_size = tcp_conn->in.datalen;
+ int buf_left = buf_size - tcp_conn->data_copied;
+ int size = min(tcp_conn->in.copy, buf_left);
+ int rc;
+@@ -676,7 +676,7 @@ iscsi_tcp_copy(struct iscsi_conn *conn,
+ }
+
+ static inline void
+-partial_sg_digest_update(struct hash_desc *desc, struct scatterlist *sg,
++partial_sg_digest_update(struct crypto_tfm *tfm, struct scatterlist *sg,
+ int offset, int length)
+ {
+ struct scatterlist temp;
+@@ -684,7 +684,7 @@ partial_sg_digest_update(struct hash_des
+ memcpy(&temp, sg, sizeof(struct scatterlist));
+ temp.offset = offset;
+ temp.length = length;
+- crypto_hash_update(desc, &temp, length);
++ crypto_digest_update(tfm, &temp, 1);
+ }
+
+ static void
+@@ -693,7 +693,7 @@ iscsi_recv_digest_update(struct iscsi_tc
+ struct scatterlist tmp;
+
+ sg_init_one(&tmp, buf, len);
+- crypto_hash_update(&tcp_conn->rx_hash, &tmp, len);
++ crypto_digest_update(tcp_conn->rx_tfm, &tmp, 1);
+ }
+
+ static int iscsi_scsi_data_in(struct iscsi_conn *conn)
+@@ -747,12 +747,12 @@ static int iscsi_scsi_data_in(struct isc
+ if (!rc) {
+ if (conn->datadgst_en) {
+ if (!offset)
+- crypto_hash_update(
+- &tcp_conn->rx_hash,
++ crypto_digest_update(
++ &tcp_conn->rx_tfm,
+ &sg[i], sg[i].length);
+ else
+ partial_sg_digest_update(
+- &tcp_conn->rx_hash,
++ &tcp_conn->rx_tfm,
+ &sg[i],
+ sg[i].offset + offset,
+ sg[i].length - offset);
+@@ -766,10 +766,9 @@ static int iscsi_scsi_data_in(struct isc
+ /*
+ * data-in is complete, but buffer not...
+ */
+- partial_sg_digest_update(&tcp_conn->rx_hash,
+- &sg[i],
+- sg[i].offset,
+- sg[i].length-rc);
++ partial_sg_digest_update(tcp_conn->rx_tfm,
++ &sg[i],
++ sg[i].offset, sg[i].length-rc);
+ rc = 0;
+ break;
+ }
+@@ -813,7 +812,7 @@ iscsi_data_recv(struct iscsi_conn *conn)
+ * Collect data segment to the connection's data
+ * placeholder
+ */
+- if (iscsi_tcp_copy(conn, tcp_conn->in.datalen)) {
++ if (iscsi_tcp_copy(conn)) {
+ rc = -EAGAIN;
+ goto exit;
+ }
+@@ -887,7 +886,7 @@ more:
+ rc = iscsi_tcp_hdr_recv(conn);
+ if (!rc && tcp_conn->in.datalen) {
+ if (conn->datadgst_en)
+- crypto_hash_init(&tcp_conn->rx_hash);
++ crypto_digest_init(tcp_conn->rx_tfm);
+ tcp_conn->in_progress = IN_PROGRESS_DATA_RECV;
+ } else if (rc) {
+ iscsi_conn_failure(conn, rc);
+@@ -900,15 +899,10 @@ more:
+
+ debug_tcp("extra data_recv offset %d copy %d\n",
+ tcp_conn->in.offset, tcp_conn->in.copy);
+- rc = iscsi_tcp_copy(conn, sizeof(uint32_t));
+- if (rc) {
+- if (rc == -EAGAIN)
+- goto again;
+- iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
+- return 0;
+- }
+-
+- memcpy(&recv_digest, conn->data, sizeof(uint32_t));
++ skb_copy_bits(tcp_conn->in.skb, tcp_conn->in.offset,
++ &recv_digest, 4);
++ tcp_conn->in.offset += 4;
++ tcp_conn->in.copy -= 4;
+ if (recv_digest != tcp_conn->in.datadgst) {
+ debug_tcp("iscsi_tcp: data digest error!"
+ "0x%x != 0x%x\n", recv_digest,
+@@ -944,14 +938,13 @@ more:
+ tcp_conn->in.padding);
+ memset(pad, 0, tcp_conn->in.padding);
+ sg_init_one(&sg, pad, tcp_conn->in.padding);
+- crypto_hash_update(&tcp_conn->rx_hash,
+- &sg, sg.length);
++ crypto_digest_update(tcp_conn->rx_tfm,
++ &sg, 1);
+ }
+- crypto_hash_final(&tcp_conn->rx_hash,
+- (u8 *) &tcp_conn->in.datadgst);
++ crypto_digest_final(tcp_conn->rx_tfm,
++ (u8 *) & tcp_conn->in.datadgst);
+ debug_tcp("rx digest 0x%x\n", tcp_conn->in.datadgst);
+ tcp_conn->in_progress = IN_PROGRESS_DDIGEST_RECV;
+- tcp_conn->data_copied = 0;
+ } else
+ tcp_conn->in_progress = IN_PROGRESS_WAIT_HEADER;
+ }
+@@ -1193,7 +1186,7 @@ static inline void
+ iscsi_data_digest_init(struct iscsi_tcp_conn *tcp_conn,
+ struct iscsi_tcp_cmd_task *tcp_ctask)
+ {
+- crypto_hash_init(&tcp_conn->tx_hash);
++ crypto_digest_init(tcp_conn->tx_tfm);
+ tcp_ctask->digest_count = 4;
+ }
+
+@@ -1449,9 +1442,8 @@ iscsi_send_padding(struct iscsi_conn *co
+ iscsi_buf_init_iov(&tcp_ctask->sendbuf, (char*)&tcp_ctask->pad,
+ tcp_ctask->pad_count);
+ if (conn->datadgst_en)
+- crypto_hash_update(&tcp_conn->tx_hash,
+- &tcp_ctask->sendbuf.sg,
+- tcp_ctask->sendbuf.sg.length);
++ crypto_digest_update(tcp_conn->tx_tfm,
++ &tcp_ctask->sendbuf.sg, 1);
+ } else if (!(tcp_ctask->xmstate & XMSTATE_W_RESEND_PAD))
+ return 0;
+
+@@ -1483,7 +1475,7 @@ iscsi_send_digest(struct iscsi_conn *con
+ tcp_conn = conn->dd_data;
+
+ if (!(tcp_ctask->xmstate & XMSTATE_W_RESEND_DATA_DIGEST)) {
+- crypto_hash_final(&tcp_conn->tx_hash, (u8*)digest);
++ crypto_digest_final(tcp_conn->tx_tfm, (u8*)digest);
+ iscsi_buf_init_iov(buf, (char*)digest, 4);
+ }
+ tcp_ctask->xmstate &= ~XMSTATE_W_RESEND_DATA_DIGEST;
+@@ -1517,7 +1509,7 @@ iscsi_send_data(struct iscsi_cmd_task *c
+ rc = iscsi_sendpage(conn, sendbuf, count, &buf_sent);
+ *sent = *sent + buf_sent;
+ if (buf_sent && conn->datadgst_en)
+- partial_sg_digest_update(&tcp_conn->tx_hash,
++ partial_sg_digest_update(tcp_conn->tx_tfm,
+ &sendbuf->sg, sendbuf->sg.offset + offset,
+ buf_sent);
+ if (!iscsi_buf_left(sendbuf) && *sg != tcp_ctask->bad_sg) {
+@@ -1774,22 +1766,18 @@ iscsi_tcp_conn_create(struct iscsi_cls_s
+ /* initial operational parameters */
+ tcp_conn->hdr_size = sizeof(struct iscsi_hdr);
+
+- tcp_conn->tx_hash.tfm = crypto_alloc_hash("crc32c", 0,
+- CRYPTO_ALG_ASYNC);
+- tcp_conn->tx_hash.flags = 0;
+- if (IS_ERR(tcp_conn->tx_hash.tfm))
++ tcp_conn->tx_tfm = crypto_alloc_tfm("crc32c", 0);
++ if (!tcp_conn->tx_tfm)
+ goto free_tcp_conn;
+
+- tcp_conn->rx_hash.tfm = crypto_alloc_hash("crc32c", 0,
+- CRYPTO_ALG_ASYNC);
+- tcp_conn->rx_hash.flags = 0;
+- if (IS_ERR(tcp_conn->rx_hash.tfm))
++ tcp_conn->rx_tfm = crypto_alloc_tfm("crc32c", 0);
++ if (!tcp_conn->rx_tfm)
+ goto free_tx_tfm;
+
+ return cls_conn;
+
+ free_tx_tfm:
+- crypto_free_hash(tcp_conn->tx_hash.tfm);
++ crypto_free_tfm(tcp_conn->tx_tfm);
+ free_tcp_conn:
+ kfree(tcp_conn);
+ tcp_conn_alloc_fail:
+@@ -1823,11 +1811,10 @@ iscsi_tcp_conn_destroy(struct iscsi_cls_
+ iscsi_tcp_release_conn(conn);
+ iscsi_conn_teardown(cls_conn);
+
+- if (tcp_conn->tx_hash.tfm)
+- crypto_free_hash(tcp_conn->tx_hash.tfm);
+- if (tcp_conn->rx_hash.tfm)
+- crypto_free_hash(tcp_conn->rx_hash.tfm);
+-
++ if (tcp_conn->tx_tfm)
++ crypto_free_tfm(tcp_conn->tx_tfm);
++ if (tcp_conn->rx_tfm)
++ crypto_free_tfm(tcp_conn->rx_tfm);
+ kfree(tcp_conn);
+ }
+
+@@ -1835,11 +1822,9 @@ static void
+ iscsi_tcp_conn_stop(struct iscsi_cls_conn *cls_conn, int flag)
+ {
+ struct iscsi_conn *conn = cls_conn->dd_data;
+- struct iscsi_tcp_conn *tcp_conn = conn->dd_data;
+
+ iscsi_conn_stop(cls_conn, flag);
+ iscsi_tcp_release_conn(conn);
+- tcp_conn->hdr_size = sizeof(struct iscsi_hdr);
+ }
+
+ static int
+Index: gen2_devel_kernel-20070129-1858_linux-2.6.18.6_check/drivers/scsi/iscsi_tcp.h
+===================================================================
+--- gen2_devel_kernel-20070129-1858_linux-2.6.18.6_check.orig/drivers/scsi/iscsi_tcp.h
++++ gen2_devel_kernel-20070129-1858_linux-2.6.18.6_check/drivers/scsi/iscsi_tcp.h
+@@ -49,7 +49,6 @@
+ #define ISCSI_SG_TABLESIZE SG_ALL
+ #define ISCSI_TCP_MAX_CMD_LEN 16
+
+-struct crypto_hash;
+ struct socket;
+
+ /* Socket connection recieve helper */
+@@ -82,7 +81,6 @@ struct iscsi_tcp_conn {
+ * stop to terminate */
+ /* iSCSI connection-wide sequencing */
+ int hdr_size; /* PDU header size */
+-
+ /* control data */
+ struct iscsi_tcp_recv in; /* TCP receive context */
+ int in_progress; /* connection state machine */
+@@ -93,8 +91,8 @@ struct iscsi_tcp_conn {
+ void (*old_write_space)(struct sock *);
+
+ /* data and header digests */
+- struct hash_desc tx_hash; /* CRC32C (Tx) */
+- struct hash_desc rx_hash; /* CRC32C (Rx) */
++ struct crypto_tfm *tx_tfm; /* CRC32C (Tx) */
++ struct crypto_tfm *rx_tfm; /* CRC32C (Rx) */
+
+ /* MIB custom statistics */
+ uint32_t sendpage_failures_cnt;
diff -ruN ofa_kernel-1.2/ofed_scripts/configure
ofa_kernel-1.2_try2/ofed_scripts/configure
--- ofa_kernel-1.2/ofed_scripts/configure 2009-02-03 02:12:23.000000000 +0530
+++ ofa_kernel-1.2_try2/ofed_scripts/configure 2009-02-03
02:13:18.000000000 +0530
@@ -218,9 +218,12 @@
2.6.17*)
echo 2.6.17
;;
- 2.6.18-*fc[56]*|2.6.18-*el5*)
+ 2.6.18-*fc[56]*|2.6.18-8.el5)
echo 2.6.18_FC6
;;
+ 2.6.18-53.el5)
+ echo 2.6.18-EL5.1
+ ;;
2.6.18*)
echo 2.6.18
;;
-regards
Devesh Sharma
More information about the general
mailing list