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

examples: fixed http_filter example #1341

Merged
merged 1 commit into from
Sep 5, 2017

Conversation

pbhole
Copy link
Contributor

@pbhole pbhole commented Sep 5, 2017

Loop unrolling wasn't happening because of variable upper
bound. Making it const fixes the problem.

Tested with 4.13.0-rc6 on fedora 26

Loop unrolling wasn't happening because of variable upper
bound. Making it const fixes the problem.

Tested with 4.13.0-rc6 on fedora 26
Copy link
Collaborator

@yonghong-song yonghong-song left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -92,7 +92,8 @@ int http_filter(struct __sk_buff *skb) {
unsigned long p[7];
int i = 0;
int j = 0;
for (i = payload_offset ; i < (payload_offset + 7) ; i++) {
const int last_index = payload_offset + 7;
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is certainly working before. But llvm compiler loop unrolling has evolved not liking the expression in the for loop conditions. I did not track down why.

Just with "int last_index = payload_offset + 7" also works fine. The point is to have a variable instead of expression.

@yonghong-song
Copy link
Collaborator

[buildbot, ok to test]

@yonghong-song yonghong-song merged commit a3abb65 into iovisor:master Sep 5, 2017
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.

None yet

2 participants