drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c- Extension
.c- Size
- 9465 bytes
- Lines
- 316
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
en.hipoib.hen/fs_ethtool.h
Detected Declarations
enum mlx5_ptys_ratefunction Copyrightfunction mlx5i_get_stringsfunction mlx5i_get_sset_countfunction mlx5i_get_ethtool_statsfunction mlx5i_set_ringparamfunction mlx5i_get_ringparamfunction mlx5i_set_channelsfunction mlx5i_get_channelsfunction mlx5i_set_coalescefunction mlx5i_get_coalescefunction mlx5i_get_ts_infofunction mlx5i_flash_devicefunction mlx5_ptys_width_enum_to_intfunction mlx5_ptys_rate_enum_to_intfunction mlx5i_get_speed_settingsfunction mlx5i_get_link_ksettingsfunction mlx5i_flow_type_maskfunction mlx5i_set_rxfh_fieldsfunction mlx5i_get_rxfh_fieldsfunction mlx5i_set_rxnfcfunction mlx5i_get_rx_ring_countfunction mlx5i_get_rxnfc
Annotated Snippet
#include "en.h"
#include "ipoib.h"
#include "en/fs_ethtool.h"
static void mlx5i_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
mlx5e_ethtool_get_drvinfo(priv, drvinfo);
strscpy(drvinfo->driver, KBUILD_MODNAME "[ib_ipoib]",
sizeof(drvinfo->driver));
}
static void mlx5i_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
mlx5e_ethtool_get_strings(priv, stringset, data);
}
static int mlx5i_get_sset_count(struct net_device *dev, int sset)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
return mlx5e_ethtool_get_sset_count(priv, sset);
}
static void mlx5i_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats,
u64 *data)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
mlx5e_ethtool_get_ethtool_stats(priv, stats, data);
}
static int mlx5i_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *param,
struct kernel_ethtool_ringparam *kernel_param,
struct netlink_ext_ack *extack)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
return mlx5e_ethtool_set_ringparam(priv, param, extack);
}
static void mlx5i_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *param,
struct kernel_ethtool_ringparam *kernel_param,
struct netlink_ext_ack *extack)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
mlx5e_ethtool_get_ringparam(priv, param, kernel_param);
}
static int mlx5i_set_channels(struct net_device *dev,
struct ethtool_channels *ch)
{
struct mlx5i_priv *ipriv = netdev_priv(dev);
struct mlx5e_priv *epriv = mlx5i_epriv(dev);
/* rtnl lock protects from race between this ethtool op and sub
* interface ndo_init/uninit.
*/
ASSERT_RTNL();
if (ipriv->num_sub_interfaces > 0) {
mlx5_core_warn(epriv->mdev,
"can't change number of channels for interfaces with sub interfaces (%u)\n",
ipriv->num_sub_interfaces);
return -EINVAL;
}
return mlx5e_ethtool_set_channels(epriv, ch);
}
static void mlx5i_get_channels(struct net_device *dev,
struct ethtool_channels *ch)
{
struct mlx5e_priv *priv = mlx5i_epriv(dev);
mlx5e_ethtool_get_channels(priv, ch);
}
static int mlx5i_set_coalesce(struct net_device *netdev,
struct ethtool_coalesce *coal,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{
Annotation
- Immediate include surface: `en.h`, `ipoib.h`, `en/fs_ethtool.h`.
- Detected declarations: `enum mlx5_ptys_rate`, `function Copyright`, `function mlx5i_get_strings`, `function mlx5i_get_sset_count`, `function mlx5i_get_ethtool_stats`, `function mlx5i_set_ringparam`, `function mlx5i_get_ringparam`, `function mlx5i_set_channels`, `function mlx5i_get_channels`, `function mlx5i_set_coalesce`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.