xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
@ 2014-11-05 10:50 David Vrabel
  0 siblings, 0 replies; 12+ messages in thread
From: David Vrabel @ 2014-11-05 10:50 UTC (permalink / raw)
  To: netdev; +Cc: xen-devel, Malcolm Crossley, Wei Liu, David Vrabel, Ian Campbell

From: Malcolm Crossley <malcolm.crossley@citrix.com>

Unconditionally pulling 128 bytes into the linear area is not required
for:

- security: Every protocol demux starts with pskb_may_pull() to pull
  frag data into the linear area, if necessary, before looking at
  headers.

- performance: Netback has already grant copied up-to 128 bytes from
  the first slot of a packet into the linear area. The first slot
  normally contain all the IPv4/IPv6 and TCP/UDP headers.

The unconditional pull would often copy frag data unnecessarily.  This
is a performance problem when running on a version of Xen where grant
unmap avoids TLB flushes for pages which are not accessed.  TLB
flushes can now be avoided for > 99% of unmaps (it was 0% before).

Grant unmap TLB flush avoidance will be available in a future version
of Xen (probably 4.6).

Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
 drivers/net/xen-netback/netback.c |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen-netback/netback.c
index 730252c..14e18bb 100644
--- a/drivers/net/xen-netback/netback.c
+++ b/drivers/net/xen-netback/netback.c
@@ -82,6 +82,16 @@ MODULE_PARM_DESC(max_queues,
 static unsigned int fatal_skb_slots = FATAL_SKB_SLOTS_DEFAULT;
 module_param(fatal_skb_slots, uint, 0444);
 
+/* The amount to copy out of the first guest Tx slot into the skb's
+ * linear area.  If the first slot has more data, it will be mapped
+ * and put into the first frag.
+ *
+ * This is sized to avoid pulling headers from the frags for most
+ * TCP/IP packets.
+ */
+#define XEN_NETBACK_TX_COPY_LEN 128
+
+
 static void xenvif_idx_release(struct xenvif_queue *queue, u16 pending_idx,
 			       u8 status);
 
@@ -125,13 +135,6 @@ static inline struct xenvif_queue *ubuf_to_queue(const struct ubuf_info *ubuf)
 			    pending_tx_info[0]);
 }
 
-/* This is a miniumum size for the linear area to avoid lots of
- * calls to __pskb_pull_tail() as we set up checksum offsets. The
- * value 128 was chosen as it covers all IPv4 and most likely
- * IPv6 headers.
- */
-#define PKT_PROT_LEN 128
-
 static u16 frag_get_pending_idx(skb_frag_t *frag)
 {
 	return (u16)frag->page_offset;
@@ -1446,9 +1449,9 @@ static void xenvif_tx_build_gops(struct xenvif_queue *queue,
 		index = pending_index(queue->pending_cons);
 		pending_idx = queue->pending_ring[index];
 
-		data_len = (txreq.size > PKT_PROT_LEN &&
+		data_len = (txreq.size > XEN_NETBACK_TX_COPY_LEN &&
 			    ret < XEN_NETBK_LEGACY_SLOTS_MAX) ?
-			PKT_PROT_LEN : txreq.size;
+			XEN_NETBACK_TX_COPY_LEN : txreq.size;
 
 		skb = xenvif_alloc_skb(data_len);
 		if (unlikely(skb == NULL)) {
@@ -1653,11 +1656,6 @@ static int xenvif_tx_submit(struct xenvif_queue *queue)
 			}
 		}
 
-		if (skb_is_nonlinear(skb) && skb_headlen(skb) < PKT_PROT_LEN) {
-			int target = min_t(int, skb->len, PKT_PROT_LEN);
-			__pskb_pull_tail(skb, target - skb_headlen(skb));
-		}
-
 		skb->dev      = queue->vif->dev;
 		skb->protocol = eth_type_trans(skb, skb->dev);
 		skb_reset_network_header(skb);
-- 
1.7.10.4

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
       [not found] <1415184622-19421-1-git-send-email-david.vrabel@citrix.com>
@ 2014-11-05 10:57 ` Ian Campbell
  2014-11-05 10:58 ` Ian Campbell
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 12+ messages in thread
From: Ian Campbell @ 2014-11-05 10:57 UTC (permalink / raw)
  To: David Vrabel; +Cc: netdev, Malcolm Crossley, Wei Liu, xen-devel

On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> From: Malcolm Crossley <malcolm.crossley@citrix.com>
> 
> Unconditionally pulling 128 bytes into the linear area is not required
> for:
> 
> - security: Every protocol demux starts with pskb_may_pull() to pull
>   frag data into the linear area, if necessary, before looking at
>   headers.
> 
> - performance: Netback has already grant copied up-to 128 bytes from
>   the first slot of a packet into the linear area. The first slot
>   normally contain all the IPv4/IPv6 and TCP/UDP headers.

Thanks for adding these.

> The unconditional pull would often copy frag data unnecessarily.  This
> is a performance problem when running on a version of Xen where grant
> unmap avoids TLB flushes for pages which are not accessed.  TLB
> flushes can now be avoided for > 99% of unmaps (it was 0% before).
> 
> Grant unmap TLB flush avoidance will be available in a future version
> of Xen (probably 4.6).
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
       [not found] <1415184622-19421-1-git-send-email-david.vrabel@citrix.com>
  2014-11-05 10:57 ` [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path Ian Campbell
@ 2014-11-05 10:58 ` Ian Campbell
  2014-11-05 11:01   ` David Vrabel
  2014-11-05 10:59 ` Ian Campbell
  2014-11-06 19:40 ` David Miller
  3 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2014-11-05 10:58 UTC (permalink / raw)
  To: David Vrabel; +Cc: xen-devel, Malcolm Crossley, Paul Durrant, Wei Liu

Dropping netdev since this isn't relevant to them, adding Paul

On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> - performance: Netback has already grant copied up-to 128 bytes from
>   the first slot of a packet into the linear area. The first slot
>   normally contain all the IPv4/IPv6 and TCP/UDP headers.

Does "normally" here include guests other than Linux? I thought Windows
in particular was prone to splitting the headers into a frag per layer
or thereabouts?

Ian.

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
       [not found] <1415184622-19421-1-git-send-email-david.vrabel@citrix.com>
  2014-11-05 10:57 ` [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path Ian Campbell
  2014-11-05 10:58 ` Ian Campbell
@ 2014-11-05 10:59 ` Ian Campbell
  2014-11-05 11:17   ` Paul Durrant
  2014-11-06 19:40 ` David Miller
  3 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2014-11-05 10:59 UTC (permalink / raw)
  To: David Vrabel; +Cc: xen-devel, Malcolm Crossley, Paul Durrant, Wei Liu

Dropping netdev since this isn't relevant to them, adding Paul

On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> - performance: Netback has already grant copied up-to 128 bytes from
>   the first slot of a packet into the linear area. The first slot
>   normally contain all the IPv4/IPv6 and TCP/UDP headers.

Does "normally" include guests other than Linux? I thought Windows in
particular was prone to splitting the headers into a frag per layer or
thereabouts?

Ian

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 10:58 ` Ian Campbell
@ 2014-11-05 11:01   ` David Vrabel
  0 siblings, 0 replies; 12+ messages in thread
From: David Vrabel @ 2014-11-05 11:01 UTC (permalink / raw)
  To: Ian Campbell; +Cc: xen-devel, Malcolm Crossley, Paul Durrant, Wei Liu

On 05/11/14 10:58, Ian Campbell wrote:
> Dropping netdev since this isn't relevant to them, adding Paul
> 
> On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
>> - performance: Netback has already grant copied up-to 128 bytes from
>>   the first slot of a packet into the linear area. The first slot
>>   normally contain all the IPv4/IPv6 and TCP/UDP headers.
> 
> Does "normally" here include guests other than Linux? I thought Windows
> in particular was prone to splitting the headers into a frag per layer
> or thereabouts?

I'm not sure what guests Malcolm tested with.

David

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 10:59 ` Ian Campbell
@ 2014-11-05 11:17   ` Paul Durrant
  2014-11-05 11:20     ` Ian Campbell
  0 siblings, 1 reply; 12+ messages in thread
From: Paul Durrant @ 2014-11-05 11:17 UTC (permalink / raw)
  To: Ian Campbell, David Vrabel
  Cc: xen-devel@lists.xenproject.org, Malcolm Crossley, Wei Liu

> -----Original Message-----
> From: Ian Campbell
> Sent: 05 November 2014 11:00
> To: David Vrabel
> Cc: xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley; Paul Durrant
> Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> __pskb_pull_tail() in guest Tx path
> 
> Dropping netdev since this isn't relevant to them, adding Paul
> 
> On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> > - performance: Netback has already grant copied up-to 128 bytes from
> >   the first slot of a packet into the linear area. The first slot
> >   normally contain all the IPv4/IPv6 and TCP/UDP headers.
> 
> Does "normally" include guests other than Linux? I thought Windows in
> particular was prone to splitting the headers into a frag per layer or
> thereabouts?
> 

Current upstream Windows PV drivers will put all parsed headers in the first frag and the rest of the packet in subsequent flags. The parser currently knows about TCP and UDP over IPv4 or v6, with and without SNAP encapsulation. It doesn't, for example, know about ARP so the backend will see only the ethernet header in the first frag.

  Paul

> Ian
> 

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 11:17   ` Paul Durrant
@ 2014-11-05 11:20     ` Ian Campbell
  2014-11-05 11:24       ` Paul Durrant
  0 siblings, 1 reply; 12+ messages in thread
From: Ian Campbell @ 2014-11-05 11:20 UTC (permalink / raw)
  To: Paul Durrant
  Cc: xen-devel@lists.xenproject.org, Malcolm Crossley, Wei Liu,
	David Vrabel

On Wed, 2014-11-05 at 11:17 +0000, Paul Durrant wrote:
> > -----Original Message-----
> > From: Ian Campbell
> > Sent: 05 November 2014 11:00
> > To: David Vrabel
> > Cc: xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley; Paul Durrant
> > Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> > __pskb_pull_tail() in guest Tx path
> > 
> > Dropping netdev since this isn't relevant to them, adding Paul
> > 
> > On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> > > - performance: Netback has already grant copied up-to 128 bytes from
> > >   the first slot of a packet into the linear area. The first slot
> > >   normally contain all the IPv4/IPv6 and TCP/UDP headers.
> > 
> > Does "normally" include guests other than Linux? I thought Windows in
> > particular was prone to splitting the headers into a frag per layer or
> > thereabouts?
> > 
> 
> Current upstream Windows PV drivers will put all parsed headers in the
> first frag and the rest of the packet in subsequent flags. The parser
> currently knows about TCP and UDP over IPv4 or v6, with and without
> SNAP encapsulation. It doesn't, for example, know about ARP so the
> backend will see only the ethernet header in the first frag.

Sounds like that is sufficient to reach the "normally" qualification,
thanks.

(I wonder what sort of benefit parsing arp would bring...)

Ian.

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 11:20     ` Ian Campbell
@ 2014-11-05 11:24       ` Paul Durrant
  2014-11-05 18:07         ` Konrad Rzeszutek Wilk
  2014-11-05 19:02         ` annie li
  0 siblings, 2 replies; 12+ messages in thread
From: Paul Durrant @ 2014-11-05 11:24 UTC (permalink / raw)
  To: Ian Campbell
  Cc: xen-devel@lists.xenproject.org, Malcolm Crossley, Wei Liu,
	David Vrabel

> -----Original Message-----
> From: Ian Campbell
> Sent: 05 November 2014 11:20
> To: Paul Durrant
> Cc: David Vrabel; xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley
> Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> __pskb_pull_tail() in guest Tx path
> 
> On Wed, 2014-11-05 at 11:17 +0000, Paul Durrant wrote:
> > > -----Original Message-----
> > > From: Ian Campbell
> > > Sent: 05 November 2014 11:00
> > > To: David Vrabel
> > > Cc: xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley; Paul
> Durrant
> > > Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> > > __pskb_pull_tail() in guest Tx path
> > >
> > > Dropping netdev since this isn't relevant to them, adding Paul
> > >
> > > On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> > > > - performance: Netback has already grant copied up-to 128 bytes from
> > > >   the first slot of a packet into the linear area. The first slot
> > > >   normally contain all the IPv4/IPv6 and TCP/UDP headers.
> > >
> > > Does "normally" include guests other than Linux? I thought Windows in
> > > particular was prone to splitting the headers into a frag per layer or
> > > thereabouts?
> > >
> >
> > Current upstream Windows PV drivers will put all parsed headers in the
> > first frag and the rest of the packet in subsequent flags. The parser
> > currently knows about TCP and UDP over IPv4 or v6, with and without
> > SNAP encapsulation. It doesn't, for example, know about ARP so the
> > backend will see only the ethernet header in the first frag.
> 
> Sounds like that is sufficient to reach the "normally" qualification,
> thanks.
> 
> (I wonder what sort of benefit parsing arp would bring...)
> 

Previous versions of the drivers used to parse ARPs so that copies of outgoing gratuitous ARPs could be cached for replay after migrate. Newer drivers acquire IP address bindings from the Windows IP helper (which is now available in kernel) and synthesize ARPs/IPv6 neighbour solicitations.

  Paul

> Ian.

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 11:24       ` Paul Durrant
@ 2014-11-05 18:07         ` Konrad Rzeszutek Wilk
  2014-11-05 19:02         ` annie li
  1 sibling, 0 replies; 12+ messages in thread
From: Konrad Rzeszutek Wilk @ 2014-11-05 18:07 UTC (permalink / raw)
  To: Paul Durrant, annie li, james.harper
  Cc: xen-devel@lists.xenproject.org, Malcolm Crossley, Wei Liu,
	Ian Campbell, David Vrabel

On Wed, Nov 05, 2014 at 11:24:16AM +0000, Paul Durrant wrote:
> > -----Original Message-----
> > From: Ian Campbell
> > Sent: 05 November 2014 11:20
> > To: Paul Durrant
> > Cc: David Vrabel; xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley
> > Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> > __pskb_pull_tail() in guest Tx path
> > 
> > On Wed, 2014-11-05 at 11:17 +0000, Paul Durrant wrote:
> > > > -----Original Message-----
> > > > From: Ian Campbell
> > > > Sent: 05 November 2014 11:00
> > > > To: David Vrabel
> > > > Cc: xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley; Paul
> > Durrant
> > > > Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> > > > __pskb_pull_tail() in guest Tx path
> > > >
> > > > Dropping netdev since this isn't relevant to them, adding Paul
> > > >
> > > > On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> > > > > - performance: Netback has already grant copied up-to 128 bytes from
> > > > >   the first slot of a packet into the linear area. The first slot
> > > > >   normally contain all the IPv4/IPv6 and TCP/UDP headers.
> > > >
> > > > Does "normally" include guests other than Linux? I thought Windows in
> > > > particular was prone to splitting the headers into a frag per layer or
> > > > thereabouts?
> > > >
> > >
> > > Current upstream Windows PV drivers will put all parsed headers in the
> > > first frag and the rest of the packet in subsequent flags. The parser
> > > currently knows about TCP and UDP over IPv4 or v6, with and without
> > > SNAP encapsulation. It doesn't, for example, know about ARP so the
> > > backend will see only the ethernet header in the first frag.
> > 
> > Sounds like that is sufficient to reach the "normally" qualification,
> > thanks.
> > 
> > (I wonder what sort of benefit parsing arp would bring...)
> > 
> 
> Previous versions of the drivers used to parse ARPs so that copies of outgoing gratuitous ARPs could be cached for replay after migrate. Newer drivers acquire IP address bindings from the Windows IP helper (which is now available in kernel) and synthesize ARPs/IPv6 neighbour solicitations.
> 

CC-ing Annie and James - the other two Windows drivers authors..
>   Paul
> 
> > Ian.
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 11:24       ` Paul Durrant
  2014-11-05 18:07         ` Konrad Rzeszutek Wilk
@ 2014-11-05 19:02         ` annie li
  2014-11-06  9:52           ` Paul Durrant
  1 sibling, 1 reply; 12+ messages in thread
From: annie li @ 2014-11-05 19:02 UTC (permalink / raw)
  To: Paul Durrant
  Cc: xen-devel@lists.xenproject.org, Malcolm Crossley, Wei Liu,
	Ian Campbell, David Vrabel


On 2014/11/5 6:24, Paul Durrant wrote:
>> -----Original Message-----
>> From: Ian Campbell
>> Sent: 05 November 2014 11:20
>> To: Paul Durrant
>> Cc: David Vrabel; xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley
>> Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
>> __pskb_pull_tail() in guest Tx path
>>
>> On Wed, 2014-11-05 at 11:17 +0000, Paul Durrant wrote:
>>>> -----Original Message-----
>>>> From: Ian Campbell
>>>> Sent: 05 November 2014 11:00
>>>> To: David Vrabel
>>>> Cc: xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley; Paul
>> Durrant
>>>> Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
>>>> __pskb_pull_tail() in guest Tx path
>>>>
>>>> Dropping netdev since this isn't relevant to them, adding Paul
>>>>
>>>> On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
>>>>> - performance: Netback has already grant copied up-to 128 bytes from
>>>>>    the first slot of a packet into the linear area. The first slot
>>>>>    normally contain all the IPv4/IPv6 and TCP/UDP headers.
>>>> Does "normally" include guests other than Linux? I thought Windows in
>>>> particular was prone to splitting the headers into a frag per layer or
>>>> thereabouts?
>>>>
>>> Current upstream Windows PV drivers will put all parsed headers in the
>>> first frag and the rest of the packet in subsequent flags. The parser
>>> currently knows about TCP and UDP over IPv4 or v6, with and without
>>> SNAP encapsulation. It doesn't, for example, know about ARP so the
>>> backend will see only the ethernet header in the first frag.
>> Sounds like that is sufficient to reach the "normally" qualification,
>> thanks.
>>
>> (I wonder what sort of benefit parsing arp would bring...)
>>
> Previous versions of the drivers used to parse ARPs so that copies of outgoing gratuitous ARPs could be cached for replay after migrate. Newer drivers acquire IP address bindings from the Windows IP helper (which is now available in kernel) and synthesize ARPs/IPv6 neighbour solicitations.
I send out fake ARP after migration to deal with it, guess you are 
mentioning here 
http://msdn.microsoft.com/en-us/library/windows/hardware/ff557015(v=vs.85).aspx 
? which is available for kernel later than Vista.

Thanks
Annie

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
  2014-11-05 19:02         ` annie li
@ 2014-11-06  9:52           ` Paul Durrant
  0 siblings, 0 replies; 12+ messages in thread
From: Paul Durrant @ 2014-11-06  9:52 UTC (permalink / raw)
  To: annie li
  Cc: xen-devel@lists.xenproject.org, Malcolm Crossley, Wei Liu,
	Ian Campbell, David Vrabel

> -----Original Message-----
> From: annie li [mailto:annie.li@oracle.com]
> Sent: 05 November 2014 19:02
> To: Paul Durrant
> Cc: Ian Campbell; xen-devel@lists.xenproject.org; Malcolm Crossley; Wei Liu;
> David Vrabel
> Subject: Re: [Xen-devel] [PATCHv2 net-next] xen-netback: remove
> unconditional __pskb_pull_tail() in guest Tx path
> 
> 
> On 2014/11/5 6:24, Paul Durrant wrote:
> >> -----Original Message-----
> >> From: Ian Campbell
> >> Sent: 05 November 2014 11:20
> >> To: Paul Durrant
> >> Cc: David Vrabel; xen-devel@lists.xenproject.org; Wei Liu; Malcolm
> Crossley
> >> Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> >> __pskb_pull_tail() in guest Tx path
> >>
> >> On Wed, 2014-11-05 at 11:17 +0000, Paul Durrant wrote:
> >>>> -----Original Message-----
> >>>> From: Ian Campbell
> >>>> Sent: 05 November 2014 11:00
> >>>> To: David Vrabel
> >>>> Cc: xen-devel@lists.xenproject.org; Wei Liu; Malcolm Crossley; Paul
> >> Durrant
> >>>> Subject: Re: [PATCHv2 net-next] xen-netback: remove unconditional
> >>>> __pskb_pull_tail() in guest Tx path
> >>>>
> >>>> Dropping netdev since this isn't relevant to them, adding Paul
> >>>>
> >>>> On Wed, 2014-11-05 at 10:50 +0000, David Vrabel wrote:
> >>>>> - performance: Netback has already grant copied up-to 128 bytes
> from
> >>>>>    the first slot of a packet into the linear area. The first slot
> >>>>>    normally contain all the IPv4/IPv6 and TCP/UDP headers.
> >>>> Does "normally" include guests other than Linux? I thought Windows in
> >>>> particular was prone to splitting the headers into a frag per layer or
> >>>> thereabouts?
> >>>>
> >>> Current upstream Windows PV drivers will put all parsed headers in the
> >>> first frag and the rest of the packet in subsequent flags. The parser
> >>> currently knows about TCP and UDP over IPv4 or v6, with and without
> >>> SNAP encapsulation. It doesn't, for example, know about ARP so the
> >>> backend will see only the ethernet header in the first frag.
> >> Sounds like that is sufficient to reach the "normally" qualification,
> >> thanks.
> >>
> >> (I wonder what sort of benefit parsing arp would bring...)
> >>
> > Previous versions of the drivers used to parse ARPs so that copies of
> outgoing gratuitous ARPs could be cached for replay after migrate. Newer
> drivers acquire IP address bindings from the Windows IP helper (which is
> now available in kernel) and synthesize ARPs/IPv6 neighbour solicitations.
> I send out fake ARP after migration to deal with it, guess you are
> mentioning here
> http://msdn.microsoft.com/en-
> us/library/windows/hardware/ff557015(v=vs.85).aspx
> ? which is available for kernel later than Vista.
> 

Yes. The upstream PV drivers are Vista+ only.

  Paul

> Thanks
> Annie

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

* Re: [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path
       [not found] <1415184622-19421-1-git-send-email-david.vrabel@citrix.com>
                   ` (2 preceding siblings ...)
  2014-11-05 10:59 ` Ian Campbell
@ 2014-11-06 19:40 ` David Miller
  3 siblings, 0 replies; 12+ messages in thread
From: David Miller @ 2014-11-06 19:40 UTC (permalink / raw)
  To: david.vrabel; +Cc: netdev, malcolm.crossley, wei.liu2, ian.campbell, xen-devel

From: David Vrabel <david.vrabel@citrix.com>
Date: Wed, 5 Nov 2014 10:50:22 +0000

> From: Malcolm Crossley <malcolm.crossley@citrix.com>
> 
> Unconditionally pulling 128 bytes into the linear area is not required
> for:
> 
> - security: Every protocol demux starts with pskb_may_pull() to pull
>   frag data into the linear area, if necessary, before looking at
>   headers.
> 
> - performance: Netback has already grant copied up-to 128 bytes from
>   the first slot of a packet into the linear area. The first slot
>   normally contain all the IPv4/IPv6 and TCP/UDP headers.
> 
> The unconditional pull would often copy frag data unnecessarily.  This
> is a performance problem when running on a version of Xen where grant
> unmap avoids TLB flushes for pages which are not accessed.  TLB
> flushes can now be avoided for > 99% of unmaps (it was 0% before).
> 
> Grant unmap TLB flush avoidance will be available in a future version
> of Xen (probably 4.6).
> 
> Signed-off-by: Malcolm Crossley <malcolm.crossley@citrix.com>
> Signed-off-by: David Vrabel <david.vrabel@citrix.com>

Applied, thanks.

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

end of thread, other threads:[~2014-11-06 19:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1415184622-19421-1-git-send-email-david.vrabel@citrix.com>
2014-11-05 10:57 ` [PATCHv2 net-next] xen-netback: remove unconditional __pskb_pull_tail() in guest Tx path Ian Campbell
2014-11-05 10:58 ` Ian Campbell
2014-11-05 11:01   ` David Vrabel
2014-11-05 10:59 ` Ian Campbell
2014-11-05 11:17   ` Paul Durrant
2014-11-05 11:20     ` Ian Campbell
2014-11-05 11:24       ` Paul Durrant
2014-11-05 18:07         ` Konrad Rzeszutek Wilk
2014-11-05 19:02         ` annie li
2014-11-06  9:52           ` Paul Durrant
2014-11-06 19:40 ` David Miller
2014-11-05 10:50 David Vrabel

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).