KVM Archive on lore.kernel.org
 help / color / Atom feed
* [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	[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, back to index

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

KVM Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/kvm/0 kvm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 kvm kvm/ https://lore.kernel.org/kvm \
		kvm@vger.kernel.org kvm@archiver.kernel.org
	public-inbox-index kvm


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.kvm


AGPL code for this site: git clone https://public-inbox.org/ public-inbox