Commit fcac6c4
Handle packets to be routed forward and those for the itf owner differently
In the current csp_can_pbuf_new() function implementation, CSP buffer exhaustion will cause the calling thread to crash (csp_buffer_get_always() will assert).
In the context of a CSH instance acting as a router, this means that as soon as this situation occurs, the router will stop functioning *silently*,
requiring a manual restart of CSH (the router thread will enter an infinite loop due to csp_panic() not being over-written in CSH (separate issue to be addressed)).
We have observed this behaviour where bursts of packets to be routed will cause the router to stop working due to buffer exhaustion.
To mitigate this issue, csp_can_pbuf_new() was changed to handle buffer exhaustion more gracefully, dropping to be routed packets, while still aborting in case
where the packet was for the interface owner, but not buffers where available.
Dropping packets will allow code to free up CSP buffers once the burst is over, making the infrastructure much more resilient.
The same logic is applied in ZMQ's csp_zmqhub_task() function1 parent aceef30 commit fcac6c4
3 files changed
Lines changed: 39 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
61 | 65 | | |
62 | 66 | | |
63 | 67 | | |
| |||
269 | 273 | | |
270 | 274 | | |
271 | 275 | | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
272 | 280 | | |
273 | 281 | | |
274 | 282 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
54 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
55 | 65 | | |
56 | | - | |
57 | | - | |
58 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
59 | 69 | | |
60 | | - | |
61 | | - | |
62 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 131 | | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
132 | 136 | | |
133 | | - | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
134 | 145 | | |
135 | 146 | | |
| 147 | + | |
136 | 148 | | |
137 | 149 | | |
138 | 150 | | |
139 | 151 | | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | 152 | | |
145 | 153 | | |
146 | 154 | | |
| |||
0 commit comments