Re: [PATCH v2 net-next 00/12] Add tc-mqprio and tc-taprio support for preemptible traffic classes

From: Vladimir Oltean
Date: Mon Feb 20 2023 - 06:48:30 EST


On Mon, Feb 20, 2023 at 12:15:57PM +0100, Ferenc Fejes wrote:
> LGTM.
>
> Reviewed-by: Ferenc Fejes <fejes@xxxxxxxxxxx>

Thanks a lot for the review!

Unfortunately I need to send a v3, because the C language apparently
doesn't like "default" switch cases with no code, and I need to make
this change (which surprises me, since the code did compile fine with
my gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu toolchain):

diff --git a/drivers/net/ethernet/mscc/ocelot_mm.c b/drivers/net/ethernet/mscc/ocelot_mm.c
index 21d5656dfc70..f7766927bdd2 100644
--- a/drivers/net/ethernet/mscc/ocelot_mm.c
+++ b/drivers/net/ethernet/mscc/ocelot_mm.c
@@ -57,20 +57,16 @@ void ocelot_port_update_preemptible_tcs(struct ocelot *ocelot, int port)

lockdep_assert_held(&mm->lock);

- /* On NXP LS1028A, when using QSGMII, the port hangs if transmitting
- * preemptible frames at any other link speed than gigabit
+ /* Only commit preemptible TCs when MAC Merge is active.
+ * On NXP LS1028A, when using QSGMII, the port hangs if transmitting
+ * preemptible frames at any other link speed than gigabit, so avoid
+ * preemption at lower speeds in this PHY mode.
*/
- if (ocelot_port->phy_mode != PHY_INTERFACE_MODE_QSGMII ||
- ocelot_port->speed == SPEED_1000) {
- /* Only commit preemptible TCs when MAC Merge is active */
- switch (mm->verify_status) {
- case ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED:
- case ETHTOOL_MM_VERIFY_STATUS_DISABLED:
- val = mm->preemptible_tcs;
- break;
- default:
- }
- }
+ if ((ocelot_port->phy_mode != PHY_INTERFACE_MODE_QSGMII ||
+ ocelot_port->speed == SPEED_1000) &&
+ (mm->verify_status == ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED ||
+ mm->verify_status == ETHTOOL_MM_VERIFY_STATUS_DISABLED))
+ val = mm->preemptible_tcs;

ocelot_rmw_rix(ocelot, QSYS_PREEMPTION_CFG_P_QUEUES(val),
QSYS_PREEMPTION_CFG_P_QUEUES_M,

Besides, I'm also taking the opportunity to make one more change, and
really do a thorough job with the netlink extack: I will be passing it
down to the device driver in v3, via struct tc_mqprio_qopt_offload and
struct tc_taprio_qopt_offload.

I'll replicate your review tag for all patches from v2 that will be
present in an unchanged form in v3, ok?