RE: [ewg] [PATCH] libnes: Fix subpackage name

2008-01-03 Thread Glenn Grundstrom
Applied.

Thanks,
Glenn. 

 
 Change libnes-devel to libnes-devel-static to be consistent with
 %files section.
 
 Signed-off-by: Vladimir Sokolovsky [EMAIL PROTECTED]
 ---
 diff --git a/libnes.spec.in b/libnes.spec.in
 index b72ed6f..543d396 100644
 --- a/libnes.spec.in
 +++ b/libnes.spec.in
 @@ -1,5 +1,5 @@
  Name: libnes
 -Version: 0.5
 +Version: @VERSION@
  Release: 0.%{?dist}
  Summary: NetEffect RNIC Userspace Library
 
 @@ -15,12 +15,12 @@ BuildRequires: libibverbs-devel
  libnes provides a device-specific userspace driver for 
 NetEffect RNICs
  for use with the libibverbs library.
 
 -%package devel
 +%package devel-static
  Summary: Development files for the libnes driver
  Group: System Environment/Libraries
  Requires: %{name} = %{version}-%{release}
 
 -%description devel
 +%description devel-static
  Static version of libnes that may be linked directly to an
  application, which may be useful for debugging.
 
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] [PATCH 4/10] nes: interrupt moderation fix

2007-12-20 Thread Glenn Grundstrom (NetEffect)

Hardware interrupt moderation timer gave average performance
on slower systems.  These fixes increase performance.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes_hw.c 
b/drivers/infiniband/hw/nes/nes_hw.c
index 674ce32..1048db2 100644
--- a/drivers/infiniband/hw/nes/nes_hw.c
+++ b/drivers/infiniband/hw/nes/nes_hw.c
@@ -155,26 +155,41 @@ static void nes_nic_tune_timer(struct nes_device *nesdev)
 
spin_lock_irqsave(nesadapter-periodic_timer_lock, flags);
 
+   if (shared_timer-cq_count_old  shared_timer-cq_count) {
+   if (shared_timer-cq_count  shared_timer-threshold_low ) {
+   shared_timer-cq_direction_downward=0;
+   }
+   }
+   if (shared_timer-cq_count_old = shared_timer-cq_count) {
+   shared_timer-cq_direction_downward++;
+   }
+   shared_timer-cq_count_old = shared_timer-cq_count;
+   if (shared_timer-cq_direction_downward  NES_NIC_CQ_DOWNWARD_TREND) {
+   if (shared_timer-cq_count = shared_timer-threshold_low ) {
+   shared_timer-threshold_low = 
shared_timer-threshold_low/2;
+   shared_timer-cq_direction_downward=0;
+   shared_timer-cq_count = 0;
+   
spin_unlock_irqrestore(nesadapter-periodic_timer_lock, flags);
+   return;
+   }
+   }
+
if (shared_timer-cq_count1) {
nesdev-deepcq_count += shared_timer-cq_count;
if (shared_timer-cq_count = shared_timer-threshold_low ) {   
/* increase timer gently */
shared_timer-timer_direction_upward++;
shared_timer-timer_direction_downward = 0;
-   }
-   else if (shared_timer-cq_count = 
shared_timer-threshold_target ) { /* balanced */
+   } else if (shared_timer-cq_count = 
shared_timer-threshold_target ) { /* balanced */
shared_timer-timer_direction_upward = 0;
shared_timer-timer_direction_downward = 0;
-   }
-   else if (shared_timer-cq_count = shared_timer-threshold_high 
) {  /* decrease timer gently */
+   } else if (shared_timer-cq_count = 
shared_timer-threshold_high ) {  /* decrease timer gently */
shared_timer-timer_direction_downward++;
shared_timer-timer_direction_upward = 0;
-   }
-   else if (shared_timer-cq_count = 
(shared_timer-threshold_high)*2) {
+   } else if (shared_timer-cq_count = 
(shared_timer-threshold_high)*2) {
shared_timer-timer_in_use -= 2;
shared_timer-timer_direction_upward = 0;
shared_timer-timer_direction_downward++;
-   }
-   else {
+   } else {
shared_timer-timer_in_use -= 4;
shared_timer-timer_direction_upward = 0;
shared_timer-timer_direction_downward++;
@@ -2241,7 +2256,7 @@ void nes_nic_ce_handler(struct nes_device *nesdev, struct 
nes_hw_nic_cq *cq)
if (atomic_read(nesvnic-rx_skbs_needed)  
(nesvnic-nic.rq_size1)) {
nes_write32(nesdev-regs+NES_CQE_ALLOC,
cq-cq_number | 
(cqe_count  16));
-nesadapter-tune_timer.cq_count += cqe_count;
+   nesadapter-tune_timer.cq_count += 
cqe_count;
cqe_count = 0;
nes_replenish_nic_rq(nesvnic);
}
diff --git a/drivers/infiniband/hw/nes/nes_hw.h 
b/drivers/infiniband/hw/nes/nes_hw.h
index 25cfda2..ca0b006 100644
--- a/drivers/infiniband/hw/nes/nes_hw.h
+++ b/drivers/infiniband/hw/nes/nes_hw.h
@@ -957,6 +957,7 @@ struct nes_arp_entry {
 #define DEFAULT_JUMBO_NES_QL_LOW12
 #define DEFAULT_JUMBO_NES_QL_TARGET 40
 #define DEFAULT_JUMBO_NES_QL_HIGH   128
+#define NES_NIC_CQ_DOWNWARD_TREND   8
 
 struct nes_hw_tune_timer {
 u16 cq_count;
@@ -969,6 +970,8 @@ struct nes_hw_tune_timer {
 u16 timer_in_use_max;
 u8  timer_direction_upward;
 u8  timer_direction_downward;
+u16 cq_count_old;
+u8  cq_direction_downward;
 };
 
 #define NES_TIMER_INT_LIMIT 2
@@ -1051,17 +1054,17 @@ struct nes_adapter {
 
u32 nic_rx_eth_route_err;
 
-   u32 et_rx_coalesce_usecs;
+   u32 et_rx_coalesce_usecs;
u32 et_rx_max_coalesced_frames;
u32 et_rx_coalesce_usecs_irq;
-   u32 et_rx_max_coalesced_frames_irq;
-   u32 et_pkt_rate_low;
-   u32 et_rx_coalesce_usecs_low;
-   u32 et_rx_max_coalesced_frames_low;
-   u32 et_pkt_rate_high;
-   u32 et_rx_coalesce_usecs_high;
-   u32

[ewg] [PATCH 5/10] nes: remove unneeded arp cache update

2007-12-20 Thread Glenn Grundstrom (NetEffect)

The hardware arp cache is updated by inet event notifiers.
Therefore, no arp cache update is needed at netdev_open.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes_nic.c 
b/drivers/infiniband/hw/nes/nes_nic.c
index 2ff4c41..496024a 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -260,16 +260,6 @@ static int nes_netdev_open(struct net_device *netdev)
}
 
 
-   if (netdev-ip_ptr) {
-   struct in_device *ip = netdev-ip_ptr;
-   struct in_ifaddr *in = NULL;
-   if (ip  ip-ifa_list) {
-   in = ip-ifa_list;
-   nes_manage_arp_cache(nesvnic-netdev, netdev-dev_addr,
-   ntohl(in-ifa_address), NES_ARP_ADD);
-   }
-   }
-
nes_write32(nesdev-regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT |
nesvnic-nic_cq.cq_number);
nes_read32(nesdev-regs+NES_CQE_ALLOC);
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] RE: [PATCH 3/6] nes: add missing unlock in error path of nes_alloc_fmr()

2007-12-14 Thread Glenn Grundstrom
 
 To avoid problems in the future you should fix up your procedure to
 preserve the Author: and Signed-off-by: lines when assimilating a
 patch.
 

Got it.  These 6 patches just bring the OFED tree in line with yours.

Another question - How do you like to see multiple patches in a set
where more than one of those patches affects the same file?  I've
been creating them where the second patch relies on the first patch
being successfully applied.  Correct?

Glenn.


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


[ewg] [PATCH 6/6] nes: remove unnecessary kernel macro #ifdefs

2007-12-13 Thread Glenn Grundstrom (NetEffect)

NETIF_F_xxx and HAVE_xxx macro #ifdefs are not needed and
have been removed.

From Rolands infiniband git tree to update OFED.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes_nic.c 
b/drivers/infiniband/hw/nes/nes_nic.c
index 0f50cd5..f196c43 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -357,9 +357,7 @@ static int nes_nic_send(struct sk_buff *skb, struct 
net_device *netdev)
struct nes_device *nesdev = nesvnic-nesdev;
struct nes_hw_nic *nesnic = nesvnic-nic;
struct nes_hw_nic_sq_wqe *nic_sqe;
-#ifdef NETIF_F_TSO
struct tcphdr *tcph;
-#endif
u16 *wqe_fragment_length;
u32 wqe_misc;
u16 wqe_fragment_index = 1; /* first fragment (0) is used by copy 
buffer */
@@ -385,7 +383,6 @@ static int nes_nic_send(struct sk_buff *skb, struct 
net_device *netdev)
if (skb-ip_summed == CHECKSUM_PARTIAL) {
tcph = tcp_hdr(skb);
if (1) {
-#ifdef NETIF_F_TSO
if (skb_is_gso(skb)) {
/* nes_debug(NES_DBG_NIC_TX, %s: TSO 
request... seg size = %u\n,
netdev-name, skb_is_gso(skb)); 
*/
@@ -395,11 +392,8 @@ static int nes_nic_send(struct sk_buff *skb, struct 
net_device *netdev)
cpu_to_le32(((u32)tcph-doff) |
(((u32)(((unsigned char *)tcph) 
- skb-data))  4));
} else {
-#endif
wqe_misc |= NES_NIC_SQ_WQE_COMPLETION;
-#ifdef NETIF_F_TSO
}
-#endif
}
} else {/* CHECKSUM_HW */
wqe_misc |= NES_NIC_SQ_WQE_DISABLE_CHKSUM | 
NES_NIC_SQ_WQE_COMPLETION;
@@ -475,7 +469,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
struct net_device *netdev)
struct nes_device *nesdev = nesvnic-nesdev;
struct nes_hw_nic *nesnic = nesvnic-nic;
struct nes_hw_nic_sq_wqe *nic_sqe;
-#ifdef NETIF_F_TSO
struct tcphdr *tcph;
/* struct udphdr *udph; */
 #define NES_MAX_TSO_FRAGS 18
@@ -486,7 +479,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
struct net_device *netdev)
u32 tso_frag_count;
u32 tso_wqe_length;
u32 curr_tcp_seq;
-#endif
u32 wqe_count=1;
u32 send_rc;
struct iphdr *iph;
@@ -499,10 +491,8 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
struct net_device *netdev)
u16 wqe_fragment_index=1;
u16 hoffset;
u16 nhoffset;
-#ifdef NETIF_F_TSO
u16 wqes_needed;
u16 wqes_available;
-#endif
u32 old_head;
u32 wqe_misc;
 
@@ -532,7 +522,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
struct net_device *netdev)
}
/* Check if too many fragments */
if (unlikely((nr_frags  4))) {
-#ifdef NETIF_F_TSO
if (skb_is_gso(skb)) {
nesvnic-segmented_tso_requests++;
nesvnic-tso_requests++;
@@ -663,7 +652,6 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
struct net_device *netdev)
nesnic-sq_head = nesnic-sq_size-1;
}
} else {
-#endif
nesvnic-linearized_skbs++;
hoffset = skb_transport_header(skb) - skb-data;
nhoffset = skb_network_header(skb) - skb-data;
@@ -675,9 +663,7 @@ static int nes_netdev_start_xmit(struct sk_buff *skb, 
struct net_device *netdev)
spin_unlock_irqrestore(nesnic-sq_lock, flags);
return NETDEV_TX_OK;
}
-#ifdef NETIF_F_TSO
}
-#endif
} else {
send_rc = nes_nic_send(skb, netdev);
if (send_rc != NETDEV_TX_OK) {
@@ -802,7 +788,6 @@ static void nes_netdev_tx_timeout(struct net_device *netdev)
 }
 
 
-#ifdef HAVE_SET_MAC_ADDR
 /**
  * nes_netdev_set_mac_address
  */
@@ -845,10 +830,8 @@ static int nes_netdev_set_mac_address(struct net_device 
*netdev, void *p)
}
return 0;
 }
-#endif
 
 
-#ifdef HAVE_MULTICAST
 /**
  * nes_netdev_set_multicast_list
  */
@@ -931,7 +914,6 @@ void nes_netdev_set_multicast_list(struct net_device 
*netdev)
}
}
 }
-#endif
 
 
 /**
@@ -1500,14 +1482,11 @@ static struct ethtool_ops nes_ethtool_ops = {
.set_tx_csum = ethtool_op_set_tx_csum,
.set_rx_csum = nes_netdev_set_rx_csum,
.set_sg = ethtool_op_set_sg,
-#ifdef NETIF_F_TSO
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
-#endif
 };
 
 
-#ifdef NETIF_F_HW_VLAN_TX
 static void nes_netdev_vlan_rx_register(struct net_device *netdev, struct 
vlan_group *grp)
 {
struct nes_vnic *nesvnic = netdev_priv(netdev);
@@ -1525,7

[ewg] [PATCH 2/6] nes: fix external crc32c() dependency

2007-12-13 Thread Glenn Grundstrom (NetEffect)

Add Select LIBCRC32C to make sure crc32c() can be resolved.  Without
this the driver may not link.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/Kconfig 
b/drivers/infiniband/hw/nes/Kconfig
index d5f2a12..2aeb7ac 100644
--- a/drivers/infiniband/hw/nes/Kconfig
+++ b/drivers/infiniband/hw/nes/Kconfig
@@ -1,6 +1,7 @@
 config INFINIBAND_NES
tristate NetEffect RNIC Driver
depends on PCI  INET  INFINIBAND
+   select LIBCRC32C
---help---
  This is a low-level driver for NetEffect RDMA enabled
  Network Interface Cards (RNIC).
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] [PATCH 3/6] nes: add missing unlock in error path of nes_alloc_fmr()

2007-12-13 Thread Glenn Grundstrom (NetEffect)

A spin_unlock_irqrestore() was missing in an error case
of nes_alloc_fmr().

From Rolands infiniband tree to update OFED.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes_verbs.c 
b/drivers/infiniband/hw/nes/nes_verbs.c
index ea7625a..cd95aba 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -479,6 +479,7 @@ static struct ib_fmr *nes_alloc_fmr(struct ib_pd *ibpd,
 
if (!vpbl.pbl_vbase) {
ret = -ENOMEM;
+   spin_unlock_irqrestore(nesadapter-pbl_lock, 
flags);
goto failed_leaf_vpbl_pages_alloc;
}
 
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] [PATCH 4/6] nes: fix nes_get_encoded_size() prototype

2007-12-13 Thread Glenn Grundstrom (NetEffect)

Change the argument type from u32 * to int * to match how
it is called.

From Rolands infiniband git tree to update OFED.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes_verbs.c 
b/drivers/infiniband/hw/nes/nes_verbs.c
index cd95aba..97cb51e 100644
--- a/drivers/infiniband/hw/nes/nes_verbs.c
+++ b/drivers/infiniband/hw/nes/nes_verbs.c
@@ -1046,7 +1046,7 @@ static int nes_destroy_ah(struct ib_ah *ah)
 /**
  * nes_get_encoded_size
  */
-static inline u8 nes_get_encoded_size(u32 *size)
+static inline u8 nes_get_encoded_size(int *size)
 {
u8 encoded_size = 0;
if (*size = 32) {
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] RE: [ofa-general] [PATCH 0/6] nes: Cosmetic changes; support virtual WQs and PPC

2007-12-04 Thread Glenn Grundstrom
 
 OK, I just pushed out a few more small cleanups (running unifdef,
 fixing signedness warnings, and fixing a locking bug on an error
 path).  One question: what is the point of the monkeying with
 SPIN_BUG_ON on in nes.c?


Probably just some leftover debugging.  I can remove it.

Thanks for letting me know that you've push content
to your branch.  I'll pick it up.  Btw, I'll be preparing
another set of patches that should be ready very soon.

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


[ewg] [PATCH 2/5] nes: provider listener cleanup

2007-11-30 Thread Glenn Grundstrom (NetEffect)

If an error occurs during the provider listen call the reference
count can be off.  This will prevent the listener from being
destroyed properly.

This is fixed by correcting the reference counts when a
problem is detected.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes_cm.c 
b/drivers/infiniband/hw/nes/nes_cm.c
index 3005cb1..933f31c 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -668,7 +668,7 @@ int send_syn(struct nes_cm_node *cm_node, u32 sendack)
options = (union all_known_options *)optionsbuffer[optionssize];
options-as_windowscale.optionnum = OPTION_NUMBER_WINDOW_SCALE;
options-as_windowscale.length = sizeof(struct option_windowscale);
-   options-as_windowscale.shiftcount = cm_node-tcp_cntxt.snd_wscale;
+   options-as_windowscale.shiftcount = cm_node-tcp_cntxt.rcv_wscale;
optionssize += sizeof(struct option_windowscale);
 
if (sendack  !(NES_DRV_OPT_SUPRESS_OPTION_BC  nes_drv_opt)
@@ -1387,15 +1387,12 @@ int process_packet(struct nes_cm_node *cm_node, struct 
sk_buff *skb,
case NES_CM_STATE_CLOSED:
break;
case NES_CM_STATE_LISTENING:
-   if (!(tcph-syn)) {
-   nes_debug(NES_DBG_CM, Received an ack 
without a SYN on a listening port\n);
-   send_reset(cm_node);
-   /* send_reset bumps refcount, this 
should have been a new node */
-   rem_ref_cm_node(cm_core, cm_node);
-   return -1;
-   } else {
-   nes_debug(NES_DBG_CM, Received an ack 
on a listening port (syn-ack maybe?)\n);
-   }
+   nes_debug(NES_DBG_CM, Received an ACK on a 
listening port (SYN %d)\n, tcph-syn);
+   cm_node-tcp_cntxt.loc_seq_num = 
ntohl(tcph-ack_seq);
+   send_reset(cm_node);
+   /* send_reset bumps refcount, this should have 
been a new node */
+   rem_ref_cm_node(cm_core, cm_node);
+   return -1;
break;
case NES_CM_STATE_TSA:
nes_debug(NES_DBG_CM, Received a packet with 
the ack bit set while in TSA state\n);
@@ -1832,6 +1829,10 @@ int mini_cm_recv_pkt(struct nes_cm_core *cm_core, struct 
nes_vnic *nesvnic,
cm_node = make_cm_node(cm_core, nesvnic, nfo, listener);
if (!cm_node) {
nes_debug(NES_DBG_CM, Unable to allocate node\n);
+   if (listener) {
+   nes_debug(NES_DBG_CM, unable to allocate node 
and decrementing listener refcount\n);
+   atomic_dec(listener-ref_count);
+   }
ret = -1;
goto out;
}
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg


[ewg] [PATCH 1/5] nes: accelerated loopback support

2007-11-30 Thread Glenn Grundstrom (NetEffect)

This patch allows accelerated loopback connections to
be made through the driver.  Prior to this patch iWarp
acclerated loopback requests were not handled.

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---

diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index 4f7ae5c..a5e0bb5 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -175,6 +175,8 @@ static int nes_inetaddr_event(struct notifier_block 
*notifier,
nes_write_indexed(nesdev,

NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev-pcidev-devfn)), 0);
 
+   nes_manage_arp_cache(netdev, 
netdev-dev_addr,
+   
ntohl(nesvnic-local_ipaddr), NES_ARP_DELETE);
nesvnic-local_ipaddr = 0;
return NOTIFY_OK;
break;
@@ -191,6 +193,8 @@ static int nes_inetaddr_event(struct notifier_block 
*notifier,
nes_write_indexed(nesdev,

NES_IDX_DST_IP_ADDR+(0x10*PCI_FUNC(nesdev-pcidev-devfn)),

ntohl(ifa-ifa_address));
+   nes_manage_arp_cache(netdev, 
netdev-dev_addr,
+   
ntohl(nesvnic-local_ipaddr), NES_ARP_ADD);
return NOTIFY_OK;
break;
default:
diff --git a/drivers/infiniband/hw/nes/nes_cm.c 
b/drivers/infiniband/hw/nes/nes_cm.c
index 4023a2c..3005cb1 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -1616,6 +1616,7 @@ struct nes_cm_node * mini_cm_connect(struct nes_cm_core 
*cm_core,
struct nes_cm_node *cm_node;
struct nes_cm_listener *loopbackremotelistener;
struct nes_cm_node *loopbackremotenode;
+   struct nes_cm_info loopback_cm_info;
 
u16 mpa_frame_size = sizeof(struct ietf_mpa_frame) +
ntohs(mpa_frame-priv_data_len);
@@ -1632,6 +1633,7 @@ struct nes_cm_node * mini_cm_connect(struct nes_cm_core 
*cm_core,
 
// set our node side to client (active) side
cm_node-tcp_cntxt.client = 1;
+   cm_node-tcp_cntxt.rcv_wscale = NES_CM_DEFAULT_RCV_WND_SCALE;
 
if (cm_info-loc_addr == cm_info-rem_addr) {
loopbackremotelistener = find_listener(cm_core, 
cm_node-rem_addr,
@@ -1639,13 +1641,14 @@ struct nes_cm_node * mini_cm_connect(struct nes_cm_core 
*cm_core,
if (loopbackremotelistener == NULL) {
create_event(cm_node, NES_CM_EVENT_ABORTED);
} else {
-   u16 temp;
-   temp = cm_info-loc_port;
-   cm_info-loc_port = cm_info-rem_port;
-   cm_info-rem_port = temp;
-   loopbackremotenode = make_cm_node(cm_core, nesvnic, 
cm_info,
+   loopback_cm_info = *cm_info;
+   loopback_cm_info.loc_port = cm_info-rem_port;
+   loopback_cm_info.rem_port = cm_info-loc_port;
+   loopback_cm_info.cm_id = loopbackremotelistener-cm_id;
+   loopbackremotenode = make_cm_node(cm_core, nesvnic, 
loopback_cm_info,
loopbackremotelistener);
loopbackremotenode-loopbackpartner = cm_node;
+   loopbackremotenode-tcp_cntxt.rcv_wscale = 
NES_CM_DEFAULT_RCV_WND_SCALE;
cm_node-loopbackpartner = loopbackremotenode;
memcpy(loopbackremotenode-mpa_frame_buf, 
mpa_frame-priv_data,
mpa_frame_size);
@@ -1654,6 +1657,14 @@ struct nes_cm_node * mini_cm_connect(struct nes_cm_core 
*cm_core,
 
// we are done handling this state, set node to a TSA 
state
cm_node-state = NES_CM_STATE_TSA;
+   cm_node-tcp_cntxt.rcv_nxt = 
loopbackremotenode-tcp_cntxt.loc_seq_num;
+   loopbackremotenode-tcp_cntxt.rcv_nxt = 
cm_node-tcp_cntxt.loc_seq_num;
+   cm_node-tcp_cntxt.max_snd_wnd = 
loopbackremotenode-tcp_cntxt.rcv_wnd;
+   loopbackremotenode-tcp_cntxt.max_snd_wnd = 
cm_node-tcp_cntxt.rcv_wnd;
+   cm_node-tcp_cntxt.snd_wnd = 
loopbackremotenode-tcp_cntxt.rcv_wnd;
+   loopbackremotenode-tcp_cntxt.snd_wnd = 
cm_node-tcp_cntxt.rcv_wnd;
+   cm_node-tcp_cntxt.snd_wscale = 
loopbackremotenode-tcp_cntxt.rcv_wscale;
+   loopbackremotenode-tcp_cntxt.snd_wscale = 
cm_node

RE: [ewg] RE: [ofa-general] [PATCH 3/5] nes: fix link reset for certainphy types

2007-11-30 Thread Glenn Grundstrom
 +
 +while (((nes_read32(nesdev-regs+NES_SOFTWARE_RESET)
 + 0x0040) != 0x0040)  (i++  5000)) {
 +}
 
 Is there a better way to wait for the read?

Typically, the reset is pretty quick and is complete within
a few loops.  The i++ counter is there to prevent a driver
hang in case the reset fails for some reason.

Thanks,
Glenn.

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


[ewg] [PATCH 2/6] nes: Cosmetic changes; support virtual WQs and PPC

2007-11-14 Thread Glenn Grundstrom (NetEffect)
Updated code for the NetEffect NE020 adapter.

Updates include:
- Support for userspace/virtual WQs.
- PowerPC
- Support for multiple debugging levels
- Many, many cosmetic changes inline with kernel.org standards

Diffs for nes_cm.c and nes_cm.h

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---
diff --git a/drivers/infiniband/hw/nes/nes_cm.c 
b/drivers/infiniband/hw/nes/nes_cm.c
index 561dcf3..4023a2c 100644
--- a/drivers/infiniband/hw/nes/nes_cm.c
+++ b/drivers/infiniband/hw/nes/nes_cm.c
@@ -120,7 +120,7 @@ static struct nes_cm_event *create_event(struct nes_cm_node 
*cm_node,
return NULL;
 
/* allocate an empty event */
-   event = (struct nes_cm_event *)kzalloc(sizeof(*event), GFP_ATOMIC);
+   event = kzalloc(sizeof(*event), GFP_ATOMIC);
 
if (!event)
return NULL;
@@ -211,11 +211,7 @@ static int parse_mpa(struct nes_cm_node *cm_node, u8 
*buffer, u32 len)
 static int handle_exception_pkt(struct nes_cm_node *cm_node, struct sk_buff 
*skb)
 {
int ret = 0;
-#ifdef OFED_1_2
-   struct tcphdr *tcph = skb-h.th;
-#else
struct tcphdr *tcph = tcp_hdr(skb);
-#endif
 
/* first check to see if this a FIN pkt */
if (tcph-fin) {
@@ -265,19 +261,12 @@ struct sk_buff *form_cm_frame(struct sk_buff *skb, struct 
nes_cm_node *cm_node,
ethh = (struct ethhdr *) buf;
buf += ETH_HLEN;
 
-#ifdef OFED_1_2
-   iph = skb-nh.iph = (struct iphdr *)buf;
-   buf += sizeof(*iph);
-   tcph  = skb-h.th = (struct tcphdr *)buf;
-   skb-mac.raw = skb-data;
-#else
iph = (struct iphdr *)buf;
buf += sizeof(*iph);
tcph = (struct tcphdr *)buf;
skb_reset_mac_header(skb);
skb_set_network_header(skb, ETH_HLEN);
skb_set_transport_header(skb, ETH_HLEN+sizeof(*iph));
-#endif
buf += sizeof(*tcph);
 
skb-ip_summed = CHECKSUM_PARTIAL;
@@ -404,11 +393,7 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct 
sk_buff *skb,
}
 
if (type == NES_TIMER_TYPE_SEND) {
-#ifdef OFED_1_2
-   new_send-seq_num = htonl(skb-h.th-seq);
-#else
new_send-seq_num = htonl(tcp_hdr(skb)-seq);
-#endif
atomic_inc(new_send-skb-users);
 
ret = nes_nic_cm_xmit(new_send-skb, cm_node-netdev);
@@ -433,11 +418,7 @@ int schedule_nes_timer(struct nes_cm_node *cm_node, struct 
sk_buff *skb,
spin_unlock_irqrestore(cm_node-retrans_list_lock, flags);
}
if (type == NES_TIMER_TYPE_RECV) {
-#ifdef OFED_1_2
-   new_send-seq_num = htonl(skb-h.th-seq);
-#else
new_send-seq_num = htonl(tcp_hdr(skb)-seq);
-#endif
new_send-timetosend = jiffies;
spin_lock_irqsave(cm_node-recv_list_lock, flags);
list_add_tail(new_send-list, cm_node-recv_list);
@@ -687,7 +668,7 @@ int send_syn(struct nes_cm_node *cm_node, u32 sendack)
options = (union all_known_options *)optionsbuffer[optionssize];
options-as_windowscale.optionnum = OPTION_NUMBER_WINDOW_SCALE;
options-as_windowscale.length = sizeof(struct option_windowscale);
-   options-as_windowscale.shiftcount = NES_CM_DEFAULT_RCV_WND_SCALE;
+   options-as_windowscale.shiftcount = cm_node-tcp_cntxt.snd_wscale;
optionssize += sizeof(struct option_windowscale);
 
if (sendack  !(NES_DRV_OPT_SUPRESS_OPTION_BC  nes_drv_opt)
@@ -1054,11 +1035,10 @@ static struct nes_cm_node *make_cm_node(struct 
nes_cm_core *cm_core,
struct nes_adapter *nesadapter;
 
/* create an hte and cm_node for this instance */
-   cm_node = (struct nes_cm_node *)kzalloc(sizeof(*cm_node), GFP_ATOMIC);
+   cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC);
if (!cm_node)
return NULL;
 
-   memset(cm_node, 0, sizeof(struct nes_cm_node));
/* set our node specific transport info */
cm_node-loc_addr = cm_info-loc_addr;
cm_node-rem_addr = cm_info-rem_addr;
@@ -1072,6 +1052,9 @@ static struct nes_cm_node *make_cm_node(struct 
nes_cm_core *cm_core,
cm_node-cm_id = cm_info-cm_id;
memcpy(cm_node-loc_mac, nesvnic-netdev-dev_addr, ETH_ALEN);
 
+   nes_debug(NES_DBG_CM, listener=%p, cm_id=%p\n,
+   cm_node-listener, cm_node-cm_id);
+
INIT_LIST_HEAD(cm_node-retrans_list);
spin_lock_init(cm_node-retrans_list_lock);
INIT_LIST_HEAD(cm_node-recv_list);
@@ -1281,14 +1264,10 @@ int process_packet(struct nes_cm_node *cm_node, struct 
sk_buff *skb,
int optionsize;
int datasize;
int ret = 0;
-#ifdef OFED_1_2
-   struct tcphdr *tcph = skb-h.th;
-#else
struct tcphdr *tcph = tcp_hdr(skb);
-#endif
u32 inc_sequence;
 
-   if ((!tcph) || (NES_CM_STATE_TSA == cm_node-state)) {
+   if ((!tcph) || (cm_node-state == NES_CM_STATE_TSA)) {
BUG_ON(!tcph);
atomic_inc(cm_accel_dropped_pkts

[ewg] [PATCH 4/6] nes: Cosmetic changes; support virtual WQs and PPC

2007-11-14 Thread Glenn Grundstrom (NetEffect)
Updated code for the NetEffect NE020 adapter.

Updates include:
- Support for userspace/virtual WQs.
- PowerPC
- Support for multiple debugging levels
- Many, many cosmetic changes inline with kernel.org standards

Diffs for nes_nic.c

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---
diff --git a/drivers/infiniband/hw/nes/nes_nic.c 
b/drivers/infiniband/hw/nes/nes_nic.c
index 2d759c4..d75b327 100644
--- a/drivers/infiniband/hw/nes/nes_nic.c
+++ b/drivers/infiniband/hw/nes/nes_nic.c
@@ -92,7 +92,40 @@ static const u32 default_msg = NETIF_MSG_DRV | 
NETIF_MSG_PROBE | NETIF_MSG_LINK
| NETIF_MSG_IFUP | NETIF_MSG_IFDOWN;
 static int debug = -1;
 
-static int rdma_enabled = 0;
+extern atomic_t cm_connects;
+extern atomic_t cm_accepts;
+extern atomic_t cm_disconnects;
+extern atomic_t cm_closes;
+extern atomic_t cm_connecteds;
+extern atomic_t cm_connect_reqs;
+extern atomic_t cm_rejects;
+extern atomic_t mod_qp_timouts;
+extern atomic_t qps_created;
+extern atomic_t qps_destroyed;
+extern atomic_t sw_qps_destroyed;
+extern u32 mh_detected;
+extern u32 mh_pauses_sent;
+extern u32 cm_packets_sent;
+extern u32 cm_packets_bounced;
+extern u32 cm_packets_created;
+extern u32 cm_packets_received;
+extern u32 cm_packets_dropped;
+extern u32 cm_packets_retrans;
+extern u32 cm_listens_created;
+extern u32 cm_listens_destroyed;
+extern u32 cm_backlog_drops;
+extern atomic_t cm_nodes_created;
+extern atomic_t cm_nodes_destroyed;
+extern atomic_t cm_accel_dropped_pkts;
+extern atomic_t cm_resets_recvd;
+extern u32 int_mod_timer_init;
+extern u32 int_mod_cq_depth_256;
+extern u32 int_mod_cq_depth_128;
+extern u32 int_mod_cq_depth_32;
+extern u32 int_mod_cq_depth_24;
+extern u32 int_mod_cq_depth_16;
+extern u32 int_mod_cq_depth_4;
+extern u32 int_mod_cq_depth_1;
 
 static int nes_netdev_open(struct net_device *);
 static int nes_netdev_stop(struct net_device *);
@@ -122,7 +155,7 @@ static int nes_netdev_poll(struct net_device* netdev, int* 
budget)
netdev-quota -= nesvnic-rx_cqes_completed;
*budget -= nesvnic-rx_cqes_completed;
 
-   if (0 == nesvnic-cqes_pending) {
+   if (nesvnic-cqes_pending == 0) {
netif_rx_complete(netdev);
/* clear out completed cqes and arm */
nes_write32(nesdev-regs+NES_CQE_ALLOC, 
NES_CQE_ALLOC_NOTIFY_NEXT |
@@ -136,7 +169,7 @@ static int nes_netdev_poll(struct net_device* netdev, int* 
budget)
nesvnic-netdev-name);
}
 
-   return((0 == nesvnic-cqes_pending) ? 0 : 1);
+   return (nesvnic-cqes_pending == 0) ? 0 : 1;
 }
 #endif
 
@@ -190,9 +223,9 @@ static int nes_netdev_open(struct net_device *netdev)
nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_ACTIVE);
nic_active |= nic_active_bit;
nes_write_indexed(nesdev, NES_IDX_NIC_ACTIVE, nic_active);
-   nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL);
+   nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ENABLE);
nic_active |= nic_active_bit;
-   nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL, nic_active);
+   nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ENABLE, nic_active);
nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_BROADCAST_ON);
nic_active |= nic_active_bit;
nes_write_indexed(nesdev, NES_IDX_NIC_BROADCAST_ON, nic_active);
@@ -204,7 +237,6 @@ static int nes_netdev_open(struct net_device *netdev)
macaddr_low += ((u32)netdev-dev_addr[4])  8;
macaddr_low += (u32)netdev-dev_addr[5];
 
-#define NES_MAX_PORT_COUNT 4
/* Program the various MAC regs */
for (i = 0; i  NES_MAX_PORT_COUNT; i++) {
if (nesvnic-qp_nic_index[i] == 0xf) {
@@ -264,8 +296,9 @@ static int nes_netdev_stop(struct net_device *netdev)
u32 nic_active_mask;
u32 nic_active;
 
-   nes_debug(NES_DBG_SHUTDOWN, \n);
-   if (0 == nesvnic-netdev_open)
+   nes_debug(NES_DBG_SHUTDOWN, nesvnic=%p, nesdev=%p, netdev=%p %s\n,
+   nesvnic, nesdev, netdev, netdev-name);
+   if (nesvnic-netdev_open == 0)
return 0;
 
if (netif_msg_ifdown(nesvnic))
@@ -273,7 +306,7 @@ static int nes_netdev_stop(struct net_device *netdev)
 
/* Disable network packets */
netif_stop_queue(netdev);
-   if ((nesdev-netdev[0] == netdev)(nesvnic-logical_port == 
nesdev-mac_index)) {
+   if ((nesdev-netdev[0] == netdev)  (nesvnic-logical_port == 
nesdev-mac_index)) {
nes_write_indexed(nesdev,
NES_IDX_MAC_INT_MASK+(0x200*nesdev-mac_index), 
0x);
}
@@ -287,6 +320,12 @@ static int nes_netdev_stop(struct net_device *netdev)
nic_active = nes_read_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL);
nic_active = nic_active_mask;
nes_write_indexed(nesdev, NES_IDX_NIC_MULTICAST_ALL, nic_active);
+   nic_active = nes_read_indexed(nesdev

[ewg] [PATCH 1/6] nes: Cosmetic changes; support virtual WQs and PPC

2007-11-14 Thread Glenn Grundstrom (NetEffect)
Updated code for the NetEffect NE020 adapter.

Updates include:
- Support for userspace/virtual WQs.
- PowerPC
- Support for multiple debugging levels
- Many, many cosmetic changes inline with kernel.org standards

Diffs for Makefile, nes.c and nes.h

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---
diff --git a/drivers/infiniband/hw/nes/Kconfig 
b/drivers/infiniband/hw/nes/Kconfig
diff --git a/drivers/infiniband/hw/nes/Makefile 
b/drivers/infiniband/hw/nes/Makefile
index 6e94d56..3514851 100644
--- a/drivers/infiniband/hw/nes/Makefile
+++ b/drivers/infiniband/hw/nes/Makefile
@@ -1,7 +1,3 @@
-
-EXTRA_CFLAGS += -DNES_MINICM
-
 obj-$(CONFIG_INFINIBAND_NES) += iw_nes.o
 
 iw_nes-objs := nes.o nes_hw.o nes_nic.o nes_utils.o nes_verbs.o nes_cm.o
-
diff --git a/drivers/infiniband/hw/nes/nes.c b/drivers/infiniband/hw/nes/nes.c
index ecf60a6..4f7ae5c 100644
--- a/drivers/infiniband/hw/nes/nes.c
+++ b/drivers/infiniband/hw/nes/nes.c
@@ -43,6 +43,7 @@
 #include linux/fs.h
 #include linux/init.h
 #include linux/if_arp.h
+#include linux/highmem.h
 #include asm/io.h
 #include asm/irq.h
 #include asm/byteorder.h
@@ -70,12 +71,8 @@ MODULE_VERSION(DRV_VERSION);
 
 int max_mtu = 9000;
 int nics_per_function = 1;
-
-#ifdef NES_INT_MODERATE
-int interrupt_mod_interval = 128;
-#else
 int interrupt_mod_interval = 0;
-#endif
+
 
 /* Interoperability */
 int mpa_version = 1;
@@ -96,9 +93,9 @@ unsigned int nes_drv_opt = 0;
 module_param(nes_drv_opt, int, 0);
 MODULE_PARM_DESC(nes_drv_opt, Driver option parameters);
 
-unsigned int nes_debug_level = 0x;
-module_param(nes_debug_level, uint, 0644);
-MODULE_PARM_DESC(nes_debug_level, Enable debug output level);
+unsigned int nes_debug_level = 0x0;
+module_param_named(debug_level, nes_debug_level, uint, 0644);
+MODULE_PARM_DESC(debug_level, Enable debug output level);
 
 LIST_HEAD(nes_adapter_list);
 LIST_HEAD(nes_dev_list);
@@ -127,7 +124,7 @@ MODULE_DEVICE_TABLE(pci, nes_pci_table);
 
 static int nes_inetaddr_event(struct notifier_block *, unsigned long, void *);
 static int nes_net_event(struct notifier_block *, unsigned long, void *);
-static int notifiers_registered = 0;
+static int nes_notifiers_registered = 0;
 
 
 static struct notifier_block nes_inetaddr_notifier = {
@@ -165,7 +162,7 @@ static int nes_inetaddr_event(struct notifier_block 
*notifier,
netdev = nesdev-netdev[0];
nesvnic = netdev_priv(netdev);
if (netdev == event_netdev) {
-   if (0 == nesvnic-rdma_enabled) {
+   if (nesvnic-rdma_enabled == 0) {
nes_debug(NES_DBG_NETDEV, Returning without 
processing event for %s since
 RDMA is not enabled.\n,
netdev-name);
@@ -224,7 +221,7 @@ static int nes_net_event(struct notifier_block *notifier,
netdev = nesdev-netdev[0];
nesvnic = netdev_priv(netdev);
if (netdev == neigh-dev) {
-   if (0 == nesvnic-rdma_enabled) {
+   if (nesvnic-rdma_enabled == 0) {
nes_debug(NES_DBG_NETDEV, 
Skipping device %s since no RDMA\n,
netdev-name);
} else {
@@ -268,6 +265,7 @@ void nes_add_ref(struct ib_qp *ibqp)
  */
 void nes_rem_ref(struct ib_qp *ibqp)
 {
+   unsigned long flags;
u64 u64temp;
struct nes_qp *nesqp;
struct nes_vnic *nesvnic = to_nesvnic(ibqp-device);
@@ -288,15 +286,28 @@ void nes_rem_ref(struct ib_qp *ibqp)
atomic_inc(qps_destroyed);
 
/* Free the control structures */
-   pci_free_consistent(nesdev-pcidev, nesqp-qp_mem_size, 
nesqp-hwqp.sq_vbase,
-   nesqp-hwqp.sq_pbase);
+
+   if (nesqp-pbl_vbase) {
+   pci_free_consistent(nesdev-pcidev, nesqp-qp_mem_size,
+   nesqp-hwqp.q2_vbase, 
nesqp-hwqp.q2_pbase);
+   spin_lock_irqsave(nesadapter-pbl_lock, flags);
+   nesadapter-free_256pbl++;
+   spin_unlock_irqrestore(nesadapter-pbl_lock, flags);
+   pci_free_consistent(nesdev-pcidev, 256, 
nesqp-pbl_vbase, nesqp-pbl_pbase);
+   nesqp-pbl_vbase = NULL;
+   kunmap(nesqp-page);
+
+   } else {
+   pci_free_consistent(nesdev-pcidev, nesqp-qp_mem_size,
+   nesqp-hwqp.sq_vbase, 
nesqp-hwqp.sq_pbase);
+   }
 
nesadapter-qp_table[nesqp-hwqp.qp_id-NES_FIRST_QPN] = NULL;
nes_free_resource(nesadapter, nesadapter-allocated_qps, 
nesqp-hwqp.qp_id

[ewg] [PATCH 5/6] nes: Cosmetic changes; support virtual WQs and PPC

2007-11-14 Thread Glenn Grundstrom (NetEffect)
Updated code for the NetEffect NE020 adapter.

Updates include:
- Support for userspace/virtual WQs.
- PowerPC
- Support for multiple debugging levels
- Many, many cosmetic changes inline with kernel.org standards

Diffs for nes_user.h and nes_utils.c

Signed-off-by: Glenn Grundstrom [EMAIL PROTECTED]

---
diff --git a/drivers/infiniband/hw/nes/nes_user.h 
b/drivers/infiniband/hw/nes/nes_user.h
index a170399..6ab2357 100644
--- a/drivers/infiniband/hw/nes/nes_user.h
+++ b/drivers/infiniband/hw/nes/nes_user.h
@@ -39,6 +39,9 @@
 
 #include linux/types.h
 
+#define NES_ABI_USERSPACE_VER 1
+#define NES_ABI_KERNEL_VER1
+
 /*
  * Make sure that all structs defined in this file remain laid out so
  * that they pack the same way on 32-bit and 64-bit architectures (to
@@ -47,11 +50,19 @@
  * instead.
  */
 
+struct nes_alloc_ucontext_req {
+   __u32 reserved32;
+   __u8  userspace_ver;
+   __u8  reserved8[3];
+};
+
 struct nes_alloc_ucontext_resp {
__u32 max_pds; /* maximum pds allowed for this user process */
__u32 max_qps; /* maximum qps allowed for this user process */
__u32 wq_size; /* size of the WQs (sq+rq) allocated to the mmaped area 
*/
-   __u32 reserved;
+   __u8  virtwq;  /* flag to indicate if virtual WQ are to be used or not 
*/
+   __u8  kernel_ver;
+   __u8  reserved[2];
 };
 
 struct nes_alloc_pd_resp {
@@ -63,6 +74,10 @@ struct nes_create_cq_req {
__u64 user_cq_buffer;
 };
 
+struct nes_create_qp_req {
+   __u64 user_wqe_buffers;
+};
+
 enum iwnes_memreg_type {
IWNES_MEMREG_TYPE_MEM = 0x,
IWNES_MEMREG_TYPE_QP = 0x0001,
diff --git a/drivers/infiniband/hw/nes/nes_utils.c 
b/drivers/infiniband/hw/nes/nes_utils.c
index 1d478e0..b6aa6d3 100644
--- a/drivers/infiniband/hw/nes/nes_utils.c
+++ b/drivers/infiniband/hw/nes/nes_utils.c
@@ -50,19 +50,8 @@
 
 #include nes.h
 
-#define BITMASK(X) (1L  (X))
-#define NES_CRC_WID 32
-
 static u16 nes_read16_eeprom(void __iomem *addr, u16 offset);
 
-static u32 nesCRCTable[256];
-static u32 nesCRCInitialized = 0;
-
-static u32 nesCRCWidMask(u32);
-static u32 nes_crc_table_gen(u32 *, u32, u32, u32);
-static u32 reflect(u32, u32);
-static u32 byte_swap(u32, u32);
-
 u32 mh_detected;
 u32 mh_pauses_sent;
 
@@ -76,7 +65,9 @@ int nes_read_eeprom_values(struct nes_device *nesdev, struct 
nes_adapter *nesada
u16 eeprom_data;
u16 eeprom_offset;
u16 next_section_address;
-   u32 index;
+   u16 sw_section_ver;
+   u8  major_ver = 0;
+   u8  minor_ver = 0;
 
/* TODO: deal with EEPROM endian issues */
if (nesadapter-firmware_eeprom_offset == 0) {
@@ -104,6 +95,9 @@ int nes_read_eeprom_values(struct nes_device *nesdev, struct 
nes_adapter *nesada
printk(Not a valid Software Image = 0x%04X\n, 
eeprom_data);
return -1;
}
+   sw_section_ver = nes_read16_eeprom(nesdev-regs, 
nesadapter-software_eeprom_offset  + 6);
+   nes_debug(NES_DBG_HW, Software section version number = 
0x%04X\n,
+   sw_section_ver);
 
eeprom_data = nes_read16_eeprom(nesdev-regs, eeprom_offset + 
2);
nes_debug(NES_DBG_HW, EEPROM Offset %u (next section)  = 
0x%04X\n,
@@ -179,7 +173,14 @@ int nes_read_eeprom_values(struct nes_device *nesdev, 
struct nes_adapter *nesada
}
eeprom_data = nes_read16_eeprom(nesdev-regs, 
next_section_address + 8);
printk(PFX Firmware version %u.%u\n, (u8)(eeprom_data8), 
(u8)eeprom_data);
+   major_ver = (u8)(eeprom_data  8);
+   minor_ver = (u8)(eeprom_data);
 
+   if (nes_drv_opt  NES_DRV_OPT_DISABLE_VIRT_WQ) {
+   nes_debug(NES_DBG_HW, Virtual WQs have been 
disabled\n);
+   } else if (((major_ver == 2)  (minor_ver  21)) || (major_ver 
 2)) {
+   nesadapter-virtwq = 1;
+   }
nesadapter-firmware_version = (((u32)(u8)(eeprom_data8))   
 16) +
(u32)((u8)eeprom_data);
 
@@ -205,22 +206,60 @@ no_fw_rev:
/* Read the Phy Type array */
eeprom_offset += 10;
eeprom_data = nes_read16_eeprom(nesdev-regs, eeprom_offset);
-   nes_debug(NES_DBG_HW, PhyType: 0x%04x\n, eeprom_data);
+   nesadapter-phy_type[0] = (u8)(eeprom_data  8);
+   nesadapter-phy_type[1] = (u8)eeprom_data;
 
/* Read the port array */
eeprom_offset += 2;
eeprom_data = nes_read16_eeprom(nesdev-regs, eeprom_offset);
+   nesadapter-phy_type[2] = (u8)(eeprom_data  8);
+   nesadapter-phy_type[3] = (u8)eeprom_data;
/* port_count is set by soft reset reg */
-   for (index = 0; index  4; index++) {
-   nesadapter-ports[index] = eeprom_data

[ewg] RE: [PATCH 10/14 v2] nes: eeprom and phy routines

2007-10-31 Thread Glenn Grundstrom
   +/*
   +Everything you wanted to know about CRC algorithms, but 
 were afraid to ask
   + for fear that errors in your understanding might be 
 detected. Version  : 3.
 
 etc etc... can all this be replaced with what's in lib/crc32.c?  (I
 hope so)

Replacing this code is already in the works.

Glenn.

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


[ewg] RE: [PATCH 1/14 v2] nes: module and device initialization

2007-10-28 Thread Glenn Grundstrom
 
 OK, on a process level, my plan is to pull the current driver into a
 neteffect branch in my git tree with the intention of merging it for
 2.6.25.  I'll let you know when that's ready (probably early next
 week).  I'll probably do some cleanups there, and you can send me
 cleanup/fix patches against that branch any time too.  We should try
 to keep the cycle time short: the interval between the first posting
 of this driver and the current one was pretty long, and there's a lot
 of cleanup to do to get ready for the next merge window.  Does that
 plan make sense?
 
  - R.
 

Thanks Roland.  Let me know when you have your branch ready.

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


[ewg] RE: libnes library: autogen.sh issue

2007-10-21 Thread Glenn Grundstrom
Vlad,
 
Should be fixed now.
 
Thanks,
Glenn.



From: Vladimir Sokolovsky [mailto:[EMAIL PROTECTED] 
Sent: Sunday, October 21, 2007 3:59 AM
To: Glenn Grundstrom
Cc: ewg@lists.openfabrics.org
Subject: libnes library: autogen.sh issue


Hello Glenn,
There is an issue with autogen.sh file in the libnes library:
libnes# sh ./autogen.sh
: not foundh: 2:
set: 3: Illegal option -
 
Please run 'dos2unix autogen.sh'
 
 
Regards,
Vladimir
___
ewg mailing list
ewg@lists.openfabrics.org
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/ewg

[ewg] RE: [PATCH 3/14] nes: connection manager routines

2007-08-08 Thread Glenn Grundstrom
This code is far from a TCP stack.  It's main purpose is to exchange
RDMA MPA request/response messages that are required by the iWarp specs
and therefore needed by our hardware.  All RNIC hardware vendors need
this MPA message exchange, including those already accepted into
kernel.org.  Do you have an alternative suggestion?

Thanks,
Glenn.

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Andi Kleen
Sent: Wednesday, August 08, 2007 7:41 AM
To: Glenn Grundstrom
Cc: [EMAIL PROTECTED]; ewg@lists.openfabrics.org; [EMAIL PROTECTED]
Subject: Re: [PATCH 3/14] nes: connection manager routines

[EMAIL PROTECTED] writes:

 NetEffect connection manager routines.

This seems more like a new TCP stack. I don't think such code is
appropiate, since Linux already has one.

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