Lines Matching full:exchange

11  * Fibre Channel exchange and sequence handling.
38 * fc_exch_mgr holds the exchange state for an N port
40 * fc_exch holds state for one exchange and links to its active sequence.
46 * struct fc_exch_pool - Per cpu exchange pool
47 * @next_index: Next possible free exchange index
54 * This structure manages per cpu exchanges in array of exchange pointers.
69 * struct fc_exch_mgr - The Exchange Manager (EM).
72 * @min_xid: Minimum exchange ID
73 * @max_xid: Maximum exchange ID
74 * @ep_pool: Reserved exchange pointers
77 * @lport: Local exchange port
81 * It manages the allocation of exchange IDs.
105 * @ema_list: Exchange Manager Anchor list
106 * @mp: Exchange Manager associated with this anchor
131 * The exchange manager is one by default in libfc but LLD may choose
132 * to have one per CPU. The sequence manager is one per exchange manager
138 * qualified by exchange ID, which one might think it would be.
140 * per session. For most targets we could treat this limit as per exchange.
142 * The exchange and its sequence are freed when the last sequence is received.
143 * It's possible for the remote port to leave an exchange open without
148 * Exchanges are reference counted and exchange gets freed when the reference
165 * with exchange and sequence tuple.
167 * When we receive the next sequence on the same exchange, we can
201 * - exchange refcnt can be done atomicly without locks.
244 * fc_exch_hold() - Increment an exchange's reference count
255 * @ep: The exchange to that will use the header
305 * fc_exch_release() - Decrement an exchange's reference count
306 * @ep: Exchange to be released
308 * If the reference count reaches zero and the exchange is complete,
326 * @ep: The exchange whose timer to be canceled
331 FC_EXCH_DBG(ep, "Exchange timer canceled\n"); in fc_exch_timer_cancel()
337 * fc_exch_timer_set_locked() - Start a timer for an exchange w/ the
338 * the exchange lock held
339 * @ep: The exchange whose timer will start
342 * Used for upper level protocols to time out the exchange.
343 * The timer is cancelled when it fires or when the exchange completes.
351 FC_EXCH_DBG(ep, "Exchange timer armed : %d msecs\n", timer_msec); in fc_exch_timer_set_locked()
356 FC_EXCH_DBG(ep, "Exchange already queued\n"); in fc_exch_timer_set_locked()
362 * fc_exch_timer_set() - Lock the exchange and set the timer
363 * @ep: The exchange whose timer will start
374 * fc_exch_done_locked() - Complete an exchange with the exchange lock held
375 * @ep: The exchange that is complete
404 * fc_exch_ptr_get() - Return an exchange from an exchange pool
405 * @pool: Exchange Pool to get an exchange from
406 * @index: Index of the exchange within the pool
408 * Use the index to get an exchange from within an exchange pool. exches
409 * will point to an array of exchange pointers. The index will select
410 * the exchange within the array.
420 * fc_exch_ptr_set() - Assign an exchange to a slot in an exchange pool
421 * @pool: The pool to assign the exchange to
422 * @index: The index in the pool where the exchange will be assigned
423 * @ep: The exchange to assign to the pool
432 * fc_exch_delete() - Delete an exchange
433 * @ep: The exchange to be deleted
505 * Update the exchange and sequence flags, in fc_seq_send_locked()
517 * fc_seq_send() - Send a frame using existing sequence/exchange pair
518 * @lport: The local port that the exchange will be sent on
520 * @fp: The frame to be sent on the exchange
538 * fc_seq_alloc() - Allocate a sequence for a given exchange
539 * @ep: The exchange to allocate a new sequence for
542 * We don't support multiple originated sequences on the same exchange.
543 * By implication, any previously originated sequence on this exchange
559 * exchange as the supplied sequence
560 * @sp: The sequence/exchange to get a new sequence for
573 * fc_seq_start_next() - Lock the exchange and get a new sequence
574 * for a given sequence/exchange pair
575 * @sp: The sequence/exchange to get a new exchange for
590 * Set the response handler for the exchange associated with a sequence.
618 * fc_exch_abort_locked() - Abort an exchange
619 * @ep: The exchange to be aborted
622 * Abort an exchange and sequence. Generally called because of a
623 * exchange timeout or an abort from the upper layer.
626 * timer_msec value is specified then exchange resp handler
684 * fc_seq_exch_abort() - Abort an exchange and sequence
706 * @ep: The exchange to be operated on
761 * fc_exch_timeout() - Handle exchange timer expiration
762 * @work: The work_struct identifying the exchange that timed out
772 FC_EXCH_DBG(ep, "Exchange timed out state %x\n", ep->state); in fc_exch_timeout()
806 * fc_exch_em_alloc() - Allocate an exchange from a specified EM.
807 * @lport: The local port that the exchange is for
808 * @mp: The exchange manager that will allocate the exchange
820 /* allocate memory for exchange */ in fc_exch_em_alloc()
873 * update exchange in fc_exch_em_alloc()
895 * fc_exch_alloc() - Allocate an exchange from an EM on a
897 * @lport: The local port that will own the exchange
898 * @fp: The FC frame that the exchange will be for
900 * This function walks the list of exchange manager(EM)
901 * anchors to select an EM for a new exchange allocation. The
922 * fc_exch_find() - Lookup and hold an exchange
923 * @mp: The exchange manager to lookup the exchange from
924 * @xid: The XID of the exchange to look up
961 * fc_exch_done() - Indicate that an exchange/sequence tuple is complete and
983 * fc_exch_resp() - Allocate a new exchange for a response frame
984 * @lport: The local port that the exchange was for
985 * @mp: The exchange manager to allocate the exchange from
1002 * Set EX_CTX indicating we're responding on this exchange. in fc_exch_resp()
1012 * Allocated exchange has placed the XID in the in fc_exch_resp()
1032 * @mp: The Exchange Manager to lookup the exchange from
1053 * Lookup or create the exchange if we will be creating the sequence. in fc_seq_lookup_recip()
1084 * new sequence - find the exchange in fc_seq_lookup_recip()
1108 * At this point, we have the exchange held. in fc_seq_lookup_recip()
1122 * frame of sequence exchange. This is needed in fc_seq_lookup_recip()
1163 * @mp: The Exchange Manager to lookup the exchange from
1198 * fc_exch_set_addr() - Set the source and destination IDs for an exchange
1199 * @ep: The exchange to set the addresses for
1203 * Note this must be done before the first sequence of the exchange is sent.
1220 * the existing sequence/exchange.
1250 * fc_seq_send_last() - Send a sequence that is the last in the exchange
1404 * @ep: The exchange the abort was on
1409 * exchange abort, ignoring the parameter.
1431 FC_EXCH_DBG(ep, "exch: ABTS rejected, exchange complete\n"); in fc_exch_recv_abts()
1466 * fc_seq_assign() - Assign exchange and sequence for incoming request
1471 * A reference will be held on the exchange/sequence for the caller, which
1503 * @mp: The EM that the exchange is on
1506 * This is used when the other end is originating the exchange
1518 * problem now that we know a new exchange needs to be allocated in fc_exch_recv_req()
1530 * If the RX_ID is 0xffff, don't allocate an exchange. in fc_exch_recv_req()
1567 * response to our initial exchange
1568 * @mp: The EM that the exchange is on
1662 * @mp: The EM that the exchange is on
1681 * @ep: The exchange that the frame is on
1684 * This response would be to an ABTS cancelling an exchange or sequence.
1701 FC_EXCH_DBG(ep, "Exchange timer canceled due to ABTS response\n"); in fc_exch_abts_resp()
1758 * @mp: The EM that the exchange is on
1762 * We may be either the originator or recipient of the exchange.
1886 * fc_exch_reset() - Reset an exchange
1887 * @ep: The exchange to be reset
1923 * fc_exch_pool_reset() - Reset a per cpu exchange pool
1924 * @lport: The local port that the exchange pool is on
1925 * @pool: The exchange pool to be reset
1994 * fc_exch_lookup() - find an exchange
1996 * @xid: The exchange ID
1998 * Returns exchange pointer with hold for caller, or NULL if not found.
2011 * fc_exch_els_rec() - Handler for ELS REC (Read Exchange Concise) requests
2097 * @arg: The exchange that the RRQ is on
2139 * fc_exch_seq_send() - Send a frame using a new exchange and sequence
2143 * @destructor: The destructor for the exchange
2145 * @timer_msec: The timeout period for the exchange
2147 * The exchange response handler is set in this routine to resp()
2149 * occurs or if a response frame is received for the exchange. The
2153 * The exchange destructor handler is also set in this routine.
2154 * The destructor handler is invoked by EM layer when exchange
2156 * resources along with exchange free.
2160 * The timeout value (in msec) for an exchange is set if non zero
2162 * it fires or when the exchange is done. The exchange timeout handler
2238 * @ep: The exchange to send the RRQ on
2241 * the exchange and the seq_cnt range.
2296 struct fc_exch *ep = NULL; /* request or subject exchange */ in fc_exch_els_rrq()
2309 * lookup subject exchange. in fc_exch_els_rrq()
2359 * @lport: The local port to update exchange manager stats
2383 * fc_exch_mgr_add() - Add an exchange manager to a local port's list of EMs
2384 * @lport: The local port to add the exchange manager to
2385 * @mp: The exchange manager to be added to the local port
2408 * fc_exch_mgr_destroy() - Destroy an exchange manager
2422 * @ema: The exchange manager anchor identifying the EM to be deleted
2434 * fc_exch_mgr_list_clone() - Share all exchange manager objects
2435 * @src: Source lport to clone exchange managers from
2436 * @dst: New lport that takes references to all the exchange managers
2455 * fc_exch_mgr_alloc() - Allocate an exchange manager
2509 * Setup per cpu exch pool with entire exchange id range equally in fc_exch_mgr_alloc()
2554 * fc_exch_mgr_free() - Free all exchange managers on a local port
2568 * fc_find_ema() - Lookup and return appropriate Exchange Manager Anchor depending
2619 FC_LPORT_DBG(lport, "Unable to find Exchange Manager Anchor," in fc_exch_recv()
2657 * fc_exch_init() - Initialize the exchange layer for a local port
2658 * @lport: The local port to initialize the exchange layer for
2670 * fc_setup_exch_mgr() - Setup an exchange manager
2688 * to exchange id's lower bits such that all incoming in fc_setup_exch_mgr()
2689 * frames of an exchange gets delivered to the same in fc_setup_exch_mgr()
2690 * cpu on which exchange originated by simple bitwise in fc_setup_exch_mgr()
2691 * AND operation between fc_cpu_mask and exchange id. in fc_setup_exch_mgr()
2706 * fc_destroy_exch_mgr() - Destroy an exchange manager