From: DENG Qingfang <dqfext@gmail.com> Date: 2021-08-11 13:53:23
Add BR_ISOLATED flag to BR_PORT_FLAGS_HW_OFFLOAD, to allow switchdev
drivers to offload port isolation.
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
net/bridge/br_switchdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
On Wed, Aug 11, 2021 at 09:52:46PM +0800, DENG Qingfang wrote:
quoted hunk
Add BR_ISOLATED flag to BR_PORT_FLAGS_HW_OFFLOAD, to allow switchdev
drivers to offload port isolation.
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
net/bridge/br_switchdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
From: Vladimir Oltean <olteanv@gmail.com> Date: 2021-08-11 21:45:28
On Thu, Aug 12, 2021 at 12:38:56AM +0300, Ido Schimmel wrote:
On Wed, Aug 11, 2021 at 09:52:46PM +0800, DENG Qingfang wrote:
quoted
Add BR_ISOLATED flag to BR_PORT_FLAGS_HW_OFFLOAD, to allow switchdev
drivers to offload port isolation.
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
net/bridge/br_switchdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -71,7 +71,8 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,/* Flags that can be offloaded to hardware */#define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \-BR_MCAST_FLOOD|BR_BCAST_FLOOD)+BR_MCAST_FLOOD|BR_BCAST_FLOOD|\+BR_ISOLATED)
Why add it now and not as part of a patchset that actually makes use of
the flag in a driver that offloads port isolation?
The way the information got transmitted is a bit unfortunate.
Making BR_ISOLATED part of BR_PORT_FLAGS_HW_OFFLOAD is a matter of
correctness when switchdev offloads the data path. Since this feature
will not work correctly without driver intervention, it makes sense that
drivers should reject it currently, which is exactly what this patch
accomplishes - it makes the code path go through the
SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS driver handlers, which return
-EINVAL for everything they don't recognize.
(yes, we do still have a problem for drivers that don't catch
SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS at all, switchdev will return
-EOPNOTSUPP for those which is then ignored, but those are in the
minority)
On Thu, Aug 12, 2021 at 12:45:06AM +0300, Vladimir Oltean wrote:
On Thu, Aug 12, 2021 at 12:38:56AM +0300, Ido Schimmel wrote:
quoted
On Wed, Aug 11, 2021 at 09:52:46PM +0800, DENG Qingfang wrote:
quoted
Add BR_ISOLATED flag to BR_PORT_FLAGS_HW_OFFLOAD, to allow switchdev
drivers to offload port isolation.
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
net/bridge/br_switchdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -71,7 +71,8 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,/* Flags that can be offloaded to hardware */#define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \-BR_MCAST_FLOOD|BR_BCAST_FLOOD)+BR_MCAST_FLOOD|BR_BCAST_FLOOD|\+BR_ISOLATED)
Why add it now and not as part of a patchset that actually makes use of
the flag in a driver that offloads port isolation?
The way the information got transmitted is a bit unfortunate.
Making BR_ISOLATED part of BR_PORT_FLAGS_HW_OFFLOAD is a matter of
correctness when switchdev offloads the data path. Since this feature
will not work correctly without driver intervention, it makes sense that
drivers should reject it currently, which is exactly what this patch
accomplishes - it makes the code path go through the
SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS driver handlers, which return
-EINVAL for everything they don't recognize.
If the purpose is correctness, then this is not the only flag that was
missed. BR_HAIRPIN_MODE is also relevant for the data path, for example.
Anyway, the commit message needs to be reworded to reflect the true
purpose of the patch.
(yes, we do still have a problem for drivers that don't catch
SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS at all, switchdev will return
-EOPNOTSUPP for those which is then ignored, but those are in the
minority)
From: Vladimir Oltean <olteanv@gmail.com> Date: 2021-08-11 21:58:46
On Thu, Aug 12, 2021 at 12:52:48AM +0300, Ido Schimmel wrote:
On Thu, Aug 12, 2021 at 12:45:06AM +0300, Vladimir Oltean wrote:
quoted
On Thu, Aug 12, 2021 at 12:38:56AM +0300, Ido Schimmel wrote:
quoted
On Wed, Aug 11, 2021 at 09:52:46PM +0800, DENG Qingfang wrote:
quoted
Add BR_ISOLATED flag to BR_PORT_FLAGS_HW_OFFLOAD, to allow switchdev
drivers to offload port isolation.
Suggested-by: Vladimir Oltean <olteanv@gmail.com>
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
net/bridge/br_switchdev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -71,7 +71,8 @@ bool nbp_switchdev_allowed_egress(const struct net_bridge_port *p,/* Flags that can be offloaded to hardware */#define BR_PORT_FLAGS_HW_OFFLOAD (BR_LEARNING | BR_FLOOD | \-BR_MCAST_FLOOD|BR_BCAST_FLOOD)+BR_MCAST_FLOOD|BR_BCAST_FLOOD|\+BR_ISOLATED)
Why add it now and not as part of a patchset that actually makes use of
the flag in a driver that offloads port isolation?
The way the information got transmitted is a bit unfortunate.
Making BR_ISOLATED part of BR_PORT_FLAGS_HW_OFFLOAD is a matter of
correctness when switchdev offloads the data path. Since this feature
will not work correctly without driver intervention, it makes sense that
drivers should reject it currently, which is exactly what this patch
accomplishes - it makes the code path go through the
SWITCHDEV_ATTR_ID_PORT_PRE_BRIDGE_FLAGS driver handlers, which return
-EINVAL for everything they don't recognize.
If the purpose is correctness, then this is not the only flag that was
missed. BR_HAIRPIN_MODE is also relevant for the data path, for example.