From: Simon Horman <simon.horman@netronome.com>
To: Jiri Pirko <jiri@resnulli.us>, Scott Feldman <sfeldma@gmail.com>
Cc: netdev@vger.kernel.org, Simon Horman <simon.horman@netronome.com>
Subject: [PATCH/RFC net-next 2/4] rocker: set untagged VLAN when opening port
Date: Mon, 13 Apr 2015 15:47:55 +0900 [thread overview]
Message-ID: <1428907677-27204-3-git-send-email-simon.horman@netronome.com> (raw)
In-Reply-To: <1428907677-27204-1-git-send-email-simon.horman@netronome.com>
When joining a bridge rocker sets the untagged VLAN of a port
according to the ifindex of its bridge device.
And when leaving a bridge rocker sets the untagged VLAN of a port
according to the ifindex of the port's device.
So after joining and leaving a VLAN the untagged VLAN of a port will
be set according to the latter. However, prior to joining a VLAN it is
unset.
This patch sets the untagged VLAN of a port according to the ifindex
of the port's device when the port's device is opened. That is, the same
value that can be achieved by joining then leaving a VLAN. Which seems
logical and consistent.
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
drivers/net/ethernet/rocker/rocker.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index 955cf0ae33a7..b88097b26587 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -3853,9 +3853,13 @@ static int rocker_port_open(struct net_device *dev)
goto err_request_rx_irq;
}
+ err = rocker_port_set_untagged_vlan(rocker_port);
+ if (err)
+ goto err_set_vlan;
+
err = rocker_port_fwd_enable(rocker_port);
if (err)
- goto err_fwd_enable;
+ goto err_set_vlan;
napi_enable(&rocker_port->napi_tx);
napi_enable(&rocker_port->napi_rx);
@@ -3863,7 +3867,7 @@ static int rocker_port_open(struct net_device *dev)
netif_start_queue(dev);
return 0;
-err_fwd_enable:
+err_set_vlan:
free_irq(rocker_msix_rx_vector(rocker_port), rocker_port);
err_request_rx_irq:
free_irq(rocker_msix_tx_vector(rocker_port), rocker_port);
--
2.1.4
next prev parent reply other threads:[~2015-04-13 6:48 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-13 6:47 [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging Simon Horman
2015-04-13 6:47 ` [PATCH/RFC net-next 1/4] rocker: add helper for setting untagged VLAN Simon Horman
2015-04-13 6:47 ` Simon Horman [this message]
2015-04-13 6:47 ` [PATCH/RFC net-next 3/4] rocker: forward packets to CPU when a port not bridged Simon Horman
2015-04-13 6:47 ` [PATCH/RFC net-next 4/4] rocker: allow forwarding of IPv4 by unicast routing table Simon Horman
2015-04-13 14:59 ` [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging Scott Feldman
2015-04-13 15:43 ` Scott Feldman
2015-04-14 7:11 ` Simon Horman
2015-04-14 7:23 ` Scott Feldman
2015-04-14 8:02 ` Simon Horman
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=1428907677-27204-3-git-send-email-simon.horman@netronome.com \
--to=simon.horman@netronome.com \
--cc=jiri@resnulli.us \
--cc=netdev@vger.kernel.org \
--cc=sfeldma@gmail.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).