Skip to content

neigh_table_shrink_tuner: add tuner to shrink neigh_table size#229

Merged
alan-maguire merged 1 commit intooracle:mainfrom
Hannibal404:arpbug
Feb 18, 2026
Merged

neigh_table_shrink_tuner: add tuner to shrink neigh_table size#229
alan-maguire merged 1 commit intooracle:mainfrom
Hannibal404:arpbug

Conversation

@Hannibal404
Copy link
Copy Markdown
Contributor

No description provided.

@oracle-contributor-agreement oracle-contributor-agreement Bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Jan 13, 2026
@alan-maguire
Copy link
Copy Markdown
Member

can you try merging the shrink code into the existing neigh_table_tuner? In general the aim is to coalesce all the tuning for a specific domain into a single tuner. I think it should be pretty straightforward to move the event handling into neigh_table_tuner.c and the bpf code into neigh_table_tuner.bpf.c

@Hannibal404
Copy link
Copy Markdown
Contributor Author

Hannibal404 commented Jan 13, 2026

I merged them but now I'm seeing the following errors while increasing thresholds when the shrinking part is used first:

Jan 13 15:24:59 prahar-nm bpftune[1106067]: Scenario 'neighbour table grown excessively' occurred for tunable 'net.ipv4.neigh.default.gc_thresh3' in global ns. neighbour table increases are beyond what would be expected for the device given the number of IP addresses/prefixlens associated with it.
Jan 13 15:24:59 prahar-nm bpftune[1106067]: can no longer update thresholds for gc_thresh[1-3] for table 'arp_cache' for device '' (ifindex 0) due to excessive size of table (we computed a reasonable max of 0 based on the prefixlens of the 0 configured addresses). Current thresh1: 12 , thresh2: 51 , thresh3: 102.

It works fine when a call to neigh_create is made first, even if it doesn't trigger a threshold expansion

@Hannibal404
Copy link
Copy Markdown
Contributor Author

Hi @alan-maguire , could you take a look when you get the chance? Thanks!

@alan-maguire
Copy link
Copy Markdown
Member

Hi @alan-maguire , could you take a look when you get the chance? Thanks!

yep, looking now, sorry about the delay..

Copy link
Copy Markdown
Member

@alan-maguire alan-maguire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks great, just would be good to do some code sharing between increase/decrease. also would be good if commit decribed what the tuning does. thanks!

Comment thread include/bpftune/bpftune.h Outdated
Comment thread src/neigh_table_tuner.bpf.c
Comment thread src/neigh_table_tuner.c Outdated
Comment thread test/neigh_table_shrink_legacy_test.sh Outdated
@Hannibal404
Copy link
Copy Markdown
Contributor Author

Made the code sharing changes

Comment thread src/neigh_table_tuner.bpf.c Outdated
Comment thread src/neigh_table_tuner.c Outdated
Copy link
Copy Markdown
Member

@alan-maguire alan-maguire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

two small things, but aside from those this looks great to me!

After neighbor table expansion has been done, as it gets emptied out, shrink
the table size in order to prevent excess memory usage. The size is decreased
up to the default kernel values.

Signed-off-by: Pradyumn Rahar <pradyumn.rahar@oracle.com>
@alan-maguire alan-maguire merged commit 0bf1348 into oracle:main Feb 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants