Skip to content

Unnessesary config / ram alloc: num_physical_ports #461

Closed
@illishar

Description

@illishar

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.

This issue, is somewhat related to the issues:
#316
#259

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions