Thread (15 messages) 15 messages, 3 authors, 2008-06-28

Re: [RESEND] [PATCH] tcp: fix for splice receive when used with software LRO

From: Octavian Purdila <hidden>
Date: 2008-06-23 09:52:11

On Monday 23 June 2008, Jarek Poplawski wrote:
IMHO it's really more readable, and probably should be sometimes faster
if these divisions are optimized by a compiler. So, since the work is
done anyway, you could try to submit this - you got nothing to lose.
Cool, thanks for reviewing it.
But, I think it's better to separate the change of functionality (a
recursive processing of frag_list) to another patch (if there is a
practical reason for this).
Yes, it makes sense, I'll remove the recursion from this patch. 

About the recursion: don't know if it makes a difference from a functional 
perspective (I don't think that we can have frag_lists in frag_lists), but 
I've noticed that skb_copy_bits does recurse. Any idea why?

static inline void __segment_seek(struct page **page, int *poff, int *plen,
				  int off)

//?? unsigned ints (especially *poff for "/,%" optimization)?
Ack, will fix.

static inline int __splice_segment(struct page *page, unsigned int poff,
				   unsigned int plen, unsigned int *off,
				   unsigned int *len, struct sk_buff *skb,
				   struct splice_pipe_desc *spd)
{
//??	if (!*len)
//??		return 1;
Ack, will fix.
	/* skip this segment if already processed */
	if (*off >= plen) {
		*off -= plen;
		return 0;
	}

	/* ignore any bits we already processed */
	if (*off) {
		__segment_seek(&page, &poff, &plen, *off);
		*off = 0;
	}

	do {
		unsigned int flen = min(*len, plen);

//?? needed for a linear region?:
//??		flen = min_t(unsigned int, flen, PAGE_SIZE - poff);
Oops, missed that, thanks for catching it.
//?? The original comment with fixed "Returns..." (unless changed to void)?
Will add the comment back, since removing the recursions will make it correct 
again and will need the return type to decide if we go into the frag list or 
not, up in skb_splice_bits.
//?? I'm not sure this recursion is really needed here, so I'd prefer
//?? to move this back to skb_splice_bits() for now, and maybe to
//?? propose this change as a separate patch giving the reasons for this.
Ack.

Thanks,
tavi

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help