The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=c31002454ea466d09071050d5467540727301fb0
commit c31002454ea466d09071050d5467540727301fb0 Author: Vag Singh <[email protected]> AuthorDate: 2025-08-14 05:40:56 +0000 Commit: Konstantin Belousov <[email protected]> CommitDate: 2026-09-16 14:12:07 +0000 mlx5en: Add sysctl variable mapping driver name to IF name PATCH 09/31] FreeBSD OFED support for DPDK MLX5 PMD HyperV is not enabling ROCE by default causing the OFED to not create few SYSCTL variables that publish kernel interface name. Due to this MLX5 PMD is not able to read kernel interface name to get MAC address. Added new sysctl variable in MLX5_EN driver to map the device name to the interface name. Differential revision: https://reviews.freebsd.org/D32183 MFC after: 1 month --- sys/dev/mlx5/mlx5_en/mlx5_en_main.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c index 4d94ddf6a391..7c03a1fcea6b 100644 --- a/sys/dev/mlx5/mlx5_en/mlx5_en_main.c +++ b/sys/dev/mlx5/mlx5_en/mlx5_en_main.c @@ -4123,6 +4123,18 @@ mlx5e_priv_static_destroy(struct mlx5e_priv *priv, struct mlx5_core_dev *mdev, sx_destroy(&priv->state_lock); } +static int +sysctl_ifname(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + char name[IFNAMSIZ]; + int error; + + strncpy(name, if_name(priv->ifp), sizeof(name)); + error = sysctl_handle_string(oidp, name, sizeof(name), req); + return (error); +} + static int sysctl_firmware(SYSCTL_HANDLER_ARGS) { @@ -4955,6 +4967,11 @@ mlx5e_create_ifp(struct mlx5_core_dev *mdev) } PRIV_UNLOCK(priv); + SYSCTL_ADD_PROC(&priv->sysctl_ctx, + SYSCTL_CHILDREN(device_get_sysctl_tree(mdev->pdev->dev.bsddev)), + OID_AUTO, "ifname", CTLTYPE_STRING | CTLFLAG_RD, priv, 0, + sysctl_ifname, "A", "ifname managed by driver"); + return (priv); err_open_flow_tables:
