Description
The allocated user config variable "num_physical_ports" is unnecessary.
Info and functionality regarding the number of physical ports, does not change at runtime in any sane scenario. (As far as I know.) And the stack has no feature or functionality to modify this at runtime.
It makes good sense, to make this kind of option, into a compile time constant. (Which it also was, until some time ago.) All the sample apps, currently needs code like this:
pnet_cfg.num_physical_ports = PNET_MAX_PHYSICAL_PORTS;
Besides allocating unnecessary global memory, this also muddies the "option api", gives unnecessary user config code and prevents the compiler from making optimizations.
The fix is simple. Just replace all references of num_physical_ports with the PNET_MAX_PHYSICAL_PORTS.