* [PATCH] vhost_net: remove wrong 'unlikely' check
@ 2019-06-17 8:50 huhai
2019-06-17 8:56 ` Jason Wang
0 siblings, 1 reply; 2+ messages in thread
From: huhai @ 2019-06-17 8:50 UTC (permalink / raw)
To: mst, jasowang; +Cc: kvm, huhai
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);
}
--
2.20.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] vhost_net: remove wrong 'unlikely' check
2019-06-17 8:50 [PATCH] vhost_net: remove wrong 'unlikely' check huhai
@ 2019-06-17 8:56 ` Jason Wang
0 siblings, 0 replies; 2+ messages in thread
From: Jason Wang @ 2019-06-17 8:56 UTC (permalink / raw)
To: huhai, mst; +Cc: kvm
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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-06-17 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-17 8:50 [PATCH] vhost_net: remove wrong 'unlikely' check huhai
2019-06-17 8:56 ` Jason Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).