HomeFreeBSD

cxgbei: Fix a race between transfer setup and a peer reset.

Description

cxgbei: Fix a race between transfer setup and a peer reset.

In 4427ac3675f9, the TOM driver stopped sending work requests to
program iSCSI page pods directly and instead queued them to be written
asynchronously with iSCSI PDUs. The queue of mbufs to send is
protected by the inp lock. However, the inp cannot be safely obtained
from the toep since a RST from the remote peer might have cleared
toep->inp asynchronously in an ithread. To fix, obtain the inp from
the socket as is already done in icl_cxgbei_conn_pdu_queue_cb() and
fail the new transfer setup with ECONNRESET if the connection has been
reset.

To avoid passing sockets or inps into the page pod routines, pull the
mbufq out of the two relevant page pod routines such that the routines
queue new work request mbufs to a caller-supplied mbufq.

Reported by: Jithesh Arakkan @ Chelsio
Fixes: 4427ac3675f91df039d54a23518132e0e0fede86

(cherry picked from commit f949967c8eb3ab5e5a965e3cf07a726dfdc81263)

Details

Provenance
jhbAuthored on May 20 2021, 11:03 PM
Parents
rGcc44e4e55b4a: cxgbei: Support iSCSI offload on T6.
Branches
Unknown
Tags
Unknown