All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
@ 2014-07-01 12:58 arei.gonglei
  2014-07-01 14:35 ` Stefan Hajnoczi
  2014-07-01 17:27 ` Peter Maydell
  0 siblings, 2 replies; 11+ messages in thread
From: arei.gonglei @ 2014-07-01 12:58 UTC (permalink / raw)
  To: qemu-devel
  Cc: antivano, peter.maydell, weidong.huang, chenliang88, luonengjun,
	Gonglei, stefanha, pbonzini

From: Gonglei <arei.gonglei@huawei.com>

because mmsghdr struct is introduced on Linux kernel 3.3+.
add check for mmsghdr struct, it only gets built on hosts that
support mmsghdr.

Reported-by: chenliang <chenliang88@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
---
v2->v1: 
   delete $l2tpv3 variable initialization and 
   'if' false check suggested by PMM.
---
 configure         | 16 ++++++++++++++++
 net/Makefile.objs |  2 +-
 net/net.c         |  4 ++--
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 23ecb37..463ae6e 100755
--- a/configure
+++ b/configure
@@ -1712,6 +1712,19 @@ else
 fi
 
 ##########################################
+# L2TPV3 probe
+
+cat > $TMPC <<EOF
+#include <sys/socket.h>
+int main(void) { return sizeof(struct mmsghdr); }
+EOF
+if compile_prog "" "" ; then
+  l2tpv3=yes
+else
+  l2tpv3=no
+fi
+
+##########################################
 # pkg-config probe
 
 if ! has "$pkg_config_exe"; then
@@ -4343,6 +4356,9 @@ fi
 if test "$netmap" = "yes" ; then
   echo "CONFIG_NETMAP=y" >> $config_host_mak
 fi
+if test "$l2tpv3" = "yes" ; then
+  echo "CONFIG_L2TPV3=y" >> $config_host_mak
+fi
 if test "$cap_ng" = "yes" ; then
   echo "CONFIG_LIBCAP=y" >> $config_host_mak
 fi
diff --git a/net/Makefile.objs b/net/Makefile.objs
index a06ba59..ec19cb3 100644
--- a/net/Makefile.objs
+++ b/net/Makefile.objs
@@ -2,7 +2,7 @@ common-obj-y = net.o queue.o checksum.o util.o hub.o
 common-obj-y += socket.o
 common-obj-y += dump.o
 common-obj-y += eth.o
-common-obj-$(CONFIG_LINUX) += l2tpv3.o
+common-obj-$(CONFIG_L2TPV3) += l2tpv3.o
 common-obj-$(CONFIG_POSIX) += tap.o vhost-user.o
 common-obj-$(CONFIG_LINUX) += tap-linux.o
 common-obj-$(CONFIG_WIN32) += tap-win32.o
diff --git a/net/net.c b/net/net.c
index 0869c60..6d930ea 100644
--- a/net/net.c
+++ b/net/net.c
@@ -806,7 +806,7 @@ static int (* const net_client_init_fun[NET_CLIENT_OPTIONS_KIND_MAX])(
 #ifdef CONFIG_VHOST_NET_USED
         [NET_CLIENT_OPTIONS_KIND_VHOST_USER] = net_init_vhost_user,
 #endif
-#ifdef CONFIG_LINUX
+#ifdef CONFIG_L2TPV3
         [NET_CLIENT_OPTIONS_KIND_L2TPV3]    = net_init_l2tpv3,
 #endif
 };
@@ -845,7 +845,7 @@ static int net_client_init1(const void *object, int is_netdev, Error **errp)
 #ifdef CONFIG_VHOST_NET_USED
         case NET_CLIENT_OPTIONS_KIND_VHOST_USER:
 #endif
-#ifdef CONFIG_LINUX
+#ifdef CONFIG_L2TPV3
         case NET_CLIENT_OPTIONS_KIND_L2TPV3:
 #endif
             break;
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 12:58 [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3 arei.gonglei
@ 2014-07-01 14:35 ` Stefan Hajnoczi
  2014-07-01 15:06   ` Anton Ivanov (antivano)
  2014-07-01 17:27 ` Peter Maydell
  1 sibling, 1 reply; 11+ messages in thread
From: Stefan Hajnoczi @ 2014-07-01 14:35 UTC (permalink / raw)
  To: arei.gonglei
  Cc: Anton Ivanov (antivano), Peter Maydell, Huangweidong (C),
	chenliang88, Luonengjun, qemu-devel, Stefan Hajnoczi,
	Paolo Bonzini

On Tue, Jul 1, 2014 at 2:58 PM,  <arei.gonglei@huawei.com> wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> because mmsghdr struct is introduced on Linux kernel 3.3+.
> add check for mmsghdr struct, it only gets built on hosts that
> support mmsghdr.
>
> Reported-by: chenliang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> ---
> v2->v1:
>    delete $l2tpv3 variable initialization and
>    'if' false check suggested by PMM.
> ---
>  configure         | 16 ++++++++++++++++
>  net/Makefile.objs |  2 +-
>  net/net.c         |  4 ++--
>  3 files changed, 19 insertions(+), 3 deletions(-)

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 14:35 ` Stefan Hajnoczi
@ 2014-07-01 15:06   ` Anton Ivanov (antivano)
  2014-07-01 15:14     ` Peter Maydell
  2014-07-02  6:21     ` Gonglei (Arei)
  0 siblings, 2 replies; 11+ messages in thread
From: Anton Ivanov (antivano) @ 2014-07-01 15:06 UTC (permalink / raw)
  To: Stefan Hajnoczi, arei.gonglei
  Cc: Peter Maydell, Huangweidong (C),
	chenliang88, Luonengjun, qemu-devel, Stefan Hajnoczi,
	Paolo Bonzini

On 01/07/14 15:35, Stefan Hajnoczi wrote:
> On Tue, Jul 1, 2014 at 2:58 PM,  <arei.gonglei@huawei.com> wrote:
>> From: Gonglei <arei.gonglei@huawei.com>
>>
>> because mmsghdr struct is introduced on Linux kernel 3.3+.
>> add check for mmsghdr struct, it only gets built on hosts that
>> support mmsghdr.

Incorrect.

mmsghdr itself is Linux 2.6.32 and so is recvmmsg. Sendmmsg which will
be introduced in the next version of the patch is 3.0. None of them is 3.3+

Please see release notes for either kernel version.

2.6.32 is now 5 years old it is about time to update to relevant headers
on whatever embedded platform you are using to try to build on.

As far as general purpose linuxes, the relevant libc headers are present
in Ubuntul LTS 12.x and onwards, Debian 7.x, Fedora, and all other major
distros. I do not have a RHEL handy to check, but looking at release
notes that the kernel supporting recmmsg is in 6.0 in the first place
and so are the headers for glibc from certain point onwards.

What appears in 3.3+ is kernel support for l2tpv3 tunnels which is what
would allow a linux host to interop.

A.

>>
>> Reported-by: chenliang <chenliang88@huawei.com>
>> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
>> ---
>> v2->v1:
>>    delete $l2tpv3 variable initialization and
>>    'if' false check suggested by PMM.
>> ---
>>  configure         | 16 ++++++++++++++++
>>  net/Makefile.objs |  2 +-
>>  net/net.c         |  4 ++--
>>  3 files changed, 19 insertions(+), 3 deletions(-)
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 15:06   ` Anton Ivanov (antivano)
@ 2014-07-01 15:14     ` Peter Maydell
  2014-07-01 15:26       ` Anton Ivanov (antivano)
  2014-07-02  6:21     ` Gonglei (Arei)
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2014-07-01 15:14 UTC (permalink / raw)
  To: Anton Ivanov (antivano)
  Cc: chenliang88, Huangweidong (C),
	Stefan Hajnoczi, Luonengjun, qemu-devel, arei.gonglei,
	Stefan Hajnoczi, Paolo Bonzini

On 1 July 2014 16:06, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
> As far as general purpose linuxes, the relevant libc headers are present
> in Ubuntul LTS 12.x and onwards, Debian 7.x, Fedora, and all other major
> distros. I do not have a RHEL handy to check, but looking at release
> notes that the kernel supporting recmmsg is in 6.0 in the first place
> and so are the headers for glibc from certain point onwards.

RHEL5 is still only 2.6.18 though (says wikipedia), so regardless of
details of exactly which version this struct appeared in we still want
to support compiling on a system which doesn't have it.

(I'm planning to apply this patch to master for rc0; I'll fix up the
commit message to quote a better version number.)

thanks
-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 15:14     ` Peter Maydell
@ 2014-07-01 15:26       ` Anton Ivanov (antivano)
  2014-07-01 15:34         ` Peter Maydell
  0 siblings, 1 reply; 11+ messages in thread
From: Anton Ivanov (antivano) @ 2014-07-01 15:26 UTC (permalink / raw)
  To: Peter Maydell
  Cc: chenliang88, Huangweidong (C),
	Stefan Hajnoczi, Luonengjun, qemu-devel, arei.gonglei,
	Stefan Hajnoczi, Paolo Bonzini

On 01/07/14 16:14, Peter Maydell wrote:
> On 1 July 2014 16:06, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
>> As far as general purpose linuxes, the relevant libc headers are present
>> in Ubuntul LTS 12.x and onwards, Debian 7.x, Fedora, and all other major
>> distros. I do not have a RHEL handy to check, but looking at release
>> notes that the kernel supporting recmmsg is in 6.0 in the first place
>> and so are the headers for glibc from certain point onwards.
> RHEL5 is still only 2.6.18 though (says wikipedia), so regardless of
> details of exactly which version this struct appeared in we still want
> to support compiling on a system which doesn't have it.
>
> (I'm planning to apply this patch to master for rc0; I'll fix up the
> commit message to quote a better version number.)

If we will support that far back, we need an emulation via recvmsg. I
will provide an incremental which does that.

I am not familiar with the way qemu ./configure tests are structured so
if you can tell me which DEFINE I should use for the choice I will
gladly supply the patch.

A.

>
> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 15:26       ` Anton Ivanov (antivano)
@ 2014-07-01 15:34         ` Peter Maydell
  2014-07-01 15:58           ` Anton Ivanov (antivano)
  0 siblings, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2014-07-01 15:34 UTC (permalink / raw)
  To: Anton Ivanov (antivano)
  Cc: chenliang88, Huangweidong (C),
	Stefan Hajnoczi, Luonengjun, qemu-devel, arei.gonglei,
	Stefan Hajnoczi, Paolo Bonzini

On 1 July 2014 16:26, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
> On 01/07/14 16:14, Peter Maydell wrote:
>> On 1 July 2014 16:06, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
>>> As far as general purpose linuxes, the relevant libc headers are present
>>> in Ubuntul LTS 12.x and onwards, Debian 7.x, Fedora, and all other major
>>> distros. I do not have a RHEL handy to check, but looking at release
>>> notes that the kernel supporting recmmsg is in 6.0 in the first place
>>> and so are the headers for glibc from certain point onwards.
>> RHEL5 is still only 2.6.18 though (says wikipedia), so regardless of
>> details of exactly which version this struct appeared in we still want
>> to support compiling on a system which doesn't have it.
>>
>> (I'm planning to apply this patch to master for rc0; I'll fix up the
>> commit message to quote a better version number.)
>
> If we will support that far back, we need an emulation via recvmsg. I
> will provide an incremental which does that.

We don't need to support this optional feature on RHEL5, we
just need not to die horribly trying to compile it when we're
on an older system, that's all. This patch should be enough for
this, right?

thanks
-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 15:34         ` Peter Maydell
@ 2014-07-01 15:58           ` Anton Ivanov (antivano)
  2014-07-01 16:01             ` Peter Maydell
  0 siblings, 1 reply; 11+ messages in thread
From: Anton Ivanov (antivano) @ 2014-07-01 15:58 UTC (permalink / raw)
  To: Peter Maydell
  Cc: chenliang88, Huangweidong (C),
	Stefan Hajnoczi, Luonengjun, qemu-devel, arei.gonglei,
	Stefan Hajnoczi, Paolo Bonzini

On 01/07/14 16:34, Peter Maydell wrote:
> On 1 July 2014 16:26, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
>> On 01/07/14 16:14, Peter Maydell wrote:
>>> On 1 July 2014 16:06, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
>>>> As far as general purpose linuxes, the relevant libc headers are present
>>>> in Ubuntul LTS 12.x and onwards, Debian 7.x, Fedora, and all other major
>>>> distros. I do not have a RHEL handy to check, but looking at release
>>>> notes that the kernel supporting recmmsg is in 6.0 in the first place
>>>> and so are the headers for glibc from certain point onwards.
>>> RHEL5 is still only 2.6.18 though (says wikipedia), so regardless of
>>> details of exactly which version this struct appeared in we still want
>>> to support compiling on a system which doesn't have it.
>>>
>>> (I'm planning to apply this patch to master for rc0; I'll fix up the
>>> commit message to quote a better version number.)
>> If we will support that far back, we need an emulation via recvmsg. I
>> will provide an incremental which does that.
> We don't need to support this optional feature on RHEL5, we
> just need not to die horribly trying to compile it when we're
> on an older system, that's all. This patch should be enough for
> this, right?

As a stop-gap -  yes.  An argument to configure which enables disables
the feature should be good for now.

I will try to supply a proper sendmms/recvmmsg configure test and
appropriate wrappers and patches by the end of the week so they can be
reused by anyone who wants to use sendmmsg/recvmmsg.

The performance difference these provide is quite significant so it will
be nice to port the legacy socket driver, etc to them too.

A.

>
> thanks
> -- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 15:58           ` Anton Ivanov (antivano)
@ 2014-07-01 16:01             ` Peter Maydell
  0 siblings, 0 replies; 11+ messages in thread
From: Peter Maydell @ 2014-07-01 16:01 UTC (permalink / raw)
  To: Anton Ivanov (antivano)
  Cc: chenliang88, Huangweidong (C),
	Stefan Hajnoczi, Luonengjun, qemu-devel, arei.gonglei,
	Stefan Hajnoczi, Paolo Bonzini

On 1 July 2014 16:58, Anton Ivanov (antivano) <antivano@cisco.com> wrote:
> On 01/07/14 16:34, Peter Maydell wrote:
>> We don't need to support this optional feature on RHEL5, we
>> just need not to die horribly trying to compile it when we're
>> on an older system, that's all. This patch should be enough for
>> this, right?
>
> As a stop-gap -  yes.  An argument to configure which enables disables
> the feature should be good for now.

This patch doesn't add any configure arguments: it just says "if there's
no struct definition we won't build l2tpv3.c".

thanks
-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 12:58 [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3 arei.gonglei
  2014-07-01 14:35 ` Stefan Hajnoczi
@ 2014-07-01 17:27 ` Peter Maydell
  2014-07-02  1:04   ` Gonglei (Arei)
  1 sibling, 1 reply; 11+ messages in thread
From: Peter Maydell @ 2014-07-01 17:27 UTC (permalink / raw)
  To: Gonglei (Arei)
  Cc: Anton Ivanov (antivano), chenliang (T), Huangweidong (C),
	Luonengjun, QEMU Developers, Stefan Hajnoczi, Paolo Bonzini

On 1 July 2014 13:58,  <arei.gonglei@huawei.com> wrote:
> From: Gonglei <arei.gonglei@huawei.com>
>
> because mmsghdr struct is introduced on Linux kernel 3.3+.
> add check for mmsghdr struct, it only gets built on hosts that
> support mmsghdr.
>
> Reported-by: chenliang <chenliang88@huawei.com>
> Signed-off-by: Gonglei <arei.gonglei@huawei.com>

Applied to master (with a tweaked commit message); thanks.

-- PMM

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 17:27 ` Peter Maydell
@ 2014-07-02  1:04   ` Gonglei (Arei)
  0 siblings, 0 replies; 11+ messages in thread
From: Gonglei (Arei) @ 2014-07-02  1:04 UTC (permalink / raw)
  To: Peter Maydell
  Cc: Anton Ivanov (antivano), chenliang (T), Huangweidong (C),
	Luonengjun, QEMU Developers, Stefan Hajnoczi, Paolo Bonzini

> -----Original Message-----
> From: Peter Maydell [mailto:peter.maydell@linaro.org]
> Sent: Wednesday, July 02, 2014 1:27 AM
> To: Gonglei (Arei)
> Cc: QEMU Developers; Anton Ivanov (antivano); Stefan Hajnoczi; Paolo Bonzini;
> Huangweidong (C); Luonengjun; chenliang (T)
> Subject: Re: [PATCH v2] net: add mmsghdr struct check for L2TPV3
> 
> On 1 July 2014 13:58,  <arei.gonglei@huawei.com> wrote:
> > From: Gonglei <arei.gonglei@huawei.com>
> >
> > because mmsghdr struct is introduced on Linux kernel 3.3+.
> > add check for mmsghdr struct, it only gets built on hosts that
> > support mmsghdr.
> >
> > Reported-by: chenliang <chenliang88@huawei.com>
> > Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> 
> Applied to master (with a tweaked commit message); thanks.
> 
> -- PMM

Ok, thank you.

Best regards,
-Gonglei

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3
  2014-07-01 15:06   ` Anton Ivanov (antivano)
  2014-07-01 15:14     ` Peter Maydell
@ 2014-07-02  6:21     ` Gonglei (Arei)
  1 sibling, 0 replies; 11+ messages in thread
From: Gonglei (Arei) @ 2014-07-02  6:21 UTC (permalink / raw)
  To: Anton Ivanov (antivano), Stefan Hajnoczi
  Cc: Peter Maydell, Huangweidong (C), chenliang (T),
	Luonengjun, qemu-devel, Stefan Hajnoczi, Paolo Bonzini








> -----Original Message-----
> From: Anton Ivanov (antivano) [mailto:antivano@cisco.com]
> Sent: Tuesday, July 01, 2014 11:06 PM
> To: Stefan Hajnoczi; Gonglei (Arei)
> Cc: qemu-devel; Peter Maydell; Huangweidong (C); chenliang (T); Luonengjun;
> Stefan Hajnoczi; Paolo Bonzini
> Subject: Re: [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for
> L2TPV3
> 
> On 01/07/14 15:35, Stefan Hajnoczi wrote:
> > On Tue, Jul 1, 2014 at 2:58 PM,  <arei.gonglei@huawei.com> wrote:
> >> From: Gonglei <arei.gonglei@huawei.com>
> >>
> >> because mmsghdr struct is introduced on Linux kernel 3.3+.
> >> add check for mmsghdr struct, it only gets built on hosts that
> >> support mmsghdr.
> 
> Incorrect.
> 
> mmsghdr itself is Linux 2.6.32 and so is recvmmsg. Sendmmsg which will
> be introduced in the next version of the patch is 3.0. None of them is 3.3+
> 
> Please see release notes for either kernel version.
> 

Sorry for my incorrect reference.

Actually, my host is :

UVP:~ # uname -a
Linux UVP 3.0.93-0.8-default #1 SMP Tue Aug 27 08:44:18 UTC 2013 (70ed288) x86_64 x86_64 x86_64 GNU/Linux
UVP:~ # cat /etc/SuSE-release 
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 3

But it is not Linux 2.6.32 or more lower-:)

Best regards,
-Gonglei

> 2.6.32 is now 5 years old it is about time to update to relevant headers
> on whatever embedded platform you are using to try to build on.
> 
> As far as general purpose linuxes, the relevant libc headers are present
> in Ubuntul LTS 12.x and onwards, Debian 7.x, Fedora, and all other major
> distros. I do not have a RHEL handy to check, but looking at release
> notes that the kernel supporting recmmsg is in 6.0 in the first place
> and so are the headers for glibc from certain point onwards.
> 
> What appears in 3.3+ is kernel support for l2tpv3 tunnels which is what
> would allow a linux host to interop.
> 
> A.
> 
> >>
> >> Reported-by: chenliang <chenliang88@huawei.com>
> >> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> >> ---
> >> v2->v1:
> >>    delete $l2tpv3 variable initialization and
> >>    'if' false check suggested by PMM.
> >> ---
> >>  configure         | 16 ++++++++++++++++
> >>  net/Makefile.objs |  2 +-
> >>  net/net.c         |  4 ++--
> >>  3 files changed, 19 insertions(+), 3 deletions(-)
> > Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-07-02  6:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 12:58 [Qemu-devel] [PATCH v2] net: add mmsghdr struct check for L2TPV3 arei.gonglei
2014-07-01 14:35 ` Stefan Hajnoczi
2014-07-01 15:06   ` Anton Ivanov (antivano)
2014-07-01 15:14     ` Peter Maydell
2014-07-01 15:26       ` Anton Ivanov (antivano)
2014-07-01 15:34         ` Peter Maydell
2014-07-01 15:58           ` Anton Ivanov (antivano)
2014-07-01 16:01             ` Peter Maydell
2014-07-02  6:21     ` Gonglei (Arei)
2014-07-01 17:27 ` Peter Maydell
2014-07-02  1:04   ` Gonglei (Arei)

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.