qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: "Anton Ivanov (antivano)" <antivano@cisco.com>
Cc: "Qemu-devel@nongnu.org" <Qemu-devel@nongnu.org>,
	Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] Contribution - L2TPv3 transport
Date: Fri, 28 Feb 2014 12:36:44 +0100	[thread overview]
Message-ID: <531074CC.2020204@redhat.com> (raw)
In-Reply-To: <5310703C.1080303@cisco.com>

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 cycles are wasted on conversion in the portions which may affect
> performance.
>

This is just one instruction (bswap) or zero on some hardware (PPC with 
has lwbrz, Haswell which has movbe), no reason to worry about it.  It 
makes the code simpler by making all accesses use stX_be_p.

>> Space before the opening brace, and parentheses around !(a & b) are
>> unnecessary.  More instances in the rest of the file.
>
> Bad habits die hard. After being burned by a couple of buggy borland
> compilers 20 years ago I brace everything to the hilt. You have a point
> though.

We also brace everything, but we do not parenthesize everything. :)

>> Why do you need separate mallocs for these?
>
> You do not really need to use a separate malloc for TX and RX. You can
> reuse the first element of the RX vector for TX.
>
> Fair point.

No, I mean: why not just use arrays in NetL2TPV3State?  All of them are 
sized statically.  Avoiding pointer chasing also improves performance. 
:)  It also avoids memory leaks; I just noticed that you're not freeing 
the memory you allocate in net_l2tpv3_init (I checked s->header-buf).

>> Is the local address mandatory?
>
> In L2TPv3 - yes.

Ok.

> In fact so is the remote - our "listen mode" is a hack.

The listen mode is not implemented in this patch, is it?

Thanks for the prompt reply.

Note that I posted two small fixes to qemu-sockets.c.  You may want to 
include them.

Paolo

  reply	other threads:[~2014-02-28 11:37 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28  8:28 [Qemu-devel] Contribution - L2TPv3 transport Anton Ivanov (antivano)
2014-02-28 10:02 ` Paolo Bonzini
2014-02-28 11:17   ` Anton Ivanov (antivano)
2014-02-28 11:36     ` Paolo Bonzini [this message]
2014-02-28 12:59       ` Anton Ivanov (antivano)
2014-02-28 13:55   ` Anton Ivanov (antivano)
2014-03-04 15:19   ` Anton Ivanov (antivano)
2014-03-04 15:22     ` Anton Ivanov (antivano)
2014-03-04 15:53       ` Eric Blake
2014-03-04 16:05         ` Anton Ivanov (antivano)
2014-03-05  8:49         ` Anton Ivanov (antivano)
2014-03-05 11:38           ` Peter Maydell
2014-03-04 15:41     ` Eric Blake
2014-03-04 15:58       ` Anton Ivanov (antivano)
2014-03-04 16:04         ` Paolo Bonzini
2014-03-04 16:33     ` Eric Blake
2014-03-04 16:48       ` Anton Ivanov (antivano)
2014-03-04 16:55         ` Paolo Bonzini
2014-03-04 17:28           ` Anton Ivanov (antivano)
2014-03-04 17:30             ` Paolo Bonzini
2014-02-28 13:40 ` Eric Blake
2014-02-28 13:52   ` Anton Ivanov (antivano)
2014-02-28 13:57     ` Eric Blake
2014-02-28 14:03       ` Anton Ivanov (antivano)
2014-02-28 14:00   ` Paolo Bonzini
2014-02-28 15:06     ` Eric Blake
2014-02-28 15:20       ` Paolo Bonzini
2014-03-03 13:27 ` Stefan Hajnoczi
2014-03-03 14:01   ` Anton Ivanov (antivano)
2014-03-04  9:36     ` Stefan Hajnoczi
2014-03-04  9:47       ` Anton Ivanov (antivano)
2014-03-05  8:59         ` Stefan Hajnoczi
2014-03-05  9:13           ` Vincenzo Maffione
2014-03-03 14:53 ` Stefan Hajnoczi
2014-03-04 11:32   ` Anton Ivanov (antivano)
2014-03-05  9:07     ` Stefan Hajnoczi

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=531074CC.2020204@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Qemu-devel@nongnu.org \
    --cc=antivano@cisco.com \
    --cc=stefanha@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 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).