Commit 10e2ffe1 authored by Faizal Rahim's avatar Faizal Rahim Committed by Tony Nguyen
Browse files

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: default avatarVladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: default avatarFaizal Rahim <faizal.abdul.rahim@linux.intel.com>
Tested-by: default avatarMor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent e9074d7f
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -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,
};

+1 −0
Original line number Diff line number Diff line
@@ -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 {