All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Cc: Jakub Kicinski <kuba@kernel.org>,
	Sven Auhagen <sven.auhagen@voleatech.de>,
	netdev@vger.kernel.org, thomas.petazzoni@bootlin.com,
	hawk@kernel.org, lorenzo@kernel.org, Paulo.DaSilva@kyberna.com,
	mcroce@linux.microsoft.com
Subject: Re: [PATCH v2 1/2] net: page_pool: check page pool ethtool stats
Date: Wed, 25 Oct 2023 10:53:41 +0300	[thread overview]
Message-ID: <20231025075341.GA2950466@unreal> (raw)
In-Reply-To: <ZTiu0Itkhbb8OqS7@hera>

On Wed, Oct 25, 2023 at 08:59:44AM +0300, Ilias Apalodimas wrote:
> Hi Jakub,
> 
> On Mon, Oct 02, 2023 at 12:46:50PM -0700, Jakub Kicinski wrote:
> > On Sun, 1 Oct 2023 13:41:15 +0200 Sven Auhagen wrote:
> > > If the page_pool variable is null while passing it to
> > > the page_pool_get_stats function we receive a kernel error.
> > >
> > > Check if the page_pool variable is at least valid.
> >
> > IMHO this seems insufficient, the driver still has to check if PP
> > was instantiated when the strings are queried. My weak preference
> > would be to stick to v1 and have the driver check all the conditions.
> > But if nobody else feels this way, it's fine :)
> 
> I don't disagree, but OTOH it would be sane for the API not to crash if
> something invalid is passed. 

In-kernel API assumes that in-kernel callers know how to use it.

> Maybe the best approach would be to keep the
> driver checks, which are saner, but add the page pool code as well with a
> printable error indicating a driver bug?

It is no different from adding extra checks to prevent drivers from random calls
with random parameters to well defined API.

Thanks

> 
> Thanks
> /Ilias
> 

  reply	other threads:[~2023-10-25  7:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-01 11:41 [PATCH v2 1/2] net: page_pool: check page pool ethtool stats Sven Auhagen
2023-10-02 19:46 ` Jakub Kicinski
2023-10-03  4:12   ` Sven Auhagen
2023-10-25  5:59   ` Ilias Apalodimas
2023-10-25  7:53     ` Leon Romanovsky [this message]
2023-10-30  9:39       ` Sven Auhagen
2023-10-30 14:23         ` Leon Romanovsky
2023-10-30 14:42           ` Sven Auhagen

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=20231025075341.GA2950466@unreal \
    --to=leon@kernel.org \
    --cc=Paulo.DaSilva@kyberna.com \
    --cc=hawk@kernel.org \
    --cc=ilias.apalodimas@linaro.org \
    --cc=kuba@kernel.org \
    --cc=lorenzo@kernel.org \
    --cc=mcroce@linux.microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=sven.auhagen@voleatech.de \
    --cc=thomas.petazzoni@bootlin.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 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.