All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Laurent Vivier <lvivier@redhat.com>
Cc: qemu-devel@nongnu.org, "Eric Blake" <eblake@redhat.com>,
	"Thomas Huth" <thuth@redhat.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	"Jason Wang" <jasowang@redhat.com>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Stefano Brivio" <sbrivio@redhat.com>
Subject: Re: [PATCH v7 05/14] qapi: net: add stream and dgram netdevs
Date: Tue, 02 Aug 2022 15:53:43 +0200	[thread overview]
Message-ID: <87les6rbtk.fsf@pond.sub.org> (raw)
In-Reply-To: <b5b66160-d0a5-c5f8-4060-8afdcba7a930@redhat.com> (Laurent Vivier's message of "Tue, 2 Aug 2022 11:39:10 +0200")

Laurent Vivier <lvivier@redhat.com> writes:

> On 02/08/2022 10:37, Markus Armbruster wrote:
>> Laurent Vivier <lvivier@redhat.com> writes:
>> 
> ...
>>> diff --git a/qemu-options.hx b/qemu-options.hx
>>> index 79e00916a11f..170117e1adf0 100644
>>> --- a/qemu-options.hx
>>> +++ b/qemu-options.hx
>>> @@ -2726,6 +2726,18 @@ DEF("netdev", HAS_ARG, QEMU_OPTION_netdev,
>>>       "-netdev socket,id=str[,fd=h][,udp=host:port][,localaddr=host:port]\n"
>>>       "                configure a network backend to connect to another network\n"
>>>       "                using an UDP tunnel\n"
>>> +    "-netdev stream,id=str[,server=on|off],addr.type=inet,addr.host=host,addr.port=port\n"
>>> +    "-netdev stream,id=str[,server=on|off],addr.type=fd,addr.str=h\n"
>>> +    "                configure a network backend to connect to another network\n"
>>> +    "                using a socket connection in stream mode.\n"
>
>  From v6:
>> This part needs to match NetdevStreamOptions above.
>> 
>> Missing here: the optional members of InetSocketAddress: numeric, to,
>> ipv4, ...  Do we care?
>
> At this patch level, no, because we decode them manually and not using 
> socket_connect()/socket_listen(). But the doc should be updated for PATCH 13/14 as I move 
> stream.c to QIO.
>
>> 
>> The next part needs to match NetdevDgramOptions above.
>
>
>>> +    "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=inet,local.host=addr]\n"
>>> +    "-netdev dgram,id=str,remote.type=inet,remote.host=maddr,remote.port=port[,local.type=fd,local.str=h]\n"
>>> +    "                configure a network backend to connect to a multicast maddr and port\n"
>>> +    "                use ``local.host=addr`` to specify the host address to send packets from\n"
>
>  From v6:
>> I figure this covers table rows
>> 
>>    #    @remote         @local      |   okay?
>>    #    ----------------------------+--------
>>    #    multicast       absent      |   yes
>>    #    multicast       present     |   yes
>> 
>> for remote.type=inet and any local.type.
>> 
>> What about remote.type=fd?
>
> multicast is only supported with remote.type=inet, not fd or unix
>
> In net_dgram_init(), we initiate a multicast connection if remote.type is inet and address 
> type is multicast, otherwise it's an unicast connection.

Hmm.

With .type=inet, .host=... determines multicast.

With .type=fd, we *assume* unicast?  What if the underlying socket is
actually bound to a multicast address?

>>> +    "-netdev dgram,id=str,local.type=inet,local.host=addr,local.port=port[,remote.type=inet,remote.host=addr,remote.port=port]\n"
>
>  From v6:
>> I figure this covers table rows
>> 
>>     #    absent          present     |   yes
>>     #    not multicast   present     |   yes
>> 
>> for *.type=inet.
>
>
>>> +    "-netdev dgram,id=str,local.type=fd,local.str=h\n"
>>> +    "                configure a network backend to connect to another network\n"
>>> +    "                using an UDP tunnel\n"
>
>  From v6:
>> I figure this covers table row
>> 
>>    #    absent          present     |   yes
>> 
>> for local.type=fd.
>> 
>> Together, they cover table row
>> 
>>     #    absent          present     |   yes
>> 
>> for any local.type.  Good.
>> 
>> Table row
>> 
>>     #    not multicast   present     |   yes
>> 
>> is only covered for *.type=inet.  Could either of the types be fd?
>
> In v7, I've update the table to include the case of fd:
>
>      =============  ========  =====
>      remote         local     okay?
>      =============  ========  =====
>      absent         absent    no
>      absent         not fd    no
>      absent         fd        yes
>      multicast      absent    yes
>      multicast      present   yes
>      not multicast  absent    no
>      not multicast  present   yes
>      =============  ========  =====
>
> For local, if it's not specified otherwise, fd is supported.
> Remote and local type must be the same (inet or unix), if local is fd, remote must not be 
> provided.

My brain is melting.



  reply	other threads:[~2022-08-02 13:55 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-22 19:04 [PATCH v7 00/14] qapi: net: add unix socket type support to netdev backend Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 01/14] net: introduce convert_host_port() Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 02/14] net: remove the @errp argument of net_client_inits() Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 03/14] net: simplify net_client_parse() error management Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 04/14] qapi: net: introduce a way to bypass qemu_opts_parse_noisily() Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 05/14] qapi: net: add stream and dgram netdevs Laurent Vivier
2022-08-02  8:37   ` Markus Armbruster
2022-08-02  9:39     ` Laurent Vivier
2022-08-02 13:53       ` Markus Armbruster [this message]
2022-07-22 19:04 ` [PATCH v7 06/14] net: stream: Don't ignore EINVAL on netdev socket connection Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 07/14] net: stream: add unix socket Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 08/14] net: dgram: make dgram_dst generic Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 09/14] net: dgram: move mcast specific code from net_socket_fd_init_dgram() Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 10/14] net: dgram: add unix socket Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 11/14] qemu-sockets: move and rename SocketAddress_to_str() Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 12/14] qemu-sockets: update socket_uri() and socket_parse() to be consistent Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 13/14] net: stream: move to QIO Laurent Vivier
2022-07-22 19:04 ` [PATCH v7 14/14] tests/qtest: netdev: test stream and dgram backends Laurent Vivier
2022-08-05 17:39 ` [PATCH v7 00/14] qapi: net: add unix socket type support to netdev backend Stefano Brivio

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=87les6rbtk.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=lvivier@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sbrivio@redhat.com \
    --cc=thuth@redhat.com \
    /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.