DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization
@ 2021-02-01  9:33 Maxime Coquelin
  2021-02-01  9:52 ` David Marchand
  2021-02-02  9:26 ` Zhou, JunX W
  0 siblings, 2 replies; 4+ messages in thread
From: Maxime Coquelin @ 2021-02-01  9:33 UTC (permalink / raw)
  To: dev, yinan.wang, chenbo.xia, amorenoz, david.marchand, weix.ling,
	yux.jiang
  Cc: Maxime Coquelin, Jun W Zhou

When running in client mode, the listen file descriptor
is not initialized, and so has value 0. At destroy time,
the listen FD is closed if its value is greater than or
equal to zero, which causes STDIN to be closed.

Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend")
Bugzilla ID: 630

Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index ec2c53c8fb..f8569f6e6f 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -831,6 +831,7 @@ vhost_user_setup(struct virtio_user_dev *dev)
 	dev->backend_data = data;
 
 	data->vhostfd = -1;
+	data->listenfd = -1;
 
 	fd = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (fd < 0) {
-- 
2.29.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization
  2021-02-01  9:33 [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization Maxime Coquelin
@ 2021-02-01  9:52 ` David Marchand
  2021-02-02  9:26 ` Zhou, JunX W
  1 sibling, 0 replies; 4+ messages in thread
From: David Marchand @ 2021-02-01  9:52 UTC (permalink / raw)
  To: Maxime Coquelin
  Cc: dev, Wang, Yinan, Xia, Chenbo, Adrian Moreno Zapata, Wei Ling,
	Yu Jiang, Jun W Zhou

On Mon, Feb 1, 2021 at 10:33 AM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> When running in client mode, the listen file descriptor
> is not initialized, and so has value 0. At destroy time,
> the listen FD is closed if its value is greater than or
> equal to zero, which causes STDIN to be closed.
>
> Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend")
> Bugzilla ID: 630

We put the Bugzilla ID: tag before Fixes:.

>
> Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  drivers/net/virtio/virtio_user/vhost_user.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
> index ec2c53c8fb..f8569f6e6f 100644
> --- a/drivers/net/virtio/virtio_user/vhost_user.c
> +++ b/drivers/net/virtio/virtio_user/vhost_user.c
> @@ -831,6 +831,7 @@ vhost_user_setup(struct virtio_user_dev *dev)
>         dev->backend_data = data;
>
>         data->vhostfd = -1;
> +       data->listenfd = -1;
>
>         fd = socket(AF_UNIX, SOCK_STREAM, 0);
>         if (fd < 0) {
> --
> 2.29.2
>

Reviewed-by: David Marchand <david.marchand@redhat.com>


-- 
David Marchand


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization
  2021-02-01  9:33 [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization Maxime Coquelin
  2021-02-01  9:52 ` David Marchand
@ 2021-02-02  9:26 ` Zhou, JunX W
  2021-02-02 23:11   ` Ferruh Yigit
  1 sibling, 1 reply; 4+ messages in thread
From: Zhou, JunX W @ 2021-02-02  9:26 UTC (permalink / raw)
  To: Maxime Coquelin, dev, Wang, Yinan, Xia, Chenbo, amorenoz,
	david.marchand, Ling, WeiX, Jiang, YuX

Tested-by: Zhou, Jun <junx.w.zhou@intel.com> 

-----Original Message-----
From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com] 
Sent: Monday, February 1, 2021 5:33 PM
To: dev@dpdk.org; Wang, Yinan <yinan.wang@intel.com>; Xia, Chenbo <chenbo.xia@intel.com>; amorenoz@redhat.com; david.marchand@redhat.com; Ling, WeiX <weix.ling@intel.com>; Jiang, YuX <yux.jiang@intel.com>
Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Zhou, JunX W <junx.w.zhou@intel.com>
Subject: [PATCH] net/virtio: fix missing listen FD initialization

When running in client mode, the listen file descriptor is not initialized, and so has value 0. At destroy time, the listen FD is closed if its value is greater than or equal to zero, which causes STDIN to be closed.

Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend") Bugzilla ID: 630

Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 drivers/net/virtio/virtio_user/vhost_user.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/virtio/virtio_user/vhost_user.c b/drivers/net/virtio/virtio_user/vhost_user.c
index ec2c53c8fb..f8569f6e6f 100644
--- a/drivers/net/virtio/virtio_user/vhost_user.c
+++ b/drivers/net/virtio/virtio_user/vhost_user.c
@@ -831,6 +831,7 @@ vhost_user_setup(struct virtio_user_dev *dev)
 	dev->backend_data = data;
 
 	data->vhostfd = -1;
+	data->listenfd = -1;
 
 	fd = socket(AF_UNIX, SOCK_STREAM, 0);
 	if (fd < 0) {
--
2.29.2


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization
  2021-02-02  9:26 ` Zhou, JunX W
@ 2021-02-02 23:11   ` Ferruh Yigit
  0 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2021-02-02 23:11 UTC (permalink / raw)
  To: Zhou, JunX W, Maxime Coquelin, dev, Wang, Yinan, Xia, Chenbo,
	amorenoz, david.marchand, Ling, WeiX, Jiang, YuX

On 2/2/2021 9:26 AM, Zhou, JunX W wrote:

> -----Original Message-----
> From: Maxime Coquelin [mailto:maxime.coquelin@redhat.com]
> Sent: Monday, February 1, 2021 5:33 PM
> To: dev@dpdk.org; Wang, Yinan <yinan.wang@intel.com>; Xia, Chenbo <chenbo.xia@intel.com>; amorenoz@redhat.com; david.marchand@redhat.com; Ling, WeiX <weix.ling@intel.com>; Jiang, YuX <yux.jiang@intel.com>
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>; Zhou, JunX W <junx.w.zhou@intel.com>
> Subject: [PATCH] net/virtio: fix missing listen FD initialization
> 
> When running in client mode, the listen file descriptor is not initialized, and so has value 0. At destroy time, the listen FD is closed if its value is greater than or equal to zero, which causes STDIN to be closed.
> 
 > Bugzilla ID: 630
> Fixes: 949735312f5e ("net/virtio: move vhost-user specifics to its backend") 
> 
> Reported-by: Jun W Zhou <junx.w.zhou@intel.com>
> Signed-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> 
 > Reviewed-by: David Marchand <david.marchand@redhat.com>
 >
 > Tested-by: Zhou, Jun <junx.w.zhou@intel.com>
 >

Applied to dpdk-next-net/main, thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-02 23:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-01  9:33 [dpdk-dev] [PATCH] net/virtio: fix missing listen FD initialization Maxime Coquelin
2021-02-01  9:52 ` David Marchand
2021-02-02  9:26 ` Zhou, JunX W
2021-02-02 23:11   ` Ferruh Yigit

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).