igc: add support to get MAC Merge data via ethtool

Implement "ethtool --show-mm" callback for IGC.

Tested with command:
$ ethtool --show-mm enp1s0.
  MAC Merge layer state for enp1s0:
  pMAC enabled: on
  TX enabled: on
  TX active: on
  TX minimum fragment size: 64
  RX minimum fragment size: 60
  Verify enabled: on
  Verify time: 128
  Max verify time: 128
  Verification status: SUCCEEDED

Verified that the fields value are retrieved correctly.

Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Faizal Rahim <faizal.abdul.rahim@linux.intel.com>
Tested-by: Mor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
This commit is contained in:
Faizal Rahim 2025-03-17 23:07:41 -04:00 committed by Tony Nguyen
parent e9074d7f37
commit 10e2ffe10e
2 changed files with 15 additions and 0 deletions

View File

@ -1782,6 +1782,19 @@ static int igc_ethtool_set_eee(struct net_device *netdev,
return 0;
}
static int igc_ethtool_get_mm(struct net_device *netdev,
struct ethtool_mm_state *cmd)
{
struct igc_adapter *adapter = netdev_priv(netdev);
struct igc_fpe_t *fpe = &adapter->fpe;
ethtool_mmsv_get_mm(&fpe->mmsv, cmd);
cmd->tx_min_frag_size = fpe->tx_min_frag_size;
cmd->rx_min_frag_size = IGC_RX_MIN_FRAG_SIZE;
return 0;
}
static int igc_ethtool_set_mm(struct net_device *netdev,
struct ethtool_mm_cfg *cmd,
struct netlink_ext_ack *extack)
@ -2101,6 +2114,7 @@ static const struct ethtool_ops igc_ethtool_ops = {
.get_link_ksettings = igc_ethtool_get_link_ksettings,
.set_link_ksettings = igc_ethtool_set_link_ksettings,
.self_test = igc_ethtool_diag_test,
.get_mm = igc_ethtool_get_mm,
.set_mm = igc_ethtool_set_mm,
};

View File

@ -4,6 +4,7 @@
#ifndef _IGC_TSN_H_
#define _IGC_TSN_H_
#define IGC_RX_MIN_FRAG_SIZE 60
#define SMD_FRAME_SIZE 60
enum igc_txd_popts_type {