Page MenuHomeFreeBSD

Make dpaa2 cleanup budget values configurable
Needs ReviewPublic

Authored by flo_purplekraken.com on Mon, Sep 7, 8:43 PM.
Tags
None
Referenced Files
F171246789: D59497.diff
Wed, Sep 9, 7:56 PM
Unknown Object (File)
Tue, Sep 8, 2:27 PM
Unknown Object (File)
Tue, Sep 8, 12:42 PM
Unknown Object (File)
Tue, Sep 8, 9:55 AM
Unknown Object (File)
Tue, Sep 8, 8:10 AM
Unknown Object (File)
Tue, Sep 8, 4:39 AM
Subscribers

Details

Reviewers
dsl
Summary

Make hard-coded values available as sysctl tunables.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

dsl requested changes to this revision.Tue, Sep 8, 9:00 AM
dsl added inline comments.
sys/dev/dpaa2/dpaa2_ni.c
455

We've the only budget here, so "budget" would be shorter. Besides, consider making it read-only with "const int". It doesn't look like the variable itself is written in the function.

456

same here

1810

Could you re-write with SYSCTL_ADD_PROC as for "buf_num" and "buf_free"? You already know how not only to read, but to write a value from sysctl ;)

1813

Should be "&sc->tx_budget", I guess

1815

Should be "&sc->rx_budget", I guess

2890

Please, declare local variables for the budgets like "uint32_t buf_num = DPAA2_ATOMIC_READ(&sc->buf_num);" and use them instead of those kept in the sc. It'd help to avoid inconsistency when someone modifies sysctl while the cleanup task is running.

sys/dev/dpaa2/dpaa2_ni.h
488

There's a sysctl(9) section below in the same sc with "buf_num" and "buf_free". Put those guys there, please. Besides, I'd still prefer "struct dpaa2_atomic" for the budget variables. It might not be necessary for the 32-bit signed variables which will probably by read/written atomically on ARM64, but I just want to be sure.

P.S. This is exactly the reason why full -U999999 context is needed ;)

This revision now requires changes to proceed.Tue, Sep 8, 9:00 AM
sys/dev/dpaa2/dpaa2_ni.c
455

The implementation contains a local variable called budget. I can of course rename the parameter, but then I have to rename the local variable, too.

1810

If I understood the documentation correctly, the SYSCTL_ADD_INT() functions do support reading and writing the value, but they do nothing else, like calling update functions. But since I will change the variable type to dpaa2_atomic, I have to use custom handlers anyway.

  • Make sysctl storage values atomic
  • Group sysctl values
flo_purplekraken.com added inline comments.
sys/dev/dpaa2/dpaa2_ni.h
488

Extra context added with this patch.