Skip to content
Open
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
5 changes: 4 additions & 1 deletion pkg/tcpip/link/xdp/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ type Options struct {

// GRO enables generic receive offload.
GRO bool

// QueueID is the ID of the RX queue to which the AF_XDP socket is attached.
QueueID uint32
}

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