aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/net/ipoib.c
diff options
context:
space:
mode:
authorMichael Brown <mcb30@etherboot.org>2007-09-17 19:01:10 +0100
committerMichael Brown <mcb30@etherboot.org>2007-09-17 19:01:10 +0100
commit267a4483abade6f352263cf159052608a0c03833 (patch)
treecb9693f80fc1d3d3c63107ba6fa5269512754d0c /src/drivers/net/ipoib.c
parent387a1a85561bd828d82bc4b69ca18dab5fc10831 (diff)
downloadipxe-267a4483abade6f352263cf159052608a0c03833.tar.gz
Added an almost obscene amount of debugging and assertion code while
tracking down a bug that turned out to be a free_iob() used where I needed a netdev_tx_complete(). This left the freed I/O buffer on the net device's TX list, with bad, bad consequences later. Also fixed the bug in question.
Diffstat (limited to 'src/drivers/net/ipoib.c')
-rw-r--r--src/drivers/net/ipoib.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/drivers/net/ipoib.c b/src/drivers/net/ipoib.c
index 077912b3..f45012ee 100644
--- a/src/drivers/net/ipoib.c
+++ b/src/drivers/net/ipoib.c
@@ -47,22 +47,22 @@ extern struct ib_address_vector hack_ipoib_bcast_av;
#define IPOIB_MTU 2048
/** Number of IPoIB data send work queue entries */
-#define IPOIB_DATA_NUM_SEND_WQES 4
+#define IPOIB_DATA_NUM_SEND_WQES 2
/** Number of IPoIB data receive work queue entries */
-#define IPOIB_DATA_NUM_RECV_WQES 4
+#define IPOIB_DATA_NUM_RECV_WQES 2
/** Number of IPoIB data completion entries */
-#define IPOIB_DATA_NUM_CQES 8
+#define IPOIB_DATA_NUM_CQES 32
/** Number of IPoIB metadata send work queue entries */
-#define IPOIB_META_NUM_SEND_WQES 4
+#define IPOIB_META_NUM_SEND_WQES 2
/** Number of IPoIB metadata receive work queue entries */
-#define IPOIB_META_NUM_RECV_WQES 4
+#define IPOIB_META_NUM_RECV_WQES 2
/** Number of IPoIB metadata completion entries */
-#define IPOIB_META_NUM_CQES 8
+#define IPOIB_META_NUM_CQES 32
/** An IPoIB queue set */
struct ipoib_queue_set {
@@ -205,6 +205,14 @@ static int ipoib_rx ( struct io_buffer *iobuf, struct net_device *netdev ) {
}
/* Strip off IPoIB header */
+ int len = iob_len ( iobuf );
+ DBG ( "WTF iob_len = %zd\n", len );
+ if ( len < 0 ) {
+ DBG_HD ( iobuf, sizeof ( *iobuf ) );
+ DBG ( "locking\n" );
+ while ( 1 ) {}
+ }
+
iob_pull ( iobuf, sizeof ( *ipoib_hdr ) );
/* Hand off to network-layer protocol */
@@ -492,7 +500,7 @@ static int ipoib_transmit ( struct net_device *netdev,
/* No path entry - get path record */
rc = ipoib_get_path_record ( ipoib,
&ipoib_pshdr->peer.gid );
- free_iob ( iobuf );
+ netdev_tx_complete ( netdev, iobuf );
return rc;
}
av.dest_qp = ntohl ( ipoib_pshdr->peer.qpn );