Page MenuHomeFreeBSD

ip_mroute: refactor bw_meter API
ClosedPublic

Authored by wma on May 11 2021, 10:41 AM.

Details

Summary

API should work as following:
- periodicaly report Lower-or-EQual bandwidth (LEQ) connections
  over kernel socket, if user application registered for such
  per-flow notifications
- report Grater-or-EQual (GEQ) bandwidth as soon as it reaches
  specified value in configured time window

Custom implementation of callouts was removed. There is no
point of doing calout-wheel here as generic callouts are
doing exactly the same. The performance is not critical
for such reporting, so the biggest concern should be
to have a code which can be easily maintained.

This is a preparation for complete locking rework here 
which is now highly inefficient.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wma requested review of this revision.May 11 2021, 10:41 AM
mw requested changes to this revision.May 14 2021, 10:03 AM
mw added inline comments.
sys/netinet/ip_mroute.c
1892

Wouldn't callout_drain be a safer option here?

2015

The formatting looks broken in the above block.

2045

Unrelated change, please drop this addition.

sys/netinet/ip_mroute.h
288

s/Grater/Greater/

This revision now requires changes to proceed.May 14 2021, 10:03 AM
sys/netinet/ip_mroute.c
1767

Please move || operator to the previous line.

1824

no need to break line for == flags. Also, please move operators to the preceding line when line-breaking.

This revision is now accepted and ready to land.May 16 2021, 6:32 AM
This revision was automatically updated to reflect the committed changes.