From: Jason Wang <jasowang@redhat.com>
To: Anton Ivanov <anton.ivanov@cambridgegreys.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 1/3] Unified Datagram Socket Transport
Date: Mon, 24 Jul 2017 11:51:07 +0800 [thread overview]
Message-ID: <20f8a99b-e05b-8371-461d-a6481d2fa68f@redhat.com> (raw)
In-Reply-To: <c6bd0b81-0b9c-89fd-31e0-00662115cad8@cambridgegreys.com>
On 2017年07月22日 01:50, Anton Ivanov wrote:
> [snip]
>
>>> + NetUnifiedState *s = (NetUnifiedState *) us;
>>> + L2TPV3TunnelParams *p = (L2TPV3TunnelParams *) s->params;
>>
>> How about embedding NetUnifiedState into this structure and keep
>> using NetL2TPV3State? Then:
>>
>> - 's' could be kept and lots of lines of changes could be saved here
>> and l2tpv3_verify_header()
>> - each transport could have their own type instead of using
>> NET_CLIENT_DRIVER_L2TPV3
>
> That means each of them having their own read/write functions in each
> transport, destroy functions, etc.
Looks not? Just something like
typedef struct L2TPV3State {
NetUDSTState udst;
/* L2TPV3 specific data */
....
};
static NetClientInfo l2tpv3_info = {
/* we share this one for all types for now, wrong I know :) */
.type = NET_CLIENT_DRIVER_L2TPV3,
.size = sizeof(L2TPV3State),
.receive = net_udst_receive_dgram,
.receive_iov = net_udst_receive_dgram_iov,
.poll = udst_poll,
.cleanup = net_udst_cleanup,
};
Thanks
>
> I am trying to achieve exactly the opposite which across all
> transports should save more code. There should be nothing in a
> transport which leverages the common datagram processing backend except:
>
> 1. Init and parse arguments
> 2. Form Header
> 3. Verify Header
>
> All the rest can be common for a large family of datagram based
> transports - L2TPv3, GRE, RAW (both full interface and just pulling a
> specific vlan out of it), etc.
>
> It is trivial to do that for fixed size headers (as in the current
> patchset family). It is a bit more difficult to that for variable
> headers, but still datagram (GUE, Geneve, etc).
>
> These may also add 4 - I/O to control plane, but it remains to be seen
> if that is needed.
>
> This also makes any improvements to the backend - f.e. switching from
> send() to sendmmsg() automatically available for all transports.
>
> What cannot be done is to shoehorn into this stream based. I believe
> we have only one of those - the original socket.c in tcp mode and we
> can leave it to stay that way and switch only the datagram mode to a
> better backend.
>
> I am going through the other comments in the meantime to see if I
> missed something else and fixing the omissions.
>
> A.
>
> [snip]
>
next prev parent reply other threads:[~2017-07-24 3:51 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-18 17:08 [Qemu-devel] Unified Socket Driver anton.ivanov
2017-07-18 17:08 ` [Qemu-devel] [PATCH 1/3] Unified Datagram Socket Transport anton.ivanov
2017-07-19 5:39 ` Jason Wang
2017-07-19 5:48 ` Anton Ivanov
2017-07-19 6:07 ` Jason Wang
2017-07-19 6:48 ` Anton Ivanov
2017-07-21 17:50 ` Anton Ivanov
2017-07-24 3:51 ` Jason Wang [this message]
2017-07-18 17:08 ` [Qemu-devel] [PATCH 2/3] Unified Datagram Socket Transport - GRE support anton.ivanov
2017-07-19 5:48 ` Jason Wang
2017-07-19 5:50 ` Anton Ivanov
2017-07-19 14:40 ` Eric Blake
2017-07-19 14:46 ` Anton Ivanov
2017-07-19 17:32 ` Anton Ivanov
2017-07-21 19:14 ` Eric Blake
2017-07-22 7:52 ` Anton Ivanov
2017-07-18 17:08 ` [Qemu-devel] [PATCH 3/3] Unified Datagram Socket Transport - raw support anton.ivanov
2017-07-19 5:58 ` Jason Wang
2017-07-19 6:02 ` Anton Ivanov
2017-07-21 18:50 ` Anton Ivanov
2017-07-24 4:03 ` Jason Wang
2017-09-08 17:22 ` Anton Ivanov
2017-07-19 14:42 ` Eric Blake
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=20f8a99b-e05b-8371-461d-a6481d2fa68f@redhat.com \
--to=jasowang@redhat.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=qemu-devel@nongnu.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 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).