• James Smart's avatar
    scsi: lpfc: Fix nvmet async receive buffer replenishment · 4552e0f6
    James Smart authored
    Under circustances with high load, the driver is running out of async
    receive buffers which may result in one of the following messages:
    
    0:6401 RQE Error x13, posted 226 err_cnt 0: 925c6050 925c604e 925c5d54
    
    or
    
    0:2885 Port Status Event: port status reg 0x81800000,
           port smphr reg 0xc000, error 1=0x52004a01, error 2=0x0
    
    The driver is waiting for full io completion before returning receive
    buffers to the adapter. There is no need for such a relationship.
    
    Whenever a new command is received from the wire, the driver will have two
    contexts - an io context (ctxp) and a receive buffer context.  In current
    code, the receive buffer context stays 1:1 with the io and won't be
    reposted to the hardware until the io completes. There is no need for such
    a relationship.
    
    Change the driver so that up on successful handing of the command to the
    transport, where the transport has copied what it needed thus the buffer is
    returned to the driver, have the driver immediately repost the buffer to
    the hardware. If the command cannot be successfully handed to the transport
    as transport resources are temporarily busy, have the driver allocate a new
    and separate receive buffer and post it to the hardware so that hardware
    can continue while the command is queued for the transport.
    
    When an io is complete, the transport returns the io context to the driver,
    and the driver may be waiting for more contexts, thus immediately reuse the
    io context. In this path, there was a buffer posted when the receive buffer
    was queued waiting for an io context so a replacement is not needed in the
    new code additions. Thus, exempt this the context reuse case from the
    buffer reposting.
    Signed-off-by: default avatarDick Kennedy <dick.kennedy@broadcom.com>
    Signed-off-by: default avatarJames Smart <jsmart2021@gmail.com>
    Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
    4552e0f6
lpfc_nvmet.c 97 KB