Bugfix,IoUringEngn: fill unassembled slots w/dummy; use separate iovecs

We implemented the feature to fill unassembled slots w/dummy header
values for the livox pcloud header.

We also fixed a bug where io uring was writing into the last slot
only because we were using the same iovec for every SQE.
This commit is contained in:
2025-11-09 00:55:58 -04:00
parent 72a3415553
commit 010ba9c7bd
3 changed files with 139 additions and 32 deletions
+17 -2
View File
@@ -28,7 +28,8 @@ class PcloudStimulusBuffer;
class IoUringAssemblyEngine
{
public:
explicit IoUringAssemblyEngine(PcloudStimulusBuffer& parent);
explicit IoUringAssemblyEngine(
PcloudStimulusBuffer& parent, size_t nDgramsPerStagingBufferFrame);
~IoUringAssemblyEngine() = default;
bool setup();
@@ -72,7 +73,21 @@ private:
SpinLock isAssemblingLock;
bool isAssembling;
void cancelIncompleteAndFillDummies();
// Number of datagrams per staging buffer frame
size_t nDgramsPerStagingBufferFrame;
struct SlotAssemblyDesc
{
bool assembled;
struct msghdr msgHdr;
struct iovec ioVec;
};
// Track which slots have been successfully assembled and maintain persistent iovecs
std::vector<SlotAssemblyDesc> assembledSlotsTracker;
void fillUnAssembledSlotsWithDummyDgrams();
void printSlotBytes(size_t slotIndex, size_t nBytes);
void onEventfdRead(
const boost::system::error_code& error, std::size_t bytes_transferred);