From: Eric Dumazet <eric.dumazet@gmail.com>
To: Shirley Ma <mashirle@us.ibm.com>
Cc: Avi Kivity <avi@redhat.com>, Arnd Bergmann <arnd@arndb.de>,
mst@redhat.com, xiaohui.xin@intel.com, netdev@vger.kernel.org,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH V2 5/5] Add TX zero copy in macvtap
Date: Fri, 10 Dec 2010 17:55:06 +0100 [thread overview]
Message-ID: <1292000106.3580.210.camel@edumazet-laptop> (raw)
In-Reply-To: <1291998355.2167.53.camel@localhost.localdomain>
Le vendredi 10 décembre 2010 à 08:25 -0800, Shirley Ma a écrit :
> On Fri, 2010-12-10 at 11:27 +0100, Eric Dumazet wrote:
> > You could make one atomic_add() outside of the loop, and factorize
> > many
> > things...
> >
> > atomic_add(len, &skb->sk->sk_wmem_alloc);
> > skb->data_len += len;
> > skb->len += len;
> > skb->truesize += len;
> > while (len) {
> > ...
> > }
>
> Yep, thanks, will update it!
Also take a look at skb_fill_page_desc() helper, and maybe
skb_add_rx_frag() too.
The atomic op should be factorized for sure, but other adds might be
done by helpers to keep code short.
prev parent reply other threads:[~2010-12-10 16:55 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-10 10:13 [RFC PATCH V2 5/5] Add TX zero copy in macvtap Shirley Ma
2010-12-10 10:27 ` Eric Dumazet
2010-12-10 16:25 ` Shirley Ma
2010-12-10 16:38 ` Shirley Ma
2010-12-10 16:55 ` Eric Dumazet [this message]
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=1292000106.3580.210.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=arnd@arndb.de \
--cc=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mashirle@us.ibm.com \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=xiaohui.xin@intel.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