mirror of
https://github.com/ipxe/ipxe
synced 2025-12-19 11:00:27 +03:00
[infiniband] Centralise assumption of 2048-byte payloads
IPoIB and the SMA have separate constants for the packet size to be used to I/O buffer allocations. Merge these into the single IB_MAX_PAYLOAD_SIZE constant. (Various other points in the Infiniband stack have hard-coded assumptions of a 2048-byte payload; we don't currently support variable MTUs.)
This commit is contained in:
@@ -345,6 +345,13 @@ int ib_post_recv ( struct ib_device *ibdev, struct ib_queue_pair *qp,
|
||||
struct io_buffer *iobuf ) {
|
||||
int rc;
|
||||
|
||||
/* Check packet length */
|
||||
if ( iob_tailroom ( iobuf ) < IB_MAX_PAYLOAD_SIZE ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %#lx wrong RX buffer size (%zd)\n",
|
||||
ibdev, qp->qpn, iob_tailroom ( iobuf ) );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* Check queue fill level */
|
||||
if ( qp->recv.fill >= qp->recv.num_wqes ) {
|
||||
DBGC ( ibdev, "IBDEV %p QPN %#lx receive queue full\n",
|
||||
|
||||
Reference in New Issue
Block a user