* [PATCH net 0/2] Bonding fixes for Ocelot switch
@ 2019-11-05 21:50 Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 1/2] net: mscc: ocelot: don't handle netdev events for other netdevs Vladimir Oltean
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Vladimir Oltean @ 2019-11-05 21:50 UTC (permalink / raw)
To: jakub.kicinski, davem
Cc: andrew, f.fainelli, alexandre.belloni, netdev, Vladimir Oltean
This series fixes 2 issues with bonding in a system that integrates the
ocelot driver, but the ports that are bonded do not actually belong to
ocelot.
Claudiu Manoil (2):
net: mscc: ocelot: don't handle netdev events for other netdevs
net: mscc: ocelot: fix NULL pointer on LAG slave removal
drivers/net/ethernet/mscc/ocelot.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
--
2.17.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH net 1/2] net: mscc: ocelot: don't handle netdev events for other netdevs
2019-11-05 21:50 [PATCH net 0/2] Bonding fixes for Ocelot switch Vladimir Oltean
@ 2019-11-05 21:50 ` Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 2/2] net: mscc: ocelot: fix NULL pointer on LAG slave removal Vladimir Oltean
2019-11-06 23:34 ` [PATCH net 0/2] Bonding fixes for Ocelot switch David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2019-11-05 21:50 UTC (permalink / raw)
To: jakub.kicinski, davem
Cc: andrew, f.fainelli, alexandre.belloni, netdev, Claudiu Manoil,
Vladimir Oltean
From: Claudiu Manoil <claudiu.manoil@nxp.com>
The check that the event is actually for this device should be moved
from the "port" handler to the net device handler.
Otherwise the port handler will deny bonding configuration for other
net devices in the same system (like enetc in the LS1028A) that don't
have the lag_upper_info->tx_type restriction that ocelot has.
Fixes: dc96ee3730fc ("net: mscc: ocelot: add bonding support")
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
drivers/net/ethernet/mscc/ocelot.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index 344539c0d3aa..dbf09fcf61f1 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -1680,9 +1680,6 @@ static int ocelot_netdevice_port_event(struct net_device *dev,
struct ocelot_port *ocelot_port = netdev_priv(dev);
int err = 0;
- if (!ocelot_netdevice_dev_check(dev))
- return 0;
-
switch (event) {
case NETDEV_CHANGEUPPER:
if (netif_is_bridge_master(info->upper_dev)) {
@@ -1719,6 +1716,9 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
int ret = 0;
+ if (!ocelot_netdevice_dev_check(dev))
+ return 0;
+
if (event == NETDEV_PRECHANGEUPPER &&
netif_is_lag_master(info->upper_dev)) {
struct netdev_lag_upper_info *lag_upper_info = info->upper_info;
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH net 2/2] net: mscc: ocelot: fix NULL pointer on LAG slave removal
2019-11-05 21:50 [PATCH net 0/2] Bonding fixes for Ocelot switch Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 1/2] net: mscc: ocelot: don't handle netdev events for other netdevs Vladimir Oltean
@ 2019-11-05 21:50 ` Vladimir Oltean
2019-11-06 23:34 ` [PATCH net 0/2] Bonding fixes for Ocelot switch David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Vladimir Oltean @ 2019-11-05 21:50 UTC (permalink / raw)
To: jakub.kicinski, davem
Cc: andrew, f.fainelli, alexandre.belloni, netdev, Claudiu Manoil,
Vladimir Oltean
From: Claudiu Manoil <claudiu.manoil@nxp.com>
lag_upper_info may be NULL on slave removal.
Fixes: dc96ee3730fc ("net: mscc: ocelot: add bonding support")
Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
---
drivers/net/ethernet/mscc/ocelot.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/mscc/ocelot.c b/drivers/net/ethernet/mscc/ocelot.c
index dbf09fcf61f1..672ea1342add 100644
--- a/drivers/net/ethernet/mscc/ocelot.c
+++ b/drivers/net/ethernet/mscc/ocelot.c
@@ -1724,7 +1724,8 @@ static int ocelot_netdevice_event(struct notifier_block *unused,
struct netdev_lag_upper_info *lag_upper_info = info->upper_info;
struct netlink_ext_ack *extack;
- if (lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
+ if (lag_upper_info &&
+ lag_upper_info->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
extack = netdev_notifier_info_to_extack(&info->info);
NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type");
--
2.17.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH net 0/2] Bonding fixes for Ocelot switch
2019-11-05 21:50 [PATCH net 0/2] Bonding fixes for Ocelot switch Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 1/2] net: mscc: ocelot: don't handle netdev events for other netdevs Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 2/2] net: mscc: ocelot: fix NULL pointer on LAG slave removal Vladimir Oltean
@ 2019-11-06 23:34 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-11-06 23:34 UTC (permalink / raw)
To: olteanv; +Cc: jakub.kicinski, andrew, f.fainelli, alexandre.belloni, netdev
From: Vladimir Oltean <olteanv@gmail.com>
Date: Tue, 5 Nov 2019 23:50:12 +0200
> This series fixes 2 issues with bonding in a system that integrates the
> ocelot driver, but the ports that are bonded do not actually belong to
> ocelot.
Series applied and queued up for -stable.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-06 23:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-05 21:50 [PATCH net 0/2] Bonding fixes for Ocelot switch Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 1/2] net: mscc: ocelot: don't handle netdev events for other netdevs Vladimir Oltean
2019-11-05 21:50 ` [PATCH net 2/2] net: mscc: ocelot: fix NULL pointer on LAG slave removal Vladimir Oltean
2019-11-06 23:34 ` [PATCH net 0/2] Bonding fixes for Ocelot switch David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.