Skip to content

Conversation

PeterKietzmann
Copy link
Member

@PeterKietzmann PeterKietzmann commented Jan 15, 2020

Contribution description

When migrating configurations to Kconfig in #13123 we found that GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE is a simple on/off switch which should be represented as a boolean. In Kconfig, a symbol is defined when enabled and it is not generated at all when disabled. In the latter case, the value would be set anyway in the config file :

#ifndef GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE
#define GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE    (1)
#endif

Offline we agreed with @jia200x and @leandrolanzieri that inverting the logic of the macro is the cleanest solution to this problem. As the semantics change, we changed the macro name and added a compile time error in case someone tries to use the old macro and we added a deprecation note to the documentation.

Testing procedure

  1. make doc and check if documentation looks alright.
  2. With examples/gnrc_networking send large ping requests between two nodes so that fragmentation takes place, e.g: ping6 -c 10 -i 1000 -s 1000 <IPv6 dst addr> .
  3. Build with CFLAGS=-DGNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES=1 and re-run 2. on nodes.

Issues/PRs references

#12888, #13123

@PeterKietzmann PeterKietzmann added Area: network Area: Networking TF: Config Marks issues and PRs related to the work of the Configuration Task Force labels Jan 15, 2020
@miri64
Copy link
Member

miri64 commented Jan 15, 2020

* @miri64 is there anything else one should test?

Both possible configurations should be checked, I would say.

However, I don't get why we need to invert the logic here and moreover remove support already for it (the title says "deprecate", but you remove the #define altogether). Can't the Kconfig switch (if defined) determine the value of GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE instead? This way it would work both with legacy code and the Kconfig integration effort.

@miri64
Copy link
Member

miri64 commented Jan 15, 2020

(and adhere to our established deprecation process)

@miri64
Copy link
Member

miri64 commented Jan 15, 2020

Something like

/**
 * ...
 */
#ifndef GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES
#define GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES              (0)
#endif

/**
 * @brief ...
 * @deprecated Use inverse `GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES` with instead. 
 *             Will be removed after 2020.10 release.
 */
#ifndef GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE
#ifdef GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES
#define GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE    (!GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES)
#else /* GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES */
#define GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE    (1)
#endif /* GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES */
#endif

@miri64
Copy link
Member

miri64 commented Jan 15, 2020

Also GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES seems off as a name. It implies, entries are always kept. However, they are still dropped when they time out. I have to think about the name to give a constructive feedback (i.e. an alternative).

@PeterKietzmann PeterKietzmann force-pushed the pr_sixlowpan_aggr_override branch from 9e6026e to f57ced3 Compare January 15, 2020 15:44
@PeterKietzmann
Copy link
Member Author

@miri64 like that? I rebuild the doc and executed the above ping command running examples/gnrc_networking on the iotlab testbed with GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES=1 and GNRC_SIXLOWPAN_FRAG_RBUF_KEEP_ENTRIES=0. Looks alright.

@miri64
Copy link
Member

miri64 commented Jan 15, 2020

Yepp. Still don't like the name of the new macro though (and still don't have a better name :-()

@PeterKietzmann
Copy link
Member Author

GNRC_SIXLOWPAN_FRAG_RBUF_DONT_OVERRIDE ?

@miri64
Copy link
Member

miri64 commented Jan 15, 2020

GNRC_SIXLOWPAN_FRAG_RBUF_DONT_OVERRIDE ?

GNRC_SIXLOWPAN_FRAG_RBUF_DO_NOT_OVERRIDE would be better in that case :-). But in general 👍

@PeterKietzmann PeterKietzmann force-pushed the pr_sixlowpan_aggr_override branch from f57ced3 to 46325ca Compare January 15, 2020 16:56
@PeterKietzmann PeterKietzmann added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jan 15, 2020
@PeterKietzmann
Copy link
Member Author

@miri64 thanks for the immediate feedback. I changed the name accordingly and squashed right away.

@fjmolinas
Copy link
Contributor

@miri64 is the status OK for you?

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miri64 thanks for the immediate feedback. I changed the name accordingly and squashed right away.

Sorry, I was rushing to the theater at that moment. Here is some more feedback on the doc.

*
* When not set, it will cause the reassembly buffer to
* override the oldest entry no matter what. When set, only the oldest
* entry that is older than @ref GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US will be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No... "When set, only incomplete entries that are older than ...TIMEOUT_US will be removed from the reassembly buffer." If and only if you want to keep the information that lingering entries are also removed, you can add something like "On creation of a new entry the timeout period of older entries is also checked."

@miri64
Copy link
Member

miri64 commented Jan 15, 2020

Also, please adapt the PR title for this PR to the current state for future reference.

@PeterKietzmann PeterKietzmann changed the title gnrc/sixlowpan: deprecate GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE gnrc/sixlowpan: add deprecation note for GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE Jan 16, 2020
@PeterKietzmann
Copy link
Member Author

@miri64, @leandrolanzieri please look at my latest changes

@@ -92,10 +109,17 @@ extern "C" {
* entry that is older than @ref GNRC_SIXLOWPAN_FRAG_RBUF_TIMEOUT_US will be
* overwritten (they will still timeout normally if reassembly buffer is not
* full).
*
* @deprecated Use inverse `GNRC_SIXLOWPAN_FRAG_RBUF_DO_NOT_OVERRIDE` with instead.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @deprecated Use inverse `GNRC_SIXLOWPAN_FRAG_RBUF_DO_NOT_OVERRIDE` with instead.
* @deprecated Use inverse of `GNRC_SIXLOWPAN_FRAG_RBUF_DO_NOT_OVERRIDE` instead.

?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also @ref GNRC_SIXLOWPAN_FRAG_RBUF_DO_NOT_OVERRIDE is safer, as this way Doxygen checks if the variable exists (and also creates a link).

@PeterKietzmann
Copy link
Member Author

@leandrolanzieri, @miri64 I addressed your comments. Can I squash?

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my part you can squash (including the fixes for the comments below).

@PeterKietzmann PeterKietzmann force-pushed the pr_sixlowpan_aggr_override branch from f59d24c to 688c5f6 Compare January 16, 2020 10:44
@PeterKietzmann
Copy link
Member Author

PeterKietzmann commented Jan 16, 2020

Applied @miri64's suggested changes and squashed

@miri64
Copy link
Member

miri64 commented Jan 16, 2020

You can remove the multiple 'Co-Authored-By:' definitions from the commit message. I don't really need the attribution :D (if you insist, please use my FU mail address).

Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that: ACK.

@leandrolanzieri leandrolanzieri added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines labels Jan 16, 2020
Copy link
Contributor

@leandrolanzieri leandrolanzieri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation looks good and GNRC_SIXLOWPAN_FRAG_RBUF_AGGRESSIVE_OVERRIDE has the expected values with and without defining GNRC_SIXLOWPAN_FRAG_RBUF_DO_NOT_OVERRIDE. ACK.

@PeterKietzmann PeterKietzmann force-pushed the pr_sixlowpan_aggr_override branch from 688c5f6 to c7b6dc5 Compare January 16, 2020 12:59
@PeterKietzmann
Copy link
Member Author

I saw green lights for a short moment now lets see if removing the co-authorship changes something

@miri64
Copy link
Member

miri64 commented Jan 16, 2020

And go.

@miri64 miri64 merged commit 97a71bc into RIOT-OS:master Jan 16, 2020
@leandrolanzieri leandrolanzieri added this to the Release 2020.04 milestone Feb 20, 2020
@leandrolanzieri leandrolanzieri added the Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation label Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: network Area: Networking CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines TF: Config Marks issues and PRs related to the work of the Configuration Task Force Type: cleanup The issue proposes a clean-up / The PR cleans-up parts of the codebase / documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants