From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Ido Schimmel <idosch@mellanox.com>,
netdev <netdev@vger.kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
bridge@lists.linux-foundation.org,
Vladimir Oltean <vladimir.oltean@nxp.com>
Subject: Re: [Bridge] [PATCH RFC] net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.
Date: Thu, 5 May 2022 16:07:20 -0700 [thread overview]
Message-ID: <20220505160720.27358a55@hermes.local> (raw)
In-Reply-To: <20220505225904.342388-1-andrew@lunn.ch>
On Fri, 6 May 2022 00:59:04 +0200
Andrew Lunn <andrew@lunn.ch> wrote:
> It is possible to stack bridges on top of each other. Consider the
> following which makes use of an Ethernet switch:
>
> br1
> / \
> / \
> / \
> br0.11 wlan0
> |
> br0
> / | \
> p1 p2 p3
>
> br0 is offloaded to the switch. Above br0 is a vlan interface, for
> vlan 11. This vlan interface is then a slave of br1. br1 also has
> wireless interface as a slave. This setup trunks wireless lan traffic
> over the copper network inside a VLAN.
>
> A frame received on p1 which is passed up to the bridge has the
> skb->offload_fwd_mark flag set to true, indicating it that the switch
> has dealt with forwarding the frame out ports p2 and p3 as
> needed. This flag instructs the software bridge it does not need to
> pass the frame back down again. However, the flag is not getting reset
> when the frame is passed upwards. As a result br1 sees the flag,
> wrongly interprets it, and fails to forward the frame to wlan0.
>
> When passing a frame upwards, clear the flag.
>
> RFC because i don't know the bridge code well enough if this is the
> correct place to do this, and if there are any side effects, could the
> skb be a clone, etc.
>
> Fixes: f1c2eddf4cb6 ("bridge: switchdev: Use an helper to clear forward mark")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Bridging of bridges is not supposed to be allowed.
See:
bridge:br_if.c
/* No bridging of bridges */
if (dev->netdev_ops->ndo_start_xmit == br_dev_xmit) {
NL_SET_ERR_MSG(extack,
"Can not enslave a bridge to a bridge");
return -ELOOP;
}
WARNING: multiple messages have this Message-ID (diff)
From: Stephen Hemminger <stephen@networkplumber.org>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>,
Nikolay Aleksandrov <razor@blackwall.org>,
Ido Schimmel <idosch@mellanox.com>,
Vladimir Oltean <vladimir.oltean@nxp.com>,
bridge@lists.linux-foundation.org
Subject: Re: [PATCH RFC] net: bridge: Clear offload_fwd_mark when passing frame up bridge interface.
Date: Thu, 5 May 2022 16:07:20 -0700 [thread overview]
Message-ID: <20220505160720.27358a55@hermes.local> (raw)
In-Reply-To: <20220505225904.342388-1-andrew@lunn.ch>
On Fri, 6 May 2022 00:59:04 +0200
Andrew Lunn <andrew@lunn.ch> wrote:
> It is possible to stack bridges on top of each other. Consider the
> following which makes use of an Ethernet switch:
>
> br1
> / \
> / \
> / \
> br0.11 wlan0
> |
> br0
> / | \
> p1 p2 p3
>
> br0 is offloaded to the switch. Above br0 is a vlan interface, for
> vlan 11. This vlan interface is then a slave of br1. br1 also has
> wireless interface as a slave. This setup trunks wireless lan traffic
> over the copper network inside a VLAN.
>
> A frame received on p1 which is passed up to the bridge has the
> skb->offload_fwd_mark flag set to true, indicating it that the switch
> has dealt with forwarding the frame out ports p2 and p3 as
> needed. This flag instructs the software bridge it does not need to
> pass the frame back down again. However, the flag is not getting reset
> when the frame is passed upwards. As a result br1 sees the flag,
> wrongly interprets it, and fails to forward the frame to wlan0.
>
> When passing a frame upwards, clear the flag.
>
> RFC because i don't know the bridge code well enough if this is the
> correct place to do this, and if there are any side effects, could the
> skb be a clone, etc.
>
> Fixes: f1c2eddf4cb6 ("bridge: switchdev: Use an helper to clear forward mark")
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Bridging of bridges is not supposed to be allowed.
See:
bridge:br_if.c
/* No bridging of bridges */
if (dev->netdev_ops->ndo_start_xmit == br_dev_xmit) {
NL_SET_ERR_MSG(extack,
"Can not enslave a bridge to a bridge");
return -ELOOP;
}
next prev parent reply other threads:[~2022-05-05 23:07 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-05 22:59 [Bridge] [PATCH RFC] net: bridge: Clear offload_fwd_mark when passing frame up bridge interface Andrew Lunn
2022-05-05 22:59 ` Andrew Lunn
2022-05-05 23:07 ` Stephen Hemminger [this message]
2022-05-05 23:07 ` Stephen Hemminger
2022-05-06 1:18 ` [Bridge] " Andrew Lunn
2022-05-06 1:18 ` Andrew Lunn
2022-05-06 15:05 ` [Bridge] " Stephen Hemminger
2022-05-06 15:05 ` Stephen Hemminger
2022-05-06 14:36 ` [Bridge] " Vladimir Oltean
2022-05-06 14:36 ` Vladimir Oltean
2022-05-06 16:58 ` [Bridge] " Andrew Lunn
2022-05-06 16:58 ` Andrew Lunn
2022-05-08 7:52 ` [Bridge] " Ido Schimmel
2022-05-08 7:52 ` Ido Schimmel
2022-05-12 20:38 ` [Bridge] " Andrew Lunn
2022-05-12 20:38 ` Andrew Lunn
2022-05-13 12:47 ` [Bridge] " Ido Schimmel
2022-05-13 12:47 ` Ido Schimmel
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=20220505160720.27358a55@hermes.local \
--to=stephen@networkplumber.org \
--cc=andrew@lunn.ch \
--cc=bridge@lists.linux-foundation.org \
--cc=idosch@mellanox.com \
--cc=netdev@vger.kernel.org \
--cc=razor@blackwall.org \
--cc=vladimir.oltean@nxp.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 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.