Skip to content

Commit e3d57a0

Browse files
Gautam R Arleon
authored andcommitted
RDMA/bnxt_re: Fix missing error handling for tx_queue
bnxt_re_fill_gen0_ext0() did not return an error when attempting to modify CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE, leading to silent failures. Fixed this by returning -EOPNOTSUPP for tx_queue modifications and ensuring proper error propagation in bnxt_re_configure_cc(). Fixes: 656dff5 ("RDMA/bnxt_re: Congestion control settings using debugfs hook") Signed-off-by: Gautam R A <[email protected]> Link: https://patch.msgid.link/[email protected] Reviewed-by: Kalesh AP <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 58d7a96 commit e3d57a0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

drivers/infiniband/hw/bnxt_re/debugfs.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ static ssize_t bnxt_re_cc_config_get(struct file *filp, char __user *buffer,
206206
return simple_read_from_buffer(buffer, usr_buf_len, ppos, (u8 *)(buf), rc);
207207
}
208208

209-
static void bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offset, u32 val)
209+
static int bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offset, u32 val)
210210
{
211211
u32 modify_mask;
212212

@@ -250,7 +250,7 @@ static void bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offs
250250
ccparam->tcp_cp = val;
251251
break;
252252
case CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE:
253-
break;
253+
return -EOPNOTSUPP;
254254
case CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP:
255255
ccparam->inact_th = val;
256256
break;
@@ -263,18 +263,21 @@ static void bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offs
263263
}
264264

265265
ccparam->mask = modify_mask;
266+
return 0;
266267
}
267268

268269
static int bnxt_re_configure_cc(struct bnxt_re_dev *rdev, u32 gen_ext, u32 offset, u32 val)
269270
{
270271
struct bnxt_qplib_cc_param ccparam = { };
272+
int rc;
271273

272-
/* Supporting only Gen 0 now */
273-
if (gen_ext == CC_CONFIG_GEN0_EXT0)
274-
bnxt_re_fill_gen0_ext0(&ccparam, offset, val);
275-
else
274+
if (gen_ext != CC_CONFIG_GEN0_EXT0)
276275
return -EINVAL;
277276

277+
rc = bnxt_re_fill_gen0_ext0(&ccparam, offset, val);
278+
if (rc)
279+
return rc;
280+
278281
bnxt_qplib_modify_cc(&rdev->qplib_res, &ccparam);
279282
return 0;
280283
}

0 commit comments

Comments
 (0)