From: "Etelson, Gregory" <getelson@nvidia.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: "Gregory Etelson" <getelson@nvidia.com>,
dev@dpdk.org, <mkashani@nvidia.com>,
rasland@nvidia.com, "Dariusz Sosnowski" <dsosnowski@nvidia.com>,
"Viacheslav Ovsiienko" <viacheslavo@nvidia.com>,
"Bing Zhao" <bingz@nvidia.com>, "Ori Kam" <orika@nvidia.com>,
"Suanming Mou" <suanmingm@nvidia.com>,
"Matan Azrad" <matan@nvidia.com>,
"Ophir Munk" <ophirmu@nvidia.com>
Subject: Re: [PATCH] net/mlx5: fix interface name parameter definition
Date: Mon, 11 Aug 2025 13:13:40 +0300 (IDT) [thread overview]
Message-ID: <dad56eb6-f773-2e4e-e0e6-042eb3044341@nvidia.com> (raw)
In-Reply-To: <20250810214420.1b1b8079@hermes.local>
[-- Attachment #1: Type: text/plain, Size: 1422 bytes --]
Hello Stephen,
>> The patch fixes `ifname` parameter as a character buffer.
>>
>> Fixes: 1256805dd54d ("net/mlx5: move Linux-specific functions")
>>
>> Signed-off-by: Gregory Etelson <getelson@nvidia.com>
>> Acked-by: Dariusz Sosnowski <dsosnowski@nvidia.com>
>> ---
>
> This looks better but did you know that the ifname can never be as big as MLX5_NAMESIZE.
> Kernel limits to IFNAMSIZ (ie 16). The largest allowable interface name in Linux is 15 characters.
>
> Looks like:
> MLX5_NAMESIZE := MXL5_FS_NAME_MAX := IBV_SYSFS_NAME_MAX + 1 = 64 + 1 = 65
>
> Because Linux interface name length is fixed by BSD legacy ABI's it will never be longer.
>
The MLX5 PMD defines MLX5_NAMESIZE macro for Linux and Windows.
The Linux definition is in the drivers/net/mlx5/linux/mlx5_os.h:
#define MLX5_NAMESIZE IF_NAMESIZE
Linux API sets IF_NAMESIZE to 16.
The Windows definition is in the drivers/net/mlx5/windows/mlx5_os.h:
#define MLX5_NAMESIZE MLX5_FS_NAME_MAX.
The MLX5_FS_NAME_MAX macro also has different definitions for Linux and Windows:
drivers/common/mlx5/linux/mlx5_common_os.h
MLX5_FS_NAME_MAX = IBV_SYSFS_NAME_MAX + 1
IB verbs API sets IBV_SYSFS_NAME_MAX to 265.
drivers/common/mlx5/windows/mlx5_common_os.h:
MLX5_FS_NAME_MAX = MLX5_DEVX_DEVICE_NAME_SIZE + 1
MLX5_DEVX_DEVICE_NAME_SIZE is defined by NVIDIA/Mellanox’s DevX (WinOF2)
user-space headers for Windows and is set to 64.
Regards,
Gregory
prev parent reply other threads:[~2025-08-11 10:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-10 13:22 Gregory Etelson
2025-08-11 4:44 ` Stephen Hemminger
2025-08-11 10:13 ` Etelson, Gregory [this message]
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=dad56eb6-f773-2e4e-e0e6-042eb3044341@nvidia.com \
--to=getelson@nvidia.com \
--cc=bingz@nvidia.com \
--cc=dev@dpdk.org \
--cc=dsosnowski@nvidia.com \
--cc=matan@nvidia.com \
--cc=mkashani@nvidia.com \
--cc=ophirmu@nvidia.com \
--cc=orika@nvidia.com \
--cc=rasland@nvidia.com \
--cc=stephen@networkplumber.org \
--cc=suanmingm@nvidia.com \
--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).