diff mbox series

vhost_net: remove wrong 'unlikely' check

Message ID 20190617085029.21730-1-huhai@kylinos.cn (mailing list archive)
State New, archived
Headers show
Series vhost_net: remove wrong 'unlikely' check | expand

Commit Message

huhai June 17, 2019, 8:50 a.m. UTC
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(-)

Comments

Jason Wang June 17, 2019, 8:56 a.m. UTC | #1
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 mbox series

Patch

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);
 }