linux/drivers/net/dsa/sja1105
Vladimir Oltean 43ce887c50 net: dsa: sja1105: fix tc-gate schedule with single element
The sja1105_gating_cfg_time_to_interval function does this, as per the
comments:

/* The gate entries contain absolute times in their e->interval field. Convert
 * that to proper intervals (i.e. "0, 5, 10, 15" to "5, 5, 5, 5").
 */

To perform that task, it iterates over gating_cfg->entries, at each step
updating the interval of the _previous_ entry. So one interval remains
to be updated at the end of the loop: the last one (since it isn't
"prev" for anyone else).

But there was an erroneous check, that the last element's interval
should not be updated if it's also the only element. I'm not quite sure
why that check was there, but it's clearly incorrect, as a tc-gate
schedule with a single element would get an e->interval of zero,
regardless of the duration requested by the user. The switch wouldn't
even consider this configuration as valid: it will just drop all traffic
that matches the rule.

Fixes: 834f8933d5 ("net: dsa: sja1105: implement tc-gate using time-triggered virtual links")
Reported-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2020-06-25 16:06:56 -07:00
..
Kconfig net: dsa: sja1105: support flow-based redirection via virtual links 2020-05-07 17:31:57 -07:00
Makefile net: dsa: sja1105: support flow-based redirection via virtual links 2020-05-07 17:31:57 -07:00
sja1105_clocking.c net: dsa: sja1105: enable internal pull-down for RX_DV/CRS_DV/RX_CTL and RX_ER 2020-04-20 11:00:27 -07:00
sja1105_dynamic_config.c net: dsa: sja1105: fix port mirroring for P/Q/R/S 2020-05-30 18:00:36 -07:00
sja1105_dynamic_config.h net: dsa: sja1105: Use the correct style for SPDX License Identifier 2019-10-15 20:16:26 -07:00
sja1105_ethtool.c dsa: sja1105: fix semicolon.cocci warnings 2020-05-10 11:05:46 -07:00
sja1105_flower.c net: dsa: sja1105: implement tc-gate using time-triggered virtual links 2020-05-07 17:31:57 -07:00
sja1105_main.c net: dsa: sja1105: avoid invalid state in sja1105_vlan_filtering 2020-05-29 16:49:50 -07:00
sja1105_ptp.c net: dsa: sja1105: fix PTP timestamping with large tc-taprio cycles 2020-06-15 13:45:59 -07:00
sja1105_ptp.h net: dsa: sja1105: implement tc-gate using time-triggered virtual links 2020-05-07 17:31:57 -07:00
sja1105_sgmii.h net: dsa: sja1105: Add support for the SGMII port 2020-03-20 08:55:21 -07:00
sja1105_spi.c net: dsa: sja1105: offload the Credit-Based Shaper qdisc 2020-05-28 11:01:22 -07:00
sja1105_static_config.c net: dsa: sja1105: fix port mirroring for P/Q/R/S 2020-05-30 18:00:36 -07:00
sja1105_static_config.h net: dsa: sja1105: fix port mirroring for P/Q/R/S 2020-05-30 18:00:36 -07:00
sja1105_tas.c net: dsa: sja1105: implement tc-gate using time-triggered virtual links 2020-05-07 17:31:57 -07:00
sja1105_tas.h net: dsa: sja1105: implement tc-gate using time-triggered virtual links 2020-05-07 17:31:57 -07:00
sja1105_vl.c net: dsa: sja1105: fix tc-gate schedule with single element 2020-06-25 16:06:56 -07:00
sja1105_vl.h net: dsa: sja1105: suppress -Wmissing-prototypes in sja1105_vl.c 2020-06-01 12:13:47 -07:00
sja1105.h net: dsa: sja1105: suppress -Wmissing-prototypes in sja1105_static_config.c 2020-05-30 18:00:36 -07:00