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, linux-doc@vger.kernel.org
Subject: Re: [net-next Patch v10 4/8] octeontx2-pf: Refactor schedular queue alloc/free calls
Date: Tue, 16 May 2023 10:07:04 +0200 [thread overview]
Message-ID: <ZGM5qO+Uhea7eGGt@corigine.com> (raw)
In-Reply-To: <ZGM5VmGcuEFG2Jh6@corigine.com>
On Tue, May 16, 2023 at 10:05:54AM +0200, Simon Horman wrote:
> Hi Hariprasad,
>
> On Sat, May 13, 2023 at 02:21:39PM +0530, Hariprasad Kelam wrote:
> > 1. Upon txschq free request, the transmit schedular config in hardware
> > is not getting reset. This patch adds necessary changes to do the same.
> >
>
> nit: s/schedular/scheduler/
>
> > 2. Current implementation calls txschq alloc during interface
> > initialization and in response handler updates the default txschq array.
> > This creates a problem for htb offload where txsch alloc will be called
> > for every tc class. This patch addresses the issue by reading txschq
> > response in mbox caller function instead in the response handler.
> >
> > 3. Current otx2_txschq_stop routine tries to free all txschq nodes
> > allocated to the interface. This creates a problem for htb offload.
> > This patch introduces the otx2_txschq_free_one to free txschq in a
> > given level.
>
> This patch seems to be doing three things.
> Could it be split into three patches?
I see that I was a bit late with my review as the
series was applied yesterday.
> ...
>
> > -int otx2_txschq_stop(struct otx2_nic *pfvf)
> > +void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)
> > {
> > struct nix_txsch_free_req *free_req;
> > - int lvl, schq, err;
> > + int err;
> >
> > mutex_lock(&pfvf->mbox.lock);
> > - /* Free the transmit schedulers */
> > +
> > free_req = otx2_mbox_alloc_msg_nix_txsch_free(&pfvf->mbox);
>
> Mainly for my own edification:
>
> - otx2_mbox_alloc_msg_nix_txsch_free is created via the
> M(_name, _id, _fn_name, _req_type, _rsp_type) macro
> around line 844 of otx2_common.h
> - It calls otx2_mbox_alloc_msg_rsp
> - Which does not call any allocation functions such as kmalloc
>
> > if (!free_req) {
> > mutex_unlock(&pfvf->mbox.lock);
> > - return -ENOMEM;
> > + netdev_err(pfvf->netdev,
> > + "Failed alloc txschq free req\n");
>
> I think that given the above it's ok to log an error here.
> As the allocation core won't have (because it's not used here.
> But I wonder if it would be more consistent with how
> allocation errors are usually handled to move the logging into
> otx2_mbox_alloc_msg_rsp().
>
> > + return;
> > }
> >
> > - free_req->flags = TXSCHQ_FREE_ALL;
> > + free_req->schq_lvl = lvl;
> > + free_req->schq = schq;
> > +
> > err = otx2_sync_mbox_msg(&pfvf->mbox);
> > + if (err) {
> > + netdev_err(pfvf->netdev,
> > + "Failed stop txschq %d at level %d\n", schq, lvl);
> > + }
> > +
> > mutex_unlock(&pfvf->mbox.lock);
> > +}
> > +
> > +void otx2_txschq_stop(struct otx2_nic *pfvf)
> > +{
> > + int lvl, schq;
> > +
> > + /* free non QOS TLx nodes */
> > + for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++)
> > + otx2_txschq_free_one(pfvf, lvl,
> > + pfvf->hw.txschq_list[lvl][0]);
> >
> > /* Clear the txschq list */
> > for (lvl = 0; lvl < NIX_TXSCH_LVL_CNT; lvl++) {
> > for (schq = 0; schq < MAX_TXSCHQ_PER_FUNC; schq++)
> > pfvf->hw.txschq_list[lvl][schq] = 0;
> > }
> > - return err;
> > +
>
> nit: no blank line here.
>
> > }
> >
> > void otx2_sqb_flush(struct otx2_nic *pfvf)
>
> ...
next prev parent reply other threads:[~2023-05-16 8:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-13 8:51 [net-next Patch v10 0/8] octeontx2-pf: HTB offload support Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 1/8] sch_htb: Allow HTB priority parameter in offload mode Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 2/8] octeontx2-pf: Rename tot_tx_queues to non_qos_queues Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 3/8] octeontx2-pf: qos send queues management Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 4/8] octeontx2-pf: Refactor schedular queue alloc/free calls Hariprasad Kelam
2023-05-16 8:05 ` Simon Horman
2023-05-16 8:07 ` Simon Horman [this message]
2023-05-13 8:51 ` [net-next Patch v10 5/8] octeontx2-pf: Prepare for QOS offload Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 6/8] octeontx2-pf: Add support for HTB offload Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 7/8] octeontx2-pf: ethtool expose qos stats Hariprasad Kelam
2023-05-13 8:51 ` [net-next Patch v10 8/8] docs: octeontx2: Add Documentation for QOS Hariprasad Kelam
2023-05-15 8:40 ` [net-next Patch v10 0/8] octeontx2-pf: HTB offload support patchwork-bot+netdevbpf
-- strict thread matches above, loose matches on Subject: below --
2023-04-26 5:47 Hariprasad Kelam
2023-04-26 5:47 ` [net-next Patch v10 4/8] octeontx2-pf: Refactor schedular queue alloc/free calls 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=ZGM5qO+Uhea7eGGt@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-doc@vger.kernel.org \
--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
Powered by JetHome