Skip to content

Commit 10e2ffe

Browse files
Faizal Rahimanguy11
authored andcommitted
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 <[email protected]> Signed-off-by: Faizal Rahim <[email protected]> Tested-by: Mor Bar-Gabay <[email protected]> Signed-off-by: Tony Nguyen <[email protected]>
1 parent e9074d7 commit 10e2ffe

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

drivers/net/ethernet/intel/igc/igc_ethtool.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,6 +1782,19 @@ static int igc_ethtool_set_eee(struct net_device *netdev,
17821782
return 0;
17831783
}
17841784

1785+
static int igc_ethtool_get_mm(struct net_device *netdev,
1786+
struct ethtool_mm_state *cmd)
1787+
{
1788+
struct igc_adapter *adapter = netdev_priv(netdev);
1789+
struct igc_fpe_t *fpe = &adapter->fpe;
1790+
1791+
ethtool_mmsv_get_mm(&fpe->mmsv, cmd);
1792+
cmd->tx_min_frag_size = fpe->tx_min_frag_size;
1793+
cmd->rx_min_frag_size = IGC_RX_MIN_FRAG_SIZE;
1794+
1795+
return 0;
1796+
}
1797+
17851798
static int igc_ethtool_set_mm(struct net_device *netdev,
17861799
struct ethtool_mm_cfg *cmd,
17871800
struct netlink_ext_ack *extack)
@@ -2101,6 +2114,7 @@ static const struct ethtool_ops igc_ethtool_ops = {
21012114
.get_link_ksettings = igc_ethtool_get_link_ksettings,
21022115
.set_link_ksettings = igc_ethtool_set_link_ksettings,
21032116
.self_test = igc_ethtool_diag_test,
2117+
.get_mm = igc_ethtool_get_mm,
21042118
.set_mm = igc_ethtool_set_mm,
21052119
};
21062120

drivers/net/ethernet/intel/igc/igc_tsn.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#ifndef _IGC_TSN_H_
55
#define _IGC_TSN_H_
66

7+
#define IGC_RX_MIN_FRAG_SIZE 60
78
#define SMD_FRAME_SIZE 60
89

910
enum igc_txd_popts_type {

0 commit comments

Comments
 (0)