[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALnjE+q=fejHPsjVj9+jnypJCUHfCDFc553U48WR48Tjcf3FZw@mail.gmail.com>
Date: Fri, 7 Mar 2014 09:28:50 -0800
From: Pravin Shelar <pshelar@...ira.com>
To: Thomas Graf <tgraf@...hat.com>
Cc: Zoltan Kiss <zoltan.kiss@...rix.com>,
Jesse Gross <jesse@...ira.com>,
"dev@...nvswitch.org" <dev@...nvswitch.org>,
xen-devel@...ts.xenproject.org, netdev <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] openvswitch: Orphan frags before sending to userspace via
Netlink to avoid guest stall
On Fri, Mar 7, 2014 at 8:23 AM, Thomas Graf <tgraf@...hat.com> wrote:
> 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@...rix.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?
>
Problem is mapping SKBTX_DEV_ZEROCOPY pages to userspace. skb_zerocopy
is not doing that.
Unless I missing something, Current netlink code can not handle
skb-frags with zero copy. So we have to copy skb anyways and no need
to orphan-frags here.
If you are planning on handling skb-frags without copying then
skb_orphan_frags should be done in netlink.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists