/* Reset destination and aggregation PGIDS */ for (p = 0; p < lan966x->num_phys_ports; ++p)
lan_wr(ANA_PGID_PGID_SET(BIT(p)),
lan966x, ANA_PGID(p));
for (p = PGID_AGGR; p < PGID_SRC; ++p)
lan_wr(ANA_PGID_PGID_SET(visited),
lan966x, ANA_PGID(p));
/* The visited ports bitmask holds the list of ports offloading any * bonding interface. Initially we mark all these ports as unvisited, * then every time we visit a port in this bitmask, we know that it is * the lowest numbered port, i.e. the one whose logical ID == physical * port ID == LAG ID. So we mark as visited all further ports in the * bitmask that are offloading the same bonding interface. This way, * we set up the aggregation PGIDs only once per bonding interface.
*/ for (p = 0; p < lan966x->num_phys_ports; ++p) { struct lan966x_port *port = lan966x->ports[p];
if (!port || !port->bond) continue;
visited &= ~BIT(p);
}
/* Now, set PGIDs for each active LAG */ for (lag = 0; lag < lan966x->num_phys_ports; ++lag) { struct lan966x_port *port = lan966x->ports[lag]; int num_active_ports = 0; struct net_device *bond; unsignedlong bond_mask;
u8 aggr_idx[16];
if (!port || !port->bond || (visited & BIT(lag))) continue;
bond = port->bond;
bond_mask = lan966x_lag_get_mask(lan966x, bond);
lan_wr(ANA_PGID_PGID_SET(bond_mask),
lan966x, ANA_PGID(p)); if (port->lag_tx_active)
aggr_idx[num_active_ports++] = p;
}
for (i = PGID_AGGR; i < PGID_SRC; ++i) {
u32 ac;
ac = lan_rd(lan966x, ANA_PGID(i));
ac &= ~bond_mask; /* Don't do division by zero if there was no active * port. Just make all aggregation codes zero.
*/ if (num_active_ports)
ac |= BIT(aggr_idx[i % num_active_ports]);
lan_wr(ANA_PGID_PGID_SET(ac),
lan966x, ANA_PGID(i));
}
/* Mark all ports in the same LAG as visited to avoid applying * the same config again.
*/ for (p = lag; p < lan966x->num_phys_ports; p++) { struct lan966x_port *port = lan966x->ports[p];
extack = netdev_notifier_info_to_extack(&info->info);
lui = info->upper_info; if (!lui) {
port->hash_type = NETDEV_LAG_HASH_NONE; return NOTIFY_DONE;
}
if (lui->tx_type != NETDEV_LAG_TX_TYPE_HASH) {
NL_SET_ERR_MSG_MOD(extack, "LAG device using unsupported Tx type"); return -EINVAL;
}
if (!lan966x_lag_port_check_hash_types(lan966x, lui->hash_type)) {
NL_SET_ERR_MSG_MOD(extack, "LAG devices can have only the same hash_type"); return -EINVAL;
}
for (p = 0; p < lan966x->num_phys_ports; p++) {
port = lan966x->ports[p]; if (!port) continue;
if (port->bond == bond)
mask |= BIT(p);
}
return mask;
}
Messung V0.5
¤ 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.0.0Bemerkung:
(vorverarbeitet)
¤
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.