[ewg] [GIT PULL] ofed_1_2 - Chelsio bug fixes

Steve Wise swise at opengridcomputing.com
Thu Apr 12 10:59:44 PDT 2007


Vlad,

Please pull these Chelsio cxgb3 and iw_cxgb3 fixes from

git://git.openfabrics.org/~swise/ofed_1_2 ofed_1_2

Short log
--------- 
Divy Le Ray:
      Fix a deadlock when the interface s configured down and
      The MAC watchdog was failing if the peer interface was brought down.
      Remove specific CPL handler.

Steve Wise:
      Initialize cpu_idx field in cpl_close_listserv_req message.
      Backport rtnl_trylock() for Chelsio Driver.
      Add set_tcb_rpl_handler.


Log
--- 

commit f0aa52b40e1da13b06c8ed93f24cf55a905e906d
Author: Steve Wise <swise at opengridcomputing.com>
Date:   Wed Apr 11 14:44:45 2007 -0500

    Add set_tcb_rpl_handler.
    
    The Ethernet Driver no longer handles SET_TCB replies.
    
    Signed-off-by: Steve Wise <swise at opengridcomputing.com>

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index 8c82226..36ab39e 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -2028,6 +2028,17 @@ static int sched(struct t3cdev *tdev, st
 	return 0;
 }
 
+static int set_tcb_rpl(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
+{
+	struct cpl_set_tcb_rpl *rpl = cplhdr(skb);
+	
+	if (rpl->status != CPL_ERR_NONE) {
+		printk(KERN_ERR MOD "Unexpected SET_TCB_RPL status %u "
+		       "for tid %u\n", rpl->status, GET_TID(rpl));
+	}
+	return CPL_RET_BUF_DONE;
+}
+
 int __init iwch_cm_init(void)
 {
 	skb_queue_head_init(&rxq);
@@ -2055,6 +2066,7 @@ int __init iwch_cm_init(void)
 	t3c_handlers[CPL_ABORT_REQ_RSS] = sched;
 	t3c_handlers[CPL_RDMA_TERMINATE] = sched;
 	t3c_handlers[CPL_RDMA_EC_STATUS] = sched;
+	t3c_handlers[CPL_SET_TCB_RPL] = set_tcb_rpl;
 
 	/*
 	 * These are the real handlers that are called from a

commit ce30b4b75ac210fb5b6857897e10112bbff194e1
Author: Divy Le Ray <divy at chelsio.com>
Date:   Wed Apr 11 14:44:45 2007 -0500

    Remove specific CPL handler.
    Add missing CPL handler.
    Add missing register setting when the interface is brought up.
    
    Signed-off-by: Divy Le Ray <divy at chelsio.com>

diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 859cfe3..475c428 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -766,6 +766,8 @@ static int cxgb_up(struct adapter *adap)
 		if (err)
 			goto out;
 
+		t3_write_reg(adap, A_ULPRX_TDDP_PSZ, V_HPZ0(PAGE_SHIFT - 12));
+		
 		err = setup_sge_qsets(adap);
 		if (err)
 			goto out;
diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
index b56e679..3353171 100644
--- a/drivers/net/cxgb3/cxgb3_offload.c
+++ b/drivers/net/cxgb3/cxgb3_offload.c
@@ -741,17 +741,6 @@ static int do_act_establish(struct t3cde
 	}
 }
 
-static int do_set_tcb_rpl(struct t3cdev *dev, struct sk_buff *skb)
-{
-	struct cpl_set_tcb_rpl *rpl = cplhdr(skb);
-
-	if (rpl->status != CPL_ERR_NONE)
-		printk(KERN_ERR
-		       "Unexpected SET_TCB_RPL status %u for tid %u\n",
-		       rpl->status, GET_TID(rpl));
-	return CPL_RET_BUF_DONE;
-}
-
 static int do_trace(struct t3cdev *dev, struct sk_buff *skb)
 {
 	struct cpl_trace_pkt *p = cplhdr(skb);
@@ -1213,7 +1202,8 @@ void __init cxgb3_offload_init(void)
 	t3_register_cpl_handler(CPL_CLOSE_CON_RPL, do_hwtid_rpl);
 	t3_register_cpl_handler(CPL_ABORT_REQ_RSS, do_abort_req_rss);
 	t3_register_cpl_handler(CPL_ACT_ESTABLISH, do_act_establish);
-	t3_register_cpl_handler(CPL_SET_TCB_RPL, do_set_tcb_rpl);
+	t3_register_cpl_handler(CPL_SET_TCB_RPL, do_hwtid_rpl);
+	t3_register_cpl_handler(CPL_GET_TCB_RPL, do_hwtid_rpl);
 	t3_register_cpl_handler(CPL_RDMA_TERMINATE, do_term);
 	t3_register_cpl_handler(CPL_RDMA_EC_STATUS, do_hwtid_rpl);
 	t3_register_cpl_handler(CPL_TRACE_PKT, do_trace);
diff --git a/drivers/net/cxgb3/regs.h b/drivers/net/cxgb3/regs.h
index f8be41c..e5a5534 100644
--- a/drivers/net/cxgb3/regs.h
+++ b/drivers/net/cxgb3/regs.h
@@ -1234,9 +1234,15 @@ #define A_ULPRX_ISCSI_ULIMIT 0x510
 
 #define A_ULPRX_ISCSI_TAGMASK 0x514
 
+#define S_HPZ0    0
+#define M_HPZ0    0xf
+#define V_HPZ0(x) ((x) << S_HPZ0)
+#define G_HPZ0(x) (((x) >> S_HPZ0) & M_HPZ0)
+
 #define A_ULPRX_TDDP_LLIMIT 0x51c
 
 #define A_ULPRX_TDDP_ULIMIT 0x520
+#define A_ULPRX_TDDP_PSZ 0x528
 
 #define A_ULPRX_STAG_LLIMIT 0x52c
 

commit 5a20a3c872ba59675db2bf895806f794506b5692
Author: Divy Le Ray <divy at chelsio.com>
Date:   Wed Apr 11 14:44:44 2007 -0500

    The MAC watchdog was failing if the peer interface was brought down.
    
    Signed-off-by: Divy Le Ray <divy at chelsio.com>

diff --git a/drivers/net/cxgb3/common.h b/drivers/net/cxgb3/common.h
index 97128d8..8d13796 100644
--- a/drivers/net/cxgb3/common.h
+++ b/drivers/net/cxgb3/common.h
@@ -478,8 +478,11 @@ struct cmac {
 	struct adapter *adapter;
 	unsigned int offset;
 	unsigned int nucast;	/* # of address filters for unicast MACs */
-	unsigned int tcnt;
-	unsigned int xcnt;
+	unsigned int tx_tcnt;
+	unsigned int tx_xcnt;
+	u64 tx_mcnt;
+	unsigned int rx_xcnt;
+	u64 rx_mcnt;
 	unsigned int toggle_cnt;
 	unsigned int txen;
 	struct mac_stats stats;
diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 7358016..859cfe3 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -196,15 +196,13 @@ void t3_os_link_changed(struct adapter *
 
 	if (link_stat != netif_carrier_ok(dev)) {
 		if (link_stat) {
-			t3_set_reg_field(adapter,
-					 A_XGM_TXFIFO_CFG + mac->offset,
-					 F_ENDROPPKT, 0);
+			t3_mac_enable(mac, MAC_DIRECTION_RX);
 			netif_carrier_on(dev);
 		} else {
 			netif_carrier_off(dev);
-			t3_set_reg_field(adapter,
-					 A_XGM_TXFIFO_CFG + mac->offset,
-					 F_ENDROPPKT, F_ENDROPPKT);
+			pi->phy.ops->power_down(&pi->phy, 1);
+			t3_mac_disable(mac, MAC_DIRECTION_RX);
+			t3_link_start(&pi->phy, mac, &pi->link_config);
 		}
 
 		link_report(dev);
diff --git a/drivers/net/cxgb3/xgmac.c b/drivers/net/cxgb3/xgmac.c
index 94aaff0..a506792 100644
--- a/drivers/net/cxgb3/xgmac.c
+++ b/drivers/net/cxgb3/xgmac.c
@@ -367,7 +367,8 @@ int t3_mac_enable(struct cmac *mac, int 
 	int idx = macidx(mac);
 	struct adapter *adap = mac->adapter;
 	unsigned int oft = mac->offset;
-
+	struct mac_stats *s = &mac->stats;
+	
 	if (which & MAC_DIRECTION_TX) {
 		t3_write_reg(adap, A_XGM_TX_CTRL + oft, F_TXEN);
 		t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CFG_CH0 + idx);
@@ -376,10 +377,16 @@ int t3_mac_enable(struct cmac *mac, int 
 		t3_set_reg_field(adap, A_TP_PIO_DATA, 1 << idx, 1 << idx);
 
 		t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CNT_CH0 + idx);
-		mac->tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap,
-							    A_TP_PIO_DATA)));
-		mac->xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
-						A_XGM_TX_SPI4_SOP_EOP_CNT)));
+		mac->tx_mcnt = s->tx_frames;
+		mac->tx_tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap,
+							A_TP_PIO_DATA)));
+		mac->tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
+						A_XGM_TX_SPI4_SOP_EOP_CNT +
+						oft)));
+		mac->rx_mcnt = s->rx_frames;
+		mac->rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
+						A_XGM_RX_SPI4_SOP_EOP_CNT +
+						oft)));
 		mac->txen = F_TXEN;
 		mac->toggle_cnt = 0;
 	}
@@ -392,6 +399,7 @@ int t3_mac_disable(struct cmac *mac, int
 {
 	int idx = macidx(mac);
 	struct adapter *adap = mac->adapter;
+	int val;
 
 	if (which & MAC_DIRECTION_TX) {
 		t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
@@ -401,44 +409,89 @@ int t3_mac_disable(struct cmac *mac, int
 		t3_set_reg_field(adap, A_TP_PIO_DATA, 1 << idx, 1 << idx);
 		mac->txen = 0;
 	}
-	if (which & MAC_DIRECTION_RX)
+	if (which & MAC_DIRECTION_RX) {
+		t3_set_reg_field(mac->adapter, A_XGM_RESET_CTRL + mac->offset,
+				 F_PCS_RESET_, 0);
+		msleep(100);
 		t3_write_reg(adap, A_XGM_RX_CTRL + mac->offset, 0);
+		val = F_MAC_RESET_;
+		if (is_10G(adap))
+			val |= F_PCS_RESET_;
+		else if (uses_xaui(adap))
+			val |= F_PCS_RESET_ | F_XG2G_RESET_;
+		else
+			val |= F_RGMII_RESET_ | F_XG2G_RESET_;
+		t3_write_reg(mac->adapter, A_XGM_RESET_CTRL + mac->offset, val);
+	}
 	return 0;
 }
 
 int t3b2_mac_watchdog_task(struct cmac *mac)
 {
 	struct adapter *adap = mac->adapter;
-	unsigned int tcnt, xcnt;
+	struct mac_stats *s = &mac->stats;
+	unsigned int tx_tcnt, tx_xcnt;
+	unsigned int tx_mcnt = s->tx_frames;
+	unsigned int rx_mcnt = s->rx_frames;
+	unsigned int rx_xcnt;
 	int status;
 
-	t3_write_reg(adap, A_TP_PIO_ADDR, A_TP_TX_DROP_CNT_CH0 + macidx(mac));
-	tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap, A_TP_PIO_DATA)));
-	xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap, 
-					   A_XGM_TX_SPI4_SOP_EOP_CNT +
-					   mac->offset)));
-
-	if (tcnt != mac->tcnt && xcnt == 0 && mac->xcnt == 0) {
-		if (mac->toggle_cnt > 4) {
-			t3b2_mac_reset(mac);
+	if (tx_mcnt == mac->tx_mcnt) {
+		tx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
+						A_XGM_TX_SPI4_SOP_EOP_CNT +
+					       	mac->offset)));
+		if (tx_xcnt == 0) {
+			t3_write_reg(adap, A_TP_PIO_ADDR,
+				     A_TP_TX_DROP_CNT_CH0 + macidx(mac));
+			tx_tcnt = (G_TXDROPCNTCH0RCVD(t3_read_reg(adap,
+						      A_TP_PIO_DATA)));
+		} else {
 			mac->toggle_cnt = 0;
+			return 0;
+		}
+	} else {
+		mac->toggle_cnt = 0;
+		return 0;
+	}
+
+	if (((tx_tcnt != mac->tx_tcnt) &&
+	     (tx_xcnt == 0) && (mac->tx_xcnt == 0)) ||
+	    ((mac->tx_mcnt == tx_mcnt) &&
+	     (tx_xcnt != 0) && (mac->tx_xcnt != 0))) {
+		if (mac->toggle_cnt > 4)
 			status = 2;
-		} else {
-			t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
-			t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);
-			t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset,
-				     mac->txen);
-			t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);
-			mac->toggle_cnt++;
+		else 
 			status = 1;
-		}	
 	} else {
 		mac->toggle_cnt = 0;
-		status = 0;
+		return 0;
 	}
-	mac->tcnt = tcnt;
-	mac->xcnt = xcnt;
 
+	if (rx_mcnt != mac->rx_mcnt)
+		rx_xcnt = (G_TXSPI4SOPCNT(t3_read_reg(adap,
+						A_XGM_RX_SPI4_SOP_EOP_CNT +
+						mac->offset)));
+	else 
+		return 0;
+
+	if (mac->rx_mcnt != s->rx_frames && rx_xcnt == 0 && mac->rx_xcnt == 0) 
+		status = 2;
+	
+	mac->tx_tcnt = tx_tcnt;
+	mac->tx_xcnt = tx_xcnt;
+	mac->tx_mcnt = s->tx_frames;
+	mac->rx_xcnt = rx_xcnt;
+	mac->rx_mcnt = s->rx_frames;
+	if (status == 1) {
+		t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, 0);
+		t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);  /* flush */
+		t3_write_reg(adap, A_XGM_TX_CTRL + mac->offset, mac->txen);
+		t3_read_reg(adap, A_XGM_TX_CTRL + mac->offset);  /* flush */
+		mac->toggle_cnt++;
+	} else if (status == 2) {
+		t3b2_mac_reset(mac);
+		mac->toggle_cnt = 0;
+	}
 	return status;
 }
 

commit 567e6ee8d3c62d1f505dc0a2d92d12859e8c68e1
Author: Divy Le Ray <divy at chelsio.com>
Date:   Wed Apr 11 14:44:44 2007 -0500

    Fix a deadlock when the interface s configured down and
    the watchdog tack is sleeping on rtnl_lock.
    
    Signed-off-by: Divy Le Ray <divy at chelsio.com>

diff --git a/drivers/net/cxgb3/cxgb3_main.c b/drivers/net/cxgb3/cxgb3_main.c
index 81262e5..7358016 100644
--- a/drivers/net/cxgb3/cxgb3_main.c
+++ b/drivers/net/cxgb3/cxgb3_main.c
@@ -2114,7 +2114,9 @@ static void check_t3b2_mac(struct adapte
 {
 	int i;
 
-	rtnl_lock();                      /* synchronize with ifdown */
+	if (!rtnl_trylock())	/* synchronize with ifdown */
+		return;
+
 	for_each_port(adapter, i) {
 		struct net_device *dev = adapter->port[i];
 		struct port_info *p = netdev_priv(dev);

commit 4a117060a593ecc3f3c6e321437362f2882b0159
Author: Steve Wise <swise at opengridcomputing.com>
Date:   Wed Apr 11 14:44:41 2007 -0500

    Backport rtnl_trylock() for Chelsio Driver.
    
    Signed-off-by: Steve Wise <swise at opengridcomputing.com>

diff --git a/kernel_addons/backport/2.6.11/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.11/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.11/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.11_FC4/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.11_FC4/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.11_FC4/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.12/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.12/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.12/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.13/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.13/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.13/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.13_suse10_0_u/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.13_suse10_0_u/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.13_suse10_0_u/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.14/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.14/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.14/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.15/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.15/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.15/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.15_ubuntu606/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.15_ubuntu606/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.15_ubuntu606/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.16/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.16/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.16/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.16_sles10/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.16_sles10/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.16_sles10/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.16_sles10_sp1/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.16_sles10_sp1/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.16_sles10_sp1/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.5_sles9_sp3/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.9_U2/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.9_U2/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.9_U2/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.9_U3/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.9_U3/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.9_U3/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif
diff --git a/kernel_addons/backport/2.6.9_U4/include/linux/rtnetlink.h b/kernel_addons/backport/2.6.9_U4/include/linux/rtnetlink.h
new file mode 100644
index 0000000..36344d7
--- /dev/null
+++ b/kernel_addons/backport/2.6.9_U4/include/linux/rtnetlink.h
@@ -0,0 +1,10 @@
+#ifndef BACKPORT_RTNETLINK_2_6_16
+#define BACKPORT_RTNETLINK_2_6_16
+#include_next <linux/rtnetlink.h>
+
+static inline int rtnl_trylock(void)
+{
+	return !rtnl_shlock_nowait();
+}
+
+#endif

commit cd78b9f2815ca4e8aa99f1eb4d198f5aa5f8fd37
Author: Steve Wise <swise at opengridcomputing.com>
Date:   Wed Apr 11 11:44:46 2007 -0500

    Initialize cpu_idx field in cpl_close_listserv_req message.
    
    Signed-off-by: Steve Wise <swise at opengridcomputing.com>

diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
index ac91a96..8c82226 100644
--- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
+++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
@@ -1188,6 +1188,7 @@ static int listen_stop(struct iwch_liste
 	}
 	req = (struct cpl_close_listserv_req *) skb_put(skb, sizeof(*req));
 	req->wr.wr_hi = htonl(V_WR_OP(FW_WROPCODE_FORWARD));
+	req->cpu_idx = 0;
 	OPCODE_TID(req) = htonl(MK_OPCODE_TID(CPL_CLOSE_LISTSRV_REQ, ep->stid));
 	skb->priority = 1;
 	ep->com.tdev->send(ep->com.tdev, skb);





More information about the ewg mailing list