mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Simon Horman <simon.horman@corigine.com>
To: Hariprasad Kelam <hkelam@marvell.com>
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	kuba@kernel.org, davem@davemloft.net,
	willemdebruijn.kernel@gmail.com, andrew@lunn.ch,
	sgoutham@marvell.com, lcherian@marvell.com, gakula@marvell.com,
	jerinj@marvell.com, sbhatta@marvell.com, naveenm@marvell.com,
	edumazet@google.com, pabeni@redhat.com, jhs@mojatatu.com,
	xiyou.wangcong@gmail.com, jiri@resnulli.us, maxtram95@gmail.com,
	corbet@lwn.net
Subject: Re: [net-next Patch v8 5/6] octeontx2-pf: Add support for HTB offload
Date: Mon, 10 Apr 2023 15:28:01 +0200	[thread overview]
Message-ID: <ZDQO4RhUmUC6w6Hr@corigine.com> (raw)
In-Reply-To: <20230410084223.5325-6-hkelam@marvell.com>

On Mon, Apr 10, 2023 at 02:12:22PM +0530, Hariprasad Kelam wrote:
> From: Naveen Mamindlapalli <naveenm@marvell.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@marvell.com>
> Signed-off-by: Hariprasad Kelam <hkelam@marvell.com>
> Signed-off-by: Sunil Kovvuri Goutham <sgoutham@marvell.com>
> Reviewed-by: Simon Horman <simon.horman@corigine.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];
> +		}
> +	}

  reply	other threads:[~2023-04-10 13:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10  8:42 [net-next Patch v8 0/6] : octeontx2-pf: HTB offload support Hariprasad Kelam
2023-04-10  8:42 ` [net-next Patch v8 1/6] sch_htb: Allow HTB priority parameter in offload mode Hariprasad Kelam
2023-04-10  8:42 ` [net-next Patch v8 2/6] octeontx2-pf: Rename tot_tx_queues to non_qos_queues Hariprasad Kelam
2023-04-10  8:42 ` [net-next Patch v8 3/6] octeontx2-pf: qos send queues management Hariprasad Kelam
2023-04-10  8:42 ` [net-next Patch v8 4/6] octeontx2-pf: Refactor schedular queue alloc/free calls Hariprasad Kelam
2023-04-10  8:42 ` [net-next Patch v8 5/6] octeontx2-pf: Add support for HTB offload Hariprasad Kelam
2023-04-10 13:28   ` Simon Horman [this message]
2023-04-10  8:42 ` [net-next Patch v8 6/6] docs: octeontx2: Add Documentation for QOS Hariprasad Kelam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDQO4RhUmUC6w6Hr@corigine.com \
    --to=simon.horman@corigine.com \
    --cc=andrew@lunn.ch \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=lcherian@marvell.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maxtram95@gmail.com \
    --cc=naveenm@marvell.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®