net: nvethernet: Fix build for Linux v6.15

In Linux v6,15, a 'speed' argument was added to the phy_loopback()
function. Add a conftest test to detect this change and update the
nvethernet driver accordingly. Note that if 'speed' is set to 0 when
calling phy_loopback(), then phy_loopback() behaves the same way as it
did before this argument was added. So by default set speed to 0 for the
nvethernet driver.

JIRA LINQPJ14-47

Change-Id: I55f775e672bfa1a00c9ccbd825c82be1868b0b52
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3330685
(cherry picked from commit 5ba2674826bc9e39b320fd79afd7d52709a39eca)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3499758
Tested-by: Brad Griffis <bgriffis@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
This commit is contained in:
Jon Hunter
2025-03-28 17:48:16 +00:00
committed by mobile promotions
parent 13ad68519d
commit 8e9d8552c3
3 changed files with 31 additions and 1 deletions

View File

@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-2.0-only
/* Copyright (c) 2019-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved */
// SPDX-FileCopyrightText: Copyright (c) 2019-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved
#ifndef OSI_STRIPPED_LIB
#include "ether_linux.h"
@@ -290,7 +290,11 @@ static int ether_test_phy_loopback(struct ether_priv_data *pdata)
if (!pdata->phydev)
return -ENODEV;
#if defined(NV_PHY_LOOPBACK_HAS_SPEED_ARG) /* Linux v6.15 */
ret = phy_loopback(pdata->phydev, true, 0);
#else
ret = phy_loopback(pdata->phydev, true);
#endif
if (ret != 0 && ret != -EBUSY)
return ret;
@@ -406,7 +410,11 @@ void ether_selftest_run(struct net_device *dev,
case ETHER_LOOPBACK_PHY:
ret = -EOPNOTSUPP;
if (dev->phydev)
#if defined(NV_PHY_LOOPBACK_HAS_SPEED_ARG) /* Linux v6.15 */
ret = phy_loopback(dev->phydev, true, 0);
#else
ret = phy_loopback(dev->phydev, true);
#endif
if (!ret)
break;
/* Fallthrough */
@@ -439,7 +447,11 @@ void ether_selftest_run(struct net_device *dev,
case ETHER_LOOPBACK_PHY:
ret = -EOPNOTSUPP;
if (dev->phydev)
#if defined(NV_PHY_LOOPBACK_HAS_SPEED_ARG) /* Linux v6.15 */
ret = phy_loopback(dev->phydev, false, 0);
#else
ret = phy_loopback(dev->phydev, false);
#endif
if (!ret)
break;
/* Fallthrough */