Thanks for the review, Nik!
On Sun, Jan 29, 2023 at 12:07:31PM +0200, Nikolay Aleksandrov wrote:
> On 26/01/2023 19:01, Petr Machata wrote:
> > +static int
> > +br_multicast_pmctx_ngroups_set_max(struct net_bridge_mcast_port *pmctx,
> > + u32 max, struct netlink_ext_ack *extack)
> > +{
> > + if (max && max < pmctx->mdb_n_entries) {
> > + NL_SET_ERR_MSG_FMT_MOD(extack, "Can't set mcast_max_groups=%u,
> > which is below mcast_n_groups=%u",
> > + max, pmctx->mdb_n_entries);
>
> Why not? All new entries will be rejected anyway, at most some will expire
> and make room.
Looking at the code of the global limit ('mcast_hash_max') and also
testing it, I see that the above is not enforced there either so doing
what you suggest will at least make the port and port-vlan limits
consistent with the global limit in this regard.
>
> > + return -EINVAL;
> > + }
> > +
> > + pmctx->mdb_max_entries = max;
> > + return 0;
> > +}