mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 16:01:38 +03:00
[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.
This commit is contained in:
@@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user