]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
RDMA/bnxt_re: Fix missing error handling for tx_queue
authorGautam R A <gautam-r.a@broadcom.com>
Tue, 20 May 2025 03:59:08 +0000 (09:29 +0530)
committerLeon Romanovsky <leon@kernel.org>
Wed, 21 May 2025 10:05:05 +0000 (06:05 -0400)
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: 656dff55da19 ("RDMA/bnxt_re: Congestion control settings using debugfs hook")
Signed-off-by: Gautam R A <gautam-r.a@broadcom.com>
Link: https://patch.msgid.link/20250520035910.1061918-3-kalesh-anakkur.purayil@broadcom.com
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Leon Romanovsky <leon@kernel.org>
drivers/infiniband/hw/bnxt_re/debugfs.c

index a3aad6c3dbec1fb1bd62d8bd214f1fc7522d2515..9f6392155d9157936662198a8204ddbad5300ad9 100644 (file)
@@ -206,7 +206,7 @@ static ssize_t bnxt_re_cc_config_get(struct file *filp, char __user *buffer,
        return simple_read_from_buffer(buffer, usr_buf_len, ppos, (u8 *)(buf), rc);
 }
 
-static void bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offset, u32 val)
+static int bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offset, u32 val)
 {
        u32 modify_mask;
 
@@ -250,7 +250,7 @@ static void bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offs
                ccparam->tcp_cp = val;
                break;
        case CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_TX_QUEUE:
-               break;
+               return -EOPNOTSUPP;
        case CMDQ_MODIFY_ROCE_CC_MODIFY_MASK_INACTIVITY_CP:
                ccparam->inact_th = val;
                break;
@@ -263,18 +263,21 @@ static void bnxt_re_fill_gen0_ext0(struct bnxt_qplib_cc_param *ccparam, u32 offs
        }
 
        ccparam->mask = modify_mask;
+       return 0;
 }
 
 static int bnxt_re_configure_cc(struct bnxt_re_dev *rdev, u32 gen_ext, u32 offset, u32 val)
 {
        struct bnxt_qplib_cc_param ccparam = { };
+       int rc;
 
-       /* Supporting only Gen 0 now */
-       if (gen_ext == CC_CONFIG_GEN0_EXT0)
-               bnxt_re_fill_gen0_ext0(&ccparam, offset, val);
-       else
+       if (gen_ext != CC_CONFIG_GEN0_EXT0)
                return -EINVAL;
 
+       rc = bnxt_re_fill_gen0_ext0(&ccparam, offset, val);
+       if (rc)
+               return rc;
+
        bnxt_qplib_modify_cc(&rdev->qplib_res, &ccparam);
        return 0;
 }