Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Zoltan Kiss
On 02/04/14 14:11, David Vrabel wrote: On 01/04/14 12:40, Ian Campbell wrote: On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: __skb_put(skb, data_len); + vif->tx_copy_ops[*copy_ops].source.u.ref = txreq.gref; +

Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Ian Campbell
On Wed, 2014-04-02 at 14:11 +0100, David Vrabel wrote: > I'd be in favour of a patch that: > > - renamed gnttab_map_refs() to gnttab_batch_map_pages() > - refactored it to call gnttab_batch_map(). > - added documentation > > But I don't see why this would be a prerequisite for this series. No,

Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread David Vrabel
On 01/04/14 12:40, Ian Campbell wrote: > On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: >> >> __skb_put(skb, data_len); >> +vif->tx_copy_ops[*copy_ops].source.u.ref = txreq.gref; >> +vif->tx_copy_ops[*copy_ops].source.domid = vif->domid; >> +

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Ian Campbell
On Tue, 2014-04-01 at 20:09 +0100, Zoltan Kiss wrote: > On 01/04/14 12:40, Ian Campbell wrote: > > On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: > >> > >> check_frags: > >> - for (i = start; i < nr_frags; i++) { > >> + for (i = 0; i < nr_frags; i++, gop_map++) { > >>int j,

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Ian Campbell
On Tue, 2014-04-01 at 19:55 +0100, Zoltan Kiss wrote: > >> @@ -1389,7 +1393,7 @@ static int xenvif_tx_submit(struct xenvif > *vif) > >> txp = >pending_tx_info[pending_idx].req; > >> > >> /* Check the remap error code. */ > >> -if

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Ian Campbell
On Tue, 2014-04-01 at 19:55 +0100, Zoltan Kiss wrote: @@ -1389,7 +1393,7 @@ static int xenvif_tx_submit(struct xenvif *vif) txp = vif-pending_tx_info[pending_idx].req; /* Check the remap error code. */ -if (unlikely(xenvif_tx_check_gop(vif, skb,

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Ian Campbell
On Tue, 2014-04-01 at 20:09 +0100, Zoltan Kiss wrote: On 01/04/14 12:40, Ian Campbell wrote: On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: check_frags: - for (i = start; i nr_frags; i++) { + for (i = 0; i nr_frags; i++, gop_map++) { int j, newerr;

Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread David Vrabel
On 01/04/14 12:40, Ian Campbell wrote: On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: __skb_put(skb, data_len); +vif-tx_copy_ops[*copy_ops].source.u.ref = txreq.gref; +vif-tx_copy_ops[*copy_ops].source.domid = vif-domid; +

Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Ian Campbell
On Wed, 2014-04-02 at 14:11 +0100, David Vrabel wrote: I'd be in favour of a patch that: - renamed gnttab_map_refs() to gnttab_batch_map_pages() - refactored it to call gnttab_batch_map(). - added documentation But I don't see why this would be a prerequisite for this series. No, I

Re: [Xen-devel] [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-02 Thread Zoltan Kiss
On 02/04/14 14:11, David Vrabel wrote: On 01/04/14 12:40, Ian Campbell wrote: On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: __skb_put(skb, data_len); + vif-tx_copy_ops[*copy_ops].source.u.ref = txreq.gref; +

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Zoltan Kiss
On 01/04/14 12:40, Ian Campbell wrote: On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: check_frags: - for (i = start; i < nr_frags; i++) { + for (i = 0; i < nr_frags; i++, gop_map++) { int j, newerr; pending_idx =

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Zoltan Kiss
On 01/04/14 10:40, Paul Durrant wrote: diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen- netback/netback.c index e781366..ba11ff5 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -915,35 +915,30 @@ static inline void

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Ian Campbell
On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: > > check_frags: > - for (i = start; i < nr_frags; i++) { > + for (i = 0; i < nr_frags; i++, gop_map++) { > int j, newerr; > > pending_idx = frag_get_pending_idx(>frags[i]); > - tx_info =

RE: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Paul Durrant
> -Original Message- > From: Zoltan Kiss > Sent: 31 March 2014 16:09 > To: Ian Campbell; Wei Liu; xen-de...@lists.xenproject.org > Cc: Paul Durrant; net...@vger.kernel.org; linux-kernel@vger.kernel.org; > Jonathan Davies; Zoltan Kiss > Subject: [PATCH net-next v2 2/2] xen-netback: Grant

RE: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Paul Durrant
-Original Message- From: Zoltan Kiss Sent: 31 March 2014 16:09 To: Ian Campbell; Wei Liu; xen-de...@lists.xenproject.org Cc: Paul Durrant; net...@vger.kernel.org; linux-kernel@vger.kernel.org; Jonathan Davies; Zoltan Kiss Subject: [PATCH net-next v2 2/2] xen-netback: Grant copy the

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Ian Campbell
On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: check_frags: - for (i = start; i nr_frags; i++) { + for (i = 0; i nr_frags; i++, gop_map++) { int j, newerr; pending_idx = frag_get_pending_idx(shinfo-frags[i]); - tx_info =

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Zoltan Kiss
On 01/04/14 10:40, Paul Durrant wrote: diff --git a/drivers/net/xen-netback/netback.c b/drivers/net/xen- netback/netback.c index e781366..ba11ff5 100644 --- a/drivers/net/xen-netback/netback.c +++ b/drivers/net/xen-netback/netback.c @@ -915,35 +915,30 @@ static inline void

Re: [PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-04-01 Thread Zoltan Kiss
On 01/04/14 12:40, Ian Campbell wrote: On Mon, 2014-03-31 at 16:08 +0100, Zoltan Kiss wrote: check_frags: - for (i = start; i nr_frags; i++) { + for (i = 0; i nr_frags; i++, gop_map++) { int j, newerr; pending_idx =

[PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-03-31 Thread Zoltan Kiss
An old inefficiency of the TX path that we are grant mapping the first slot, and then copy the header part to the linear area. Instead, doing a grant copy for that header straight on is more reasonable. Especially because there are ongoing efforts to make Xen avoiding TLB flush after unmap when

[PATCH net-next v2 2/2] xen-netback: Grant copy the header instead of map and memcpy

2014-03-31 Thread Zoltan Kiss
An old inefficiency of the TX path that we are grant mapping the first slot, and then copy the header part to the linear area. Instead, doing a grant copy for that header straight on is more reasonable. Especially because there are ongoing efforts to make Xen avoiding TLB flush after unmap when