[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZDQO4RhUmUC6w6Hr@corigine.com>
Date: Mon, 10 Apr 2023 15:28:01 +0200
From: Simon Horman <simon.horman@...igine.com>
To: Hariprasad Kelam <hkelam@...vell.com>
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
kuba@...nel.org, davem@...emloft.net,
willemdebruijn.kernel@...il.com, andrew@...n.ch,
sgoutham@...vell.com, lcherian@...vell.com, gakula@...vell.com,
jerinj@...vell.com, sbhatta@...vell.com, naveenm@...vell.com,
edumazet@...gle.com, pabeni@...hat.com, jhs@...atatu.com,
xiyou.wangcong@...il.com, jiri@...nulli.us, maxtram95@...il.com,
corbet@....net
Subject: Re: [net-next Patch v8 5/6] octeontx2-pf: Add support for HTB offload
On Mon, Apr 10, 2023 at 02:12:22PM +0530, Hariprasad Kelam wrote:
> From: Naveen Mamindlapalli <naveenm@...vell.com>
>
> This patch registers callbacks to support HTB offload.
>
> Below are features supported,
>
> - supports traffic shaping on the given class by honoring rate and ceil
> configuration.
>
> - supports traffic scheduling, which prioritizes different types of
> traffic based on strict priority values.
>
> - supports the creation of leaf to inner classes such that parent node
> rate limits apply to all child nodes.
>
> Signed-off-by: Naveen Mamindlapalli <naveenm@...vell.com>
> Signed-off-by: Hariprasad Kelam <hkelam@...vell.com>
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@...vell.com>
> Reviewed-by: Simon Horman <simon.horman@...igine.com>
...
> +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) {
> + mutex_unlock(&mbox->lock);
> + return -ENOMEM;
> + }
> +
> + for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++) {
> + req->schq[lvl] = cfg->schq[lvl];
> + req->schq_contig[lvl] = cfg->schq_contig[lvl];
> + }
> +
> + rc = otx2_sync_mbox_msg(&pfvf->mbox);
> + if (rc) {
> + mutex_unlock(&mbox->lock);
> + return rc;
> + }
> +
> + rsp = (struct nix_txsch_alloc_rsp *)
> + otx2_mbox_get_rsp(&pfvf->mbox.mbox, 0, &req->hdr);
I think you need to check if otx2_mbox_get_rsp returned an error here.
Smatch reported this as:
drivers/net/ethernet/marvell/octeontx2/nic/qos.c:719 otx2_qos_txschq_alloc() error: 'rsp' dereferencing possible ERR_PTR()
> +
> + for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++) {
> + for (schq = 0; schq < rsp->schq_contig[lvl]; schq++) {
> + cfg->schq_contig_list[lvl][schq] =
> + rsp->schq_contig_list[lvl][schq];
> + }
> + }
Powered by blists - more mailing lists