From: Eric Dumazet <eric.dumazet@gmail.com>
To: RongQing Li <roy.qing.li@gmail.com>
Cc: netdev@vger.kernel.org, edumazet@google.com
Subject: Re: [PATCH net-next] core: adjust checks for calling skb_copy_bits in skb_try_coalesce
Date: Thu, 20 Sep 2012 07:53:58 +0200 [thread overview]
Message-ID: <1348120438.31352.63.camel@edumazet-glaptop> (raw)
In-Reply-To: <CAJFZqHzTEwgJaKjvNLW3yYbMLUu0xm8tHwQ2e_TZJNdiTKOTFw@mail.gmail.com>
On Thu, 2012-09-20 at 13:40 +0800, RongQing Li wrote:
> >> 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.
next prev parent reply other threads:[~2012-09-20 5:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 3:19 [PATCH net-next] core: adjust checks for calling skb_copy_bits in skb_try_coalesce roy.qing.li
2012-09-20 5:20 ` Eric Dumazet
2012-09-20 5:40 ` RongQing Li
2012-09-20 5:53 ` Eric Dumazet [this message]
2012-09-20 5:57 ` RongQing Li
2012-09-20 7:00 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348120438.31352.63.camel@edumazet-glaptop \
--to=eric.dumazet@gmail.com \
--cc=edumazet@google.com \
--cc=netdev@vger.kernel.org \
--cc=roy.qing.li@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox