Re: [PATCH for-next v2] RDMA/bnxt_re: Congestion control settings using debugfs hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Feb 8, 2025 at 2:49 PM Chengchang Tang
<tangchengchang@xxxxxxxxxx> wrote:
>
>
>
> On 2025/1/19 23:45, Selvin Xavier wrote:
> > Implements routines to set and get different settings  of
> > the congestion control. This will enable the users to modify
> > the settings according to their network.
> >
> > Currently supporting only GEN 0 version of the parameters.
> > Reading these files queries the firmware and report the values
> > currently programmed. Writing to the files sends commands that
> > update the congestion control settings
> >
> > Signed-off-by: Selvin Xavier <selvin.xavier@xxxxxxxxxxxx>
> > ---
> > v1 -> v2:
> >   Addressed Leon's comments
> >      - rename debugfs file "g" to "run_avg_weight_g"
> >      - Fix the indentation errors
> >      - Remove the unnecessary error message during the read entry point
> >      - Fix the return value
> >
> >  drivers/infiniband/hw/bnxt_re/bnxt_re.h |   2 +
> >  drivers/infiniband/hw/bnxt_re/debugfs.c | 212 +++++++++++++++++++++++++++++++-
> >  drivers/infiniband/hw/bnxt_re/debugfs.h |  15 +++
> >  3 files changed, 228 insertions(+), 1 deletion(-)
> >
>
> ...
> > +static const struct file_operations bnxt_re_cc_config_ops = {
> > +     .owner = THIS_MODULE,
> > +     .open = simple_open,
> > +     .read = bnxt_re_cc_config_get,
> > +     .write = bnxt_re_cc_config_set,
> > +};
> > +
> >  void bnxt_re_debugfs_add_pdev(struct bnxt_re_dev *rdev)
> >  {
> >       struct pci_dev *pdev = rdev->en_dev->pdev;
> > +     struct bnxt_re_dbg_cc_config_params *cc_params;
> > +     int i;
> >
> >       rdev->dbg_root = debugfs_create_dir(dev_name(&pdev->dev), bnxt_re_debugfs_root);
> >
> >       rdev->qp_debugfs = debugfs_create_dir("QPs", rdev->dbg_root);
> > +     rdev->cc_config = debugfs_create_dir("cc_config", rdev->dbg_root);
> > +
> > +     rdev->cc_config_params = kzalloc(sizeof(*cc_params), GFP_KERNEL);
> > +
> > +     for (i = 0; i < BNXT_RE_CC_PARAM_GEN0; i++) {
> > +             struct bnxt_re_cc_param *tmp_params = &rdev->cc_config_params->gen0_parms[i];
> > +
> > +             tmp_params->rdev = rdev;
> > +             tmp_params->offset = i;
> > +             tmp_params->cc_gen = CC_CONFIG_GEN0_EXT0;
> > +             tmp_params->dentry = debugfs_create_file(bnxt_re_cc_gen0_name[i], 0400,
>
> Write operation doesn't seem to work?
right. I made a mistake in some code cleanup done just before posting
this patch.
 I have a bug fix patch for this, will post it. Thanks.

> > +                                                      rdev->cc_config, tmp_params,
> > +                                                      &bnxt_re_cc_config_ops);
> > +     }
> >  }
> >
>
>

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux