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 v2] ethdev: add Linux ethtool link mode conversion
Date: Thu, 29 Feb 2024 08:45:17 -0800	[thread overview]
Message-ID: <20240229084517.510acd7f@hermes.local> (raw)
In-Reply-To: <20240229154343.1752555-1-thomas@monjalon.net>

On Thu, 29 Feb 2024 16:42:56 +0100
Thomas Monjalon <thomas@monjalon.net> wrote:

> +/* Link modes sorted with index as defined in ethtool.
> + * Values are speed in Mbps with LSB indicating duplex.
> + *
> + * The ethtool bits definition should not change as it is a kernel API.
> + * Using raw numbers directly avoids checking API availability
> + * 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_/{$3=$3+1","}1'
> + */
> +static uint32_t link_modes[] = {

Make it const please.

You could add meson rule to generate it and then use non-numeric tags.

  reply	other threads:[~2024-02-29 16:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-29 12:34 [PATCH v1] ethdev: add Linux ethtool link mode conversion Thomas Monjalon
2024-02-29 15:42 ` [PATCH v2] " Thomas Monjalon
2024-02-29 16:45   ` Stephen Hemminger [this message]
2024-02-29 16:58     ` Morten Brørup
2024-02-29 17:38       ` Stephen Hemminger
2024-03-01 10:27         ` Thomas Monjalon
2024-03-01 13:12   ` Ferruh Yigit
2024-03-01 13:37     ` Thomas Monjalon
2024-03-01 15:08       ` Ferruh Yigit
2024-03-01 15:20         ` Thomas Monjalon
2024-03-01 17:16           ` Ferruh Yigit
2024-03-01 18:00           ` Stephen Hemminger
2024-03-03  9:36             ` Thomas Monjalon
2024-03-03  9:56 ` [PATCH v3] " Thomas Monjalon
2024-03-04 15:58   ` Ferruh Yigit

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=20240229084517.510acd7f@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.