Skip to content

Fix RoundRobin crash with zero output gate#623

Merged
melvinw merged 1 commit intomasterfrom
fix_roundrobin_crash
Aug 28, 2017
Merged

Fix RoundRobin crash with zero output gate#623
melvinw merged 1 commit intomasterfrom
fix_roundrobin_crash

Conversation

@sangjinhan
Copy link
Copy Markdown
Member

If RoundRobin module has no output gate, it crashes due to division by zero. In this case, the "right" behavior should be just dropping packets.

Also, this commit replaces the modulo(%) operation with a simple if branch. It saves about 22 cycles per batch or packet, depending on the operation mode of RoundRobin.

If RoundRobin module has no output gate, it crashes due to division by
zero. In this case, the "right" behavior should be just dropping
packets.

Also, this commit replaces the modulo(%) operation with a simple if
branch. It saves about 22 cycles per batch or packet, depending on the
operation mode of RoundRobin.
@codecov
Copy link
Copy Markdown

codecov Bot commented Aug 27, 2017

Codecov Report

Merging #623 into master will decrease coverage by 0.02%.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #623      +/-   ##
=========================================
- Coverage   69.32%   69.3%   -0.03%     
=========================================
  Files         204     204              
  Lines       13068   13072       +4     
=========================================
- Hits         9060    9059       -1     
- Misses       4008    4013       +5
Impacted Files Coverage Δ
core/modules/round_robin.cc 52.94% <71.42%> (-0.26%) ⬇️
core/modules/port_out.cc 80.95% <0%> (-2.39%) ⬇️
core/drivers/unix_socket.cc 80.91% <0%> (-0.77%) ⬇️
core/modules/flowgen.cc 73.7% <0%> (-0.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0716603...f8c3a7c. Read the comment docs.

@melvinw melvinw merged commit 122e4ce into master Aug 28, 2017
@melvinw
Copy link
Copy Markdown
Contributor

melvinw commented Aug 28, 2017

Thanks! cat

@changlan changlan deleted the fix_roundrobin_crash branch September 6, 2017 00:22
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.

2 participants