IB/hfi1: Clean up context initialization
Context initialization mixes base context init with sub context init. This is bad because contexts can be reused, and on reuse, reinit things that should not re-initialized. Normalize comments and function names to refer to base context and sub context (not main, shared or slaves). Separate the base context initialization from sub context initialization. hfi1_init_ctxt() cannot return an error so changed to a void and remove error message. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:

committed by
Doug Ledford

parent
637a9a7feb
commit
9b60d2cbe0
@@ -224,13 +224,12 @@ struct hfi1_ctxtdata {
|
||||
* (ignoring forks, dup, etc. for now)
|
||||
*/
|
||||
int cnt;
|
||||
/*
|
||||
* how much space to leave at start of eager TID entries for
|
||||
* protocol use, on each TID
|
||||
*/
|
||||
/* instead of calculating it */
|
||||
/* Device context index */
|
||||
unsigned ctxt;
|
||||
/* non-zero if ctxt is being shared. */
|
||||
/*
|
||||
* non-zero if ctxt can be shared, and defines the maximum number of
|
||||
* sub contexts allowed.
|
||||
*/
|
||||
u16 subctxt_cnt;
|
||||
/* non-zero if ctxt is being shared. */
|
||||
u16 subctxt_id;
|
||||
@@ -1725,12 +1724,10 @@ struct cc_state *get_cc_state_protected(struct hfi1_pportdata *ppd)
|
||||
#define HFI1_PBC_LENGTH_MASK ((1 << 11) - 1)
|
||||
|
||||
/* ctxt_flag bit offsets */
|
||||
/* context has been setup */
|
||||
#define HFI1_CTXT_SETUP_DONE 1
|
||||
/* waiting for a packet to arrive */
|
||||
#define HFI1_CTXT_WAITING_RCV 2
|
||||
/* master has not finished initializing */
|
||||
#define HFI1_CTXT_MASTER_UNINIT 4
|
||||
#define HFI1_CTXT_BASE_UNINIT 4
|
||||
/* waiting for an urgent packet to arrive */
|
||||
#define HFI1_CTXT_WAITING_URG 5
|
||||
|
||||
|
Reference in New Issue
Block a user