Re: [net-next PATCH V3 4/4] octeontx2-pf: Add support for HTB offload

From: Hariprasad Kelam
Date: Thu Feb 09 2023 - 11:04:12 EST


Please see inline,


> On Mon, 2023-02-06 at 11:16 +0530, Hariprasad Kelam wrote:
> > +static int otx2_qos_txschq_alloc(struct otx2_nic *pfvf,
> > + struct otx2_qos_cfg *cfg)
> > +{
> > + struct nix_txsch_alloc_req *req;
> > + struct nix_txsch_alloc_rsp *rsp;
> > + struct mbox *mbox = &pfvf->mbox;
> > + int lvl, rc, schq;
> > +
> > + mutex_lock(&mbox->lock);
> > + req = otx2_mbox_alloc_msg_nix_txsch_alloc(&pfvf->mbox);
> > + if (!req)
> > + return -ENOMEM;
>
> This does not releases the mbox->lock mutex on error (another occurrence
> below).
>
ACK , will fix this in next version.

> [...]
>
>
> > +static int otx2_qos_txschq_update_config(struct otx2_nic *pfvf,
> > + struct otx2_qos_node *node,
> > + struct otx2_qos_cfg *cfg)
> > +{
> > + int ret = 0;
> > +
> > + otx2_qos_txschq_fill_cfg(pfvf, node, cfg);
> > + ret = otx2_qos_txschq_push_cfg(pfvf, node, cfg);
> > +
> > + return ret;
>
> I personally find the plain:
>
> return <function>
>
> more easy to read - more instances below.
>
ACK , will fix this in next version.
> [...]
>
> > +static void otx2_reset_qdisc(struct net_device *dev, u16 qid) {
> > + struct netdev_queue *dev_queue = netdev_get_tx_queue(dev,
> qid);
> > + struct Qdisc *qdisc = dev_queue->qdisc_sleeping;
> > +
> > + if (!qdisc)
> > + return;
> > +
> > + spin_lock_bh(qdisc_lock(qdisc));
> > + qdisc_reset(qdisc);
> > + spin_unlock_bh(qdisc_lock(qdisc));
> > +}
>
> The above looks like a possible shared helper, as mlx code implements a
> quite identical function.
>
Found equivalent API dev_reset_queue() but it is defined as static, will reuse the same by exposing
This API in header file (sch_generic.h)

Thanks,
Hariprasad k


> Cheers,
>
> Paolo