* [PATCH/RFC net-next 1/4] rocker: add helper for setting untagged VLAN
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 ` Simon Horman
2015-04-13 6:47 ` [PATCH/RFC net-next 2/4] rocker: set untagged VLAN when opening port Simon Horman
` (3 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2015-04-13 6:47 UTC (permalink / raw)
To: Jiri Pirko, Scott Feldman; +Cc: netdev, Simon Horman
Add a helper for setting setting untagged VLAN and use it twice.
Also add a helper for returning the uppermost device of a port:
its bridge device if present otherwise the port's device. This seems
to be clean enough in the context of this patch. I also plan
to re-use it in a subsequent patch.
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
drivers/net/ethernet/rocker/rocker.c | 41 ++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 18 deletions(-)
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index a87b177bd723..955cf0ae33a7 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -325,6 +325,12 @@ static bool rocker_port_is_bridged(struct rocker_port *rocker_port)
return !!rocker_port->bridge_dev;
}
+static struct net_device *rocker_port_uppermost_dev(struct rocker_port *rocker_port)
+{
+ return rocker_port_is_bridged(rocker_port) ?
+ rocker_port->bridge_dev : rocker_port->dev;
+}
+
struct rocker_wait {
wait_queue_head_t wait;
bool done;
@@ -3758,6 +3764,21 @@ not_found:
spin_unlock_irqrestore(&rocker->internal_vlan_tbl_lock, lock_flags);
}
+static int rocker_port_set_untagged_vlan(struct rocker_port *rocker_port)
+{
+ int err;
+ int ifindex;
+
+ err = rocker_port_vlan(rocker_port, ROCKER_OP_FLAG_REMOVE, 0);
+ if (err)
+ return err;
+
+ ifindex = rocker_port_uppermost_dev(rocker_port)->ifindex;
+ rocker_port->internal_vlan_id =
+ rocker_port_internal_vlan_id_get(rocker_port, ifindex);
+ return rocker_port_vlan(rocker_port, 0, 0);
+}
+
static int rocker_port_fib_ipv4(struct rocker_port *rocker_port, __be32 dst,
int dst_len, struct fib_info *fi, u32 tb_id,
int flags)
@@ -4888,21 +4909,12 @@ static bool rocker_port_dev_check(struct net_device *dev)
static int rocker_port_bridge_join(struct rocker_port *rocker_port,
struct net_device *bridge)
{
- int err;
-
rocker_port_internal_vlan_id_put(rocker_port,
rocker_port->dev->ifindex);
rocker_port->bridge_dev = bridge;
- /* Use bridge internal VLAN ID for untagged pkts */
- err = rocker_port_vlan(rocker_port, ROCKER_OP_FLAG_REMOVE, 0);
- if (err)
- return err;
- rocker_port->internal_vlan_id =
- rocker_port_internal_vlan_id_get(rocker_port,
- bridge->ifindex);
- return rocker_port_vlan(rocker_port, 0, 0);
+ return rocker_port_set_untagged_vlan(rocker_port);
}
static int rocker_port_bridge_leave(struct rocker_port *rocker_port)
@@ -4914,14 +4926,7 @@ static int rocker_port_bridge_leave(struct rocker_port *rocker_port)
rocker_port->bridge_dev = NULL;
- /* Use port internal VLAN ID for untagged pkts */
- err = rocker_port_vlan(rocker_port, ROCKER_OP_FLAG_REMOVE, 0);
- if (err)
- return err;
- rocker_port->internal_vlan_id =
- rocker_port_internal_vlan_id_get(rocker_port,
- rocker_port->dev->ifindex);
- err = rocker_port_vlan(rocker_port, 0, 0);
+ err = rocker_port_set_untagged_vlan(rocker_port);
if (err)
return err;
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH/RFC net-next 2/4] rocker: set untagged VLAN when opening port
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
2015-04-13 6:47 ` [PATCH/RFC net-next 3/4] rocker: forward packets to CPU when a port not bridged Simon Horman
` (2 subsequent siblings)
4 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2015-04-13 6:47 UTC (permalink / raw)
To: Jiri Pirko, Scott Feldman; +Cc: netdev, Simon Horman
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
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH/RFC net-next 3/4] rocker: forward packets to CPU when a port not bridged
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 ` [PATCH/RFC net-next 2/4] rocker: set untagged VLAN when opening port Simon Horman
@ 2015-04-13 6:47 ` 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
4 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2015-04-13 6:47 UTC (permalink / raw)
To: Jiri Pirko, Scott Feldman; +Cc: netdev, Simon Horman
This is intended to be sufficient for the kernel to act as
a fall-back for any packets that are received when a rocker port
is not bridged.
A subsequent patch will build on this one to make use of the port's
unicast routing entries.
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
drivers/net/ethernet/rocker/rocker.c | 56 ++++++++++++++++++++++++++++++++----
1 file changed, 51 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index b88097b26587..d74d53cb59ab 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -199,6 +199,8 @@ struct rocker;
enum {
ROCKER_CTRL_LINK_LOCAL_MCAST,
ROCKER_CTRL_LOCAL_ARP,
+ ROCKER_CTRL_LOCAL_UNICAST,
+ ROCKER_CTRL_PROMISC,
ROCKER_CTRL_IPV4_MCAST,
ROCKER_CTRL_IPV6_MCAST,
ROCKER_CTRL_DFLT_BRIDGING,
@@ -3129,6 +3131,17 @@ static struct rocker_ctrl {
.eth_type = htons(ETH_P_ARP),
.acl = true,
},
+ [ROCKER_CTRL_LOCAL_UNICAST] = {
+ /* pass local unicast pkts up to CPU */
+ .eth_dst_mask = ff_mac,
+ .acl = true,
+ },
+ [ROCKER_CTRL_PROMISC] = {
+ /* pass all pkts up to CPU */
+ .eth_dst = zero_mac,
+ .eth_dst_mask = zero_mac,
+ .acl = true,
+ },
[ROCKER_CTRL_IPV4_MCAST] = {
/* pass IPv4 mcast pkts up to CPU, RFC 1112 */
.eth_dst = ipv4_mcast,
@@ -3161,6 +3174,8 @@ static int rocker_port_ctrl_vlan_acl(struct rocker_port *rocker_port,
u32 out_pport = 0;
u8 *eth_src = NULL;
u8 *eth_src_mask = NULL;
+ const u8 *eth_dst = ctrl->eth_dst ? :
+ rocker_port_uppermost_dev(rocker_port)->dev_addr;
__be16 vlan_id_mask = htons(0xffff);
u8 ip_proto = 0;
u8 ip_proto_mask = 0;
@@ -3172,7 +3187,7 @@ static int rocker_port_ctrl_vlan_acl(struct rocker_port *rocker_port,
err = rocker_flow_tbl_acl(rocker_port, flags,
in_pport, in_pport_mask,
eth_src, eth_src_mask,
- ctrl->eth_dst, ctrl->eth_dst_mask,
+ eth_dst, ctrl->eth_dst_mask,
ctrl->eth_type,
vlan_id, vlan_id_mask,
ip_proto, ip_proto_mask,
@@ -3630,13 +3645,20 @@ static int rocker_port_stp_update(struct rocker_port *rocker_port, u8 state)
break;
case BR_STATE_LEARNING:
case BR_STATE_FORWARDING:
- want[ROCKER_CTRL_LINK_LOCAL_MCAST] = true;
+ if (!(rocker_port->dev->flags & IFF_PROMISC))
+ want[ROCKER_CTRL_LINK_LOCAL_MCAST] = true;
want[ROCKER_CTRL_IPV4_MCAST] = true;
want[ROCKER_CTRL_IPV6_MCAST] = true;
- if (rocker_port_is_bridged(rocker_port))
+ if (rocker_port_is_bridged(rocker_port)) {
want[ROCKER_CTRL_DFLT_BRIDGING] = true;
- else
- want[ROCKER_CTRL_LOCAL_ARP] = true;
+ } else {
+ if (rocker_port->dev->flags & IFF_PROMISC) {
+ want[ROCKER_CTRL_PROMISC] = true;
+ } else {
+ want[ROCKER_CTRL_LOCAL_UNICAST] = true;
+ want[ROCKER_CTRL_LOCAL_ARP] = true;
+ }
+ }
break;
}
@@ -4027,10 +4049,33 @@ static int rocker_port_set_mac_address(struct net_device *dev, void *p)
err = rocker_cmd_set_port_settings_macaddr(rocker_port, addr->sa_data);
if (err)
return err;
+
+ if (rocker_port->dev->flags & IFF_UP) {
+ err = rocker_port_fwd_disable(rocker_port);
+ if (err)
+ return err;
+ }
+
memcpy(dev->dev_addr, addr->sa_data, dev->addr_len);
+
+ if (rocker_port->dev->flags & IFF_UP) {
+ err = rocker_port_fwd_enable(rocker_port);
+ if (err)
+ return err;
+ }
+
return 0;
}
+static void rocker_port_change_rx_flags(struct net_device *dev, int change)
+{
+ struct rocker_port *rocker_port = netdev_priv(dev);
+
+ if (change & IFF_PROMISC && rocker_port->dev->flags & IFF_UP)
+ if (!rocker_port_fwd_disable(rocker_port))
+ rocker_port_fwd_enable(rocker_port);
+}
+
static int rocker_port_vlan_rx_add_vid(struct net_device *dev,
__be16 proto, u16 vid)
{
@@ -4230,6 +4275,7 @@ static const struct net_device_ops rocker_port_netdev_ops = {
.ndo_open = rocker_port_open,
.ndo_stop = rocker_port_stop,
.ndo_start_xmit = rocker_port_xmit,
+ .ndo_change_rx_flags = rocker_port_change_rx_flags,
.ndo_set_mac_address = rocker_port_set_mac_address,
.ndo_vlan_rx_add_vid = rocker_port_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = rocker_port_vlan_rx_kill_vid,
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* [PATCH/RFC net-next 4/4] rocker: allow forwarding of IPv4 by unicast routing table
2015-04-13 6:47 [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging Simon Horman
` (2 preceding siblings ...)
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 ` Simon Horman
2015-04-13 14:59 ` [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging Scott Feldman
4 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2015-04-13 6:47 UTC (permalink / raw)
To: Jiri Pirko, Scott Feldman; +Cc: netdev, Simon Horman
This configures entries in the ACL and termination MAC tables of
a rocker switch to allow the use of IPv4 unicast routing entries.
This configuration is activated for a port when it is neither bridged or in
promiscuous mode.
The result is that unicast IPv4 forwarding may be performed by
the rocker switch as per its configuration by the kernel via the
rocker device driver.
Signed-off-by: Simon Horman <simon.horman@netronome.com>
---
drivers/net/ethernet/rocker/rocker.c | 33 ++++++++++++++++++++++++++++++---
1 file changed, 30 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/rocker/rocker.c b/drivers/net/ethernet/rocker/rocker.c
index d74d53cb59ab..74394ce86322 100644
--- a/drivers/net/ethernet/rocker/rocker.c
+++ b/drivers/net/ethernet/rocker/rocker.c
@@ -200,9 +200,11 @@ enum {
ROCKER_CTRL_LINK_LOCAL_MCAST,
ROCKER_CTRL_LOCAL_ARP,
ROCKER_CTRL_LOCAL_UNICAST,
+ ROCKER_CTRL_ROUTED_IPV4_UNICAST,
ROCKER_CTRL_PROMISC,
ROCKER_CTRL_IPV4_MCAST,
ROCKER_CTRL_IPV6_MCAST,
+ ROCKER_CTRL_IPV4_UNICAST,
ROCKER_CTRL_DFLT_BRIDGING,
ROCKER_CTRL_MAX,
};
@@ -2583,7 +2585,8 @@ static int rocker_flow_tbl_acl(struct rocker_port *rocker_port,
if (eth_dst && eth_dst_mask) {
if (memcmp(eth_dst_mask, mcast_mac, ETH_ALEN) == 0)
priority = ROCKER_PRIORITY_ACL_DFLT;
- else if (is_link_local_ether_addr(eth_dst))
+ else if (is_link_local_ether_addr(eth_dst) ||
+ eth_type == htons(ETH_P_IP))
priority = ROCKER_PRIORITY_ACL_CTRL;
}
@@ -3117,6 +3120,7 @@ static struct rocker_ctrl {
bool bridge;
bool term;
bool copy_to_cpu;
+ bool no_group;
} rocker_ctrls[] = {
[ROCKER_CTRL_LINK_LOCAL_MCAST] = {
/* pass link local multicast pkts up to CPU for filtering */
@@ -3136,6 +3140,13 @@ static struct rocker_ctrl {
.eth_dst_mask = ff_mac,
.acl = true,
},
+ [ROCKER_CTRL_ROUTED_IPV4_UNICAST] = {
+ /* allow unicast IPv4 pkts that have been routed */
+ .eth_dst_mask = ff_mac,
+ .eth_type = htons(ETH_P_IP),
+ .acl = true,
+ .no_group = true,
+ },
[ROCKER_CTRL_PROMISC] = {
/* pass all pkts up to CPU */
.eth_dst = zero_mac,
@@ -3158,6 +3169,13 @@ static struct rocker_ctrl {
.term = true,
.copy_to_cpu = true,
},
+ [ROCKER_CTRL_IPV4_UNICAST] = {
+ /* pass IPv4 unicast packets to unicast routing table */
+ .eth_dst_mask = ff_mac,
+ .eth_type = htons(ETH_P_IP),
+ .term = true,
+ .copy_to_cpu = true,
+ },
[ROCKER_CTRL_DFLT_BRIDGING] = {
/* flood any pkts on vlan */
.bridge = true,
@@ -3181,9 +3199,14 @@ static int rocker_port_ctrl_vlan_acl(struct rocker_port *rocker_port,
u8 ip_proto_mask = 0;
u8 ip_tos = 0;
u8 ip_tos_mask = 0;
- u32 group_id = ROCKER_GROUP_L2_INTERFACE(vlan_id, out_pport);
+ u32 group_id;
int err;
+ if (ctrl->no_group)
+ group_id = ROCKER_GROUP_NONE;
+ else
+ group_id = ROCKER_GROUP_L2_INTERFACE(vlan_id, out_pport);
+
err = rocker_flow_tbl_acl(rocker_port, flags,
in_pport, in_pport_mask,
eth_src, eth_src_mask,
@@ -3228,6 +3251,8 @@ static int rocker_port_ctrl_vlan_term(struct rocker_port *rocker_port,
int flags, struct rocker_ctrl *ctrl,
__be16 vlan_id)
{
+ const u8 *eth_dst = ctrl->eth_dst ? :
+ rocker_port_uppermost_dev(rocker_port)->dev_addr;
u32 in_pport_mask = 0xffffffff;
__be16 vlan_id_mask = htons(0xffff);
int err;
@@ -3237,7 +3262,7 @@ static int rocker_port_ctrl_vlan_term(struct rocker_port *rocker_port,
err = rocker_flow_tbl_term_mac(rocker_port,
rocker_port->pport, in_pport_mask,
- ctrl->eth_type, ctrl->eth_dst,
+ ctrl->eth_type, eth_dst,
ctrl->eth_dst_mask, vlan_id,
vlan_id_mask, ctrl->copy_to_cpu,
flags);
@@ -3657,6 +3682,8 @@ static int rocker_port_stp_update(struct rocker_port *rocker_port, u8 state)
} else {
want[ROCKER_CTRL_LOCAL_UNICAST] = true;
want[ROCKER_CTRL_LOCAL_ARP] = true;
+ want[ROCKER_CTRL_ROUTED_IPV4_UNICAST] = true;
+ want[ROCKER_CTRL_IPV4_UNICAST] = true;
}
}
break;
--
2.1.4
^ permalink raw reply related [flat|nested] 10+ messages in thread* Re: [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging
2015-04-13 6:47 [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging Simon Horman
` (3 preceding siblings ...)
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 ` Scott Feldman
2015-04-13 15:43 ` Scott Feldman
4 siblings, 1 reply; 10+ messages in thread
From: Scott Feldman @ 2015-04-13 14:59 UTC (permalink / raw)
To: Simon Horman; +Cc: Jiri Pirko, Netdev
On Sun, Apr 12, 2015 at 11:47 PM, Simon Horman
<simon.horman@netronome.com> wrote:
> Hi,
>
> this short series attempts to allow rocker ports to be used when they
> are not attached to a bridge. It attempts to make use of flow entries
> in a rocker switch where appropriate and otherwise forwards packets up
> to the kernel for processing.
Hi Simon,
Unbridged ports should be working now with current driver/device. I
wonder if you have an older qemu rocker device? Use master branch of
https://github.com/scottfeldman/qemu-rocker.git.
My test setup is to IPv4 ping two hosts from two different ports.
Something like:
sw1:sw1p1:11.0.0.1/24 <----------------> h1:eth1:11.0.0.2/24
sw1:sw1p2:12.0.0.1/24 <----------------> h2:eth1:12.0.0.2/24
ARP and ping work fine. What is your test setup? I haven't spent a
lot of time on unbridged port testing, since major focus has been on
offloading bridge L2 and L3.
-scott
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging
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
0 siblings, 1 reply; 10+ messages in thread
From: Scott Feldman @ 2015-04-13 15:43 UTC (permalink / raw)
To: Simon Horman; +Cc: Jiri Pirko, Netdev, Arad, Ronen
On Mon, Apr 13, 2015 at 7:59 AM, Scott Feldman <sfeldma@gmail.com> wrote:
> On Sun, Apr 12, 2015 at 11:47 PM, Simon Horman
> <simon.horman@netronome.com> wrote:
>> Hi,
>>
>> this short series attempts to allow rocker ports to be used when they
>> are not attached to a bridge. It attempts to make use of flow entries
>> in a rocker switch where appropriate and otherwise forwards packets up
>> to the kernel for processing.
>
> Hi Simon,
>
> Unbridged ports should be working now with current driver/device. I
> wonder if you have an older qemu rocker device? Use master branch of
> https://github.com/scottfeldman/qemu-rocker.git.
>
> My test setup is to IPv4 ping two hosts from two different ports.
> Something like:
>
> sw1:sw1p1:11.0.0.1/24 <----------------> h1:eth1:11.0.0.2/24
> sw1:sw1p2:12.0.0.1/24 <----------------> h2:eth1:12.0.0.2/24
>
> ARP and ping work fine. What is your test setup? I haven't spent a
> lot of time on unbridged port testing, since major focus has been on
> offloading bridge L2 and L3.
Ah, I think I know why it's not working for you. You don't have the
VLAN 8021.q module loaded, do you? I'm getting these:
[ 2.871619] 8021q: 802.1Q VLAN Support v1.8
[ 2.871629] 8021q: adding VLAN 0 to HW filter on device sw1p1
[ 2.872097] 8021q: adding VLAN 0 to HW filter on device sw1p2
Which calls into the driver ndo_vlan ops and sets up untagged access.
But, dependence on VLAN 802.1q module is wrong I think, and we'll need
your patch (I haven't reviewed it yet, but I'm assuming it's doing
basically what loading what VLAN 802.1q driver forces).
The Spring Cleanup patchset has better setlink/dellink support so
driver can manage VLANs from bridge driver and moves away from
ndo_vlan ops used with 802.1q VLAN driver. Ronan (Cc:d) has a VLAN
patch that builds on top of my Spring Cleanup patchset I think the
order of changes will be to get my Spring Cleanup patchset in and then
get yours/Ronan's patches in. And rocker can get away from using
ndo_vlan ops.
Would you verify that without your patch, and with VLAN 802.1q driver
loaded, unbridged ports are working?
-scott
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging
2015-04-13 15:43 ` Scott Feldman
@ 2015-04-14 7:11 ` Simon Horman
2015-04-14 7:23 ` Scott Feldman
0 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2015-04-14 7:11 UTC (permalink / raw)
To: Scott Feldman; +Cc: Jiri Pirko, Netdev, Arad, Ronen
Hi Scott,
On Mon, Apr 13, 2015 at 08:43:16AM -0700, Scott Feldman wrote:
> On Mon, Apr 13, 2015 at 7:59 AM, Scott Feldman <sfeldma@gmail.com> wrote:
> > On Sun, Apr 12, 2015 at 11:47 PM, Simon Horman
> > <simon.horman@netronome.com> wrote:
> >> Hi,
> >>
> >> this short series attempts to allow rocker ports to be used when they
> >> are not attached to a bridge. It attempts to make use of flow entries
> >> in a rocker switch where appropriate and otherwise forwards packets up
> >> to the kernel for processing.
> >
> > Hi Simon,
> >
> > Unbridged ports should be working now with current driver/device. I
> > wonder if you have an older qemu rocker device? Use master branch of
> > https://github.com/scottfeldman/qemu-rocker.git.
For the record, that is what I am using.
> > My test setup is to IPv4 ping two hosts from two different ports.
> > Something like:
> >
> > sw1:sw1p1:11.0.0.1/24 <----------------> h1:eth1:11.0.0.2/24
> > sw1:sw1p2:12.0.0.1/24 <----------------> h2:eth1:12.0.0.2/24
> >
> > ARP and ping work fine. What is your test setup? I haven't spent a
> > lot of time on unbridged port testing, since major focus has been on
> > offloading bridge L2 and L3.
My setup is similar if not the same. I used it to test both bridging
and routing.
> Ah, I think I know why it's not working for you. You don't have the
> VLAN 8021.q module loaded, do you? I'm getting these:
>
> [ 2.871619] 8021q: 802.1Q VLAN Support v1.8
> [ 2.871629] 8021q: adding VLAN 0 to HW filter on device sw1p1
> [ 2.872097] 8021q: adding VLAN 0 to HW filter on device sw1p2
>
> Which calls into the driver ndo_vlan ops and sets up untagged access.
Thanks! There is now one less mystery in my life.
I had not considered the ndo_vlan ops and with the 802.1q driver present
things seem to work.
> But, dependence on VLAN 802.1q module is wrong I think, and we'll need
> your patch (I haven't reviewed it yet, but I'm assuming it's doing
> basically what loading what VLAN 802.1q driver forces).
Yes, I think that is more or less the case.
One thing that my patches did which does not seem to occur without
them is to cause, or at least try to cause, all packets to
be forwarded to the CPU if the interface is in promiscuous mode.
This seems logical to me.
> The Spring Cleanup patchset has better setlink/dellink support so
> driver can manage VLANs from bridge driver and moves away from
> ndo_vlan ops used with 802.1q VLAN driver. Ronan (Cc:d) has a VLAN
> patch that builds on top of my Spring Cleanup patchset I think the
> order of changes will be to get my Spring Cleanup patchset in and then
> get yours/Ronan's patches in. And rocker can get away from using
> ndo_vlan ops.
Sure, that ordering is entirely fine by me.
> Would you verify that without your patch, and with VLAN 802.1q driver
> loaded, unbridged ports are working?
As noted above, I have verified that scenario works.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging
2015-04-14 7:11 ` Simon Horman
@ 2015-04-14 7:23 ` Scott Feldman
2015-04-14 8:02 ` Simon Horman
0 siblings, 1 reply; 10+ messages in thread
From: Scott Feldman @ 2015-04-14 7:23 UTC (permalink / raw)
To: Simon Horman; +Cc: Jiri Pirko, Netdev, Arad, Ronen
On Tue, Apr 14, 2015 at 12:11 AM, Simon Horman
<simon.horman@netronome.com> wrote:
> Hi Scott,
>
> On Mon, Apr 13, 2015 at 08:43:16AM -0700, Scott Feldman wrote:
>> On Mon, Apr 13, 2015 at 7:59 AM, Scott Feldman <sfeldma@gmail.com> wrote:
>> > On Sun, Apr 12, 2015 at 11:47 PM, Simon Horman
>> > <simon.horman@netronome.com> wrote:
>> >> Hi,
>> >>
>> >> this short series attempts to allow rocker ports to be used when they
>> >> are not attached to a bridge. It attempts to make use of flow entries
>> >> in a rocker switch where appropriate and otherwise forwards packets up
>> >> to the kernel for processing.
>> >
>> > Hi Simon,
>> >
>> > Unbridged ports should be working now with current driver/device. I
>> > wonder if you have an older qemu rocker device? Use master branch of
>> > https://github.com/scottfeldman/qemu-rocker.git.
>
> For the record, that is what I am using.
>
>> > My test setup is to IPv4 ping two hosts from two different ports.
>> > Something like:
>> >
>> > sw1:sw1p1:11.0.0.1/24 <----------------> h1:eth1:11.0.0.2/24
>> > sw1:sw1p2:12.0.0.1/24 <----------------> h2:eth1:12.0.0.2/24
>> >
>> > ARP and ping work fine. What is your test setup? I haven't spent a
>> > lot of time on unbridged port testing, since major focus has been on
>> > offloading bridge L2 and L3.
>
> My setup is similar if not the same. I used it to test both bridging
> and routing.
>
>> Ah, I think I know why it's not working for you. You don't have the
>> VLAN 8021.q module loaded, do you? I'm getting these:
>>
>> [ 2.871619] 8021q: 802.1Q VLAN Support v1.8
>> [ 2.871629] 8021q: adding VLAN 0 to HW filter on device sw1p1
>> [ 2.872097] 8021q: adding VLAN 0 to HW filter on device sw1p2
>>
>> Which calls into the driver ndo_vlan ops and sets up untagged access.
>
> Thanks! There is now one less mystery in my life.
>
> I had not considered the ndo_vlan ops and with the 802.1q driver present
> things seem to work.
Good. Sorry about the wasted time. I'm trying to get the
Documentation/network/switchdev.txt file updated with notes about
setup, so at least we all go the same path, right or wrong.
>> But, dependence on VLAN 802.1q module is wrong I think, and we'll need
>> your patch (I haven't reviewed it yet, but I'm assuming it's doing
>> basically what loading what VLAN 802.1q driver forces).
>
> Yes, I think that is more or less the case.
>
> One thing that my patches did which does not seem to occur without
> them is to cause, or at least try to cause, all packets to
> be forwarded to the CPU if the interface is in promiscuous mode.
> This seems logical to me.
rocker needs help here for rx filters, for things like IGMP snooping
and so on. promisc is ignored now as you found out. Maybe after this
vlan stuff gets sorted out with mine and Ronan's patchsets, you can
look at the rx filters again? I think we'll need to be more selective
with some of the default setups, like the bridge or bond putting port
in promisc by default. Promisc seems dangerous thing to enable on a
live switch port. Firehose in mouth kind of thing.
>
>> The Spring Cleanup patchset has better setlink/dellink support so
>> driver can manage VLANs from bridge driver and moves away from
>> ndo_vlan ops used with 802.1q VLAN driver. Ronan (Cc:d) has a VLAN
>> patch that builds on top of my Spring Cleanup patchset I think the
>> order of changes will be to get my Spring Cleanup patchset in and then
>> get yours/Ronan's patches in. And rocker can get away from using
>> ndo_vlan ops.
>
> Sure, that ordering is entirely fine by me.
>
>> Would you verify that without your patch, and with VLAN 802.1q driver
>> loaded, unbridged ports are working?
>
> As noted above, I have verified that scenario works.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH/RFC net-next 0/4] Allow use of rocker ports without bridging
2015-04-14 7:23 ` Scott Feldman
@ 2015-04-14 8:02 ` Simon Horman
0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2015-04-14 8:02 UTC (permalink / raw)
To: Scott Feldman; +Cc: Jiri Pirko, Netdev, Arad, Ronen
On Tue, Apr 14, 2015 at 12:23:41AM -0700, Scott Feldman wrote:
> On Tue, Apr 14, 2015 at 12:11 AM, Simon Horman
> <simon.horman@netronome.com> wrote:
> > Hi Scott,
> >
> > On Mon, Apr 13, 2015 at 08:43:16AM -0700, Scott Feldman wrote:
> >> On Mon, Apr 13, 2015 at 7:59 AM, Scott Feldman <sfeldma@gmail.com> wrote:
> >> > On Sun, Apr 12, 2015 at 11:47 PM, Simon Horman
> >> > <simon.horman@netronome.com> wrote:
> >> >> Hi,
> >> >>
> >> >> this short series attempts to allow rocker ports to be used when they
> >> >> are not attached to a bridge. It attempts to make use of flow entries
> >> >> in a rocker switch where appropriate and otherwise forwards packets up
> >> >> to the kernel for processing.
> >> >
> >> > Hi Simon,
> >> >
> >> > Unbridged ports should be working now with current driver/device. I
> >> > wonder if you have an older qemu rocker device? Use master branch of
> >> > https://github.com/scottfeldman/qemu-rocker.git.
> >
> > For the record, that is what I am using.
> >
> >> > My test setup is to IPv4 ping two hosts from two different ports.
> >> > Something like:
> >> >
> >> > sw1:sw1p1:11.0.0.1/24 <----------------> h1:eth1:11.0.0.2/24
> >> > sw1:sw1p2:12.0.0.1/24 <----------------> h2:eth1:12.0.0.2/24
> >> >
> >> > ARP and ping work fine. What is your test setup? I haven't spent a
> >> > lot of time on unbridged port testing, since major focus has been on
> >> > offloading bridge L2 and L3.
> >
> > My setup is similar if not the same. I used it to test both bridging
> > and routing.
> >
> >> Ah, I think I know why it's not working for you. You don't have the
> >> VLAN 8021.q module loaded, do you? I'm getting these:
> >>
> >> [ 2.871619] 8021q: 802.1Q VLAN Support v1.8
> >> [ 2.871629] 8021q: adding VLAN 0 to HW filter on device sw1p1
> >> [ 2.872097] 8021q: adding VLAN 0 to HW filter on device sw1p2
> >>
> >> Which calls into the driver ndo_vlan ops and sets up untagged access.
> >
> > Thanks! There is now one less mystery in my life.
> >
> > I had not considered the ndo_vlan ops and with the 802.1q driver present
> > things seem to work.
>
> Good. Sorry about the wasted time. I'm trying to get the
> Documentation/network/switchdev.txt file updated with notes about
> setup, so at least we all go the same path, right or wrong.
It wasn't really a waste; I learnt a lot about rocker :)
> >> But, dependence on VLAN 802.1q module is wrong I think, and we'll need
> >> your patch (I haven't reviewed it yet, but I'm assuming it's doing
> >> basically what loading what VLAN 802.1q driver forces).
> >
> > Yes, I think that is more or less the case.
> >
> > One thing that my patches did which does not seem to occur without
> > them is to cause, or at least try to cause, all packets to
> > be forwarded to the CPU if the interface is in promiscuous mode.
> > This seems logical to me.
>
> rocker needs help here for rx filters, for things like IGMP snooping
> and so on. promisc is ignored now as you found out. Maybe after this
> vlan stuff gets sorted out with mine and Ronan's patchsets, you can
> look at the rx filters again? I think we'll need to be more selective
> with some of the default setups, like the bridge or bond putting port
> in promisc by default. Promisc seems dangerous thing to enable on a
> live switch port. Firehose in mouth kind of thing.
I agree that it would make sense to try treading carefully in this area
once your and Ronan's patchsets have landed.
> >> The Spring Cleanup patchset has better setlink/dellink support so
> >> driver can manage VLANs from bridge driver and moves away from
> >> ndo_vlan ops used with 802.1q VLAN driver. Ronan (Cc:d) has a VLAN
> >> patch that builds on top of my Spring Cleanup patchset I think the
> >> order of changes will be to get my Spring Cleanup patchset in and then
> >> get yours/Ronan's patches in. And rocker can get away from using
> >> ndo_vlan ops.
> >
> > Sure, that ordering is entirely fine by me.
> >
> >> Would you verify that without your patch, and with VLAN 802.1q driver
> >> loaded, unbridged ports are working?
> >
> > As noted above, I have verified that scenario works.
^ permalink raw reply [flat|nested] 10+ messages in thread