Thread (6 messages) flat view 6 messages, 2 authors, 2012-09-20

Re: [PATCH net-next] core: adjust checks for calling skb_copy_bits in skb_try_coalesce

From: Eric Dumazet <hidden>
Date: 2012-09-20 05:54:08

On Thu, 2012-09-20 at 13:40 +0800, RongQing Li wrote:
quoted
quoted
              unsigned int offset;
This is not needed at all.
I think the below modification maybe needed,
if (len <= skb_tailroom(to) && !skb_shinfo(to)->nr_frags) {
..
}

First skb A is added to skb TO frags, since the len is larger
than skb_tailroot(TO), but second len of skb B is less than
skb_tailroot(To)  which will call skb_copy_bits.

Of cause, this kinds of cases maybe only exist on my mind.
Did you read skb_tailroom(to) definition by any chance ?

static inline int skb_tailroom(const struct sk_buff *skb)
{
        return skb_is_nonlinear(skb) ? 0 : skb->end - skb->tail;
}

Current code is fine, because if @to is linear, its ... linear.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help