-
Notifications
You must be signed in to change notification settings - Fork 757
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
tuntap: Add multiqueue support #293
Conversation
link_linux.go
Outdated
_, _, _ = unix.Syscall(unix.SYS_IOCTL, fds[0].Fd(), uintptr(unix.TUNSETPERSIST), 0) | ||
cleanupFds(fds) | ||
} | ||
return err |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we can successfully set the master interface, then we return here, without storing the list of opened fds into tuntap.Fds
. Is it intentional ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aboch that is a bug. I will fix this and update the PR.
link_linux.go
Outdated
if err != nil { | ||
_, _, _ = unix.Syscall(unix.SYS_IOCTL, fds[0].Fd(), uintptr(unix.TUNSETPERSIST), 0) | ||
cleanupFds(fds) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we will not report this error to the caller. Is this the expected behavior ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aboch that should also be fixed now... sorry about that.
Add multi queue support to tuntap without breaking legacy users of tuntap. Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
return fmt.Errorf("Tuntap IOCTL TUNSETIFF failed, errno %v", errno) | ||
|
||
for i := 0; i < queues; i++ { | ||
localReq := req |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this extra variable localReq
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are sending it down as an unsafe pointer later. So it was just a way to ensure that we started with a clean slate each time around
unix.Syscall(unix.SYS_IOCTL, file.Fd(), uintptr(unix.TUNSETIFF), uintptr(unsafe.Pointer(&localReq)))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought kernel would just read from that structure, but I see it does actually write to it in case of error
copy_to_user(argp, &ifr, ifreq_len))
in __tun_chr_ioctl()
.
Given ifReq
member types, localReq := req
will indeed create a deep copy of req
.
LGTM |
Add multi queue support to tuntap without breaking legacy users
of tuntap.
Signed-off-by: Manohar Castelino manohar.r.castelino@intel.com