Page MenuHomeFreeBSD

pf: remove unused variable allrulelist
AbandonedPublic

Authored by kp on Mon, Oct 13, 2:12 PM.
Tags
None
Referenced Files
F132544561: D53070.id164093.diff
Fri, Oct 17, 8:43 PM
F132486009: D53070.id.diff
Fri, Oct 17, 8:00 AM
Unknown Object (File)
Thu, Oct 16, 11:55 AM
Unknown Object (File)
Thu, Oct 16, 10:05 AM
Unknown Object (File)
Wed, Oct 15, 11:45 PM
Unknown Object (File)
Wed, Oct 15, 11:45 PM
Unknown Object (File)
Wed, Oct 15, 1:16 PM
Unknown Object (File)
Tue, Oct 14, 12:01 PM

Details

Reviewers
mjg
Group Reviewers
network
pfsense
Summary

We update this, and assert on it, but never actually iterate the list or use it
to look anything up.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 67753
Build 64636: arc lint + arc unit

Event Timeline

kp requested review of this revision.Mon, Oct 13, 2:12 PM

In pf_krule we got remaining:

#ifdef PF_WANT_32_TO_64_COUNTER
        LIST_ENTRY(pf_krule)     allrulelist;
        bool                     allrulelinked;
#endif

This gives a hint when was it used. Shouldn't this be removed from krule as well?

This *is* used by pf_rule_counter_u64_periodic. The goal is to sum up the 32 bit values frequently enough(tm) that they don't overflow.

In D53070#1212661, @mjg wrote:

This *is* used by pf_rule_counter_u64_periodic. The goal is to sum up the 32 bit values frequently enough(tm) that they don't overflow.

Then probably better to rename the field from allrulelist to markerlist.

Thanks for catching that. I'm not sure how I missed it, but I'm glad I remembered you wrote it and would be a good person to copy on a review.

I do still want to murder this code, but we'll wait until armv7 finally dies, or dies enough.

In D53070#1212661, @mjg wrote:

This *is* used by pf_rule_counter_u64_periodic. The goal is to sum up the 32 bit values frequently enough(tm) that they don't overflow.

Then probably better to rename the field from allrulelist to markerlist.

but this is a list of all rules

In D53070#1212847, @kp wrote:

I do still want to murder this code, but we'll wait until armv7 finally dies, or dies enough.

one can consider reverting this to a state prior to introduction of per-cpu counters. that is, just have a var updated directly. this loses updates, but maybe it's good enough for armv7?

In D53070#1213136, @mjg wrote:
In D53070#1212847, @kp wrote:

I do still want to murder this code, but we'll wait until armv7 finally dies, or dies enough.

one can consider reverting this to a state prior to introduction of per-cpu counters. that is, just have a var updated directly. this loses updates, but maybe it's good enough for armv7?

We don't need to do anything about it right now.
We're going to stop releasing updates for the 3100 any decade now, and then we can think about how much we still care about armv7.