All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas@monjalon.net>
Cc: dev@dpdk.org, Ferruh Yigit <ferruh.yigit@amd.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>
Subject: Re: [PATCH] ethdev: sync ethtool link modes with Linux 6.15
Date: Thu, 26 Jun 2025 07:26:51 -0700	[thread overview]
Message-ID: <20250626072651.79d51099@hermes.local> (raw)
In-Reply-To: <20250625134202.3193570-1-thomas@monjalon.net>

On Wed, 25 Jun 2025 15:42:02 +0200
Thomas Monjalon <thomas@monjalon.net> wrote:

> diff --git a/lib/ethdev/ethdev_linux_ethtool.c b/lib/ethdev/ethdev_linux_ethtool.c
> index ec42d3054a..f508cdba6c 100644
> --- a/lib/ethdev/ethdev_linux_ethtool.c
> +++ b/lib/ethdev/ethdev_linux_ethtool.c
> @@ -17,8 +17,9 @@
>   *
>   * The array below is built from bit definitions with this shell command:
>   *   sed -rn 's;.*(ETHTOOL_LINK_MODE_)([0-9]+)([0-9a-zA-Z_]*).*= *([0-9]*).*;'\
> - *           '[\4] = \2, /\* \1\2\3 *\/;p' /usr/include/linux/ethtool.h |
> - *   awk '/_Half_/{$3=$3+1","}1'
> + *           '[\4] \2 \1\2\3;p' /usr/include/linux/ethtool.h |
> + *   awk '/_Half_/{$2=$2+1}1' |
> + *   awk '{printf "\t%5s = %7s, /\* %s *\/\n", $1, $2, $3}'
>   */

The commands in the comment never worked verbatim.

$  sed -rn 's;.*(ETHTOOL_LINK_MODE_)([0-9]+)([0-9a-zA-Z_]*).*= *([0-9]*).*;'\
           '[\4] \2 \1\2\3;p' /usr/include/linux/ethtool.h |
   awk '/_Half_/{$2=$2+1}1' |
   awk '{printf "\t%5s = %7s, /\* %s *\/\n", $1, $2, $3}'

> > > sed: -e expression #1, char 63: unterminated `s' command
awk: cmd. line:1: warning: escape sequence `\*' treated as plain `*'
awk: cmd. line:1: warning: escape sequence `\/' treated as plain `/'

Fixing the comment would be:
$ git diff
diff --git a/lib/ethdev/ethdev_linux_ethtool.c b/lib/ethdev/ethdev_linux_ethtool.c
index f508cdba6c..8a148ae0cd 100644
--- a/lib/ethdev/ethdev_linux_ethtool.c
+++ b/lib/ethdev/ethdev_linux_ethtool.c
@@ -16,10 +16,11 @@
  * and allows to compile with new bits included even on an old kernel.
  *
  * The array below is built from bit definitions with this shell command:
- *   sed -rn 's;.*(ETHTOOL_LINK_MODE_)([0-9]+)([0-9a-zA-Z_]*).*= *([0-9]*).*;'\
- *           '[\4] \2 \1\2\3;p' /usr/include/linux/ethtool.h |
- *   awk '/_Half_/{$2=$2+1}1' |
- *   awk '{printf "\t%5s = %7s, /\* %s *\/\n", $1, $2, $3}'
+ * sed -rn \
+ *   's;.*(ETHTOOL_LINK_MODE_)([0-9]+)([0-9a-zA-Z_]*).*= *([0-9]*).*;[\4] \2 \1\2\3;p' \
+ *   /usr/include/linux/ethtool.h | \
+ * awk '/_Half_/{$2=$2+1}1' | \
+ * awk '{printf "\t%5s = %7s, /* %s */\n", $1, $2, $3}'
  */
 static const uint32_t link_modes[] = {
          [0] =      11, /* ETHTOOL_LINK_MODE_10baseT_Half_BIT */



  reply	other threads:[~2025-06-26 14:26 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-25 13:42 [PATCH] ethdev: sync ethtool link modes with Linux 6.15 Thomas Monjalon
2025-06-26 14:26 ` Stephen Hemminger [this message]
2025-06-26 15:13   ` Thomas Monjalon
2025-06-29 16:37     ` Thomas Monjalon
2025-06-29 17:30       ` 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=20250626072651.79d51099@hermes.local \
    --to=stephen@networkplumber.org \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@amd.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 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.