Skip to content

Commit a0c1d7d

Browse files
bodedogalbxela
authored andcommitted
[mtcr_ul] [reg_access] [ib] fixing rc handling
1 parent b075d8e commit a0c1d7d

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

mtcr_ul/mtcr_ib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,5 @@ int mib_send_gmp_access_reg_mad(mfile * mf,
6868
int mib_supports_reg_access_cls_a(mfile* mf, maccess_reg_method_t reg_method);
6969
int mib_send_cls_a_access_reg_mad(mfile* mf, u_int8_t* data);
7070
int mib_supports_reg_access_smp(mfile* mf);
71+
int mib_use_smp(mfile* mf);
7172
#endif

mtcr_ul/mtcr_ib_ofed.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,3 +2047,8 @@ int mib_supports_reg_access_smp(mfile* mf)
20472047
return (mf->tp == MST_IB && ((ibvs_mad*)mf->ctx)->use_smp) && (mf->flags & (MDEVS_IB | MDEVS_FWCTX)) ||
20482048
(!(mf->flags & MDEVS_IB));
20492049
}
2050+
2051+
int mib_use_smp(mfile* mf)
2052+
{
2053+
return ((ibvs_mad*)mf->ctx)->use_smp;
2054+
}

mtcr_ul/mtcr_ul_com.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3278,6 +3278,15 @@ int supports_reg_access_smp(mfile* mf)
32783278
return 0;
32793279
}
32803280

3281+
int should_use_smp(mfile* mf)
3282+
{
3283+
#ifndef NO_INBAND
3284+
return mib_use_smp(mf);
3285+
#endif
3286+
(void)mf;
3287+
return 0;
3288+
}
3289+
32813290

32823291
int maccess_reg_ul(mfile * mf,
32833292
u_int16_t reg_id,
@@ -3384,7 +3393,7 @@ int maccess_reg_ul(mfile * mf,
33843393
if (supports_reg_access_smp(mf)) {
33853394
class_to_use = MAD_CLASS_REG_ACCESS;
33863395
rc = mreg_send_raw(mf, reg_id, reg_method, reg_data, reg_size, r_size_reg, w_size_reg, reg_status);
3387-
} else {
3396+
} else if (should_use_smp(mf)){
33883397
return ME_REG_ACCESS_NOT_SUPPORTED;
33893398
}
33903399
}

0 commit comments

Comments
 (0)