netif: introduce generic network interface descriptor#11879
netif: introduce generic network interface descriptor#11879leandrolanzieri merged 3 commits intoRIOT-OS:masterfrom
Conversation
6f9f778 to
df0b1b0
Compare
| sprintf(exp_name, "if%d", (int) ((gnrc_netif_t*) netif)->pid); | ||
| TEST_ASSERT_EQUAL_INT(strlen(exp_name), res); | ||
| TEST_ASSERT_EQUAL_STRING(&exp_name[0], &name[0]); | ||
| TEST_ASSERT_EQUAL_INT(0, netif_get_name(INT16_MAX, name)); |
There was a problem hiding this comment.
This one is not required anymore, because netif_t pointers will always be valid or NULL
leandrolanzieri
left a comment
There was a problem hiding this comment.
It looks good to me. I have tested this and works well. This is a really good improvement in the API towards making it more compatible.
@miri64 could you take a look at this?
|
@miri64 @leandrolanzieri I think I addressed al comments. May I rebase/squash? |
For my part, yes. |
leandrolanzieri
left a comment
There was a problem hiding this comment.
All comments were addressed. I retested and works as expected. Please rebase and squash.
ACK. We will need a second one.
miri64
left a comment
There was a problem hiding this comment.
ACK for my part as well. I trust @leandrolanzieri's testing and the tests run by Murdock
52cb2ca to
1144baf
Compare
|
hmm looks like |
How to proceed? Blacklisting? |
|
The build size for the current master is: So RAM usage is surprisingly 16.384 (16 Kb). It makes sense that with this PR it no longer fits the memory. I would say blacklisting is the way to go here. |
|
I guess that's the kind of Spähne that happen if you hobel, as we say in German ;-P. I hope, further development will amortize the RAM usage in the end. |
1144baf to
d19d26d
Compare
|
Soft feature freeze is now active, as this is an API change we won't be able to merge it until the hard feature freeze (10th of October). |
d19d26d to
2e36ea2
Compare
|
@jia200x please rebase |
2e36ea2 to
9727f32
Compare
|
Just looked at this once more: do I understand it correctly, that the 'netif device list (registry)' is with this approach mandatory to use whenever network devices are used in a system? This seems to break the good practice in separating in interface from its concrete usage context (e.g. see |
No, it's not mandatory. Only if the network device requires a "network interface". Network devices and network interfaces are in 2 different layers. |
|
Even more, there might be network interface that don't depend on any network device (e.g loopback) |
Contribution description
This PR changes the way a
netif_tobject is represented. Currently the representation is stack specific (e.g https://github.com/RIOT-OS/RIOT/blob/master/sys/net/gnrc/netif/include/netif_types.h#L29). With this PR, an interface is always represented by anetif_tobject (where stack specific network interfaces can inherit).The consequences of these changes are:
netif_tfunctions (see here)netif_send(netif_t *netif),netif_recv(netif_t *netif)).TBD!(see netif: introduce generic network interface descriptor #11879)The
netif_tis now a linked list that point to the next interface, so it's required to register netifs via the newly introducednetif_registerfunction.Also, the NETIF_INVALID macro is not needed anymore (an invalid interface is mapped to NULL).
This PR is needed in order to have MAC/PHY layers independent of the network stack.
Testing procedure
It should be enough to run
tests/gnrc_netiftest.Check if the documentation builds without issues:
make docIssues/PRs references
It somehow relates to #11483.