Skip to content
This repository was archived by the owner on Aug 26, 2024. It is now read-only.

Commit 56d7123

Browse files
committed
Fix GetDescs() call missing an argument in some examples
1 parent 30c53df commit 56d7123

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

examples/dumpframes/dumpframes.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ func main() {
9595
// descriptors and push them onto the Fill ring queue
9696
// for the kernel to fill them with the received
9797
// frames.
98-
xsk.Fill(xsk.GetDescs(n))
98+
xsk.Fill(xsk.GetDescs(n, true))
9999
}
100100

101101
// Wait for receive - meaning the kernel has

examples/l2fwd/l2fwd.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ func forwardL2(verbose bool, inLink netlink.Link, inLinkQueueID int, inLinkDst n
125125
fds[0].Fd = int32(inXsk.FD())
126126
fds[1].Fd = int32(outXsk.FD())
127127
for {
128-
inXsk.Fill(inXsk.GetDescs(inXsk.NumFreeFillSlots()))
129-
outXsk.Fill(outXsk.GetDescs(outXsk.NumFreeFillSlots()))
128+
inXsk.Fill(inXsk.GetDescs(inXsk.NumFreeFillSlots(), true))
129+
outXsk.Fill(outXsk.GetDescs(outXsk.NumFreeFillSlots(), true))
130130

131131
fds[0].Events = unix.POLLIN
132132
if inXsk.NumTransmitted() > 0 {
@@ -172,7 +172,7 @@ func forwardFrames(input *xdp.Socket, output *xdp.Socket, dstMac net.HardwareAdd
172172
inDescs := input.Receive(input.NumReceived())
173173
replaceDstMac(input, inDescs, dstMac)
174174

175-
outDescs := output.GetDescs(output.NumFreeTxSlots())
175+
outDescs := output.GetDescs(output.NumFreeTxSlots(), false)
176176

177177
if len(inDescs) > len(outDescs) {
178178
inDescs = inDescs[:len(outDescs)]

examples/rebroadcast/rebroadcast.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func main() {
8888
// descriptors and push them onto the Fill ring queue
8989
// for the kernel to fill them with the received
9090
// frames.
91-
xsk.Fill(xsk.GetDescs(n))
91+
xsk.Fill(xsk.GetDescs(n, true))
9292
}
9393
fmt.Printf(" fill=%d, rx=%d, tx=%d, complete=%d\n", xsk.NumFilled(), xsk.NumReceived(), xsk.NumTransmitted(), xsk.NumCompleted())
9494

xdp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ transmits them back out the same network link:
8181
}()
8282
8383
for {
84-
xsk.Fill(xsk.GetDescs(xsk.NumFreeFillSlots()))
84+
xsk.Fill(xsk.GetDescs(xsk.NumFreeFillSlots(), true))
8585
numRx, _, err := xsk.Poll(-1)
8686
if err != nil {
8787
panic(err)

0 commit comments

Comments
 (0)