public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Graf <tgraf@redhat.com>
To: Zoltan Kiss <zoltan.kiss@citrix.com>,
	Jesse Gross <jesse@nicira.com>,
	pshelar@nicira.com, dev@openvswitch.org
Cc: xen-devel@lists.xenproject.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] openvswitch: Orphan frags before sending to userspace via Netlink to avoid guest stall
Date: Fri, 07 Mar 2014 17:23:14 +0100	[thread overview]
Message-ID: <5319F272.1070101@redhat.com> (raw)
In-Reply-To: <1393615016-9187-1-git-send-email-zoltan.kiss@citrix.com>

On 02/28/2014 08:16 PM, Zoltan Kiss wrote:
> The kernel datapath now switched to zerocopy Netlink messages, but that also
> means that the pages on frags array are sent straight to userspace. If those
> pages came outside the kernel, we have to swap them out with local copies.
>
> Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
> ---
>   net/openvswitch/datapath.c |    6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
> index 36f8872..ffb563c 100644
> --- a/net/openvswitch/datapath.c
> +++ b/net/openvswitch/datapath.c
> @@ -464,6 +464,12 @@ static int queue_userspace_packet(struct datapath *dp, struct sk_buff *skb,
>   	}
>   	nla->nla_len = nla_attr_size(skb->len);
>
> +	if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC))) {
> +		err = -ENOMEM;
> +		skb_tx_error(skb);
> +		goto out;
> +	}
> +
>   	skb_zerocopy(user_skb, skb, skb->len, hlen);
>
>   	/* Pad OVS_PACKET_ATTR_PACKET if linear copy was performed */

How about we move the call to skb_orphan_frags() into skb_zerocopy()
itself and call it before we actually reference the frags?

It's not just OVS affected but nfqueue as well.

  parent reply	other threads:[~2014-03-07 16:23 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28 19:16 [PATCH] openvswitch: Orphan frags before sending to userspace via Netlink to avoid guest stall Zoltan Kiss
2014-03-06 17:09 ` Zoltan Kiss
2014-03-07  4:46   ` Pravin Shelar
2014-03-07 12:29     ` Zoltan Kiss
2014-03-07 17:38       ` Pravin Shelar
2014-03-07 15:58     ` Thomas Graf
2014-03-07 17:19       ` Pravin Shelar
2014-03-07 18:05         ` Thomas Graf
2014-03-07 18:43           ` Pravin Shelar
2014-03-07 16:23 ` Thomas Graf [this message]
2014-03-07 17:28   ` Pravin Shelar
2014-03-07 17:59     ` Thomas Graf
2014-03-07 18:41       ` Pravin Shelar
2014-03-11 19:41       ` Zoltan Kiss
2014-03-14 22:26         ` [ovs-dev] " Zoltan Kiss

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=5319F272.1070101@redhat.com \
    --to=tgraf@redhat.com \
    --cc=dev@openvswitch.org \
    --cc=jesse@nicira.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pshelar@nicira.com \
    --cc=xen-devel@lists.xenproject.org \
    --cc=zoltan.kiss@citrix.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