| 214 | } |
| 215 | |
| 216 | CommandResponse Queue::SetSize(uint64_t size) { |
| 217 | if (size < 4 || size > 16384) { |
| 218 | return CommandFailure(EINVAL, "must be in [4, 16384]"); |
| 219 | } |
| 220 | |
| 221 | if (size & (size - 1)) { |
| 222 | return CommandFailure(EINVAL, "must be a power of 2"); |
| 223 | } |
| 224 | |
| 225 | int ret = Resize(size); |
| 226 | if (ret) { |
| 227 | return CommandFailure(-ret); |
| 228 | } |
| 229 | size_ = size; |
| 230 | |
| 231 | return CommandSuccess(); |
| 232 | } |
| 233 | |
| 234 | CommandResponse Queue::CommandSetSize( |
| 235 | const bess::pb::QueueCommandSetSizeArg &arg) { |
nothing calls this directly
no test coverage detected