[ipxe-devel] [PATCH] [ipoib] Fix cache discarder

Michael Brown mcb30 at ipxe.org
Mon Jun 1 17:10:02 UTC 2015


On 13/01/15 11:02, Wissam Shoukair wrote:
> We found an issue in ipoib_discard_remac().
> 1. IPoIB discarder is not valid for non-Infiniband devices.
> 2. owner data in ibdev is netdev struct pointer and not ipoib struct pointer.
>
> This bug made some servers hang when trying to do HTTP boot over IB.

Thanks.  The patch had some issues:

>   	for_each_ibdev ( ibdev ) {
> -		ipoib = ib_get_ownerdata ( ibdev );
> +		netdev = ib_get_ownerdata ( ibdev );
> +		/* Skip non-Infiniband ports */
> +		if ( netdev->op != &ipoib_operations )
> +			continue;

I don't think there are any circumstances (at least in the current iPXE 
master) in which an ibdev will have a valid netdev as its ownerdata but 
where that netdev will be something other than an IPoIB device.

> +		if ( list_empty ( &ipoib->peers ) )
> +			return 0;

This check is unnecessary: if the list is empty than 
list_for_each_entry_reverse_safe() will be a no-op.  In such a 
circumstance, we probably want to continue to iterate over any other 
IPoIB devices, rather than aborting (and returning a possibly-incorrect 
zero item count).

I've committed a hopefully-fixed version of this patch:

   http://git.ipxe.org/ipxe.git/commitdiff/6b7157c

Please let me know if this does not fix your issue.

Thanks,

Michael



More information about the ipxe-devel mailing list