Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-05 Thread Anton Ivanov (antivano)
On 04/03/14 15:53, Eric Blake wrote: On 03/04/2014 08:22 AM, Anton Ivanov (antivano) wrote: Apologies, missed to diff the json definitions. Attached. Missing a commit message and a Signed-off-by line, so it can't be applied as-is. Also, we prefer inline patches (as sent by 'git

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-05 Thread Stefan Hajnoczi
On Tue, Mar 04, 2014 at 09:47:09AM +, Anton Ivanov (antivano) wrote: On 04/03/14 09:36, Stefan Hajnoczi wrote: On Mon, Mar 03, 2014 at 02:01:00PM +, Anton Ivanov (antivano) wrote: On 03/03/14 13:27, Stefan Hajnoczi wrote: On Fri, Feb 28, 2014 at 08:28:11AM +, Anton Ivanov

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-05 Thread Stefan Hajnoczi
On Tue, Mar 04, 2014 at 11:32:26AM +, Anton Ivanov (antivano) wrote: If you really *need* the page size, please use sysconf(_SC_PAGESIZE). I like to have it page aligned and if possible page sized so I can later extend to do jumbo frame support via a vector. If this is the wrong way

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-05 Thread Vincenzo Maffione
I think the would be nice if we add a command-line option (or maybe even an option that can be changed dinamically) for the net backend that enables/disables the use of the CORK flag, so that the device emulation can use it anyways, but backend does really use it (and so there are real effects)

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-05 Thread Peter Maydell
On 5 March 2014 08:49, Anton Ivanov (antivano) antiv...@cisco.com wrote: On 04/03/14 15:53, Eric Blake wrote: Missing a commit message and a Signed-off-by line, so it can't be applied as-is. Also, we prefer inline patches (as sent by 'git send-email') over attached patches; I suggest using

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Stefan Hajnoczi
On Mon, Mar 03, 2014 at 02:01:00PM +, Anton Ivanov (antivano) wrote: On 03/03/14 13:27, Stefan Hajnoczi wrote: On Fri, Feb 28, 2014 at 08:28:11AM +, Anton Ivanov (antivano) wrote: 3. Qemu to communicate with the local host, remote vms, network devices, etc at speeds which for a

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
On 04/03/14 09:36, Stefan Hajnoczi wrote: On Mon, Mar 03, 2014 at 02:01:00PM +, Anton Ivanov (antivano) wrote: On 03/03/14 13:27, Stefan Hajnoczi wrote: On Fri, Feb 28, 2014 at 08:28:11AM +, Anton Ivanov (antivano) wrote: 3. Qemu to communicate with the local host, remote vms, network

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
Hi Stefan, I am addressing a few more comments which I missed on first pass. If you really *need* the page size, please use sysconf(_SC_PAGESIZE). I like to have it page aligned and if possible page sized so I can later extend to do jumbo frame support via a vector. If this is the wrong way

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
Attached is a revised version. * I am still keeping the sendmsg instead of iov_send because I have not had the time to review udp.c in the kernel and do the relevant regression testing to see if they connect() still breaks bind() on multihomed hosts as it did in 2.6. We can revisit that

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
Apologies, missed to diff the json definitions. Attached. On 04/03/14 15:19, Anton Ivanov wrote: Attached is a revised version. * I am still keeping the sendmsg instead of iov_send because I have not had the time to review udp.c in the kernel and do the relevant regression testing to

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Eric Blake
On 03/04/2014 08:19 AM, Anton Ivanov (antivano) wrote: Attached is a revised version. Better is to post a new top-level thread, with [PATCHv2] in the title. Also, one of the v1 review comments was to break this into smaller self-contained patches - that review request still applies. For more

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Eric Blake
On 03/04/2014 08:22 AM, Anton Ivanov (antivano) wrote: Apologies, missed to diff the json definitions. Attached. Missing a commit message and a Signed-off-by line, so it can't be applied as-is. Also, we prefer inline patches (as sent by 'git send-email') over attached patches; I suggest

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
On 04/03/14 15:41, Eric Blake wrote: On 03/04/2014 08:19 AM, Anton Ivanov (antivano) wrote: Attached is a revised version. Better is to post a new top-level thread, with [PATCHv2] in the title. Also, one of the v1 review comments was to break this into smaller self-contained patches - that

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Paolo Bonzini
Il 04/03/2014 16:58, Anton Ivanov (antivano) ha scritto: On 04/03/14 15:41, Eric Blake wrote: On 03/04/2014 08:19 AM, Anton Ivanov (antivano) wrote: Attached is a revised version. Better is to post a new top-level thread, with [PATCHv2] in the title. Also, one of the v1 review comments was to

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
On 04/03/14 15:53, Eric Blake wrote: On 03/04/2014 08:22 AM, Anton Ivanov (antivano) wrote: Apologies, missed to diff the json definitions. Attached. Missing a commit message and a Signed-off-by line, so it can't be applied as-is. Also, we prefer inline patches (as sent by 'git

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Eric Blake
On 03/04/2014 08:19 AM, Anton Ivanov (antivano) wrote: Attached is a revised version. + + +#define PAGE_SIZE 4096 One of your earlier review comments suggested using sysconf or else renaming this, as not all systems have a page size of 4096. +#define IOVSIZE 2 +#define MAX_L2TPV3_MSGCNT

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
On 04/03/14 16:33, Eric Blake wrote: + + +#define PAGE_SIZE 4096 One of your earlier review comments suggested using sysconf or else renaming this, as not all systems have a page size of 4096. OK. +#define IOVSIZE 2 +#define MAX_L2TPV3_MSGCNT 32 +#define MAX_L2TPV3_IOVCNT

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Paolo Bonzini
Il 04/03/2014 17:48, Anton Ivanov (antivano) ha scritto: +static ssize_t net_l2tpv3_receive_dgram_iov(NetClientState *nc, const struct iovec *iov, int iovcnt) Long line; you can split after , to fit within 80 columns. OK +{ +NetL2TPV3State *s = DO_UPCAST(NetL2TPV3State, nc, nc); +

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Anton Ivanov (antivano)
On 04/03/14 16:55, Paolo Bonzini wrote: Il 04/03/2014 17:48, Anton Ivanov (antivano) ha scritto: +static ssize_t net_l2tpv3_receive_dgram_iov(NetClientState *nc, const struct iovec *iov, int iovcnt) Long line; you can split after , to fit within 80 columns. OK +{ +NetL2TPV3State

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-04 Thread Paolo Bonzini
Il 04/03/2014 18:28, Anton Ivanov (antivano) ha scritto: One question - what git client are you using to do git send-mail. While debian does have a reference to git send-mail in the main git manpage, it does not seem to have it as a part of git. It's git send-email. Sometimes it is in a

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-03 Thread Stefan Hajnoczi
On Fri, Feb 28, 2014 at 08:28:11AM +, Anton Ivanov (antivano) wrote: 3. Qemu to communicate with the local host, remote vms, network devices, etc at speeds which for a number of use cases exceed the speed of the legacy tap driver. This surprises me. It's odd that tap performs

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-03 Thread Anton Ivanov (antivano)
On 03/03/14 13:27, Stefan Hajnoczi wrote: On Fri, Feb 28, 2014 at 08:28:11AM +, Anton Ivanov (antivano) wrote: 3. Qemu to communicate with the local host, remote vms, network devices, etc at speeds which for a number of use cases exceed the speed of the legacy tap driver. This surprises

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-03-03 Thread Stefan Hajnoczi
On Fri, Feb 28, 2014 at 08:28:11AM +, Anton Ivanov (antivano) wrote: I didn't check all of Paolo and Eric's comments. Feel free to skip comments that have already been made. diff --git a/include/qemu/sockets.h b/include/qemu/sockets.h index 45588d7..865f1c2 100644 ---

[Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Anton Ivanov (antivano)
Hi all, On behalf of Cisco Systems I am authorized to contribute a new transport to the network subsystem in qemu. Specifically, we would like to contribute a new transport: L2TPv3 static tunnel network transport. Earlier versions of this (we have patchsets going back to qemu-1.0) have been

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Paolo Bonzini
This transport uses a linux specific call to get several GBit RX rate. Might as well mention that it's recvmmsg. :) This call can be wrapped (at some cost) in a compatibility loop using posix compliant recvmsg instead for other systems. As I am not familiar with the fine details on how to add

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Anton Ivanov (antivano)
On 28/02/14 10:02, Paolo Bonzini wrote: This transport uses a linux specific call to get several GBit RX rate. Might as well mention that it's recvmmsg. :) :) This call can be wrapped (at some cost) in a compatibility loop using posix compliant recvmsg instead for other systems. As I am

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Paolo Bonzini
Il 28/02/2014 12:17, Anton Ivanov (antivano) ha scritto: As mentioned below, I suggest storing the cookies and session ids in host order in NetL2TPV3State, and doing the conversion in l2tpv3_form_header and friends. I can fix it. I prefer to keep all params in ready to use form so that no

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Anton Ivanov (antivano)
On 28/02/14 11:36, Paolo Bonzini wrote: Il 28/02/2014 12:17, Anton Ivanov (antivano) ha scritto: As mentioned below, I suggest storing the cookies and session ids in host order in NetL2TPV3State, and doing the conversion in l2tpv3_form_header and friends. I can fix it. I prefer to keep all

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Eric Blake
On 02/28/2014 01:28 AM, Anton Ivanov (antivano) wrote: Hi all, On behalf of Cisco Systems I am authorized to contribute a new transport to the network subsystem in qemu. Patch attached. Your patch is huge - it might be better to break it into smaller logical chunks to make it easier to

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Anton Ivanov (antivano)
On 28/02/14 13:40, Eric Blake wrote: On 02/28/2014 01:28 AM, Anton Ivanov (antivano) wrote: Hi all, On behalf of Cisco Systems I am authorized to contribute a new transport to the network subsystem in qemu. Patch attached. Your patch is huge - it might be better to break it into smaller

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Anton Ivanov (antivano)
I now remember why I am not using connected sockets. connect() in UDP used to break source address bind(). I had a bug filed vs that as far back as early 2.6 which everyone ignored for ages. It was showing as bug vs hpa-tftpd. I need to reverify if this is still the case as it has to keep a

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Eric Blake
On 02/28/2014 06:52 AM, Anton Ivanov (antivano) wrote: On 28/02/14 13:40, Eric Blake wrote: On 02/28/2014 01:28 AM, Anton Ivanov (antivano) wrote: Hi all, On behalf of Cisco Systems I am authorized to contribute a new transport to the network subsystem in qemu. +# +# +# Since 1.0

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Paolo Bonzini
Il 28/02/2014 14:40, Eric Blake ha scritto: These should probably be 'int', not 'str'. If you have to hand-parse a string into a numeric value, you encoded the QMP wrong. Eric, note that this is not QMP. It is only used for option parsing. Paolo

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Anton Ivanov (antivano)
[snip] s/1.0/2.0/ OK - just to clarify, which version is this referring to - qemu, api, etc? This field is the version of qemu that first contains the release. If your patch is on time to make the qemu 2.0 release, then 2.0 is appropriate; but we're close to feature freeze so it may end up

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Eric Blake
On 02/28/2014 07:00 AM, Paolo Bonzini wrote: Il 28/02/2014 14:40, Eric Blake ha scritto: These should probably be 'int', not 'str'. If you have to hand-parse a string into a numeric value, you encoded the QMP wrong. Eric, note that this is not QMP. It is only used for option parsing. But

Re: [Qemu-devel] Contribution - L2TPv3 transport

2014-02-28 Thread Paolo Bonzini
Il 28/02/2014 16:06, Eric Blake ha scritto: On 02/28/2014 07:00 AM, Paolo Bonzini wrote: Il 28/02/2014 14:40, Eric Blake ha scritto: These should probably be 'int', not 'str'. If you have to hand-parse a string into a numeric value, you encoded the QMP wrong. Eric, note that this is not