This change allows users to have the benefits of using ether_input as an entropy source without forcing FreeBSD (or at least iflib drivers) to be slow by default.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Skipped - Unit
Tests Skipped - Build Status
Buildable 11259
Event Timeline
We currently disable entropy collection (or hoarding, as you aptly describe it) for NET_ETHER. It looks like if the IFF_ NO_ENTROPY flag was present for our 100G nics, this might be slightly cheaper for us, as it will avoid the function call, and the load of the entropy mask, since if_flags will already be hot in cache from the IFF_UP check. As it is, it will be no worse .
@sbruno I've created an iflib/adaptive_entropy branch with this change. It's dependent on the master-bogofix branch.
I *think* sbin/ifconfig/ifconfig.c needs to be modified with shortcuts for this with something like:
DEF_CMD("entropy", -IFF_NO_ENTROPY, setifflags); DEF_CMD("-entropy", IFF_NO_ENTROPY, setifflags);
sys/net/if.h | ||
---|---|---|
162 | I think the change to all of these defines will be made in a separate commit. Its not relevant to the feature being proposed. | |
sys/net/iflib.c | ||
4103 | This is a style change here? |
sys/net/iflib.c | ||
---|---|---|
2188 | Should this entire code block be wrapped? if (IFF_NO_ENTROPY) skip? |
I prefer the solution in https://reviews.freebsd.org/D12132, and provide commentary in there as to why we shouldn't grow a wart in iflib for what I believe are misunderstandings on entropy collection that occurred when Fortuna went in.