• Sean Bruno's avatar
    Change EM_MULTIQUEUE to a real kernconf entry and enable support for · 23c9098b
    Sean Bruno authored
    up to 2 rx/tx queues for the 82574.
    
    Program the 82574 to enable 5 msix vectors, assign 1 to each rx queue,
    1 to each tx queue and 1 to the link handler.
    
    Inspired by DragonFlyBSD, enable some RSS logic for handling tx queue
    handling/processing.
    
    Move multiqueue handler functions so that they line up better in a diff
    review to if_igb.c
    
    Always enqueue tx work to be done in em_mq_start, if unable to acquire
    the TX lock, then this will be processed in the background later by the
    taskqueue.  Remove mbuf argument from em_start_mq_locked() as the work
    is always enqueued.  (stolen from igb)
    
    Setup TARC, TXDCTL and RXDCTL registers for better performance and stability
    in multiqueue and singlequeue implementations. Handle Intel errata  3 and
    generic multiqueue behavior with the initialization of TARC(0) and TARC(1)
    
    Bind interrupt threads to cpus in order.  (stolen from igb)
    
    Add 2 new DDB functions, one to display the queue(s) and their settings and
    one to reset the adapter.  Primarily used for debugging.
    
    In the multiqueue configuration, bump RXD and TXD ring size to max for the
    adapter (4096).  Setup an RDTR of 64 and an RADV of 128 in multiqueue configuration
    to cut down on the number of interrupts.  RADV was arbitrarily set to 2x RDTR
    and can be adjusted as needed.
    
    Cleanup the display in top a bit to make it clearer where the taskqueue threads
    are running and what they should be doing.
    
    Ensure that both queues are processed by em_local_timer() by writing them both
    to the IMS register to generate soft interrupts.
    
    Ensure that an soft interrupt is generated when em_msix_link() is run so that
    any races between assertion of the link/status interrupt and a rx/tx interrupt
    are handled.
    
    Document existing tuneables: hw.em.eee_setting, hw.em.msix, hw.em.smart_pwr_down, hw.em.sbp
    
    Document use of hw.em.num_queues and the new kernel option EM_MULTIQUEUE
    
    Thanks to Intel for their continued support of FreeBSD.
    
    Reviewed by:	erj jfv hiren gnn wblock
    Obtained from:	Intel Corporation
    MFC after:	2 weeks
    Relnotes:	Yes
    Sponsored by:	Limelight Networks
    Differential Revision:	https://reviews.freebsd.org/D1994
    23c9098b