qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark McLoughlin <markmc@redhat.com>
To: Pierre Riteau <Pierre.Riteau@irisa.fr>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Check for TUNSETOFFLOAD support before trying to enable offload features
Date: Wed, 25 Nov 2009 10:08:32 +0000	[thread overview]
Message-ID: <1259143712.2514.18.camel@blaa> (raw)
In-Reply-To: <1259143482-17735-1-git-send-email-Pierre.Riteau@irisa.fr>

On Wed, 2009-11-25 at 11:04 +0100, Pierre Riteau wrote:
> This avoids the "TUNSETOFFLOAD ioctl() failed: Invalid argument" message
> on kernels without TUNSETOFFLOAD support.
> 
> Signed-off-by: Pierre Riteau <Pierre.Riteau@irisa.fr>

Acked-by: Mark McLoughlin <markmc@redhat.com>

Thanks,
Mark.

> ---
>  net/tap-linux.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
> 
> diff --git a/net/tap-linux.c b/net/tap-linux.c
> index 0f621a2..e038e1a 100644
> --- a/net/tap-linux.c
> +++ b/net/tap-linux.c
> @@ -129,6 +129,11 @@ void tap_fd_set_offload(int fd, int csum, int tso4,
>  {
>      unsigned int offload = 0;
>  
> +    /* Check if our kernel supports TUNSETOFFLOAD */
> +    if (ioctl(fd, TUNSETOFFLOAD, 0) != 0 && errno == EINVAL) {
> +        return;
> +    }
> +
>      if (csum) {
>          offload |= TUN_F_CSUM;
>          if (tso4)

      reply	other threads:[~2009-11-25 10:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-25 10:04 [Qemu-devel] [PATCH] Check for TUNSETOFFLOAD support before trying to enable offload features Pierre Riteau
2009-11-25 10:08 ` Mark McLoughlin [this message]

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=1259143712.2514.18.camel@blaa \
    --to=markmc@redhat.com \
    --cc=Pierre.Riteau@irisa.fr \
    --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).