From: Jiri Pirko <jpirko@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, eric.dumazet@gmail.com,
bhutchings@solarflare.com, shemminger@vyatta.com,
ebiederm@xmission.com, mirqus@gmail.com, kaber@trash.net,
greearb@candelatech.com, jesse@nicira.com
Subject: [patch net-next 6/6] team: use vlan_vids_[addr/del]_by_dev
Date: Thu, 8 Dec 2011 15:11:20 +0100 [thread overview]
Message-ID: <1323353480-1900-7-git-send-email-jpirko@redhat.com> (raw)
In-Reply-To: <1323353480-1900-1-git-send-email-jpirko@redhat.com>
So far when vlan id was added to team device befor port was added, this
vid was not added to port's vlan filter. Also after removal, vid stayed
in port device's vlan filter. Benefit of new vlan functions to handle
this work.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
drivers/net/team/team.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 79c2d1b..ed2a862 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -588,6 +588,13 @@ static int team_port_add(struct team *team, struct net_device *port_dev)
goto err_dev_open;
}
+ err = vlan_vids_add_by_dev(port_dev, dev);
+ if (err) {
+ netdev_err(dev, "Failed to add vlan ids to device %s\n",
+ portname);
+ goto err_vids_add;
+ }
+
err = netdev_set_master(port_dev, dev);
if (err) {
netdev_err(dev, "Device %s failed to set master\n", portname);
@@ -615,6 +622,9 @@ err_handler_register:
netdev_set_master(port_dev, NULL);
err_set_master:
+ vlan_vids_del_by_dev(port_dev, dev);
+
+err_vids_add:
dev_close(port_dev);
err_dev_open:
@@ -648,6 +658,7 @@ static int team_port_del(struct team *team, struct net_device *port_dev)
team_adjust_ops(team);
netdev_rx_handler_unregister(port_dev);
netdev_set_master(port_dev, NULL);
+ vlan_vids_del_by_dev(port_dev, dev);
dev_close(port_dev);
team_port_leave(team, port);
team_port_set_orig_mac(port);
--
1.7.6
next prev parent reply other threads:[~2011-12-08 14:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-08 14:11 [patch net-next 0/6] vlan: introduce per-device vlan id list Jiri Pirko
2011-12-08 14:11 ` [patch net-next 1/6] vlan: rename vlan_dev_info to vlan_dev_priv Jiri Pirko
2011-12-08 14:11 ` [patch net-next 3/6] net: introduce vlan_vid_[add/del] and use them instead of direct [add/kill]_vid ndo calls Jiri Pirko
2011-12-08 14:11 ` [patch net-next 4/6] vlan: introduce vid list with reference counting Jiri Pirko
2011-12-08 14:11 ` [patch net-next 5/6] vlan: introduce functions to do mass addition/deletion of vids by another device Jiri Pirko
2011-12-08 14:11 ` Jiri Pirko [this message]
2011-12-09 0:53 ` [patch net-next 0/6] vlan: introduce per-device vlan id list David Miller
[not found] ` <1323353480-1900-3-git-send-email-jpirko@redhat.com>
[not found] ` <87iplqfgcz.fsf@rustcorp.com.au>
2011-12-09 10:41 ` [patch net-next 2/6] net: make vlan ndo_vlan_rx_[add/kill]_vid return error value Jiri Pirko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1323353480-1900-7-git-send-email-jpirko@redhat.com \
--to=jpirko@redhat.com \
--cc=bhutchings@solarflare.com \
--cc=davem@davemloft.net \
--cc=ebiederm@xmission.com \
--cc=eric.dumazet@gmail.com \
--cc=greearb@candelatech.com \
--cc=jesse@nicira.com \
--cc=kaber@trash.net \
--cc=mirqus@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).