I''m trying to improve performance on the gpl pv drivers for windows, and am running into trouble with the sg stuff on the tx path. Taking an icmp packet as an example, windows formats the packet like this: sg entry 0 - Ethernet header sg entry 1 - IP header sg entry 2 - payload Those pieces could be anywhere inside the page. In netback.c, it appears that the sg magic happens inside netbk_count_requests. The following statement confuses me: " if (txp->size > first->size) { DPRINTK("Frags galore\n"); return -frags; } " If I interpret the implications of that correctly, the ''size'' field in the first fragment of a packet should be the size of the entire packet, but then how do I tell netback how long my first fragment is? Thanks James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Santos, Jose Renato G
2008-Mar-04 06:27 UTC
[Xen-devel] RE: Question on sg in netback tx path
> -----Original Message----- > From: xen-devel-bounces@lists.xensource.com > [mailto:xen-devel-bounces@lists.xensource.com] On Behalf Of > James Harper > Sent: Monday, March 03, 2008 9:03 PM > To: xen-devel@lists.xensource.com > Subject: [Xen-devel] Question on sg in netback tx path > > I''m trying to improve performance on the gpl pv drivers for > windows, and am running into trouble with the sg stuff on the tx path. > > Taking an icmp packet as an example, windows formats the packet like > this: > sg entry 0 - Ethernet header > sg entry 1 - IP header > sg entry 2 - payload > > Those pieces could be anywhere inside the page. > > In netback.c, it appears that the sg magic happens inside > netbk_count_requests. The following statement confuses me: > > " > if (txp->size > first->size) { > DPRINTK("Frags galore\n"); > return -frags; > } > " > > If I interpret the implications of that correctly, the ''size'' > field in the first fragment of a packet should be the size of > the entire packet,Correct.>but then how do I tell netback how long my > first fragment is?Look at the line following the code above: first->size -= txp->size; This line subtract each fragment size from the "size" field in the first fragment. When the loop ends you will have subtracted the size of all fragments and first->size will now have the actual size of the first fragment. Renato> > Thanks > > James > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
> > If I interpret the implications of that correctly, the ''size'' > > field in the first fragment of a packet should be the size of > > the entire packet, > > Correct. > > >but then how do I tell netback how long my > > first fragment is? > > Look at the line following the code above: > first->size -= txp->size; > > This line subtract each fragment size from the "size" field in thefirst> fragment. > When the loop ends you will have subtracted the size of allfragments> and first->size will now have the actual size of the first fragment. >Thanks for the clarification - all makes sense now! James _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Apparently Analagous Threads
- [PATCH net-next 2/2] xen-netback: avoid allocating variable size array on stack
- [PATCH 1/4] xen/netback: shutdown the ring if it contains garbage.
- netback Oops then xenwatch stuck in D state
- xennet: skb rides the rocket: 20 slots
- [PATCH v2 1/1] xen/netback: correctly calculate required slots of skb.