All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@gmail.com>
To: Stefano Garzarella <sgarzare@redhat.com>
Cc: netdev@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	Dexuan Cui <decui@microsoft.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	Jorgen Hansen <jhansen@vmware.com>
Subject: Re: [PATCH net-next 4/6] vsock: add vsock_loopback transport
Date: Thu, 21 Nov 2019 09:34:58 +0000	[thread overview]
Message-ID: <20191121093458.GB439743@stefanha-x1.localdomain> (raw)
In-Reply-To: <20191119110121.14480-5-sgarzare@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2388 bytes --]

On Tue, Nov 19, 2019 at 12:01:19PM +0100, Stefano Garzarella wrote:

Ideas for long-term changes below.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

> diff --git a/MAINTAINERS b/MAINTAINERS
> index 760049454a23..c2a3dc3113ba 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -17239,6 +17239,7 @@ F:	net/vmw_vsock/diag.c
>  F:	net/vmw_vsock/af_vsock_tap.c
>  F:	net/vmw_vsock/virtio_transport_common.c
>  F:	net/vmw_vsock/virtio_transport.c
> +F:	net/vmw_vsock/vsock_loopback.c
>  F:	drivers/net/vsockmon.c
>  F:	drivers/vhost/vsock.c
>  F:	tools/testing/vsock/

At this point you are most active in virtio-vsock and I am reviewing
patches on a best-effort basis.  Feel free to add yourself as
maintainer.

> diff --git a/net/vmw_vsock/vsock_loopback.c b/net/vmw_vsock/vsock_loopback.c
> new file mode 100644
> index 000000000000..3d1c1a88305f
> --- /dev/null
> +++ b/net/vmw_vsock/vsock_loopback.c
> @@ -0,0 +1,217 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * loopback transport for vsock using virtio_transport_common APIs
> + *
> + * Copyright (C) 2013-2019 Red Hat, Inc.
> + * Author: Asias He <asias@redhat.com>
> + *         Stefan Hajnoczi <stefanha@redhat.com>
> + *         Stefano Garzarella <sgarzare@redhat.com>
> + *
> + */
> +#include <linux/spinlock.h>
> +#include <linux/module.h>
> +#include <linux/list.h>
> +#include <linux/virtio_vsock.h>

Is it time to rename the generic functionality in
virtio_transport_common.c?  This doesn't have anything to do with virtio
:).

> +
> +static struct workqueue_struct *vsock_loopback_workqueue;
> +static struct vsock_loopback *the_vsock_loopback;

the_vsock_loopback could be a static global variable (not a pointer) and
vsock_loopback_workqueue could also be included in the struct.

The RCU pointer is really a way to synchronize vsock_loopback_send_pkt()
and vsock_loopback_cancel_pkt() with module exit.  There is no other
reason for using a pointer.

It's cleaner to implement the synchronization once in af_vsock.c (or
virtio_transport_common.c) instead of making each transport do it.
Maybe try_module_get() and related APIs provide the necessary semantics
so that core vsock code can hold the transport module while it's being
used to send/cancel a packet.

> +MODULE_ALIAS_NETPROTO(PF_VSOCK);

Why does this module define the alias for PF_VSOCK?  Doesn't another
module already define this alias?

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2019-11-21  9:35 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-19 11:01 [PATCH net-next 0/6] vsock: add local transport support Stefano Garzarella
2019-11-19 11:01 ` [PATCH net-next 1/6] vsock/virtio_transport_common: remove unused virtio header includes Stefano Garzarella
2019-11-19 11:01 ` [PATCH net-next 2/6] vsock: add VMADDR_CID_LOCAL definition Stefano Garzarella
2019-11-21 14:49   ` Jorgen Hansen via Virtualization
2019-11-21 14:49   ` Jorgen Hansen
2019-11-19 11:01 ` [PATCH net-next 3/6] vsock: add local transport support in the vsock core Stefano Garzarella
2019-11-21 15:04   ` Jorgen Hansen
2019-11-21 15:21     ` Stefano Garzarella
2019-11-21 15:21     ` Stefano Garzarella
2019-11-21 15:53       ` Jorgen Hansen
2019-11-21 16:12         ` Stefano Garzarella
2019-11-21 16:19           ` Jorgen Hansen
2019-11-21 16:19           ` Jorgen Hansen via Virtualization
2019-11-21 16:12         ` Stefano Garzarella
2019-11-21 15:53       ` Jorgen Hansen via Virtualization
2019-11-21 15:04   ` Jorgen Hansen via Virtualization
2019-11-19 11:01 ` [PATCH net-next 4/6] vsock: add vsock_loopback transport Stefano Garzarella
2019-11-20  1:15   ` David Miller
2019-11-20  9:00     ` Stefano Garzarella
2019-11-21  9:34   ` Stefan Hajnoczi
2019-11-21  9:34   ` Stefan Hajnoczi [this message]
2019-11-21  9:59     ` Stefano Garzarella
2019-11-21  9:59     ` Stefano Garzarella
2019-11-21 15:25       ` Stefano Garzarella
2019-11-22  9:25         ` Stefan Hajnoczi
2019-11-22  9:25         ` Stefan Hajnoczi
2019-11-22 10:02           ` Stefano Garzarella
2019-11-22 10:02             ` Stefano Garzarella
2019-11-21 15:25       ` Stefano Garzarella
2019-11-19 11:01 ` [PATCH net-next 5/6] vsock: use local transport when it is loaded Stefano Garzarella
2019-11-21  9:46   ` Stefan Hajnoczi
2019-11-21  9:46   ` Stefan Hajnoczi
2019-11-21 10:01     ` Stefano Garzarella
2019-11-21 10:01     ` Stefano Garzarella
2019-11-19 11:01 ` [PATCH net-next 6/6] vsock/virtio: remove loopback handling Stefano Garzarella
2019-11-21  9:46 ` [PATCH net-next 0/6] vsock: add local transport support Stefan Hajnoczi
2019-11-21 10:05   ` Stefano Garzarella
2019-11-21 10:05   ` Stefano Garzarella
2019-11-21  9:46 ` Stefan Hajnoczi
2019-11-21 14:45 ` Jorgen Hansen via Virtualization
2019-11-21 14:45 ` Jorgen Hansen
2019-11-21 15:13   ` Stefano Garzarella
2019-11-21 15:13   ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191121093458.GB439743@stefanha-x1.localdomain \
    --to=stefanha@gmail.com \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=jhansen@vmware.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.