Commit 57f5a2a
committed
mctpd: allow for pool allocations that are smaller than our max limit
Currently, we attempt to allocate bridge pool ranges of the size of our
max pool configuration setting, and then trim after we know the
requested pool size. If the max allocation is not available, we do not
provide *any* EID range to the requesting bridge.
However, it's entirely likely that the bridge will request a pool that
is smaller than our maximum. We should not reject that allocation, as
there is space available.
Instead of insisting on allocating the max, just pre-allocate the
largest space up to the max. When we then learn the bridge pool size,
offer the allocation that we made. If this is smaller than the
preallocation, we trim. If it is larger, we just offer what is
allocated.
This changes a failure case, where the tests expect the less-than-max
allocation to fail. No need to preserve this behaviour, as we can
actually offer a workable pool at this point.
Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>1 parent e748dac commit 57f5a2a
2 files changed
+57
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1942 | 1942 | | |
1943 | 1943 | | |
1944 | 1944 | | |
1945 | | - | |
1946 | | - | |
1947 | | - | |
1948 | | - | |
1949 | | - | |
1950 | | - | |
1951 | | - | |
1952 | | - | |
1953 | | - | |
1954 | | - | |
1955 | | - | |
1956 | | - | |
1957 | | - | |
1958 | 1945 | | |
1959 | 1946 | | |
1960 | 1947 | | |
| |||
1977 | 1964 | | |
1978 | 1965 | | |
1979 | 1966 | | |
1980 | | - | |
| 1967 | + | |
1981 | 1968 | | |
1982 | | - | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
1983 | 1972 | | |
1984 | | - | |
1985 | | - | |
1986 | 1973 | | |
1987 | 1974 | | |
1988 | 1975 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1105 | 1105 | | |
1106 | 1106 | | |
1107 | 1107 | | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | | - | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
1112 | 1112 | | |
1113 | 1113 | | |
1114 | 1114 | | |
| |||
1121 | 1121 | | |
1122 | 1122 | | |
1123 | 1123 | | |
1124 | | - | |
1125 | | - | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
1126 | 1127 | | |
1127 | 1128 | | |
1128 | 1129 | | |
| |||
1139 | 1140 | | |
1140 | 1141 | | |
1141 | 1142 | | |
1142 | | - | |
1143 | | - | |
1144 | | - | |
1145 | | - | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
1146 | 1147 | | |
1147 | 1148 | | |
1148 | 1149 | | |
| |||
1209 | 1210 | | |
1210 | 1211 | | |
1211 | 1212 | | |
| 1213 | + | |
| 1214 | + | |
| 1215 | + | |
| 1216 | + | |
| 1217 | + | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
| 1252 | + | |
| 1253 | + | |
| 1254 | + | |
0 commit comments