All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Subbaraya Sundeep <sbhatta@marvell.com>
Cc: Wentao Liang <vulab@iscas.ac.cn>,
	Sunil Kovvuri Goutham <sgoutham@marvell.com>,
	Geethasowjanya Akula <gakula@marvell.com>,
	Hariprasad Kelam <hkelam@marvell.com>,
	"andrew+netdev@lunn.ch" <andrew+netdev@lunn.ch>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"edumazet@google.com" <edumazet@google.com>,
	"kuba@kernel.org" <kuba@kernel.org>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] octeontx2-pf:  Add error handling for cn10k_map_unmap_rq_policer().
Date: Mon, 7 Apr 2025 16:03:58 +0100	[thread overview]
Message-ID: <20250407150358.GN395307@horms.kernel.org> (raw)
In-Reply-To: <Z_NpOu08haGEgqi6@452e0070d9ab>

On Mon, Apr 07, 2025 at 05:57:14AM +0000, Subbaraya Sundeep wrote:
> On 2025-04-04 at 11:11:38, Simon Horman (horms@kernel.org) wrote:
> > On Fri, Apr 04, 2025 at 05:22:16AM +0000, Subbaraya Sundeep Bhatta wrote:
> > > Hi,
> > > 
> > > From: Wentao Liang <vulab@iscas.ac.cn> 
> > > Sent: Thursday, April 3, 2025 8:43 PM
> > > To: Sunil Kovvuri Goutham <sgoutham@marvell.com>; Geethasowjanya Akula <gakula@marvell.com>; Subbaraya Sundeep Bhatta <sbhatta@marvell.com>; Hariprasad Kelam <hkelam@marvell.com>; andrew+netdev@lunn.ch; davem@davemloft.net; edumazet@google.com; kuba@kernel.org; pabeni@redhat.com
> > > Cc: netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Wentao Liang <vulab@iscas.ac.cn>
> > > Subject: [PATCH] octeontx2-pf: Add error handling for cn10k_map_unmap_rq_policer().
> > > 
> > > The cn10k_free_matchall_ipolicer() calls the cn10k_map_unmap_rq_policer()
> > > for each queue in a for loop without checking for any errors. A proper
> > > implementation can be found in cn10k_set_matchall_ipolicer_rate().
> > > 
> > > Check the return value of the cn10k_map_unmap_rq_policer() function during
> > > each loop. Jump to unlock function and return the error code if the
> > > funciton fails to unmap policer.
> > > 
> > > Fixes: 2ca89a2c3752 ("octeontx2-pf: TC_MATCHALL ingress ratelimiting offload")
> > > Signed-off-by: Wentao Liang <mailto:vulab@iscas.ac.cn>
> > > ---
> > >  drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c | 6 ++++--
> > >  1 file changed, 4 insertions(+), 2 deletions(-)
> > > 
> > > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
> > > index a15cc86635d6..ce58ad61198e 100644
> > > --- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
> > > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
> > > @@ -353,11 +353,13 @@ int cn10k_free_matchall_ipolicer(struct otx2_nic *pfvf)
> > >  
> > >  	/* Remove RQ's policer mapping */
> > >  	for (qidx = 0; qidx < hw->rx_queues; qidx++)
> > > -		cn10k_map_unmap_rq_policer(pfvf, qidx,
> > > -					   hw->matchall_ipolicer, false);
> > > +		rc = cn10k_map_unmap_rq_policer(pfvf, qidx, hw->matchall_ipolicer, false);
> > > +		if (rc)
> > > +			goto out;
> > >  
> > > Intentionally we do not bail out when unmapping one of the queues is failed. The reason is during teardown if one of the queues is failed then
> > > we end up not tearing down rest of the queues and those queues cannot be used later which is bad. So leave whatever queues have failed and proceed
> > > with tearing down the rest. Hence all we can do is print an error for the failed queue and continue.
> > 
> > Hi Sundeep,
> > 
> > Sorry that I didn't notice your response before sending my own to Wentao.
> > 
> > I do agree that bailing out here is not a good idea.  But I wonder if there
> > is any value in the function should propagate some error reporting if any
> > call to cn10k_map_unmap_rq_policer fails - e.g. the first failure - while
> > still iterating aver all elements.
> > 
> > Just an idea.
> > 
> Hi Simon,
> 
> We can do but it gets compilcated if more than one queue failed and
> reasons are different. Hence just print error and continue.

Yes, understood. I did think about this some more and I think that
reporting an error is the best we can do, else as you say it gets complex.
So if there is already a log made, then I think that is sufficient.

  reply	other threads:[~2025-04-07 15:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-07  5:57 [PATCH] octeontx2-pf: Add error handling for cn10k_map_unmap_rq_policer() Subbaraya Sundeep
2025-04-07 15:03 ` Simon Horman [this message]
  -- strict thread matches above, loose matches on Subject: below --
2025-04-03 15:13 Wentao Liang
2025-04-04  5:07 ` Michal Swiatkowski
2025-04-04  5:22 ` Subbaraya Sundeep Bhatta
2025-04-04 11:11   ` Simon Horman
2025-04-04 11:06 ` Simon Horman
2025-04-04 17:35 ` kernel test robot
2025-04-04 17:46 ` kernel test robot

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=20250407150358.GN395307@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew+netdev@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=hkelam@marvell.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@marvell.com \
    --cc=vulab@iscas.ac.cn \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.