• Julian Wiedmann's avatar
    s390/qeth: make queue lock a proper spinlock · a1668474
    Julian Wiedmann authored
    queue->state is a ternary spinlock in disguise, used by
    OSA's TX completion path to lock the Output Queue and flush any pending
    packets on it to the device. If the Queue is already locked by our TX
    code, setting the lock word to QETH_OUT_Q_LOCKED_FLUSH lets the TX
    completion code move on - the TX path will later take care of things
    when it unlocks the Queue.
    
    This sort of DIY locking is a non-starter of course, just let the
    TX completion path block on the spinlock when necessary. If that ends up
    causing additional latency due to lock contention, then converting
    the OSA path to use xmit_more is the right way to go forward.
    
    Also slightly expand the locked section and capture all of
    qeth_do_send_packet(), so that the update for the 'bufs_pack' statistics
    is done race-free.
    
    While reworking the TX completion path's code, remove a barrier() that
    doesn't make any sense.
    Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    a1668474
qeth_core_main.c 184 KB