Message ID | 1356831061-1483-1-git-send-email-fbl@redhat.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Sun, Dec 30, 2012 at 02:31:01AM CET, fbl@redhat.com wrote: >The user space teamd daemon may need to control the >master's carrier state depending on the selected mode. > >Signed-off-by: Flavio Leitner <fbl@redhat.com> >--- > drivers/net/team/team.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) > >diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c >index f711039..14cb843 100644 >--- a/drivers/net/team/team.c >+++ b/drivers/net/team/team.c >@@ -1708,6 +1708,15 @@ static netdev_features_t team_fix_features(struct net_device *dev, > return features; > } > >+static int team_change_carrier(struct net_device *dev, bool new_carrier) >+{ >+ if (new_carrier) >+ netif_carrier_on(dev); >+ else >+ netif_carrier_off(dev); >+ return 0; >+} >+ > static const struct net_device_ops team_netdev_ops = { > .ndo_init = team_init, > .ndo_uninit = team_uninit, >@@ -1730,6 +1739,7 @@ static const struct net_device_ops team_netdev_ops = { > .ndo_add_slave = team_add_slave, > .ndo_del_slave = team_del_slave, > .ndo_fix_features = team_fix_features, >+ .ndo_change_carrier = team_change_carrier, > }; > > /*********************** >-- >1.8.0.1 Acked-by: Jiri Pirko <jiri@resnulli.us> > -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Flavio Leitner <fbl@redhat.com> Date: Sat, 29 Dec 2012 23:31:01 -0200 > The user space teamd daemon may need to control the > master's carrier state depending on the selected mode. > > Signed-off-by: Flavio Leitner <fbl@redhat.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
2012/12/30 Flavio Leitner <fbl@redhat.com>: > The user space teamd daemon may need to control the > master's carrier state depending on the selected mode. [...] > +static int team_change_carrier(struct net_device *dev, bool new_carrier) > +{ > + if (new_carrier) > + netif_carrier_on(dev); > + else > + netif_carrier_off(dev); > + return 0; > +} > + [...] > + .ndo_change_carrier = team_change_carrier, I wonder what else you might put in the .ndo_change_carrier implementation? It's already the same for dummy device and tunnels would get more copies. Maybe it would be enough to allocate a bit in netdev->priv_flags and use that in dev_change_carrier() instead? Best Regards, Michał Mirosław -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
30. 12. 2012 v 14:03, Michał Mirosław <mirqus@gmail.com>: > 2012/12/30 Flavio Leitner <fbl@redhat.com>: >> The user space teamd daemon may need to control the >> master's carrier state depending on the selected mode. > [...] >> +static int team_change_carrier(struct net_device *dev, bool new_carrier) >> +{ >> + if (new_carrier) >> + netif_carrier_on(dev); >> + else >> + netif_carrier_off(dev); >> + return 0; >> +} >> + > [...] >> + .ndo_change_carrier = team_change_carrier, > > I wonder what else you might put in the .ndo_change_carrier > implementation? It's already the same for dummy device and tunnels > would get more copies. Maybe it would be enough to allocate a bit in > netdev->priv_flags and use that in dev_change_carrier() instead? > Flavio has a patch adding some more code here prepared already. Will be posted soon. > Best Regards, > Michał Mirosław -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index f711039..14cb843 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c @@ -1708,6 +1708,15 @@ static netdev_features_t team_fix_features(struct net_device *dev, return features; } +static int team_change_carrier(struct net_device *dev, bool new_carrier) +{ + if (new_carrier) + netif_carrier_on(dev); + else + netif_carrier_off(dev); + return 0; +} + static const struct net_device_ops team_netdev_ops = { .ndo_init = team_init, .ndo_uninit = team_uninit, @@ -1730,6 +1739,7 @@ static const struct net_device_ops team_netdev_ops = { .ndo_add_slave = team_add_slave, .ndo_del_slave = team_del_slave, .ndo_fix_features = team_fix_features, + .ndo_change_carrier = team_change_carrier, }; /***********************
The user space teamd daemon may need to control the master's carrier state depending on the selected mode. Signed-off-by: Flavio Leitner <fbl@redhat.com> --- drivers/net/team/team.c | 10 ++++++++++ 1 file changed, 10 insertions(+)