tuntap: set SOCK_ZEROCOPY flag during open
Subsystems (3)
PATCH 1/1 tuntap: set SOCK_ZEROCOPY flag during open
Commit 54f968d6efdbf7dec36faa44fc11f01b0e4d1990
(tuntap: move socket to tun_file) forgets to set SOCK_ZEROCOPY flag, which will prevent vhost_net from doing zercopy w/ tap. This patch fixes this by setting it during file open.
--- drivers/net/tun.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/net/tun.c +2 -0
@@ -2155,6 +2155,8 @@ static int tun_chr_open(struct inode *inode, struct file * file)set_bit (SOCK_EXTERNALLY_ALLOCATED , &tfile->socket.flags);INIT_LIST_HEAD (&tfile->next); +sock_set_flag (&tfile->sk,SOCK_ZEROCOPY ); +return 0 ; }
Signature · 1 line
1.7.1
Quoted 7 lines · Jason Wang
Commit
54f968d6efdbf7dec36faa44fc11f01b0e4d1990
(tuntap: move socket totun_file) forgets to setSOCK_ZEROCOPYflag, which will preventvhost_netfrom doing zercopy w/ tap. This patch fixes this by setting it during file open.Cc Michael S. Tsirkin <[email protected]>Signed-off-by Jason Wang <[email protected]>
I see, and this explains the perf regression we are seeing with 3.9.
and I think this should go into stable as well.
Quoted 19 lines
--- drivers/net/tun.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/net/tun.c +2
-0@@ -2155,6 +2155,8 @@ static int tun_chr_open(struct inode *inode, struct file * file)set_bit (SOCK_EXTERNALLY_ALLOCATED , &tfile->socket.flags);INIT_LIST_HEAD (&tfile->next); +sock_set_flag (&tfile->sk,SOCK_ZEROCOPY ); +return 0 ; }Signature · 1 line
1.7.1
Quoted 10 lines · Jason Wang
Cc: [email protected], [email protected],
[email protected], [email protected]Commit
54f968d6efdbf7dec36faa44fc11f01b0e4d1990
(tuntap: move socket totun_file) forgets to setSOCK_ZEROCOPYflag, which will preventvhost_netfrom doing zercopy w/ tap. This patch fixes this by setting it during file open.Cc Michael S. Tsirkin <[email protected]>Signed-off-by Jason Wang <[email protected]>
One of the addresses in the Cc list ([email protected]) is clearly a mistake, which probably explains why it didn't get into patchwork.
I have bounced it to correct addresses, hope this helps instead of making even more of a mess of it.
For 3.10 and -stable:
Quoted 19 lines
--- drivers/net/tun.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)drivers/net/tun.c +2
-0@@ -2155,6 +2155,8 @@ static int tun_chr_open(struct inode *inode, struct file * file)set_bit (SOCK_EXTERNALLY_ALLOCATED , &tfile->socket.flags);INIT_LIST_HEAD (&tfile->next); +sock_set_flag (&tfile->sk,SOCK_ZEROCOPY ); +return 0 ; }Signature · 1 line
1.7.1
David Miller
maintainerFrom: "Michael S. Tsirkin" <[email protected]>
Date: Tue, 11 Jun 2013 16:17:50 +0300
Quoted 16 lines · Jason Wang
Quoted 10 lines
Cc: [email protected], [email protected],
[email protected], [email protected]Commit
54f968d6efdbf7dec36faa44fc11f01b0e4d1990
(tuntap: move socket totun_file) forgets to setSOCK_ZEROCOPYflag, which will preventvhost_netfrom doing zercopy w/ tap. This patch fixes this by setting it during file open.Cc Michael S. Tsirkin <[email protected]>Signed-off-by Jason Wang <[email protected]>One of the addresses in the Cc list ([email protected]) is clearly a mistake, which probably explains why it didn't get into patchwork.
Quoted 6 lines
I have bounced it to correct addresses, hope this helps instead of making even more of a mess of it.
For 3.10 and -stable:
Applied and queued up for -stable, thanks.