IB/hfi1, rdmavt: Update copy_sge to use boolean arguments

Convert copy_sge and related SGE state functions to use boolean.
For determining if QP is in user mode, add helper function in rdmavt_qp.h.
This is used to determine if QP needs the last byte ordering.
While here, change rvt_pd.user to a boolean.

Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Reviewed-by: Dean Luick <dean.luick@intel.com>
Signed-off-by: Brian Welty <brian.welty@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Doug Ledford <dledford@redhat.com>
This commit is contained in:
Brian Welty
2017-02-08 05:27:31 -08:00
committed by Doug Ledford
parent b4238e7057
commit 0128fceaf9
9 changed files with 48 additions and 38 deletions

View File

@@ -291,7 +291,7 @@ static void wss_insert(void *address)
/*
* Is the working set larger than the threshold?
*/
static inline int wss_exceeds_threshold(void)
static inline bool wss_exceeds_threshold(void)
{
return atomic_read(&wss.total_count) >= wss.threshold;
}
@@ -419,18 +419,19 @@ __be64 ib_hfi1_sys_image_guid;
* @ss: the SGE state
* @data: the data to copy
* @length: the length of the data
* @release: boolean to release MR
* @copy_last: do a separate copy of the last 8 bytes
*/
void hfi1_copy_sge(
struct rvt_sge_state *ss,
void *data, u32 length,
int release,
int copy_last)
bool release,
bool copy_last)
{
struct rvt_sge *sge = &ss->sge;
int in_last = 0;
int i;
int cacheless_copy = 0;
bool in_last = false;
bool cacheless_copy = false;
if (sge_copy_mode == COPY_CACHELESS) {
cacheless_copy = length >= PAGE_SIZE;
@@ -454,8 +455,8 @@ void hfi1_copy_sge(
if (length > 8) {
length -= 8;
} else {
copy_last = 0;
in_last = 1;
copy_last = false;
in_last = true;
}
}
@@ -501,8 +502,8 @@ again:
}
if (copy_last) {
copy_last = 0;
in_last = 1;
copy_last = false;
in_last = true;
length = 8;
goto again;
}
@@ -513,7 +514,7 @@ again:
* @ss: the SGE state
* @length: the number of bytes to skip
*/
void hfi1_skip_sge(struct rvt_sge_state *ss, u32 length, int release)
void hfi1_skip_sge(struct rvt_sge_state *ss, u32 length, bool release)
{
struct rvt_sge *sge = &ss->sge;