mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-20 14:09:28 +07:00
IB/hfi1: Remove unnecessary initialization from tx request
The tx request is unnecessarily initialized in the hot code path with memset(), however, there's no need to do this as most fields are initialized later on. this initialization shows to be costly in the profile. Remove unnecessary initialization from tx request and make sure all variables are initialized properly. Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
parent
8c32c4f2f7
commit
ceb26569af
@ -607,12 +607,19 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,
|
||||
hfi1_cdbg(SDMA, "[%u:%u:%u] Using req/comp entry %u\n", dd->unit,
|
||||
uctxt->ctxt, fd->subctxt, info.comp_idx);
|
||||
req = pq->reqs + info.comp_idx;
|
||||
memset(req, 0, sizeof(*req));
|
||||
req->data_iovs = req_iovcnt(info.ctrl) - 1; /* subtract header vector */
|
||||
req->data_len = 0;
|
||||
req->pq = pq;
|
||||
req->cq = cq;
|
||||
req->status = -1;
|
||||
req->ahg_idx = -1;
|
||||
req->iov_idx = 0;
|
||||
req->sent = 0;
|
||||
req->seqnum = 0;
|
||||
req->seqcomp = 0;
|
||||
req->seqsubmitted = 0;
|
||||
req->flags = 0;
|
||||
req->tids = NULL;
|
||||
INIT_LIST_HEAD(&req->txps);
|
||||
|
||||
memcpy(&req->info, &info, sizeof(info));
|
||||
@ -701,12 +708,14 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,
|
||||
|
||||
/* Save all the IO vector structures */
|
||||
for (i = 0; i < req->data_iovs; i++) {
|
||||
req->iovs[i].offset = 0;
|
||||
INIT_LIST_HEAD(&req->iovs[i].list);
|
||||
memcpy(&req->iovs[i].iov,
|
||||
iovec + idx++,
|
||||
sizeof(req->iovs[i].iov));
|
||||
ret = pin_vector_pages(req, &req->iovs[i]);
|
||||
if (ret) {
|
||||
req->data_iovs = i;
|
||||
req->status = ret;
|
||||
goto free_req;
|
||||
}
|
||||
@ -749,6 +758,7 @@ int hfi1_user_sdma_process_request(struct hfi1_filedata *fd,
|
||||
}
|
||||
req->tids = tmp;
|
||||
req->n_tids = ntids;
|
||||
req->tididx = 0;
|
||||
idx++;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user