Page MenuHomeFreeBSD

LinuxKPI: add net_ratelimit()
ClosedPublic

Authored by bz on Mar 23 2021, 5:13 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Nov 13, 9:48 PM
Unknown Object (File)
Wed, Oct 30, 12:11 AM
Unknown Object (File)
Oct 19 2024, 9:11 PM
Unknown Object (File)
Oct 17 2024, 1:21 AM
Unknown Object (File)
Oct 5 2024, 5:16 PM
Unknown Object (File)
Oct 1 2024, 9:37 AM
Unknown Object (File)
Oct 1 2024, 7:30 AM
Unknown Object (File)
Sep 23 2024, 5:15 AM

Details

Summary

Add a net_ratelimit() compat implementation based on ppsratecheck().
Add a sysctl to allow tuning of the number of messages.

Sponsored-by: The FreeBSD Foundation
MFC-after: 2 weeks
Reviewed-by: ...
Differential Revision:

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38024
Build 34913: arc lint + arc unit

Event Timeline

bz requested review of this revision.Mar 23 2021, 5:13 PM
hselasky added inline comments.
sys/compat/linuxkpi/common/include/linux/net.h
80

Please don't declare static variables in header files.
Make them global and possibly into SYSCTLs.

Migrate function and static variables into the implementation file
and add a SYSCTl to allow tuning the number of messages as suggested
by @hselasky.

bz marked an inline comment as done.
sys/compat/linuxkpi/common/src/linux_compat.c
105 ↗(On Diff #86266)

Does Linux default to 99 for its equivalent, or is this just a convenient number?

bz marked an inline comment as done.Mar 24 2021, 7:19 PM
bz added inline comments.
sys/compat/linuxkpi/common/src/linux_compat.c
105 ↗(On Diff #86266)

I cannot tell you what Linux defaults to as that would require me reading (likely) GPL code. It is a convenience number as I figure I can survive with 99 log messages / s on a serial console these days if worse comes to worse.

This revision is now accepted and ready to land.Mar 24 2021, 7:32 PM
sys/compat/linuxkpi/common/src/linux_compat.c
106 ↗(On Diff #86266)

Use CTLFLAG_RWTUN .

sys/compat/linuxkpi/common/src/linux_compat.c
105 ↗(On Diff #86266)

Ok - mainly was just curious, but either way it doesn't matter much, we can change the default based on feedback if it proves necessary.

bz marked an inline comment as done.Mar 24 2021, 9:31 PM
bz added inline comments.
sys/compat/linuxkpi/common/src/linux_compat.c
106 ↗(On Diff #86266)

Is there a specific reason we need this to be a tunable so it's available before /etc/rc.d/sysctl runs?

bz marked an inline comment as done.Mar 26 2021, 12:16 PM
This revision was automatically updated to reflect the committed changes.