net: dsa: b53: Preliminary fixes
Florian Fainelli
maintainerv7 cover net: dsa: b53: Preliminary fixes
This patch series contains fixes to issues reported by Sashiko on the b53 PCS bug fixes being submitted, and then some more that came from code review and testing.
Except for issue #2, all of the other issues did trigger in testing and needed to be corrected.
Changes in v7:
- reduce the series from eight patches to six, following Sashiko's review
- move the BCM5325/BCM5365 mirror encoding fix ahead of the other mirror changes, adapting it to the original add/delete paths (now patch 5)
- combine v6 patches 4, 6 and 7 into patch 6 so destination ownership, source reference counting, register error handling and initialization are introduced together, without intermediate regressions
- introduce b53_mirror_init(), its declaration and both setup callers in the same patch; explicitly document the dependency on the encoding fix
- drop Jonas' Reviewed-by from the combined mirror patch because its scope has changed substantially
- keep the other four fixes unchanged; the override-register fix is now patch 4, and the final tree is identical to v6
- validate both mirror patches with ARM built-in and module builds, strict B53/SF2 driver compilation and mocked register regression tests; no switch hardware or suspend/resume hardware testing was performed
Changes in v6:
- patch 3: drop the commit message paragraph claiming that deleting an absent entry now returns -ENOENT, the return value is unchanged (0)
- patch 4: describe the b53_mirror_del() capture port clear as a cleanup rather than a separate fix
- patch 5: add a Fixes: tag for 41af38324341, which covers the 2 Gbps set path on GMII override registers
- patch 6: do not propagate the ds->ops->setup() error from bcm_sf2_sw_resume(), setup re-registers the devlink VLAN resource on resume and would return -EEXIST, leaving the user ports down
- patch 7: document that active mirror rules are restored on resume and that the patch depends on patches 4 and 6; verified the mirror register offsets against the BCM6368, BCM6362 and BCM63268 datasheets
Changes in v5:
- resolved build warning in patch #7 by moving b53_mirror_init()'s declaration into patch #6
Changes in v4:
- Return success when deleting an ARL entry that does not exist per
Sashiko's review
- Restrict the 2 Gbps override bit to BCM5301x and BCM58xx
- Restore mirror configuration on resume, moving mirror initialization into the reference-counting patch
- Propagate SF2 setup errors on resume and disable the clock on failure when WoL is inactive
- Add a patch fixing BCM5325/BCM5365 mirror port encoding, including CPU port bitmap translation
Changes in v3:
- patch 2: added Daniel's R-b tag
- patch 3: mention in the commit message that deleting an absent entry now returns -ENOENT, including when the lookup runs out of space
- patch 4: document that the patch also fixes the clear of the capture port field in b53_mirror_del()
- patch 6: reference count the mirror source bits per port and direction, ignoring deletions without a matching reference
- patch 7: new, harden mirror register programming:
- reset the mirror capture and source control registers at setup for b53 and bcm_sf2, since not all switches are reset
- check and propagate all mirror register read/write errors, only taking a source reference once hardware programming succeeded
- use the source masks rather than MIRROR_EN to decide whether the destination is occupied, and write the destination before the source
- log failures in b53_mirror_del() since it cannot return an error
- patch 8: new, fix the mirror capture port encoding on BCM5325 and BCM5365, which use an 11-bit bitmap (CPU port at bit 8) instead of a port ID, and translate the CPU port in the ingress/egress source masks as well (verified against the BCM5325E, BCM5325M and BCM5365P datasheets)
Changes in v2:
- collected Jonas' R-b tags
- corrected logic in patch #3 to propagate -ENOENT, memset after the debug print, translate -ENOSPC to -ENOENT when deleting
Florian Fainelli (6):
net: dsa: b53: initialize the jumbo frame size register offset
net: dsa: b53: fix the SRAB grant timeout check
net: dsa: b53: clear stale state when creating an ARL entry
net: dsa: b53: use the correct override register 2 Gbps bit
net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365
net: dsa: b53: fix mirror destination and source state tracking
drivers/net/dsa/b53/b53_common.c | 209 +++++++++++++++++++++++++------ drivers/net/dsa/b53/b53_priv.h | 4 + drivers/net/dsa/b53/b53_regs.h | 1 + drivers/net/dsa/b53/b53_srab.c | 2 +- drivers/net/dsa/bcm_sf2.c | 4 + 5 files changed, 179 insertions(+), 41 deletions(-)
base-commit: 7e1392a42ea288d70a266f6553fe06f57f8647ea
Signature · 1 line
2.53.0
Florian Fainelli
maintainerPATCH v7 1/6 net: dsa: b53: initialize the jumbo frame size register offset
The chip data specifies both the jumbo port mask and frame size register offsets, but b53_switch_init() only copies the former into the device. Since the device is zero-initialized, b53_set_jumbo() writes the frame size to offset zero instead of the chip-specific size register at 0x05 or 0x08.
Copy jumbo_size_reg from the chip data along with jumbo_pm_reg so frame size updates reach the intended register.
--- drivers/net/dsa/b53/b53_common.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/dsa/b53/b53_common.c +1 -0
@@ -3172,6 +3172,7 @@ static int b53_switch_init(struct b53_device *dev) dev->vta_regs[1 ] = chip->vta_regs[1 ]; dev->vta_regs[2 ] = chip->vta_regs[2 ]; dev->jumbo_pm_reg = chip->jumbo_pm_reg; + dev->jumbo_size_reg = chip->jumbo_size_reg; dev->imp_port = chip->imp_port; dev->num_vlans = chip->vlans; dev->num_arl_bins = chip->arl_bins;
Signature · 1 line
2.53.0
Florian Fainelli
maintainerPATCH v7 2/6 net: dsa: b53: fix the SRAB grant timeout check
In reply to Florian Fainellib53_srab_request_grant() polls for a grant up to 20 times, but checks for an iteration count of five to detect a timeout. This rejects a grant received on the sixth poll and reports success when all 20 polls finish without a grant. The latter allows a register access to proceed without ownership of the switch resources.
Check for exhaustion of all 20 iterations instead.
--- drivers/net/dsa/b53/b53_srab.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/dsa/b53/b53_srab.c +1 -1
@@ -105,7 +105,7 @@ static int b53_srab_request_grant(struct b53_device *dev)break ;usleep_range (10 ,100 ); } -if (WARN_ON (i ==5 )) +if (WARN_ON (i ==20 ))return -EIO ;return 0 ;
Signature · 1 line
2.53.0
Florian Fainelli
maintainerPATCH v7 3/6 net: dsa: b53: clear stale state when creating an ARL entry
In reply to Florian FainelliWhen an ARL lookup does not find the requested MAC and VID, b53_arl_read() returns the first free bin index but leaves the entry populated with the last bin examined. The multicast add path then ORs the requested port into that unrelated entry's forwarding bitmap, potentially forwarding packets to ports which are not members of the multicast group.
Clear the entry before creating a new one. Also return without writing anything when deleting an entry which is not present, instead of writing back stale bin contents. The return value for that case is unchanged (0).
--- drivers/net/dsa/b53/b53_common.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/dsa/b53/b53_common.c +4 -0
@@ -2055,9 +2055,13 @@ static int b53_arl_op(struct b53_device *dev, int op, int port, addr, vid);return is_valid ? ret :0 ;case -ENOENT : +if (!is_valid) +return 0 ; +/* We could not find a matching MAC, so reset to a new entry */ dev_dbg (dev->dev,"{%pM,%.4d} not found, using idx: %d\n" , addr, vid, idx); +memset (&ent,0 ,sizeof (ent));break ;default : dev_dbg(dev->dev, "{%pM,%.4d} found, using idx: %d\n",
Signature · 1 line
2.53.0
Florian Fainelli
maintainerPATCH v7 4/6 net: dsa: b53: use the correct override register 2 Gbps bit
In reply to Florian FainelliThe IMP and per-port GMII override registers swap the override-enable and 2 Gbps speed bits. Using the IMP speed bit on a GMII port clears its override enable and leaves any previous 2 Gbps selection intact. Select the speed bit alongside the register and enable bit so lower speeds clear the correct bit and 2 Gbps sets it.
--- drivers/net/dsa/b53/b53_common.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/dsa/b53/b53_common.c +6 -3
@@ -1427,17 +1427,19 @@ static void b53_force_port_config(struct b53_device *dev, int port, int speed, int duplex, bool tx_pause, bool rx_pause) { - u8 reg, val, off; + u8 reg, val, off, speed2000;/* Override the port settings */ if (port == dev->imp_port) { off =B53_PORT_OVERRIDE_CTRL ; val =PORT_OVERRIDE_EN ; + speed2000 =PORT_OVERRIDE_SPEED_2000M ; }else if (is5325 (dev)) {return ; }else { off =B53_GMII_PORT_OVERRIDE_CTRL (port); val =GMII_PO_EN ; + speed2000 =GMII_PO_SPEED_2000M ; }b53_read8 (dev,B53_CTRL_PAGE , off, ®);
@@ -1449,11 +1451,12 @@ static void b53_force_port_config(struct b53_device *dev, int port, reg &= ~(0x3 <<GMII_PO_SPEED_S );if (is5301x (dev) ||is58xx (dev)) - reg &= ~PORT_OVERRIDE_SPEED_2000M ; + reg &= ~speed2000;switch (speed) {case 2000 : - reg |=PORT_OVERRIDE_SPEED_2000M ; +if (is5301x (dev) ||is58xx (dev)) + reg |= speed2000; fallthrough;case SPEED_1000 : reg |=PORT_OVERRIDE_SPEED_1000M ;
Signature · 1 line
2.53.0
Florian Fainelli
maintainerPATCH v7 5/6 net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365
In reply to Florian FainelliBCM5325 and BCM5365 use an 11-bit bitmap for the mirror capture port, whereas newer switches use a four-bit port ID. Programming the port number directly can select no destination or the wrong destination, and can select multiple destinations. For example, port 2 requires BIT(2), but writing 2 selects port 1 instead.
Use the bitmap encoding on BCM5325 and BCM5365, including translating logical CPU port 5 to hardware bit 8. Apply the corresponding field mask when checking for a conflicting destination, replacing the destination, and clearing it after the last mirror source is removed. Keep the port ID encoding for newer switches.
The ingress and egress mirror source masks use the same layout on these switches, with the CPU port at bit 8 and bits 5-7 reserved, so apply the same translation when setting and clearing a source port bit.
--- drivers/net/dsa/b53/b53_common.c | 35 +++++++++++++++++++++++++++----- drivers/net/dsa/b53/b53_regs.h | 1 + 2 files changed, 31 insertions(+), 5 deletions(-)
drivers/net/dsa/b53/b53_common.c +30 -5
@@ -2604,6 +2604,31 @@ enum dsa_tag_protocol b53_get_tag_protocol(struct dsa_switch *ds, int port, }EXPORT_SYMBOL (b53_get_tag_protocol); +static u16 b53_mirror_capture_port_mask (struct b53_device *dev) +{ +if (is5325 (dev) ||is5365 (dev)) +return CAP_PORT_MASK_25 ; + +return CAP_PORT_MASK ; +} + +static u16 b53_mirror_port_mask (struct b53_device *dev,int port) +{ +/* These switches use a bitmap with the CPU port at bit 8. */ +if ((is5325 (dev) ||is5365 (dev)) && port ==B53_CPU_PORT_25 ) + port =B53_CPU_PORT ; + +return BIT (port); +} + +static u16 b53_mirror_capture_port (struct b53_device *dev,int port) +{ +if (is5325 (dev) ||is5365 (dev)) +return b53_mirror_port_mask (dev, port); + +return port; +} +int b53_mirror_add (struct dsa_switch *ds,int port,struct dsa_mall_mirror_tc_entry *mirror,bool ingress,struct netlink_ext_ack *extack)
@@ -2617,12 +2642,12 @@ int b53_mirror_add(struct dsa_switch *ds, int port, loc =B53_EG_MIR_CTL ;b53_read16 (dev,B53_MGMT_PAGE , loc, ®); - reg |=BIT (port); + reg |=b53_mirror_port_mask (dev, port);b53_write16 (dev,B53_MGMT_PAGE , loc, reg);b53_read16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , ®); - reg &= ~CAP_PORT_MASK ; - reg |= mirror->to_local_port; + reg &= ~b53_mirror_capture_port_mask (dev); + reg |=b53_mirror_capture_port (dev, mirror->to_local_port); reg |=MIRROR_EN ;b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , reg);
@@ -2644,7 +2669,7 @@ void b53_mirror_del(struct dsa_switch *ds, int port,/* Update the desired ingress/egress register */ b53_read16 (dev,B53_MGMT_PAGE , loc, ®); - reg &= ~BIT (port); + reg &= ~b53_mirror_port_mask (dev, port);if (!(reg &MIRROR_MASK )) loc_disable = true;b53_write16 (dev,B53_MGMT_PAGE , loc, reg);
@@ -2663,7 +2688,7 @@ void b53_mirror_del(struct dsa_switch *ds, int port,/* Both no longer have ports, let's disable mirroring */ if (loc_disable && other_loc_disable) { reg &= ~MIRROR_EN ; - reg &= ~mirror->to_local_port; + reg &= ~b53_mirror_capture_port_mask (dev); }b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , reg); }
drivers/net/dsa/b53/b53_regs.h +1 -0
@@ -239,6 +239,7 @@/* Mirror capture control register (16 bit) */ #define B53_MIR_CAP_CTL 0x10#define CAP_PORT_MASK 0xf +#define CAP_PORT_MASK_25 0x7ff#define BLK_NOT_MIR BIT(14)#define MIRROR_EN BIT(15)
Signature · 1 line
2.53.0
Florian Fainelli
maintainerPATCH v7 6/6 net: dsa: b53: fix mirror destination and source state tracking
In reply to Florian FainelliThe mirror capture control register selects one destination for all ingress and egress sources. Adding a rule for another destination currently redirects existing rules. Multiple matchall filters can also share one source bit, but deleting any one of them clears that bit and can disable mirroring while other filters still need it.
Reject a different destination while either source mask is occupied, and reference count each port's ingress and egress source bit under RTNL. Program a source on its first reference and clear it on its last one. Check every mirror register access and record a first reference only after programming succeeds. Select the destination before enabling the source, and log deletion failures because the callback returns no error. Use the source masks to retain the destination after a failed source deletion and allow a new destination after a failed capture-control clear.
Not all supported switches receive a hardware reset during setup, so clear stale capture and source registers before accepting mirror rules. Introduce b53_mirror_init() together with its b53 and bcm_sf2 setup callers. Rebuild active sources and their destination from the reference counts when setup runs again, preserving rules across bcm_sf2 resume. Propagate initialization failures instead of accepting stale state.
This depends on "net: dsa: b53: fix mirror port encoding on BCM5325 and BCM5365" for the chip-specific source and capture-port helpers.
--- drivers/net/dsa/b53/b53_common.c | 168 ++++++++++++++++++++++++------- drivers/net/dsa/b53/b53_priv.h | 4 + drivers/net/dsa/bcm_sf2.c | 4 + 3 files changed, 140 insertions(+), 36 deletions(-)
drivers/net/dsa/b53/b53_common.c +132 -36
@@ -1360,6 +1360,10 @@ static int b53_setup(struct dsa_switch *ds)return ret; } + ret =b53_mirror_init (ds); +if (ret) +return ret; +/* setup default vlan for filtering mode */ pvid =b53_default_pvid (dev); vl = &dev->vlans[pvid];
@@ -2629,27 +2633,103 @@ static u16 b53_mirror_capture_port(struct b53_device *dev, int port)return port; } +int b53_mirror_init (struct dsa_switch *ds) +{ +struct b53_device *dev = ds->priv; +u16 ingress =0 , egress =0 , cap_ctl =0 ; +unsigned int port; +int ret; + +/* A switch reset may leave the previous mirror configuration intact. */ + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL ,0 ); +if (ret) +return ret; + + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_IG_MIR_CTL ,0 ); +if (ret) +return ret; + + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_EG_MIR_CTL ,0 ); +if (ret) +return ret; + +/* DSA retains matchall filters across suspend and resume. */ +for (port =0 ; port < dev->num_ports; port++) { +if (dev->ports[port].mirror_count[true]) + ingress |=b53_mirror_port_mask (dev, port); +if (dev->ports[port].mirror_count[false]) + egress |=b53_mirror_port_mask (dev, port); + } + +if (!(ingress | egress)) +return 0 ; + + cap_ctl =MIRROR_EN |b53_mirror_capture_port (dev, dev->mirror_port); + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , cap_ctl); +if (ret) +return ret; + + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_IG_MIR_CTL , ingress); +if (ret) +return ret; + +return b53_write16 (dev,B53_MGMT_PAGE ,B53_EG_MIR_CTL , egress); +} +EXPORT_SYMBOL (b53_mirror_init); +int b53_mirror_add (struct dsa_switch *ds,int port,struct dsa_mall_mirror_tc_entry *mirror,bool ingress,struct netlink_ext_ack *extack) {struct b53_device *dev = ds->priv; -u16 reg, loc; +unsigned int *mirror_count = &dev->ports[port].mirror_count[ingress]; +u16 reg, other_reg, loc, other_loc, cap_ctl; +u16 cap_mask =b53_mirror_capture_port_mask (dev); +u16 cap_port =b53_mirror_capture_port (dev, mirror->to_local_port); +int ret; -if (ingress) - loc =B53_IG_MIR_CTL ; -else - loc =B53_EG_MIR_CTL ; + loc = ingress ?B53_IG_MIR_CTL :B53_EG_MIR_CTL ; + other_loc = ingress ?B53_EG_MIR_CTL :B53_IG_MIR_CTL ; -b53_read16 (dev,B53_MGMT_PAGE , loc, ®); - reg |=b53_mirror_port_mask (dev, port); -b53_write16 (dev,B53_MGMT_PAGE , loc, reg); + ret =b53_read16 (dev,B53_MGMT_PAGE , loc, ®); +if (ret) +return ret; -b53_read16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , ®); - reg &= ~b53_mirror_capture_port_mask (dev); - reg |=b53_mirror_capture_port (dev, mirror->to_local_port); - reg |=MIRROR_EN ; -b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , reg); + ret =b53_read16 (dev,B53_MGMT_PAGE , other_loc, &other_reg); +if (ret) +return ret; + + ret =b53_read16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , &cap_ctl); +if (ret) +return ret; + +if (((reg | other_reg) &MIRROR_MASK ) && + (cap_ctl & cap_mask) != cap_port) { +NL_SET_ERR_MSG_MOD (extack, +"Only one mirroring destination is supported" ); +return -EOPNOTSUPP ; + } + +if (*mirror_count) { + (*mirror_count)++; +return 0 ; + } + +/* Select the destination before enabling the new source. */ + cap_ctl &= ~cap_mask; + cap_ctl |= cap_port; + cap_ctl |=MIRROR_EN ; + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , cap_ctl); +if (ret) +return ret; + + ret =b53_write16 (dev,B53_MGMT_PAGE , loc, + reg |b53_mirror_port_mask (dev, port)); +if (ret) +return ret; + + (*mirror_count)++; + dev->mirror_port = mirror->to_local_port;return 0 ; }
@@ -2659,38 +2739,54 @@ void b53_mirror_del(struct dsa_switch *ds, int port, struct dsa_mall_mirror_tc_entry *mirror) {struct b53_device *dev = ds->priv; -bool loc_disable = false, other_loc_disable = false; -u16 reg, loc; +unsigned int *mirror_count = + &dev->ports[port].mirror_count[mirror->ingress]; +u16 reg, other_reg, loc, other_loc; +int ret; -if (mirror->ingress) - loc =B53_IG_MIR_CTL ; -else - loc =B53_EG_MIR_CTL ; +if (!*mirror_count) +return ; + +if (--(*mirror_count)) +return ; + + loc = mirror->ingress ?B53_IG_MIR_CTL :B53_EG_MIR_CTL ; + other_loc = mirror->ingress ?B53_EG_MIR_CTL :B53_IG_MIR_CTL ;/* Update the desired ingress/egress register */ -b53_read16 (dev,B53_MGMT_PAGE , loc, ®); + ret =b53_read16 (dev,B53_MGMT_PAGE , loc, ®); +if (ret) + goto err; + reg &= ~b53_mirror_port_mask (dev, port); -if (!(reg &MIRROR_MASK )) - loc_disable = true; -b53_write16 (dev,B53_MGMT_PAGE , loc, reg); + ret =b53_write16 (dev,B53_MGMT_PAGE , loc, reg); +if (ret) + goto err;/* Now look at the other one to know if we can disable mirroring * entirely */ -if (mirror->ingress) -b53_read16 (dev,B53_MGMT_PAGE ,B53_EG_MIR_CTL , ®); -else -b53_read16 (dev,B53_MGMT_PAGE ,B53_IG_MIR_CTL , ®); -if (!(reg &MIRROR_MASK )) - other_loc_disable = true; + ret =b53_read16 (dev,B53_MGMT_PAGE , other_loc, &other_reg); +if (ret) + goto err; -b53_read16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , ®); -/* Both no longer have ports, let's disable mirroring */ -if (loc_disable && other_loc_disable) { - reg &= ~MIRROR_EN ; - reg &= ~b53_mirror_capture_port_mask (dev); - } -b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , reg); +if ((reg | other_reg) &MIRROR_MASK ) +return ; + + ret =b53_read16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , ®); +if (ret) + goto err; + + reg &= ~(MIRROR_EN |b53_mirror_capture_port_mask (dev)); + ret =b53_write16 (dev,B53_MGMT_PAGE ,B53_MIR_CAP_CTL , reg); +if (ret) + goto err; + +return ; + +err: +dev_err (dev->dev,"Failed to delete mirror rule for port %d: %d\n" , + port, ret); }EXPORT_SYMBOL (b53_mirror_del);
drivers/net/dsa/b53/b53_priv.h +4 -0
@@ -119,6 +119,8 @@ struct b53_pcs {#define B53_N_PCS 2struct b53_port { +/* References to each egress/ingress mirror source mask bit. */ +unsigned int mirror_count[2 ];u16 vlan_ctl_mask;u16 pvid;struct ethtool_keee eee;
@@ -170,6 +172,7 @@ struct b53_device {/* run time configuration */ bool enable_jumbo; +unsigned int mirror_port;unsigned int num_vlans;struct b53_vlan *vlans;
@@ -545,6 +548,7 @@ int b53_mdb_add(struct dsa_switch *ds, int port,int b53_mdb_del (struct dsa_switch *ds,int port,const struct switchdev_obj_port_mdb *mdb,struct dsa_db db); +int b53_mirror_init (struct dsa_switch *ds);int b53_mirror_add (struct dsa_switch *ds,int port,struct dsa_mall_mirror_tc_entry *mirror,bool ingress,struct netlink_ext_ack *extack);
drivers/net/dsa/bcm_sf2.c +4 -0
@@ -1061,6 +1061,10 @@ static int bcm_sf2_sw_setup(struct dsa_switch *ds)unsigned int port;int ret; + ret =b53_mirror_init (ds); +if (ret) +return ret; +/* Enable all valid ports and disable those unused */ for (port =0 ; port < priv->hw_params.num_ports; port++) {/* IMP port receives special treatment */
Signature · 1 line
2.53.0
Re: [PATCH net v7 6/6] net: dsa: b53: fix mirror destination and source state tracking
I tested this on a BCM53125 over SPI, with the series applied to v7.3.3, using skip_sw matchall mirred rules and the switch MIB counters:
- ingress and egress mirroring to one port work, and stop when the rules are deleted
- a rule for a second destination is refused
- with two ingress filters on one source, deleting one keeps mirroring and deleting both stops it
- once all rules are gone, a different destination is accepted
Florian Fainelli
maintainerRe: [PATCH net v7 6/6] net: dsa: b53: fix mirror destination and source state tracking
Quoted 11 lines · Joseph Telaak
I tested this on a BCM53125 over SPI, with the series applied to v7.3.3, using
skip_swmatchall mirred rules and the switch MIB counters:- ingress and egress mirroring to one port work, and stop when the rules are deleted
- a rule for a second destination is refused
- with two ingress filters on one source, deleting one keeps mirroring and deleting both stops it
- once all rules are gone, a different destination is acceptedTested-by Joseph Telaak <[email protected]>
Thank you Joseph for testing!
Signature · 1 line
Florian