Commit f8c3a7c
committed
Fix RoundRobin crash with zero output gate
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.1 parent 0716603 commit f8c3a7c
1 file changed
Lines changed: 11 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
104 | 109 | | |
105 | 110 | | |
106 | 111 | | |
107 | | - | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
111 | 118 | | |
112 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
113 | 122 | | |
114 | 123 | | |
115 | 124 | | |
| |||
0 commit comments