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
@@ -176,13 +176,7 @@ int hfi1_create_ctxts(struct hfi1_devdata *dd)
|
||||
goto nomem;
|
||||
}
|
||||
|
||||
ret = hfi1_init_ctxt(rcd->sc);
|
||||
if (ret < 0) {
|
||||
dd_dev_err(dd,
|
||||
"Failed to setup kernel receive context, failing\n");
|
||||
ret = -EFAULT;
|
||||
goto bail;
|
||||
}
|
||||
hfi1_init_ctxt(rcd->sc);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -194,7 +188,7 @@ int hfi1_create_ctxts(struct hfi1_devdata *dd)
|
||||
return 0;
|
||||
nomem:
|
||||
ret = -ENOMEM;
|
||||
bail:
|
||||
|
||||
if (dd->rcd) {
|
||||
for (i = 0; i < dd->num_rcv_contexts; ++i)
|
||||
hfi1_free_ctxtdata(dd, dd->rcd[i]);
|
||||
|
Reference in New Issue
Block a user