Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gomemif: Packet sent on Tx queue is received back on Rx queue of send… #165

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion extras/gomemif/memif/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ func (i *Interface) initializeQueues() (err error) {
q.putDescBuf(slot, desc)
}
}

txPacketBufOffset := uint32(uint32(i.run.NumQueuePairs) * i.run.PacketBufferSize * (1 << i.run.Log2RingSize))
for qid := 0; qid < int(i.run.NumQueuePairs); qid++ {
/* RX */
q = &Queue{
Expand Down Expand Up @@ -497,7 +499,7 @@ func (i *Interface) initializeQueues() (err error) {

for j := 0; j < q.ring.size; j++ {
slot = qid*q.ring.size + j
desc.setOffset(int(i.regions[0].packetBufferOffset + uint32(slot)*i.run.PacketBufferSize))
desc.setOffset(int(i.regions[0].packetBufferOffset + txPacketBufOffset + uint32(slot)*i.run.PacketBufferSize))
q.putDescBuf(slot, desc)
}
}
Expand Down
Loading