/* 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) && mm->tx_active)
val = mm->preemptible_tcs;
/* Cut through switching doesn't work for preemptible priorities, * so first make sure it is disabled. Also, changing the preemptible * TCs affects the oversized frame dropping logic, so that needs to be * re-triggered. And since tas_guard_bands_update() also implicitly * calls cut_through_fwd(), we don't need to explicitly call it.
*/
mm->active_preemptible_tcs = val;
ocelot->ops->tas_guard_bands_update(ocelot, port);
if (val & DEV_MM_STAT_MM_STATUS_UNEXP_RX_PFRM_STICKY) {
dev_err(ocelot->dev, "Unexpected P-frame received on port %d while verification was unsuccessful or not yet verified\n",
port);
if (val & DEV_MM_STAT_MM_STATUS_UNEXP_TX_PFRM_STICKY) {
dev_err(ocelot->dev, "Unexpected P-frame requested to be transmitted on port %d while verification was unsuccessful or not yet verified, or MM_TX_ENA=0\n",
port);
/* The switch will emit an IRQ when TX is disabled, to notify that it * has become inactive. We optimize ocelot_mm_update_port_status() to * not bother processing MM IRQs at all for ports with TX disabled, * but we need to ACK this IRQ now, while mm->tx_enabled is still set, * otherwise we get an IRQ storm.
*/ if (mm->tx_enabled && !cfg->tx_enabled) {
ocelot_mm_update_port_status(ocelot, port);
WARN_ON(mm->tx_active);
}
int ocelot_mm_init(struct ocelot *ocelot)
{ struct ocelot_port *ocelot_port; struct ocelot_mm_state *mm; int port;
if (!ocelot->mm_supported) return 0;
ocelot->mm = devm_kcalloc(ocelot->dev, ocelot->num_phys_ports, sizeof(*ocelot->mm), GFP_KERNEL); if (!ocelot->mm) return -ENOMEM;
for (port = 0; port < ocelot->num_phys_ports; port++) {
u32 val;
mm = &ocelot->mm[port];
ocelot_port = ocelot->ports[port];
/* Update initial status variable for the * verification state machine
*/
val = ocelot_port_readl(ocelot_port, DEV_MM_STATUS);
mm->verify_status = ocelot_mm_verify_status(val);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.