Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example for BPF+tc rate limiting #63

Merged
merged 3 commits into from
Jun 17, 2015
Merged

Add example for BPF+tc rate limiting #63

merged 3 commits into from
Jun 17, 2015

Conversation

drzaeus77
Copy link
Collaborator

Signed-off-by: Brenden Blanco [email protected]

* Adding an example to address #59, simulation of bandwidth sharing

Signed-off-by: Brenden Blanco <[email protected]>
u32 sip = ip->src;
struct ipkey key = {.client_ip=sip};
int val = 1;
learned_ips.lookup_or_init(&key, &val);
Copy link
Member

Choose a reason for hiding this comment

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

update(,NOEXIST) would be cleaner?

@drzaeus77
Copy link
Collaborator Author

Addressed some comments. Will attempt to address the sleep(2) after some investigation in a follow-up change.

4ast pushed a commit that referenced this pull request Jun 17, 2015
Add example for BPF+tc rate limiting
@4ast 4ast merged commit 7679a2e into master Jun 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants