Skip to content
  • Vincenzo Maffione's avatar
    netmap: fix LOR in iflib_netmap_register · e0e12405
    Vincenzo Maffione authored
    In iflib_device_register(), the CTX_LOCK is acquired first and then
    IFNET_WLOCK is acquired by ether_ifattach(). However, in netmap_hw_reg()
    we do the opposite: IFNET_RLOCK is acquired first, and then CTX_LOCK
    is acquired by iflib_netmap_register(). Fix this LOR issue by wrapping
    the CTX_LOCK/UNLOCK calls in iflib_device_register with an additional
    IFNET_WLOCK. This is safe since the IFNET_WLOCK is recursive.
    
    MFC after:	1 month
    e0e12405