mirror of
https://github.com/ipxe/ipxe
synced 2026-01-12 08:28:37 +03:00
[infiniband] Generate more specific errors in response to failure MADs
Generate errors within individual MAD transaction consumers such as ib_pathrec.c and ib_mcast.c, rather than within ib_mi.c. This allows for more meaningful error messages to eventually be displayed to the user.
This commit is contained in:
@@ -76,18 +76,14 @@ static int ib_mi_handle ( struct ib_device *ibdev,
|
||||
struct ib_mad_hdr *hdr = &mad->hdr;
|
||||
struct ib_mad_transaction *madx;
|
||||
struct ib_mad_agent *agent;
|
||||
int rc;
|
||||
|
||||
/* Look for a matching transaction by TID */
|
||||
list_for_each_entry ( madx, &mi->madx, list ) {
|
||||
if ( memcmp ( &hdr->tid, &madx->mad.hdr.tid,
|
||||
sizeof ( hdr->tid ) ) != 0 )
|
||||
continue;
|
||||
/* Get transaction result status */
|
||||
rc = ( ( hdr->status == htons ( IB_MGMT_STATUS_OK ) ) ?
|
||||
0 : -EIO );
|
||||
/* Found a matching transaction */
|
||||
madx->op->complete ( ibdev, mi, madx, rc, mad, av );
|
||||
madx->op->complete ( ibdev, mi, madx, 0, mad, av );
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user