<snip>
> > > -#ifdef RTE_SCHED_CMAN > > > - set_subport_cman_params(subport_params+i, > > > cman_params); > > > -#endif > > > + subport_params[i].cman_params = &cman_params; > > > > Since cman_params_is global variable, memory is allocated regardless > > of whether cman mechanism is enabled or disabled. So subport_params- > > >cman_params will never point to NULL even when red/pie is disabled. > > Define local flag "cman_enabled" and set his flag if red or pie is > > enabled and check this flag to set subport_params[i].cman_params to > cman_params. > Ah .. nice spot. But, cant we do that with additional check, using what we > have? > For an instance: > If (cman_params.cman_mode == RTE_SCHED_CMAN_PIE || > cman_params.cman_mode == RTE_SCHED_CMAN_RED) { Then set > subport_params[i].cman_params to cman_params. > } Yes, this is correct as well.