Skip to content

Commit 4cee9a6

Browse files
committed
Merge: CNB95: ethtool: switch EEE netlink interface to use EEE linkmode bitmaps
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/4136 JIRA: https://issues.redhat.com/browse/RHEL-32101 Commits: ``` d80a523 ("ethtool: replace struct ethtool_eee with a new struct ethtool_keee on kernel side") 0b3100b ("ethtool: switch back from ethtool_keee to ethtool_eee for ioctl") 285cc15 ("ethtool: adjust struct ethtool_keee to kernel needs") 1d756ff ("ethtool: add suffix _u32 to legacy bitmap members of struct ethtool_keee") 1f069de ("ethtool: add linkmode bitmap support to struct ethtool_keee") ``` Signed-off-by: Ivan Vecera <ivecera@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: Michal Schmidt <mschmidt@redhat.com> Approved-by: Petr Oros <poros@redhat.com> Approved-by: Davide Caratti <dcaratti@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Lucas Zampieri <lzampier@redhat.com>
2 parents acab7bf + 3ed5333 commit 4cee9a6

File tree

49 files changed

+347
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+347
-256
lines changed

drivers/net/dsa/b53/b53_common.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,
12131213
struct phy_device *phydev)
12141214
{
12151215
struct b53_device *dev = ds->priv;
1216-
struct ethtool_eee *p = &dev->ports[port].eee;
1216+
struct ethtool_keee *p = &dev->ports[port].eee;
12171217
u8 rgmii_ctrl = 0, reg = 0, off;
12181218
bool tx_pause = false;
12191219
bool rx_pause = false;
@@ -2191,10 +2191,10 @@ int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
21912191
}
21922192
EXPORT_SYMBOL(b53_eee_init);
21932193

2194-
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
2194+
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
21952195
{
21962196
struct b53_device *dev = ds->priv;
2197-
struct ethtool_eee *p = &dev->ports[port].eee;
2197+
struct ethtool_keee *p = &dev->ports[port].eee;
21982198
u16 reg;
21992199

22002200
if (is5325(dev) || is5365(dev))
@@ -2208,10 +2208,10 @@ int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
22082208
}
22092209
EXPORT_SYMBOL(b53_get_mac_eee);
22102210

2211-
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
2211+
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
22122212
{
22132213
struct b53_device *dev = ds->priv;
2214-
struct ethtool_eee *p = &dev->ports[port].eee;
2214+
struct ethtool_keee *p = &dev->ports[port].eee;
22152215

22162216
if (is5325(dev) || is5365(dev))
22172217
return -EOPNOTSUPP;

drivers/net/dsa/b53/b53_priv.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ enum {
9191

9292
struct b53_port {
9393
u16 vlan_ctl_mask;
94-
struct ethtool_eee eee;
94+
struct ethtool_keee eee;
9595
};
9696

9797
struct b53_vlan {
@@ -378,7 +378,7 @@ void b53_disable_port(struct dsa_switch *ds, int port);
378378
void b53_brcm_hdr_setup(struct dsa_switch *ds, int port);
379379
void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable);
380380
int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy);
381-
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
382-
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
381+
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
382+
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
383383

384384
#endif

drivers/net/dsa/bcm_sf2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
816816
bool tx_pause, bool rx_pause)
817817
{
818818
struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
819-
struct ethtool_eee *p = &priv->dev->ports[port].eee;
819+
struct ethtool_keee *p = &priv->dev->ports[port].eee;
820820

821821
bcm_sf2_sw_mac_link_set(ds, port, interface, true);
822822

drivers/net/dsa/mt7530.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,7 @@ mt753x_setup(struct dsa_switch *ds)
30173017
}
30183018

30193019
static int mt753x_get_mac_eee(struct dsa_switch *ds, int port,
3020-
struct ethtool_eee *e)
3020+
struct ethtool_keee *e)
30213021
{
30223022
struct mt7530_priv *priv = ds->priv;
30233023
u32 eeecr = mt7530_read(priv, MT7530_PMEEECR_P(port));
@@ -3029,7 +3029,7 @@ static int mt753x_get_mac_eee(struct dsa_switch *ds, int port,
30293029
}
30303030

30313031
static int mt753x_set_mac_eee(struct dsa_switch *ds, int port,
3032-
struct ethtool_eee *e)
3032+
struct ethtool_keee *e)
30333033
{
30343034
struct mt7530_priv *priv = ds->priv;
30353035
u32 set, mask = LPI_THRESH_MASK | LPI_MODE_EN;

drivers/net/dsa/mv88e6xxx/chip.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1198,14 +1198,14 @@ static void mv88e6xxx_get_regs(struct dsa_switch *ds, int port,
11981198
}
11991199

12001200
static int mv88e6xxx_get_mac_eee(struct dsa_switch *ds, int port,
1201-
struct ethtool_eee *e)
1201+
struct ethtool_keee *e)
12021202
{
12031203
/* Nothing to do on the port's MAC */
12041204
return 0;
12051205
}
12061206

12071207
static int mv88e6xxx_set_mac_eee(struct dsa_switch *ds, int port,
1208-
struct ethtool_eee *e)
1208+
struct ethtool_keee *e)
12091209
{
12101210
/* Nothing to do on the port's MAC */
12111211
return 0;

drivers/net/dsa/qca8k.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ qca8k_get_sset_count(struct dsa_switch *ds, int port, int sset)
14451445
}
14461446

14471447
static int
1448-
qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
1448+
qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *eee)
14491449
{
14501450
struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv;
14511451
u32 lpi_en = QCA8K_REG_EEE_CTRL_LPI_EN(port);
@@ -1469,7 +1469,7 @@ qca8k_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *eee)
14691469
}
14701470

14711471
static int
1472-
qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
1472+
qca8k_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
14731473
{
14741474
/* Nothing to do on the port's MAC */
14751475
return 0;

drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ static u32 eee_mask_to_ethtool_mask(u32 speed)
697697
return rate;
698698
}
699699

700-
static int aq_ethtool_get_eee(struct net_device *ndev, struct ethtool_eee *eee)
700+
static int aq_ethtool_get_eee(struct net_device *ndev, struct ethtool_keee *eee)
701701
{
702702
struct aq_nic_s *aq_nic = netdev_priv(ndev);
703703
u32 rate, supported_rates;
@@ -713,14 +713,14 @@ static int aq_ethtool_get_eee(struct net_device *ndev, struct ethtool_eee *eee)
713713
if (err < 0)
714714
return err;
715715

716-
eee->supported = eee_mask_to_ethtool_mask(supported_rates);
716+
eee->supported_u32 = eee_mask_to_ethtool_mask(supported_rates);
717717

718718
if (aq_nic->aq_nic_cfg.eee_speeds)
719-
eee->advertised = eee->supported;
719+
eee->advertised_u32 = eee->supported_u32;
720720

721-
eee->lp_advertised = eee_mask_to_ethtool_mask(rate);
721+
eee->lp_advertised_u32 = eee_mask_to_ethtool_mask(rate);
722722

723-
eee->eee_enabled = !!eee->advertised;
723+
eee->eee_enabled = !!eee->advertised_u32;
724724

725725
eee->tx_lpi_enabled = eee->eee_enabled;
726726
if ((supported_rates & rate) & AQ_NIC_RATE_EEE_MSK)
@@ -729,7 +729,7 @@ static int aq_ethtool_get_eee(struct net_device *ndev, struct ethtool_eee *eee)
729729
return 0;
730730
}
731731

732-
static int aq_ethtool_set_eee(struct net_device *ndev, struct ethtool_eee *eee)
732+
static int aq_ethtool_set_eee(struct net_device *ndev, struct ethtool_keee *eee)
733733
{
734734
struct aq_nic_s *aq_nic = netdev_priv(ndev);
735735
u32 rate, supported_rates;

drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ static u32 bnx2x_adv_to_eee(u32 modes, u32 shift)
21082108
return eee_adv << shift;
21092109
}
21102110

2111-
static int bnx2x_get_eee(struct net_device *dev, struct ethtool_eee *edata)
2111+
static int bnx2x_get_eee(struct net_device *dev, struct ethtool_keee *edata)
21122112
{
21132113
struct bnx2x *bp = netdev_priv(dev);
21142114
u32 eee_cfg;
@@ -2120,14 +2120,14 @@ static int bnx2x_get_eee(struct net_device *dev, struct ethtool_eee *edata)
21202120

21212121
eee_cfg = bp->link_vars.eee_status;
21222122

2123-
edata->supported =
2123+
edata->supported_u32 =
21242124
bnx2x_eee_to_adv((eee_cfg & SHMEM_EEE_SUPPORTED_MASK) >>
21252125
SHMEM_EEE_SUPPORTED_SHIFT);
21262126

2127-
edata->advertised =
2127+
edata->advertised_u32 =
21282128
bnx2x_eee_to_adv((eee_cfg & SHMEM_EEE_ADV_STATUS_MASK) >>
21292129
SHMEM_EEE_ADV_STATUS_SHIFT);
2130-
edata->lp_advertised =
2130+
edata->lp_advertised_u32 =
21312131
bnx2x_eee_to_adv((eee_cfg & SHMEM_EEE_LP_ADV_STATUS_MASK) >>
21322132
SHMEM_EEE_LP_ADV_STATUS_SHIFT);
21332133

@@ -2141,7 +2141,7 @@ static int bnx2x_get_eee(struct net_device *dev, struct ethtool_eee *edata)
21412141
return 0;
21422142
}
21432143

2144-
static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata)
2144+
static int bnx2x_set_eee(struct net_device *dev, struct ethtool_keee *edata)
21452145
{
21462146
struct bnx2x *bp = netdev_priv(dev);
21472147
u32 eee_cfg;
@@ -2162,7 +2162,7 @@ static int bnx2x_set_eee(struct net_device *dev, struct ethtool_eee *edata)
21622162
return -EOPNOTSUPP;
21632163
}
21642164

2165-
advertised = bnx2x_adv_to_eee(edata->advertised,
2165+
advertised = bnx2x_adv_to_eee(edata->advertised_u32,
21662166
SHMEM_EEE_ADV_STATUS_SHIFT);
21672167
if ((advertised != (eee_cfg & SHMEM_EEE_ADV_STATUS_MASK))) {
21682168
DP(BNX2X_MSG_ETHTOOL,

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9572,10 +9572,10 @@ static int bnxt_hwrm_phy_qcaps(struct bnxt *bp)
95729572

95739573
bp->phy_flags = resp->flags | (le16_to_cpu(resp->flags2) << 8);
95749574
if (resp->flags & PORT_PHY_QCAPS_RESP_FLAGS_EEE_SUPPORTED) {
9575-
struct ethtool_eee *eee = &bp->eee;
9575+
struct ethtool_keee *eee = &bp->eee;
95769576
u16 fw_speeds = le16_to_cpu(resp->supported_speeds_eee_mode);
95779577

9578-
eee->supported = _bnxt_fw_to_ethtool_adv_spds(fw_speeds, 0);
9578+
eee->supported_u32 = _bnxt_fw_to_ethtool_adv_spds(fw_speeds, 0);
95799579
bp->lpi_tmr_lo = le32_to_cpu(resp->tx_lpi_timer_low) &
95809580
PORT_PHY_QCAPS_RESP_TX_LPI_TIMER_LOW_MASK;
95819581
bp->lpi_tmr_hi = le32_to_cpu(resp->valid_tx_lpi_timer_high) &
@@ -9678,7 +9678,7 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
96789678
link_info->module_status = resp->module_status;
96799679

96809680
if (bp->phy_flags & BNXT_PHY_FL_EEE_CAP) {
9681-
struct ethtool_eee *eee = &bp->eee;
9681+
struct ethtool_keee *eee = &bp->eee;
96829682
u16 fw_speeds;
96839683

96849684
eee->eee_active = 0;
@@ -9687,7 +9687,7 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
96879687
eee->eee_active = 1;
96889688
fw_speeds = le16_to_cpu(
96899689
resp->link_partner_adv_eee_link_speed_mask);
9690-
eee->lp_advertised =
9690+
eee->lp_advertised_u32 =
96919691
_bnxt_fw_to_ethtool_adv_spds(fw_speeds, 0);
96929692
}
96939693

@@ -9698,7 +9698,7 @@ int bnxt_update_link(struct bnxt *bp, bool chng_link_state)
96989698
eee->eee_enabled = 1;
96999699

97009700
fw_speeds = le16_to_cpu(resp->adv_eee_link_speed_mask);
9701-
eee->advertised =
9701+
eee->advertised_u32 =
97029702
_bnxt_fw_to_ethtool_adv_spds(fw_speeds, 0);
97039703

97049704
if (resp->eee_config_phy_addr &
@@ -9872,7 +9872,7 @@ int bnxt_hwrm_set_pause(struct bnxt *bp)
98729872
static void bnxt_hwrm_set_eee(struct bnxt *bp,
98739873
struct hwrm_port_phy_cfg_input *req)
98749874
{
9875-
struct ethtool_eee *eee = &bp->eee;
9875+
struct ethtool_keee *eee = &bp->eee;
98769876

98779877
if (eee->eee_enabled) {
98789878
u16 eee_speeds;
@@ -9884,7 +9884,7 @@ static void bnxt_hwrm_set_eee(struct bnxt *bp,
98849884
flags |= PORT_PHY_CFG_REQ_FLAGS_EEE_TX_LPI_DISABLE;
98859885

98869886
req->flags |= cpu_to_le32(flags);
9887-
eee_speeds = bnxt_get_fw_auto_link_speeds(eee->advertised);
9887+
eee_speeds = bnxt_get_fw_auto_link_speeds(eee->advertised_u32);
98889888
req->eee_link_speed_mask = cpu_to_le16(eee_speeds);
98899889
req->tx_lpi_timer = cpu_to_le32(eee->tx_lpi_timer);
98909890
} else {
@@ -10312,7 +10312,7 @@ static void bnxt_hwmon_open(struct bnxt *bp)
1031210312

1031310313
static bool bnxt_eee_config_ok(struct bnxt *bp)
1031410314
{
10315-
struct ethtool_eee *eee = &bp->eee;
10315+
struct ethtool_keee *eee = &bp->eee;
1031610316
struct bnxt_link_info *link_info = &bp->link_info;
1031710317

1031810318
if (!(bp->phy_flags & BNXT_PHY_FL_EEE_CAP))
@@ -10326,8 +10326,8 @@ static bool bnxt_eee_config_ok(struct bnxt *bp)
1032610326
eee->eee_enabled = 0;
1032710327
return false;
1032810328
}
10329-
if (eee->advertised & ~advertising) {
10330-
eee->advertised = advertising & eee->supported;
10329+
if (eee->advertised_u32 & ~advertising) {
10330+
eee->advertised_u32 = advertising & eee->supported_u32;
1033110331
return false;
1033210332
}
1033310333
}

drivers/net/ethernet/broadcom/bnxt/bnxt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2121,7 +2121,7 @@ struct bnxt {
21212121
*/
21222122
struct mutex link_lock;
21232123
struct bnxt_link_info link_info;
2124-
struct ethtool_eee eee;
2124+
struct ethtool_keee eee;
21252125
u32 lpi_tmr_lo;
21262126
u32 lpi_tmr_hi;
21272127

0 commit comments

Comments
 (0)