diff options
author | Michael Brown <mcb30@etherboot.org> | 2008-10-03 03:04:21 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2008-11-11 05:31:06 +0000 |
commit | 0de5f7af6db39ea9173caa0015a63353174d72ce (patch) | |
tree | 8f43e82f5401c9fe02175713718302179885e488 /src/drivers/net/ipoib.c | |
parent | d9751edafa08b2ec3779004d4209400b95884cd4 (diff) | |
download | ipxe-0de5f7af6db39ea9173caa0015a63353174d72ce.tar.gz |
[infiniband] Maintain queue fill level as a property of a work queue
Both queue owners and drivers often need to keep track of the fill
level, so let's make it a generic property.
Diffstat (limited to 'src/drivers/net/ipoib.c')
-rw-r--r-- | src/drivers/net/ipoib.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/drivers/net/ipoib.c b/src/drivers/net/ipoib.c index a56ceb89..55123006 100644 --- a/src/drivers/net/ipoib.c +++ b/src/drivers/net/ipoib.c @@ -57,8 +57,6 @@ struct ipoib_queue_set { struct ib_completion_queue *cq; /** Queue pair */ struct ib_queue_pair *qp; - /** Receive work queue fill level */ - unsigned int recv_fill; /** Receive work queue maximum fill level */ unsigned int recv_max_fill; }; @@ -565,7 +563,7 @@ static void ipoib_data_complete_recv ( struct ib_device *ibdev __unused, if ( completion->syndrome ) { netdev_rx_err ( netdev, iobuf, -EIO ); - goto done; + return; } iob_put ( iobuf, completion->len ); @@ -574,7 +572,7 @@ static void ipoib_data_complete_recv ( struct ib_device *ibdev __unused, "contain GRH\n", ipoib ); DBGC_HD ( ipoib, iobuf->data, iob_len ( iobuf ) ); netdev_rx_err ( netdev, iobuf, -EIO ); - goto done; + return; } iob_pull ( iobuf, sizeof ( struct ib_global_route_header ) ); @@ -583,16 +581,13 @@ static void ipoib_data_complete_recv ( struct ib_device *ibdev __unused, "contain IPoIB header\n", ipoib ); DBGC_HD ( ipoib, iobuf->data, iob_len ( iobuf ) ); netdev_rx_err ( netdev, iobuf, -EIO ); - goto done; + return; } ipoib_pshdr = iob_push ( iobuf, sizeof ( *ipoib_pshdr ) ); /* FIXME: fill in a MAC address for the sake of AoE! */ netdev_rx ( netdev, iobuf ); - - done: - ipoib->data.recv_fill--; } /** @@ -732,7 +727,6 @@ static void ipoib_meta_complete_recv ( struct ib_device *ibdev __unused, } done: - ipoib->meta.recv_fill--; free_iob ( iobuf ); } @@ -747,7 +741,7 @@ static void ipoib_refill_recv ( struct ipoib_device *ipoib, struct io_buffer *iobuf; int rc; - while ( qset->recv_fill < qset->recv_max_fill ) { + while ( qset->qp->recv.fill < qset->recv_max_fill ) { iobuf = alloc_iob ( IPOIB_PKT_LEN ); if ( ! iobuf ) break; @@ -755,7 +749,6 @@ static void ipoib_refill_recv ( struct ipoib_device *ipoib, free_iob ( iobuf ); break; } - qset->recv_fill++; } } |