From: Stephen Hemminger <stephen@networkplumber.org>
To: Bing Zhao <bingz@nvidia.com>
Cc: Slava Ovsiienko <viacheslavo@nvidia.com>,
Matan Azrad <matan@nvidia.com>, "dev@dpdk.org" <dev@dpdk.org>,
Raslan Darawsheh <rasland@nvidia.com>,
"stable@dpdk.org" <stable@dpdk.org>
Subject: Re: [PATCH] common/mlx5: fix the sysfs port name translation
Date: Fri, 11 Nov 2022 09:38:09 -0800 [thread overview]
Message-ID: <20221111093809.38358203@hermes.local> (raw)
In-Reply-To: <DM4PR12MB5184BA475B2FA638F76C043FD0009@DM4PR12MB5184.namprd12.prod.outlook.com>
On Fri, 11 Nov 2022 05:41:05 +0000
Bing Zhao <bingz@nvidia.com> wrote:
> Hi Stephen,
>
> > -----Original Message-----
> > From: Stephen Hemminger <stephen@networkplumber.org>
> > Sent: Friday, November 11, 2022 12:22 AM
> > To: Bing Zhao <bingz@nvidia.com>
> > Cc: Slava Ovsiienko <viacheslavo@nvidia.com>; Matan Azrad
> > <matan@nvidia.com>; dev@dpdk.org; Raslan Darawsheh
> > <rasland@nvidia.com>; stable@dpdk.org
> > Subject: Re: [PATCH] common/mlx5: fix the sysfs port name
> > translation
> >
> > External email: Use caution opening links or attachments
> >
> >
> > On Thu, 10 Nov 2022 17:57:26 +0200
> > Bing Zhao <bingz@nvidia.com> wrote:
> >
> > > With some OFED or upstream kernel of mlx5, the port name fetched
> > from
> > > "/sys/class/net/[DEV]/phys_port_name" may have a tailing "\n" as
> > the
> > > EOL. The sscanf() will return the scanned items number with this
> > EOL.
> >
> > Why not fix the DPDK driver to strip off the new line when the port
> > name is read? The code in mlx5_os.c should do it there.
>
> Thanks for your comments. Yes, IF_NAMESIZE is large enough to read all the characters including the newline into the buffer.
> After fgets(), the strlen() or strchr() can be used to remove the tailing newline character.
>
>
> BR. Bing
Another alternative would be to use getline() which doesn't have annoying length restrictions
to deal with.
next prev parent reply other threads:[~2022-11-11 17:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-10 15:57 Bing Zhao
2022-11-10 16:21 ` Stephen Hemminger
2022-11-11 5:41 ` Bing Zhao
2022-11-11 17:38 ` Stephen Hemminger [this message]
2023-03-22 11:34 ` [PATCH v2] " Bing Zhao
2023-03-22 14:58 ` Stephen Hemminger
2023-03-23 8:20 ` Bing Zhao
2023-03-22 14:59 ` Stephen Hemminger
2023-03-23 8:23 ` Bing Zhao
2023-03-23 10:54 ` [PATCH v3] net/mlx5: " Bing Zhao
2023-03-27 15:00 ` Matan Azrad
2023-03-28 8:39 ` Raslan Darawsheh
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=20221111093809.38358203@hermes.local \
--to=stephen@networkplumber.org \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=matan@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stable@dpdk.org \
--cc=viacheslavo@nvidia.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;
as well as URLs for NNTP newsgroup(s).