Page MenuHomeFreeBSD

Adaptively enable/disable entropy collection from packets
AbandonedPublic

Authored by kmacy on Aug 27 2017, 7:55 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 1, 9:10 PM
Unknown Object (File)
Wed, May 1, 9:10 PM
Unknown Object (File)
Wed, May 1, 1:40 PM
Unknown Object (File)
Mar 2 2024, 9:34 AM
Unknown Object (File)
Mar 2 2024, 7:56 AM
Unknown Object (File)
Dec 20 2023, 8:17 AM
Unknown Object (File)
Nov 10 2023, 7:49 AM
Unknown Object (File)
May 5 2023, 2:35 AM
Subscribers

Details

Summary

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 .

This revision is now accepted and ready to land.Aug 28 2017, 12:34 PM

@sbruno I've created an iflib/adaptive_entropy branch with this change. It's dependent on the master-bogofix branch.

sbruno requested changes to this revision.Aug 30 2017, 6:51 PM

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?

This revision now requires changes to proceed.Aug 30 2017, 6:51 PM
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.

And by that I mean we should use random_harvest_fast