TCPImagePuller: add fifo occupancy in ACK message

This commit is contained in:
2026-03-05 19:48:44 +01:00
parent 6410dcd604
commit 512023f5f6
3 changed files with 18 additions and 16 deletions
+2 -2
View File
@@ -47,6 +47,6 @@ struct alignas(64) TcpFrameHeader {
uint32_t ack_processed_images = 0;
uint16_t ack_code = 0;
uint16_t ack_for = 0;
uint64_t reserved[2] = {0, 0};
uint64_t ack_fifo_occupancy = 0;
uint64_t reserved = 0;
};
+15 -14
View File
@@ -125,20 +125,21 @@ On Linux, large payload transmission (`DATA` and `CALIBRATION` frames) can use k
#### TCP frame header (`TcpFrameHeader`)
| Field | Type | Description |
|---|---|---|
| `magic` | `uint32_t` | Protocol magic (`0x4A464A54`, `"JFJT"`) |
| `version` | `uint16_t` | Protocol version (`2`) |
| `type` | `uint16_t` | Frame type (see table above) |
| `image_number` | `uint64_t` | Image index for `DATA` frames |
| `payload_size` | `uint64_t` | Number of payload bytes after header |
| `socket_number` | `uint32_t` | Connection index in split-stream mode |
| `flags` | `uint32_t` | ACK flags (`OK`, `FATAL`, `HAS_ERROR_TEXT`) |
| `run_number` | `uint64_t` | Run identifier |
| `ack_processed_images` | `uint32_t` | In `ACK`: number of images processed by receiver |
| `ack_code` | `uint16_t` | In `ACK`: error/status code |
| `ack_for` | `uint16_t` | In `ACK`: frame type being acknowledged |
| `reserved` | `uint64_t[2]` | Reserved, set to `0` |
| Field | Type | Description |
|------------------------|---|----------------------------------------------------------|
| `magic` | `uint32_t` | Protocol magic (`0x4A464A54`, `"JFJT"`) |
| `version` | `uint16_t` | Protocol version (`2`) |
| `type` | `uint16_t` | Frame type (see table above) |
| `image_number` | `uint64_t` | Image index for `DATA` frames |
| `payload_size` | `uint64_t` | Number of payload bytes after header |
| `socket_number` | `uint32_t` | Connection index in split-stream mode |
| `flags` | `uint32_t` | ACK flags (`OK`, `FATAL`, `HAS_ERROR_TEXT`) |
| `run_number` | `uint64_t` | Run identifier |
| `ack_processed_images` | `uint32_t` | In `ACK`: number of images processed by receiver |
| `ack_code` | `uint16_t` | In `ACK`: error/status code |
| `ack_for` | `uint16_t` | In `ACK`: frame type being acknowledged |
| `ack_fifo_occupancy` | `uint16_t` | In `ACK`: occupancy of input FIFO in the `jfjoch_writer` |
| `reserved` | `uint64_t` | Reserved, set to `0` |
The header is 64-byte aligned (`alignas(64)`).
+1
View File
@@ -108,6 +108,7 @@ bool TCPImagePuller::SendAck(const PullerAckMessage &ack) {
h.ack_processed_images = ack.processed_images;
h.ack_code = static_cast<uint32_t>(ack.error_code);
h.payload_size = ack.error_text.size();
h.ack_fifo_occupancy = cbor_fifo.GetCurrentUtilization();
if (!SendAll(&h, sizeof(h)))
return false;