From: Stephen Hemminger <stephen@networkplumber.org>
To: Wencheng Li <liwencheng@phytium.com.cn>
Cc: dev@dpdk.org
Subject: Re: [PATCH v9 1/3] net/macb: add new poll mode driver
Date: Fri, 6 Jun 2025 08:38:05 -0700 [thread overview]
Message-ID: <20250606083805.3523f1d5@hermes.local> (raw)
In-Reply-To: <1749200770-53411-1-git-send-email-liwencheng@phytium.com.cn>
On Fri, 6 Jun 2025 09:06:10 +0000
Wencheng Li <liwencheng@phytium.com.cn> wrote:
> +static int macb_get_speed_info(struct rte_eth_dev *dev, char *speed_info)
> +{
> + char filename[PATH_MAX];
> + char *s;
> + struct macb_priv *priv = dev->data->dev_private;
> +
> + if (!speed_info) {
> + MACB_LOG(ERR, "speed info is NULL.");
> + return -ENOMEM;
> + }
> +
> + snprintf(filename, PATH_MAX, "%s/%s/speed_info", MACB_PDEV_PATH, priv->name);
> + FILE *file = fopen(filename, "r");
> + if (!file) {
> + MACB_LOG(ERR, "There is no speed_info file!");
> + return -ENFILE;
> + }
> +
> + s = fgets(speed_info, SPEED_INFO_LEN, file);
> + if (!s) {
> + fclose(file);
> + MACB_LOG(ERR, "get speed info error!");
> + return -EINVAL;
> + }
> +
> + fclose(file);
> + return 0;
> +}
Looking at this API I see a potential review conflict.
Although sysfs is a text based API, and any string can be returned;
the convention used is one value per file.
Writing UIO drivers is hard, and getting it upstream you will find lots of issues;
ask Long about hyper-v uio. I wonder if there is a better way to do this.
next prev parent reply other threads:[~2025-06-06 15:38 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-02 6:58 [PATCH v4 2/4] " liwencheng
2025-04-03 1:43 ` Stephen Hemminger
2025-04-03 1:45 ` Stephen Hemminger
2025-04-07 6:38 ` [PATCH v5 " liwencheng
2025-04-08 6:20 ` [PATCH v6 1/3] " liwencheng
2025-04-16 16:38 ` Stephen Hemminger
2025-04-18 3:25 ` [PATCH v7 " Wencheng Li
2025-06-04 6:59 ` [PATCH v8 " Wencheng Li
2025-06-04 20:52 ` Stephen Hemminger
2025-06-06 9:06 ` [PATCH v9 " Wencheng Li
2025-06-06 15:38 ` Stephen Hemminger [this message]
2025-04-16 16:34 ` [PATCH v4 2/4] " Stephen Hemminger
2025-04-16 16:34 ` Stephen Hemminger
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=20250606083805.3523f1d5@hermes.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=liwencheng@phytium.com.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 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).