Copy iw_nes backport patches from RHEL5U3 to RHEL5U4.

Signed-off-by: Chien Tung <chien.tin.t...@intel.com>
---
 .../2.6.18-EL5.4/iw_nes_800_to_2_6_28.patch        |   83 ++++++
 .../2.6.18-EL5.4/iw_nes_870_to_2_6_24.patch        |   27 ++
 .../2.6.18-EL5.4/iw_nes_880_to_2_6_23.patch        |  275 ++++++++++++++++++++
 .../2.6.18-EL5.4/iw_nes_890_to_2_6_22.patch        |   55 ++++
 .../2.6.18-EL5.4/iw_nes_900_to_2_6_21.patch        |   23 ++
 .../2.6.18-EL5.4/iw_nes_930_to_2_6_18.patch        |  115 ++++++++
 6 files changed, 578 insertions(+), 0 deletions(-)
 create mode 100644 
kernel_patches/backport/2.6.18-EL5.4/iw_nes_800_to_2_6_28.patch
 create mode 100644 
kernel_patches/backport/2.6.18-EL5.4/iw_nes_870_to_2_6_24.patch
 create mode 100644 
kernel_patches/backport/2.6.18-EL5.4/iw_nes_880_to_2_6_23.patch
 create mode 100644 
kernel_patches/backport/2.6.18-EL5.4/iw_nes_890_to_2_6_22.patch
 create mode 100644 
kernel_patches/backport/2.6.18-EL5.4/iw_nes_900_to_2_6_21.patch
 create mode 100644 
kernel_patches/backport/2.6.18-EL5.4/iw_nes_930_to_2_6_18.patch

diff --git a/kernel_patches/backport/2.6.18-EL5.4/iw_nes_800_to_2_6_28.patch 
b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_800_to_2_6_28.patch
new file mode 100644
index 0000000..254d9b3
--- /dev/null
+++ b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_800_to_2_6_28.patch
@@ -0,0 +1,83 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_hw.c 
nes.2_6_28_patch/drivers/infiniband/hw/nes/nes_hw.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_hw.c       2009-07-01 
13:16:41.000000000 -0500
++++ nes.2_6_28_patch/drivers/infiniband/hw/nes/nes_hw.c        2009-07-06 
11:15:13.000000000 -0500
+@@ -2555,7 +2555,7 @@ static void nes_nic_napi_ce_handler(stru
+ {
+       struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq);
+ 
+-      napi_schedule(&nesvnic->napi);
++      netif_rx_schedule(nesdev->netdev[nesvnic->netdev_index], 
&nesvnic->napi);
+ }
+ 
+ 
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_nic.c 
nes.2_6_28_patch/drivers/infiniband/hw/nes/nes_nic.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_nic.c      2009-07-01 
13:16:41.000000000 -0500
++++ nes.2_6_28_patch/drivers/infiniband/hw/nes/nes_nic.c       2009-07-06 
14:15:25.000000000 -0500
+@@ -99,6 +99,7 @@ static int nics_per_function = 1;
+ static int nes_netdev_poll(struct napi_struct *napi, int budget)
+ {
+       struct nes_vnic *nesvnic = container_of(napi, struct nes_vnic, napi);
++      struct net_device *netdev = nesvnic->netdev;
+       struct nes_device *nesdev = nesvnic->nesdev;
+       struct nes_hw_nic_cq *nescq = &nesvnic->nic_cq;
+ 
+@@ -111,7 +112,7 @@ static int nes_netdev_poll(struct napi_s
+       nes_nic_ce_handler(nesdev, nescq);
+ 
+       if (nescq->cqes_pending == 0) {
+-              napi_complete(napi);
++              netif_rx_complete(netdev, napi);
+               /* clear out completed cqes and arm */
+               nes_write32(nesdev->regs+NES_CQE_ALLOC, 
NES_CQE_ALLOC_NOTIFY_NEXT |
+                               nescq->cq_number | (nescq->cqe_allocs_pending 
<< 16));
+@@ -1551,19 +1552,6 @@ static void nes_netdev_vlan_rx_register(
+       spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
+ }
+ 
+-static const struct net_device_ops nes_netdev_ops = {
+-      .ndo_open               = nes_netdev_open,
+-      .ndo_stop               = nes_netdev_stop,
+-      .ndo_start_xmit         = nes_netdev_start_xmit,
+-      .ndo_get_stats          = nes_netdev_get_stats,
+-      .ndo_tx_timeout         = nes_netdev_tx_timeout,
+-      .ndo_set_mac_address    = nes_netdev_set_mac_address,
+-      .ndo_set_multicast_list = nes_netdev_set_multicast_list,
+-      .ndo_change_mtu         = nes_netdev_change_mtu,
+-      .ndo_set_mac_address    = eth_mac_addr,
+-      .ndo_validate_addr      = eth_validate_addr,
+-      .ndo_vlan_rx_register   = nes_netdev_vlan_rx_register,
+-};
+ 
+ /**
+  * nes_netdev_init - initialize network device
+@@ -1590,6 +1578,17 @@ struct net_device *nes_netdev_init(struc
+ 
+       SET_NETDEV_DEV(netdev, &nesdev->pcidev->dev);
+ 
++      nesvnic = netdev_priv(netdev);
++      memset(nesvnic, 0, sizeof(*nesvnic));
++
++      netdev->open = nes_netdev_open;
++      netdev->stop = nes_netdev_stop;
++      netdev->hard_start_xmit = nes_netdev_start_xmit;
++      netdev->get_stats = nes_netdev_get_stats;
++      netdev->tx_timeout = nes_netdev_tx_timeout;
++      netdev->set_mac_address = nes_netdev_set_mac_address;
++      netdev->set_multicast_list = nes_netdev_set_multicast_list;
++      netdev->change_mtu = nes_netdev_change_mtu;
+       netdev->watchdog_timeo = NES_TX_TIMEOUT;
+       netdev->irq = nesdev->pcidev->irq;
+       netdev->mtu = ETH_DATA_LEN;
+@@ -1597,11 +1596,11 @@ struct net_device *nes_netdev_init(struc
+       netdev->addr_len = ETH_ALEN;
+       netdev->type = ARPHRD_ETHER;
+       netdev->features = NETIF_F_HIGHDMA;
+-      netdev->netdev_ops = &nes_netdev_ops;
+       netdev->ethtool_ops = &nes_ethtool_ops;
+       netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
+       nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
+       netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
++      netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
+ 
+       /* Fill in the port structure */
+       nesvnic->netdev = netdev;
diff --git a/kernel_patches/backport/2.6.18-EL5.4/iw_nes_870_to_2_6_24.patch 
b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_870_to_2_6_24.patch
new file mode 100644
index 0000000..a890b9e
--- /dev/null
+++ b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_870_to_2_6_24.patch
@@ -0,0 +1,27 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes.c 
nes.2_6_24_patch/drivers/infiniband/hw/nes/nes.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes.c  2009-07-01 13:16:41.000000000 
-0500
++++ nes.2_6_24_patch/drivers/infiniband/hw/nes/nes.c   2009-07-06 
01:08:56.000000000 -0500
+@@ -1101,19 +1101,19 @@ static ssize_t nes_show_wqm_quanta(struc
+ static ssize_t nes_store_wqm_quanta(struct device_driver *ddp,
+                                       const char *buf, size_t count)
+ {
+-      unsigned long wqm_quanta_value;
++      u32 wqm_quanta;
+       u32 wqm_config1;
+       u32 i = 0;
+       struct nes_device *nesdev;
+ 
+-      strict_strtoul(buf, 0, &wqm_quanta_value);
++      wqm_quanta = simple_strtoul(buf, NULL, 0);
+       list_for_each_entry(nesdev, &nes_dev_list, list) {
+               if (i == ee_flsh_adapter) {
+-                      nesdev->nesadapter->wqm_quanta = wqm_quanta_value;
++                      nesdev->nesadapter->wqm_quanta = wqm_quanta;
+                       wqm_config1 = nes_read_indexed(nesdev,
+                                               NES_IDX_WQM_CONFIG1);
+                       nes_write_indexed(nesdev, NES_IDX_WQM_CONFIG1,
+-                                      ((wqm_quanta_value << 1) |
++                                      ((wqm_quanta << 1) |
+                                       (wqm_config1 & 0x00000001)));
+                       break;
+               }
diff --git a/kernel_patches/backport/2.6.18-EL5.4/iw_nes_880_to_2_6_23.patch 
b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_880_to_2_6_23.patch
new file mode 100644
index 0000000..049a5b1
--- /dev/null
+++ b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_880_to_2_6_23.patch
@@ -0,0 +1,275 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/Kconfig 
nes.2_6_23_patch/drivers/infiniband/hw/nes/Kconfig
+--- linux-2.6/drivers/infiniband/hw/nes/Kconfig        2009-07-01 
13:16:41.000000000 -0500
++++ nes.2_6_23_patch/drivers/infiniband/hw/nes/Kconfig 2009-07-06 
01:08:56.000000000 -0500
+@@ -2,7 +2,6 @@ config INFINIBAND_NES
+       tristate "NetEffect RNIC Driver"
+       depends on PCI && INET && INFINIBAND
+       select LIBCRC32C
+-      select INET_LRO
+       ---help---
+         This is a low-level driver for NetEffect RDMA enabled
+         Network Interface Cards (RNIC).
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_hw.c 
nes.2_6_23_patch/drivers/infiniband/hw/nes/nes_hw.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_hw.c       2009-07-06 
15:17:35.000000000 -0500
++++ nes.2_6_23_patch/drivers/infiniband/hw/nes/nes_hw.c        2009-07-06 
11:14:30.000000000 -0500
+@@ -38,14 +38,9 @@
+ #include <linux/ip.h>
+ #include <linux/tcp.h>
+ #include <linux/if_vlan.h>
+-#include <linux/inet_lro.h>
+ 
+ #include "nes.h"
+ 
+-static unsigned int nes_lro_max_aggr = NES_LRO_MAX_AGGR;
+-module_param(nes_lro_max_aggr, uint, 0444);
+-MODULE_PARM_DESC(nes_lro_max_aggr, "NIC LRO max packet aggregation");
+-
+ static int wide_ppm_offset;
+ module_param(wide_ppm_offset, int, 0644);
+ MODULE_PARM_DESC(wide_ppm_offset, "Increase CX4 interface clock ppm offset, 
0=100ppm (default), 1=300ppm");
+@@ -1530,25 +1525,6 @@ static void nes_rq_wqes_timeout(unsigned
+ }
+ 
+ 
+-static int nes_lro_get_skb_hdr(struct sk_buff *skb, void **iphdr,
+-                             void **tcph, u64 *hdr_flags, void *priv)
+-{
+-      unsigned int ip_len;
+-      struct iphdr *iph;
+-      skb_reset_network_header(skb);
+-      iph = ip_hdr(skb);
+-      if (iph->protocol != IPPROTO_TCP)
+-              return -1;
+-      ip_len = ip_hdrlen(skb);
+-      skb_set_transport_header(skb, ip_len);
+-      *tcph = tcp_hdr(skb);
+-
+-      *hdr_flags = LRO_IPV4 | LRO_TCP;
+-      *iphdr = iph;
+-      return 0;
+-}
+-
+-
+ /**
+  * nes_init_nic_qp
+  */
+@@ -1772,14 +1748,6 @@ int nes_init_nic_qp(struct nes_device *n
+                       jumbomode = 1;
+               nes_nic_init_timer_defaults(nesdev, jumbomode);
+       }
+-      nesvnic->lro_mgr.max_aggr       = nes_lro_max_aggr;
+-      nesvnic->lro_mgr.max_desc       = NES_MAX_LRO_DESCRIPTORS;
+-      nesvnic->lro_mgr.lro_arr        = nesvnic->lro_desc;
+-      nesvnic->lro_mgr.get_skb_header = nes_lro_get_skb_hdr;
+-      nesvnic->lro_mgr.features       = LRO_F_NAPI | LRO_F_EXTRACT_VLAN_ID;
+-      nesvnic->lro_mgr.dev            = netdev;
+-      nesvnic->lro_mgr.ip_summed      = CHECKSUM_UNNECESSARY;
+-      nesvnic->lro_mgr.ip_summed_aggr = CHECKSUM_UNNECESSARY;
+       return 0;
+ }
+ 
+@@ -2555,7 +2523,7 @@ static void nes_nic_napi_ce_handler(stru
+ {
+       struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq);
+ 
+-      netif_rx_schedule(nesdev->netdev[nesvnic->netdev_index], 
&nesvnic->napi);
++      netif_rx_schedule(nesdev->netdev[nesvnic->netdev_index]);
+ }
+ 
+ 
+@@ -2590,13 +2558,10 @@ void nes_nic_ce_handler(struct nes_devic
+       u16 pkt_type;
+       u16 rqes_processed = 0;
+       u8 sq_cqes = 0;
+-      u8 nes_use_lro = 0;
+ 
+       head = cq->cq_head;
+       cq_size = cq->cq_size;
+       cq->cqes_pending = 1;
+-      if (nesvnic->netdev->features & NETIF_F_LRO)
+-              nes_use_lro = 1;
+       do {
+               if 
(le32_to_cpu(cq->cq_vbase[head].cqe_words[NES_NIC_CQE_MISC_IDX]) &
+                               NES_NIC_CQE_VALID) {
+@@ -2728,17 +2693,9 @@ void nes_nic_ce_handler(struct nes_devic
+                                                       >> 16);
+                                       nes_debug(NES_DBG_CQ, "%s: Reporting 
stripped VLAN packet. Tag = 0x%04X\n",
+                                                       nesvnic->netdev->name, 
vlan_tag);
+-                                      if (nes_use_lro)
+-                                              
lro_vlan_hwaccel_receive_skb(&nesvnic->lro_mgr, rx_skb,
+-                                                              
nesvnic->vlan_grp, vlan_tag, NULL);
+-                                      else
+-                                              nes_vlan_rx(rx_skb, 
nesvnic->vlan_grp, vlan_tag);
+-                              } else {
+-                                      if (nes_use_lro)
+-                                              
lro_receive_skb(&nesvnic->lro_mgr, rx_skb, NULL);
+-                                      else
+-                                              nes_netif_rx(rx_skb);
+-                              }
++                                      nes_vlan_rx(rx_skb, nesvnic->vlan_grp, 
vlan_tag);
++                              } else
++                                      nes_netif_rx(rx_skb);
+ 
+ skip_rx_indicate0:
+                               nesvnic->netdev->last_rx = jiffies;
+@@ -2769,8 +2726,6 @@ skip_rx_indicate0:
+ 
+       } while (1);
+ 
+-      if (nes_use_lro)
+-              lro_flush_all(&nesvnic->lro_mgr);
+       if (sq_cqes) {
+               barrier();
+               /* restart the queue if it had been stopped */
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_hw.h 
nes.2_6_23_patch/drivers/infiniband/hw/nes/nes_hw.h
+--- linux-2.6/drivers/infiniband/hw/nes/nes_hw.h       2009-07-01 
13:16:41.000000000 -0500
++++ nes.2_6_23_patch/drivers/infiniband/hw/nes/nes_hw.h        2009-07-06 
01:08:56.000000000 -0500
+@@ -33,8 +33,6 @@
+ #ifndef __NES_HW_H
+ #define __NES_HW_H
+ 
+-#include <linux/inet_lro.h>
+-
+ #define NES_PHY_TYPE_CX4       1
+ #define NES_PHY_TYPE_1G        2
+ #define NES_PHY_TYPE_IRIS      3
+@@ -993,8 +991,6 @@ struct nes_hw_tune_timer {
+ #define NES_TIMER_ENABLE_LIMIT      4
+ #define NES_MAX_LINK_INTERRUPTS     128
+ #define NES_MAX_LINK_CHECK          200
+-#define NES_MAX_LRO_DESCRIPTORS     32
+-#define NES_LRO_MAX_AGGR            64
+ 
+ struct nes_adapter {
+       u64              fw_ver;
+@@ -1169,7 +1165,6 @@ struct nes_vnic {
+       u32               msg_enable;
+       /* u32 tx_avail; */
+       __be32            local_ipaddr;
+-      struct napi_struct   napi;
+       spinlock_t           tx_lock;   /* could use netdev tx lock? */
+       struct timer_list    rq_wqes_timer;
+       u32                  nic_mem_size;
+@@ -1197,9 +1192,6 @@ struct nes_vnic {
+       u8  of_device_registered;
+       u8  rdma_enabled;
+       u8  rx_checksum_disabled;
+-      u32 lro_max_aggr;
+-      struct net_lro_mgr lro_mgr;
+-      struct net_lro_desc lro_desc[NES_MAX_LRO_DESCRIPTORS];
+ };
+ 
+ struct nes_ib_device {
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_nic.c 
nes.2_6_23_patch/drivers/infiniband/hw/nes/nes_nic.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_nic.c      2009-07-06 
15:17:35.000000000 -0500
++++ nes.2_6_23_patch/drivers/infiniband/hw/nes/nes_nic.c       2009-07-06 
13:39:45.000000000 -0500
+@@ -96,35 +96,38 @@ static int nics_per_function = 1;
+ /**
+  * nes_netdev_poll
+  */
+-static int nes_netdev_poll(struct napi_struct *napi, int budget)
++static int nes_netdev_poll(struct net_device *netdev, int *budget_ptr)
+ {
+-      struct nes_vnic *nesvnic = container_of(napi, struct nes_vnic, napi);
+-      struct net_device *netdev = nesvnic->netdev;
++      struct nes_vnic *nesvnic = netdev_priv(netdev);
+       struct nes_device *nesdev = nesvnic->nesdev;
+       struct nes_hw_nic_cq *nescq = &nesvnic->nic_cq;
+-
+-      nesvnic->budget = budget;
++      nesvnic->budget = min(netdev->quota, *budget_ptr);
+       nescq->cqes_pending = 0;
+       nescq->rx_cqes_completed = 0;
+       nescq->cqe_allocs_pending = 0;
+       nescq->rx_pkts_indicated = 0;
+ 
+       nes_nic_ce_handler(nesdev, nescq);
++      netdev->quota -= nescq->rx_pkts_indicated;
++      *budget_ptr -= nescq->rx_pkts_indicated;
+ 
+-      if (nescq->cqes_pending == 0) {
+-              netif_rx_complete(netdev, napi);
++      if ((nescq->cqes_pending == 0) && (netdev->quota != 0)) {
++              netif_rx_complete(netdev);
+               /* clear out completed cqes and arm */
+               nes_write32(nesdev->regs+NES_CQE_ALLOC, 
NES_CQE_ALLOC_NOTIFY_NEXT |
+                               nescq->cq_number | (nescq->cqe_allocs_pending 
<< 16));
+               nes_read32(nesdev->regs+NES_CQE_ALLOC);
++
++              return 0;
+       } else {
+               /* clear out completed cqes but don't arm */
+               nes_write32(nesdev->regs+NES_CQE_ALLOC,
+                               nescq->cq_number | (nescq->cqe_allocs_pending 
<< 16));
+               nes_debug(NES_DBG_NETDEV, "%s: exiting with work pending\n",
+                               nesvnic->netdev->name);
++
++              return 1;
+       }
+-      return nescq->rx_pkts_indicated;
+ }
+ 
+ 
+@@ -238,7 +241,6 @@ static int nes_netdev_open(struct net_de
+               netif_start_queue(netdev);
+               netif_carrier_on(netdev);
+       }
+-      napi_enable(&nesvnic->napi);
+       nesvnic->netdev_open = 1;
+ 
+       return 0;
+@@ -266,7 +268,6 @@ static int nes_netdev_stop(struct net_de
+               printk(KERN_INFO PFX "%s: disabling interface\n", netdev->name);
+ 
+       /* Disable network packets */
+-      napi_disable(&nesvnic->napi);
+       netif_stop_queue(netdev);
+       list_for_each_safe(list_pos, list_temp, 
&nesdev->nesadapter->nesvnic_list[nesdev->mac_index]) {
+               first_nesvnic = container_of(list_pos, struct nes_vnic, list);
+@@ -1038,9 +1039,6 @@ static const char nes_ethtool_stringset[
+       "CQ Depth 32",
+       "CQ Depth 128",
+       "CQ Depth 256",
+-      "LRO aggregated",
+-      "LRO flushed",
+-      "LRO no_desc",
+ };
+ 
+ #define NES_ETHTOOL_STAT_COUNT  ARRAY_SIZE(nes_ethtool_stringset)
+@@ -1238,9 +1236,6 @@ static void nes_netdev_get_ethtool_stats
+       target_stat_values[++index] = int_mod_cq_depth_32;
+       target_stat_values[++index] = int_mod_cq_depth_128;
+       target_stat_values[++index] = int_mod_cq_depth_256;
+-      target_stat_values[++index] = nesvnic->lro_mgr.stats.aggregated;
+-      target_stat_values[++index] = nesvnic->lro_mgr.stats.flushed;
+-      target_stat_values[++index] = nesvnic->lro_mgr.stats.no_desc;
+ 
+ }
+ 
+@@ -1523,8 +1518,6 @@ static struct ethtool_ops nes_ethtool_op
+       .set_sg = ethtool_op_set_sg,
+       .get_tso = ethtool_op_get_tso,
+       .set_tso = ethtool_op_set_tso,
+-      .get_flags = ethtool_op_get_flags,
+-      .set_flags = ethtool_op_set_flags,
+ };
+ 
+ 
+@@ -1597,7 +1590,8 @@ struct net_device *nes_netdev_init(struc
+       netdev->type = ARPHRD_ETHER;
+       netdev->features = NETIF_F_HIGHDMA;
+       netdev->ethtool_ops = &nes_ethtool_ops;
+-      netif_napi_add(netdev, &nesvnic->napi, nes_netdev_poll, 128);
++      netdev->poll = nes_netdev_poll;
++      netdev->weight = 128;
+       nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
+       netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+       netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
+@@ -1629,7 +1623,6 @@ struct net_device *nes_netdev_init(struc
+ 
+       if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != 
NE020_REV)) {
+               netdev->features |= NETIF_F_TSO | NETIF_F_SG | NETIF_F_IP_CSUM;
+-              netdev->features |= NETIF_F_GSO | NETIF_F_TSO | NETIF_F_SG | 
NETIF_F_IP_CSUM;
+       } else {
+               netdev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
+       }
diff --git a/kernel_patches/backport/2.6.18-EL5.4/iw_nes_890_to_2_6_22.patch 
b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_890_to_2_6_22.patch
new file mode 100644
index 0000000..460f507
--- /dev/null
+++ b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_890_to_2_6_22.patch
@@ -0,0 +1,55 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes.c 
nes.2_6_22_patch/drivers/infiniband/hw/nes/nes.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes.c  2009-07-06 15:17:35.000000000 
-0500
++++ nes.2_6_22_patch/drivers/infiniband/hw/nes/nes.c   2009-07-06 
01:08:56.000000000 -0500
+@@ -576,16 +576,22 @@ static int __devinit nes_probe(struct pc
+                                               nesdev->nesadapter->port_count;
+       }
+ 
+-      if ((limit_maxrdreqsz ||
+-           ((nesdev->nesadapter->phy_type[0] == NES_PHY_TYPE_GLADIUS) &&
+-            (hw_rev == NE020_REV1))) &&
+-          (pcie_get_readrq(pcidev) > 256)) {
+-              if (pcie_set_readrq(pcidev, 256))
+-                      printk(KERN_ERR PFX "Unable to set max read request"
+-                              " to 256 bytes\n");
+-              else
+-                      nes_debug(NES_DBG_INIT, "Max read request size set"
+-                              " to 256 bytes\n");
++      if (limit_maxrdreqsz ||
++          ((nesdev->nesadapter->phy_type[0] == NES_PHY_TYPE_GLADIUS) &&
++           (hw_rev == NE020_REV1))) {
++              u16 maxrdreqword;
++              pci_read_config_word(pcidev, 0x68, &maxrdreqword);
++              /* set bits 12-14 to 001b = 256 bytes */
++              if ((maxrdreqword & 0x7000) > 0x1000) {
++                      maxrdreqword &= 0x8fff;
++                      maxrdreqword |= 0x1000;
++                      if (pci_write_config_word(pcidev, 0x68, maxrdreqword))
++                              printk(KERN_ERR PFX "Unable to set max read "
++                                      "request to 256 bytes\n");
++                      else
++                              nes_debug(NES_DBG_INIT, "Max read request size"
++                                      "set to 256 bytes\n");
++              }
+       }
+ 
+       tasklet_init(&nesdev->dpc_tasklet, nes_dpc, (unsigned long)nesdev);
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes.h 
nes.2_6_22_patch/drivers/infiniband/hw/nes/nes.h
+--- linux-2.6/drivers/infiniband/hw/nes/nes.h  2009-07-01 13:16:41.000000000 
-0500
++++ nes.2_6_22_patch/drivers/infiniband/hw/nes/nes.h   2009-07-06 
01:08:56.000000000 -0500
+@@ -274,14 +274,7 @@ static inline __le32 get_crc_value(struc
+       u32 crc_value;
+       crc_value = crc32c(~0, (void *)nes_quad, sizeof (struct nes_v4_quad));
+ 
+-      /*
+-       * With commit ef19454b ("[LIB] crc32c: Keep intermediate crc
+-       * state in cpu order"), behavior of crc32c changes on
+-       * big-endian platforms.  Our algorithm expects the previous
+-       * behavior; otherwise we have RDMA connection establishment
+-       * issue on big-endian.
+-       */
+-      return cpu_to_le32(crc_value);
++      return crc_value;
+ }
+ 
+ static inline void
diff --git a/kernel_patches/backport/2.6.18-EL5.4/iw_nes_900_to_2_6_21.patch 
b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_900_to_2_6_21.patch
new file mode 100644
index 0000000..b88f3a3
--- /dev/null
+++ b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_900_to_2_6_21.patch
@@ -0,0 +1,23 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_nic.c 
nes.2_6_21_patch/drivers/infiniband/hw/nes/nes_nic.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_nic.c      2009-07-06 
15:17:35.000000000 -0500
++++ nes.2_6_21_patch/drivers/infiniband/hw/nes/nes_nic.c       2009-07-06 
15:14:54.000000000 -0500
+@@ -1545,6 +1545,11 @@ static void nes_netdev_vlan_rx_register(
+       spin_unlock_irqrestore(&nesadapter->phy_lock, flags);
+ }
+ 
++static void nes_netdev_vlan_rx_kill_vid(struct net_device *netdev,
++                                      unsigned short vid)
++{
++}
++
+ 
+ /**
+  * nes_netdev_init - initialize network device
+@@ -1595,6 +1600,7 @@ struct net_device *nes_netdev_init(struc
+       nes_debug(NES_DBG_INIT, "Enabling VLAN Insert/Delete.\n");
+       netdev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
+       netdev->vlan_rx_register = nes_netdev_vlan_rx_register;
++      netdev->vlan_rx_kill_vid = nes_netdev_vlan_rx_kill_vid;
+ 
+       /* Fill in the port structure */
+       nesvnic->netdev = netdev;
diff --git a/kernel_patches/backport/2.6.18-EL5.4/iw_nes_930_to_2_6_18.patch 
b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_930_to_2_6_18.patch
new file mode 100644
index 0000000..16f7595
--- /dev/null
+++ b/kernel_patches/backport/2.6.18-EL5.4/iw_nes_930_to_2_6_18.patch
@@ -0,0 +1,115 @@
+diff -Nurp linux-2.6/drivers/infiniband/hw/nes/nes_verbs.c 
nes.2_6_18_patch/drivers/infiniband/hw/nes/nes_verbs.c
+--- linux-2.6/drivers/infiniband/hw/nes/nes_verbs.c    2009-07-01 
13:16:41.000000000 -0500
++++ nes.2_6_18_patch/drivers/infiniband/hw/nes/nes_verbs.c     2009-07-07 
09:08:15.000000000 -0500
+@@ -2785,11 +2785,10 @@ static int nes_dereg_mr(struct ib_mr *ib
+ /**
+  * show_rev
+  */
+-static ssize_t show_rev(struct device *dev, struct device_attribute *attr,
+-                      char *buf)
++static ssize_t show_rev(struct class_device *cdev, char *buf)
+ {
+       struct nes_ib_device *nesibdev =
+-                      container_of(dev, struct nes_ib_device, ibdev.dev);
++                      container_of(cdev, struct nes_ib_device, 
ibdev.class_dev);
+       struct nes_vnic *nesvnic = nesibdev->nesvnic;
+ 
+       nes_debug(NES_DBG_INIT, "\n");
+@@ -2800,11 +2799,10 @@ static ssize_t show_rev(struct device *d
+ /**
+  * show_fw_ver
+  */
+-static ssize_t show_fw_ver(struct device *dev, struct device_attribute *attr,
+-                         char *buf)
++static ssize_t show_fw_ver(struct class_device *cdev, char *buf)
+ {
+       struct nes_ib_device *nesibdev =
+-                      container_of(dev, struct nes_ib_device, ibdev.dev);
++                      container_of(cdev, struct nes_ib_device, 
ibdev.class_dev);
+       struct nes_vnic *nesvnic = nesibdev->nesvnic;
+ 
+       nes_debug(NES_DBG_INIT, "\n");
+@@ -2817,8 +2815,7 @@ static ssize_t show_fw_ver(struct device
+ /**
+  * show_hca
+  */
+-static ssize_t show_hca(struct device *dev, struct device_attribute *attr,
+-                      char *buf)
++static ssize_t show_hca(struct class_device *cdev, char *buf)
+ {
+       nes_debug(NES_DBG_INIT, "\n");
+       return sprintf(buf, "NES020\n");
+@@ -2828,24 +2825,23 @@ static ssize_t show_hca(struct device *d
+ /**
+  * show_board
+  */
+-static ssize_t show_board(struct device *dev, struct device_attribute *attr,
+-                        char *buf)
++static ssize_t show_board(struct class_device *cdev, char *buf)
+ {
+       nes_debug(NES_DBG_INIT, "\n");
+       return sprintf(buf, "%.*s\n", 32, "NES020 Board ID");
+ }
+ 
+ 
+-static DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
+-static DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
+-static DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
+-static DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
+-
+-static struct device_attribute *nes_dev_attributes[] = {
+-      &dev_attr_hw_rev,
+-      &dev_attr_fw_ver,
+-      &dev_attr_hca_type,
+-      &dev_attr_board_id
++static CLASS_DEVICE_ATTR(hw_rev, S_IRUGO, show_rev, NULL);
++static CLASS_DEVICE_ATTR(fw_ver, S_IRUGO, show_fw_ver, NULL);
++static CLASS_DEVICE_ATTR(hca_type, S_IRUGO, show_hca, NULL);
++static CLASS_DEVICE_ATTR(board_id, S_IRUGO, show_board, NULL);
++
++static struct class_device_attribute *nes_class_attributes[] = {
++      &class_device_attr_hw_rev,
++      &class_device_attr_fw_ver,
++      &class_device_attr_hca_type,
++      &class_device_attr_board_id
+ };
+ 
+ 
+@@ -3754,7 +3750,7 @@ struct nes_ib_device *nes_init_ofa_devic
+       nesibdev->ibdev.phys_port_cnt = 1;
+       nesibdev->ibdev.num_comp_vectors = 1;
+       nesibdev->ibdev.dma_device = &nesdev->pcidev->dev;
+-      nesibdev->ibdev.dev.parent = &nesdev->pcidev->dev;
++      nesibdev->ibdev.class_dev.dev = &nesdev->pcidev->dev;
+       nesibdev->ibdev.query_device = nes_query_device;
+       nesibdev->ibdev.query_port = nes_query_port;
+       nesibdev->ibdev.modify_port = nes_modify_port;
+@@ -3849,13 +3845,13 @@ int nes_register_ofa_device(struct nes_i
+       nesibdev->max_qp = (nesadapter->max_qp-NES_FIRST_QPN) / 
nesadapter->port_count;
+       nesibdev->max_pd = nesadapter->max_pd / nesadapter->port_count;
+ 
+-      for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) {
+-              ret = device_create_file(&nesibdev->ibdev.dev, 
nes_dev_attributes[i]);
++      for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) {
++              ret = class_device_create_file(&nesibdev->ibdev.class_dev, 
nes_class_attributes[i]);
+               if (ret) {
+                       while (i > 0) {
+                               i--;
+-                              device_remove_file(&nesibdev->ibdev.dev,
+-                                                 nes_dev_attributes[i]);
++                              
class_device_remove_file(&nesibdev->ibdev.class_dev,
++                                              nes_class_attributes[i]);
+                       }
+                       ib_unregister_device(&nesibdev->ibdev);
+                       return ret;
+@@ -3876,8 +3872,8 @@ static void nes_unregister_ofa_device(st
+       struct nes_vnic *nesvnic = nesibdev->nesvnic;
+       int i;
+ 
+-      for (i = 0; i < ARRAY_SIZE(nes_dev_attributes); ++i) {
+-              device_remove_file(&nesibdev->ibdev.dev, nes_dev_attributes[i]);
++      for (i = 0; i < ARRAY_SIZE(nes_class_attributes); ++i) {
++              class_device_remove_file(&nesibdev->ibdev.class_dev, 
nes_class_attributes[i]);
+       }
+ 
+       if (nesvnic->of_device_registered) {
-- 
1.6.4.2

_______________________________________________
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg

Reply via email to