Message ID | 20190617085029.21730-1-huhai@kylinos.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | vhost_net: remove wrong 'unlikely' check | expand |
On 2019/6/17 下午4:50, huhai wrote: > Since commit f9611c43ab0d ("vhost-net: enable zerocopy tx by default") > experimental_zcopytx is set to true by default, so remove the unlikely check. > > Signed-off-by: huhai <huhai@kylinos.cn> > --- > drivers/vhost/net.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 2d9df786a9d3..8c1dfd02372b 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -342,7 +342,7 @@ static bool vhost_net_tx_select_zcopy(struct vhost_net *net) > > static bool vhost_sock_zcopy(struct socket *sock) > { > - return unlikely(experimental_zcopytx) && > + return experimental_zcopytx && > sock_flag(sock->sk, SOCK_ZEROCOPY); > } > Thanks for the patch, actually I plan to disable zerocopy by default for various reasons. Let me post a patch and let's then decide.
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 2d9df786a9d3..8c1dfd02372b 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -342,7 +342,7 @@ static bool vhost_net_tx_select_zcopy(struct vhost_net *net) static bool vhost_sock_zcopy(struct socket *sock) { - return unlikely(experimental_zcopytx) && + return experimental_zcopytx && sock_flag(sock->sk, SOCK_ZEROCOPY); }
Since commit f9611c43ab0d ("vhost-net: enable zerocopy tx by default") experimental_zcopytx is set to true by default, so remove the unlikely check. Signed-off-by: huhai <huhai@kylinos.cn> --- drivers/vhost/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)