if (type == DPSW_BROADCAST && ethsw->ports[j]->bcast_flood)
cfg->if_id[i++] = ethsw->ports[j]->idx;
- else if (type == DPSW_FLOODING)
+ else if (type == DPSW_FLOODING && ethsw->ports[j]->ucast_flood)
cfg->if_id[i++] = ethsw->ports[j]->idx;
}
if (flags.mask & BR_BCAST_FLOOD)
port_priv->bcast_flood = !!(flags.val & BR_BCAST_FLOOD);
+ if (flags.mask & BR_FLOOD)
+ port_priv->ucast_flood = !!(flags.val & BR_FLOOD);
+
return dpaa2_switch_fdb_set_egress_flood(ethsw, port_priv->fdb->fdb_id);
}
struct switchdev_brport_flags flags,
struct netlink_ext_ack *extack)
{
- if (flags.mask & ~(BR_LEARNING | BR_BCAST_FLOOD))
+ if (flags.mask & ~(BR_LEARNING | BR_BCAST_FLOOD | BR_FLOOD |
+ BR_MCAST_FLOOD))
return -EINVAL;
+ if (flags.mask & (BR_FLOOD | BR_MCAST_FLOOD)) {
+ bool multicast = !!(flags.val & BR_MCAST_FLOOD);
+ bool unicast = !!(flags.val & BR_FLOOD);
+
+ if (unicast != multicast) {
+ NL_SET_ERR_MSG_MOD(extack,
+ "Cannot configure multicast flooding independently of unicast");
+ return -EINVAL;
+ }
+ }
+
return 0;
}
return err;
}
- if (flags.mask & BR_BCAST_FLOOD) {
+ if (flags.mask & (BR_BCAST_FLOOD | BR_FLOOD | BR_MCAST_FLOOD)) {
err = dpaa2_switch_port_flood(port_priv, flags);
if (err)
return err;
* later bridge join will have the flooding flag on.
*/
port_priv->bcast_flood = true;
+ port_priv->ucast_flood = true;
/* Setup the egress flood policy (broadcast, unknown unicast).
* When the port is not under a bridge, only the CTRL interface is part
port_netdev->needed_headroom = DPAA2_SWITCH_NEEDED_HEADROOM;
port_priv->bcast_flood = true;
+ port_priv->ucast_flood = true;
/* Set MTU limits */
port_netdev->min_mtu = ETH_MIN_MTU;