From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71BDE43C3B; Thu, 29 Feb 2024 17:45:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 60ECE42EA1; Thu, 29 Feb 2024 17:45:33 +0100 (CET) Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by mails.dpdk.org (Postfix) with ESMTP id 000494025C for ; Thu, 29 Feb 2024 17:45:20 +0100 (CET) Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1dba177c596so8069085ad.0 for ; Thu, 29 Feb 2024 08:45:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1709225120; x=1709829920; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ZiQES/1JMNDvivbwEHBbHFVGJZJkpCPV63q8W1f9SNU=; b=0jn5fZljnN57ilPujso+0pv4XDxOVrqiHsu1LeDIQK8MvyozjvvzqVZA+u15OgDcFH 4FECVeSlKWuodSzY52vkihx31VPqxntu9FUCVXEY+rhQoGlFyZbAnZtVWUV0dChiKSRh SHcZfztYD7vbgFqIOhXOOBCrG2S0Pba57NQCk9sjLeHjT+b+RkkPnnz3Y47fOvoN/Qtv mV68+iYtoMMwajfG0BBXUtuR1rc4OxWZmomhzsCs5/4LY7sKabEC3joHtHbtvuqcfhKb LyLue+PV3UQl8Te5y6bqf+a/67ROtzQyGuWAsTFpEul2zzyQLCOGraiQVY3pXgnJTl0K oWrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709225120; x=1709829920; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZiQES/1JMNDvivbwEHBbHFVGJZJkpCPV63q8W1f9SNU=; b=VSWRBb/hplgICy54/Ql6LhdtZkZ/VvS6REfk0tIuhZUIXxRh/BheMDjvhExIjZbov+ 2pDbDVgfP3G7z/v/gvQ4kVUvKDj5cGyA0ufiiWPSEQzs4OAGxe/lsI9DSXyaNL/3t3bB dkrJtSo4HBR+7IIthRfK/u6oJA7yZyhXzQ1hMAKCfwAl1pF4sSrUAZtZSdsCSApCsleh //BBfdCm6OcY/LI9W2wOlplLiXx8BfUefCozD7rD5ySwJ/nsKFT4yFCVNICQsm3a7S7k H1siH0clvA3/YEgbcLd0dUyO79DcJoIXq6F6aTlwLcJEAvoKY5R5R6HsMV8OY4erMikx 3k2Q== X-Gm-Message-State: AOJu0YyGvKaWFYSanK2VM2B1tjt3H41eileft1gxvbNh1fLE5As4+bR+ sO23/AYn2ggPfNlJsAbVzL6/xgKH1Fupe+vU6gA64eI4OR1d6P3/vIpN7c8MA10= X-Google-Smtp-Source: AGHT+IEd+u6fBzoWricvmuV5idPl1FRFYBGoLzKBy6Mu49hjZrahBIVmC2c1rCtzGOeEOO5QFqapYA== X-Received: by 2002:a17:902:c403:b0:1dc:6b26:d1cd with SMTP id k3-20020a170902c40300b001dc6b26d1cdmr3740883plk.2.1709225120013; Thu, 29 Feb 2024 08:45:20 -0800 (PST) Received: from hermes.local (204-195-123-141.wavecable.com. [204.195.123.141]) by smtp.gmail.com with ESMTPSA id z17-20020a170903019100b001db4433ef95sm1713075plg.152.2024.02.29.08.45.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 08:45:19 -0800 (PST) Date: Thu, 29 Feb 2024 08:45:17 -0800 From: Stephen Hemminger To: Thomas Monjalon Cc: dev@dpdk.org, Ferruh Yigit , Andrew Rybchenko Subject: Re: [PATCH v2] ethdev: add Linux ethtool link mode conversion Message-ID: <20240229084517.510acd7f@hermes.local> In-Reply-To: <20240229154343.1752555-1-thomas@monjalon.net> References: <20240229123653.1379466-1-thomas@monjalon.net> <20240229154343.1752555-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 29 Feb 2024 16:42:56 +0100 Thomas Monjalon 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.