Page MenuHomeFreeBSD

ifnet: initial if_grow() shall always succeed
ClosedPublic

Authored by glebius on Dec 4 2021, 9:16 PM.

Details

Summary

So let's just call malloc() directly. This also avoids hidden
doubling of default V_if_indexlim.

Diff Detail

Repository
R10 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

This revision is now accepted and ready to land.Dec 4 2021, 10:51 PM

I think your description may be misleading and that it was initially done simply to have a single point of malloc.
That indeed does not make sense anymore with the current code.

Do you want to also bump V_if_indexlim to 16 now to make it explicit and not reduce the number of initial array size?

In D33261#752134, @bz wrote:

I think your description may be misleading and that it was initially done simply to have a single point of malloc.
That indeed does not make sense anymore with the current code.

Do you want to also bump V_if_indexlim to 16 now to make it explicit and not reduce the number of initial array size?

I'd like to leave it 8. First, this number seems more sane default to me. Second, the doubling was not documented as intentional in f9132cebdc924.