DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Morten Brørup" <mb@smartsharesystems.com>
To: "Thomas Monjalon" <thomas@monjalon.net>,
	"David Marchand" <david.marchand@redhat.com>
Cc: <ktraynor@redhat.com>, <dev@dpdk.org>
Subject: RE: [PATCH] eal/unix: lower log level for reading files
Date: Mon, 30 Oct 2023 11:45:28 +0100	[thread overview]
Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9EFB2@smartserver.smartshare.dk> (raw)
In-Reply-To: <3255719.aeNJFYEL58@thomas>

> From: Thomas Monjalon [mailto:thomas@monjalon.net]
> Sent: Monday, 30 October 2023 11.35
> 
> I would add "sysfs" in the title.
> 
> 27/10/2023 11:13, David Marchand:
> > On Fri, Oct 27, 2023 at 11:00 AM Morten Brørup
> <mb@smartsharesystems.com> wrote:
> > >
> > > > From: David Marchand [mailto:david.marchand@redhat.com]
> > > > Sent: Friday, 27 October 2023 10.01
> > > >
> > > > The eal_parse_sysfs_value helper both returns an error code and
> logs an
> > > > error level message when something goes wrong.
> > > > On the other hand, internal users of this helper either ignore
> this
> > > > error code (like when trying to find out some numa information
> from the
> > > > Linux sysfs, or discovering some optional feature), or add their
> own
> > > > error
> > > > logging when reading the file actually matters.
> > > >
> > > > Lower this helper log messages to debug level as it provides no
> useful
> > > > information to final DPDK users.
> > >
> > > Such assumptions seem risky.
> > >
> > > Please add __attribute__ ((warn_unused_result)) to this function's
> header, to support the assumption.
> >
> > I can add this.
> 
> Would be __rte_warn_unused_result
> 
> I'm not sure it is required to mandate checking the result.
> I'm fine with or without it.

Me too.

> 
> I agree with this patch because not having a sysfs entry is never
> critical in itself.
> If the entry is required in a case, it should be handled by the caller
> with a more meaningful message.

I agree 100 %. And if all current callers do, then I consider it safe to lower the message level here. New callers are expected to follow the pattern of current callers.

> 
> Acked-by: Thomas Monjalon <thomas@monjalon.net>
> 
> 
> > > Alternatively, add a "bool may_not_exist" parameter to the function
> to choose the relevant log level.
> >
> > If an API update is to be considered, I would rather add some new
> > helpers with Windows support.
> 
> Please don't change the API for such detail.
> 

I don't feel strongly about my suggested changes, so however you handle it...

Acked-by: Morten Brørup <mb@smartsharesystems.com>


      reply	other threads:[~2023-10-30 10:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-27  8:00 David Marchand
2023-10-27  9:00 ` Morten Brørup
2023-10-27  9:13   ` David Marchand
2023-10-30 10:34     ` Thomas Monjalon
2023-10-30 10:45       ` Morten Brørup [this message]

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=98CBD80474FA8B44BF855DF32C47DC35E9EFB2@smartserver.smartshare.dk \
    --to=mb@smartsharesystems.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=ktraynor@redhat.com \
    --cc=thomas@monjalon.net \
    /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;
as well as URLs for NNTP newsgroup(s).