Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1740209 > unrolled thread
| Started by | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| First post | 2017-09-26 23:20 +0200 |
| Last post | 2017-09-27 05:10 +0200 |
| Articles | 15 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH net-next 0/5] net: dsa: use generic slave phydev Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-26 23:20 +0200
[PATCH net-next 1/5] net: dsa: return -ENODEV is there is no slave PHY Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-26 23:30 +0200
Re: [PATCH net-next 1/5] net: dsa: return -ENODEV is there is no slave PHY Andrew Lunn <andrew@lunn.ch> - 2017-09-26 23:50 +0200
Re: [PATCH net-next 1/5] net: dsa: return -ENODEV is there is no slave PHY Florian Fainelli <f.fainelli@gmail.com> - 2017-09-27 00:10 +0200
[PATCH net-next 5/5] net: dsa: use phy_ethtool_nway_reset Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-26 23:30 +0200
Re: [PATCH net-next 5/5] net: dsa: use phy_ethtool_nway_reset Andrew Lunn <andrew@lunn.ch> - 2017-09-27 00:00 +0200
Re: [PATCH net-next 5/5] net: dsa: use phy_ethtool_nway_reset Florian Fainelli <f.fainelli@gmail.com> - 2017-09-27 00:10 +0200
[PATCH net-next 3/5] net: dsa: use phy_ethtool_get_link_ksettings Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-26 23:30 +0200
Re: [PATCH net-next 3/5] net: dsa: use phy_ethtool_get_link_ksettings Andrew Lunn <andrew@lunn.ch> - 2017-09-27 00:00 +0200
Re: [PATCH net-next 3/5] net: dsa: use phy_ethtool_get_link_ksettings Florian Fainelli <f.fainelli@gmail.com> - 2017-09-27 00:10 +0200
[PATCH net-next 4/5] net: dsa: use phy_ethtool_set_link_ksettings Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-09-26 23:30 +0200
Re: [PATCH net-next 4/5] net: dsa: use phy_ethtool_set_link_ksettings Andrew Lunn <andrew@lunn.ch> - 2017-09-27 00:00 +0200
Re: [PATCH net-next 4/5] net: dsa: use phy_ethtool_set_link_ksettings Florian Fainelli <f.fainelli@gmail.com> - 2017-09-27 00:10 +0200
Re: [PATCH net-next 0/5] net: dsa: use generic slave phydev Florian Fainelli <f.fainelli@gmail.com> - 2017-09-27 02:00 +0200
Re: [PATCH net-next 0/5] net: dsa: use generic slave phydev David Miller <davem@davemloft.net> - 2017-09-27 05:10 +0200
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-09-26 23:20 +0200 |
| Subject | [PATCH net-next 0/5] net: dsa: use generic slave phydev |
| Message-ID | <uu5qN-1Br-9@gated-at.bofh.it> |
DSA currently stores a phy_device pointer in each slave private structure. This requires to implement our own ethtool ksettings accessors and such. This patchset removes the private phy_device in favor of the one provided in the net_device structure, and thus allows us to use the generic phy_ethtool_* functions. Vivien Didelot (5): net: dsa: return -ENODEV is there is no slave PHY net: dsa: use slave device phydev net: dsa: use phy_ethtool_get_link_ksettings net: dsa: use phy_ethtool_set_link_ksettings net: dsa: use phy_ethtool_nway_reset net/dsa/dsa_priv.h | 1 - net/dsa/slave.c | 143 +++++++++++++++++++---------------------------------- 2 files changed, 52 insertions(+), 92 deletions(-) -- 2.14.1
[toc] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-09-26 23:30 +0200 |
| Subject | [PATCH net-next 1/5] net: dsa: return -ENODEV is there is no slave PHY |
| Message-ID | <uu5Au-1Es-11@gated-at.bofh.it> |
| In reply to | #1740209 |
Instead of returning -EOPNOTSUPP when a slave device has no PHY,
directly return -ENODEV as ethtool and phylib do.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
net/dsa/slave.c | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index bd51ef56ec5b..79c5a0cd9923 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -266,10 +266,10 @@ static int dsa_slave_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct dsa_slave_priv *p = netdev_priv(dev);
- if (p->phy != NULL)
- return phy_mii_ioctl(p->phy, ifr, cmd);
+ if (!p->phy)
+ return -ENODEV;
- return -EOPNOTSUPP;
+ return phy_mii_ioctl(p->phy, ifr, cmd);
}
static int dsa_slave_port_attr_set(struct net_device *dev,
@@ -429,7 +429,7 @@ dsa_slave_get_link_ksettings(struct net_device *dev,
struct dsa_slave_priv *p = netdev_priv(dev);
if (!p->phy)
- return -EOPNOTSUPP;
+ return -ENODEV;
phy_ethtool_ksettings_get(p->phy, cmd);
@@ -442,10 +442,10 @@ dsa_slave_set_link_ksettings(struct net_device *dev,
{
struct dsa_slave_priv *p = netdev_priv(dev);
- if (p->phy != NULL)
- return phy_ethtool_ksettings_set(p->phy, cmd);
+ if (!p->phy)
+ return -ENODEV;
- return -EOPNOTSUPP;
+ return phy_ethtool_ksettings_set(p->phy, cmd);
}
static void dsa_slave_get_drvinfo(struct net_device *dev,
@@ -481,22 +481,22 @@ static int dsa_slave_nway_reset(struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
- if (p->phy != NULL)
- return genphy_restart_aneg(p->phy);
+ if (!p->phy)
+ return -ENODEV;
- return -EOPNOTSUPP;
+ return genphy_restart_aneg(p->phy);
}
static u32 dsa_slave_get_link(struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
- if (p->phy != NULL) {
- genphy_update_link(p->phy);
- return p->phy->link;
- }
+ if (!p->phy)
+ return -ENODEV;
- return -EOPNOTSUPP;
+ genphy_update_link(p->phy);
+
+ return p->phy->link;
}
static int dsa_slave_get_eeprom_len(struct net_device *dev)
--
2.14.1
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-09-26 23:50 +0200 |
| Subject | Re: [PATCH net-next 1/5] net: dsa: return -ENODEV is there is no slave PHY |
| Message-ID | <uu5TP-1KX-11@gated-at.bofh.it> |
| In reply to | #1740213 |
On Tue, Sep 26, 2017 at 05:15:31PM -0400, Vivien Didelot wrote:
> Instead of returning -EOPNOTSUPP when a slave device has no PHY,
> directly return -ENODEV as ethtool and phylib do.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-09-27 00:10 +0200 |
| Subject | Re: [PATCH net-next 1/5] net: dsa: return -ENODEV is there is no slave PHY |
| Message-ID | <uu6db-27Y-5@gated-at.bofh.it> |
| In reply to | #1740213 |
On 09/26/2017 02:15 PM, Vivien Didelot wrote: > Instead of returning -EOPNOTSUPP when a slave device has no PHY, > directly return -ENODEV as ethtool and phylib do. > > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-09-26 23:30 +0200 |
| Subject | [PATCH net-next 5/5] net: dsa: use phy_ethtool_nway_reset |
| Message-ID | <uu5Au-1Es-13@gated-at.bofh.it> |
| In reply to | #1740209 |
Use phy_ethtool_nway_reset now that dsa_slave_nway_reset does exactly
the same.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
net/dsa/slave.c | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index d2b632cae468..bf8800de13c1 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -450,14 +450,6 @@ dsa_slave_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *_p)
ds->ops->get_regs(ds, p->dp->index, regs, _p);
}
-static int dsa_slave_nway_reset(struct net_device *dev)
-{
- if (!dev->phydev)
- return -ENODEV;
-
- return genphy_restart_aneg(dev->phydev);
-}
-
static u32 dsa_slave_get_link(struct net_device *dev)
{
if (!dev->phydev)
@@ -888,7 +880,7 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
.get_drvinfo = dsa_slave_get_drvinfo,
.get_regs_len = dsa_slave_get_regs_len,
.get_regs = dsa_slave_get_regs,
- .nway_reset = dsa_slave_nway_reset,
+ .nway_reset = phy_ethtool_nway_reset,
.get_link = dsa_slave_get_link,
.get_eeprom_len = dsa_slave_get_eeprom_len,
.get_eeprom = dsa_slave_get_eeprom,
--
2.14.1
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-09-27 00:00 +0200 |
| Subject | Re: [PATCH net-next 5/5] net: dsa: use phy_ethtool_nway_reset |
| Message-ID | <uu63w-1PM-23@gated-at.bofh.it> |
| In reply to | #1740214 |
On Tue, Sep 26, 2017 at 05:15:35PM -0400, Vivien Didelot wrote:
> Use phy_ethtool_nway_reset now that dsa_slave_nway_reset does exactly
> the same.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-09-27 00:10 +0200 |
| Subject | Re: [PATCH net-next 5/5] net: dsa: use phy_ethtool_nway_reset |
| Message-ID | <uu6db-27Y-1@gated-at.bofh.it> |
| In reply to | #1740214 |
On 09/26/2017 02:15 PM, Vivien Didelot wrote: > Use phy_ethtool_nway_reset now that dsa_slave_nway_reset does exactly > the same. > > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-09-26 23:30 +0200 |
| Subject | [PATCH net-next 3/5] net: dsa: use phy_ethtool_get_link_ksettings |
| Message-ID | <uu5Au-1Es-15@gated-at.bofh.it> |
| In reply to | #1740209 |
Use phy_ethtool_get_link_ksettings now that dsa_slave_get_link_ksettings
does exactly the same.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
net/dsa/slave.c | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 4ea1c6eb0da8..bb0f64f47ae7 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -420,17 +420,6 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev)
}
/* ethtool operations *******************************************************/
-static int
-dsa_slave_get_link_ksettings(struct net_device *dev,
- struct ethtool_link_ksettings *cmd)
-{
- if (!dev->phydev)
- return -ENODEV;
-
- phy_ethtool_ksettings_get(dev->phydev, cmd);
-
- return 0;
-}
static int
dsa_slave_set_link_ksettings(struct net_device *dev,
@@ -921,8 +910,8 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
.get_wol = dsa_slave_get_wol,
.set_eee = dsa_slave_set_eee,
.get_eee = dsa_slave_get_eee,
- .get_link_ksettings = dsa_slave_get_link_ksettings,
.set_link_ksettings = dsa_slave_set_link_ksettings,
+ .get_link_ksettings = phy_ethtool_get_link_ksettings,
.get_rxnfc = dsa_slave_get_rxnfc,
.set_rxnfc = dsa_slave_set_rxnfc,
};
--
2.14.1
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-09-27 00:00 +0200 |
| Subject | Re: [PATCH net-next 3/5] net: dsa: use phy_ethtool_get_link_ksettings |
| Message-ID | <uu63w-1PM-21@gated-at.bofh.it> |
| In reply to | #1740216 |
On Tue, Sep 26, 2017 at 05:15:33PM -0400, Vivien Didelot wrote:
> Use phy_ethtool_get_link_ksettings now that dsa_slave_get_link_ksettings
> does exactly the same.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-09-27 00:10 +0200 |
| Subject | Re: [PATCH net-next 3/5] net: dsa: use phy_ethtool_get_link_ksettings |
| Message-ID | <uu6db-27Y-7@gated-at.bofh.it> |
| In reply to | #1740216 |
On 09/26/2017 02:15 PM, Vivien Didelot wrote: > Use phy_ethtool_get_link_ksettings now that dsa_slave_get_link_ksettings > does exactly the same. > > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Vivien Didelot <vivien.didelot@savoirfairelinux.com> |
|---|---|
| Date | 2017-09-26 23:30 +0200 |
| Subject | [PATCH net-next 4/5] net: dsa: use phy_ethtool_set_link_ksettings |
| Message-ID | <uu5Au-1Es-19@gated-at.bofh.it> |
| In reply to | #1740209 |
Use phy_ethtool_set_link_ksettings now that dsa_slave_set_link_ksettings
does exactly the same.
Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
---
net/dsa/slave.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index bb0f64f47ae7..d2b632cae468 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -421,16 +421,6 @@ static netdev_tx_t dsa_slave_xmit(struct sk_buff *skb, struct net_device *dev)
/* ethtool operations *******************************************************/
-static int
-dsa_slave_set_link_ksettings(struct net_device *dev,
- const struct ethtool_link_ksettings *cmd)
-{
- if (!dev->phydev)
- return -ENODEV;
-
- return phy_ethtool_ksettings_set(dev->phydev, cmd);
-}
-
static void dsa_slave_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{
@@ -910,8 +900,8 @@ static const struct ethtool_ops dsa_slave_ethtool_ops = {
.get_wol = dsa_slave_get_wol,
.set_eee = dsa_slave_set_eee,
.get_eee = dsa_slave_get_eee,
- .set_link_ksettings = dsa_slave_set_link_ksettings,
.get_link_ksettings = phy_ethtool_get_link_ksettings,
+ .set_link_ksettings = phy_ethtool_set_link_ksettings,
.get_rxnfc = dsa_slave_get_rxnfc,
.set_rxnfc = dsa_slave_set_rxnfc,
};
--
2.14.1
[toc] | [prev] | [next] | [standalone]
| From | Andrew Lunn <andrew@lunn.ch> |
|---|---|
| Date | 2017-09-27 00:00 +0200 |
| Subject | Re: [PATCH net-next 4/5] net: dsa: use phy_ethtool_set_link_ksettings |
| Message-ID | <uu63w-1PM-29@gated-at.bofh.it> |
| In reply to | #1740217 |
On Tue, Sep 26, 2017 at 05:15:34PM -0400, Vivien Didelot wrote:
> Use phy_ethtool_set_link_ksettings now that dsa_slave_set_link_ksettings
> does exactly the same.
>
> Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-09-27 00:10 +0200 |
| Subject | Re: [PATCH net-next 4/5] net: dsa: use phy_ethtool_set_link_ksettings |
| Message-ID | <uu6db-27Y-9@gated-at.bofh.it> |
| In reply to | #1740217 |
On 09/26/2017 02:15 PM, Vivien Didelot wrote: > Use phy_ethtool_set_link_ksettings now that dsa_slave_set_link_ksettings > does exactly the same. > > Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> -- Florian
[toc] | [prev] | [next] | [standalone]
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Date | 2017-09-27 02:00 +0200 |
| Message-ID | <uu7VD-31c-1@gated-at.bofh.it> |
| In reply to | #1740209 |
On 09/26/2017 02:15 PM, Vivien Didelot wrote: > DSA currently stores a phy_device pointer in each slave private > structure. This requires to implement our own ethtool ksettings > accessors and such. > > This patchset removes the private phy_device in favor of the one > provided in the net_device structure, and thus allows us to use the > generic phy_ethtool_* functions. For this series: Tested-by: Florian Fainelli <f.fainelli@gmail.com> On bcm_sf2 (7445 and 7278) along with the externally attached BCM53125 switch that needs the special MDIO read/write divert. We properly attach to the right PHY devices in all cases. Also tested unbind/bind, working correctly. Thanks! > > Vivien Didelot (5): > net: dsa: return -ENODEV is there is no slave PHY > net: dsa: use slave device phydev > net: dsa: use phy_ethtool_get_link_ksettings > net: dsa: use phy_ethtool_set_link_ksettings > net: dsa: use phy_ethtool_nway_reset > > net/dsa/dsa_priv.h | 1 - > net/dsa/slave.c | 143 +++++++++++++++++++---------------------------------- > 2 files changed, 52 insertions(+), 92 deletions(-) > -- Florian
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-09-27 05:10 +0200 |
| Message-ID | <uuaTv-59K-7@gated-at.bofh.it> |
| In reply to | #1740209 |
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Date: Tue, 26 Sep 2017 17:15:30 -0400 > DSA currently stores a phy_device pointer in each slave private > structure. This requires to implement our own ethtool ksettings > accessors and such. > > This patchset removes the private phy_device in favor of the one > provided in the net_device structure, and thus allows us to use the > generic phy_ethtool_* functions. Series applied, thanks Vivien.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web