Skip to content

Commit 43ca398

Browse files
committed
Merge pull request #12117 from wangxinmian:go
PiperOrigin-RevId: 835109509
2 parents 2879878 + e31aab6 commit 43ca398

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/tcpip/link/xdp/endpoint.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,9 @@ type Options struct {
109109

110110
// GRO enables generic receive offload.
111111
GRO bool
112+
113+
// QueueID is the ID of the RX queue to which the AF_XDP socket is attached.
114+
QueueID uint32
112115
}
113116

114117
// New creates a new endpoint from an AF_XDP socket.
@@ -164,7 +167,7 @@ func New(opts *Options) (stack.LinkEndpoint, error) {
164167
NDescriptors: nFrames / 2,
165168
Bind: opts.Bind,
166169
}
167-
ep.control, err = xdp.NewFromSocket(opts.FD, uint32(opts.InterfaceIndex), 0 /* queueID */, xdpOpts)
170+
ep.control, err = xdp.NewFromSocket(opts.FD, uint32(opts.InterfaceIndex), opts.QueueID, xdpOpts)
168171
if err != nil {
169172
return nil, fmt.Errorf("failed to create AF_XDP dispatcher: %v", err)
170173
}

0 commit comments

Comments
 (0)