From: Alexander Aring <alex.aring@gmail.com>
To: Martin Townsend <mtownsend1973@gmail.com>
Cc: linux-bluetooth@vger.kernel.org, linux-wpan@vger.kernel.org,
marcel@holtmann.org, jukka.rissanen@linux.intel.com,
Martin Townsend <martin.townsend@xsilon.com>
Subject: Re: [PATCH bluetooth-next] 6lowpan: Use pskb_expand_head in IPHC decompression.
Date: Tue, 7 Oct 2014 18:17:10 +0200 [thread overview]
Message-ID: <20141007161709.GB2216@omega> (raw)
In-Reply-To: <20141007161420.GA2216@omega>
On Tue, Oct 07, 2014 at 06:14:20PM +0200, Alexander Aring wrote:
> Hi Martin,
>
> On Tue, Oct 07, 2014 at 04:33:57PM +0100, Martin Townsend wrote:
> > Currently there are potentially 2 skb_copy_expand calls in IPHC
> > decompression. This patch replaces this with one call to
> > pskb_expand_head. It also checks to see if there is enough headroom
> > first to ensure it's only done if necessary.
> > As pskb_expand_head must only have one reference the calling code
> > now ensures this.
> >
> > Signed-off-by: Martin Townsend <martin.townsend@xsilon.com>
> > ---
> > net/6lowpan/iphc.c | 53 ++++++++++++++++++++++---------------------
> > net/bluetooth/6lowpan.c | 19 ++++++++++++----
> > net/ieee802154/6lowpan_rtnl.c | 13 +++++++++++
> > 3 files changed, 55 insertions(+), 30 deletions(-)
> >
> > diff --git a/net/6lowpan/iphc.c b/net/6lowpan/iphc.c
> > index 142eef5..fa8f348 100644
> > --- a/net/6lowpan/iphc.c
> > +++ b/net/6lowpan/iphc.c
> > @@ -174,30 +174,22 @@ static int uncompress_context_based_src_addr(struct sk_buff *skb,
> > static int skb_deliver(struct sk_buff *skb, struct ipv6hdr *hdr,
> > struct net_device *dev, skb_delivery_cb deliver_skb)
> > {
> > - struct sk_buff *new;
> > int stat;
> >
> > - new = skb_copy_expand(skb, sizeof(struct ipv6hdr), skb_tailroom(skb),
> > - GFP_ATOMIC);
> > - kfree_skb(skb);
> > -
> > - if (!new)
> > - return -ENOMEM;
> > -
> > - skb_push(new, sizeof(struct ipv6hdr));
> > - skb_reset_network_header(new);
> > - skb_copy_to_linear_data(new, hdr, sizeof(struct ipv6hdr));
> > + skb_push(skb, sizeof(struct ipv6hdr));
> > + skb_reset_network_header(skb);
> > + skb_copy_to_linear_data(skb, hdr, sizeof(struct ipv6hdr));
> >
> > - new->protocol = htons(ETH_P_IPV6);
> > - new->pkt_type = PACKET_HOST;
> > - new->dev = dev;
> > + skb->protocol = htons(ETH_P_IPV6);
> > + skb->pkt_type = PACKET_HOST;
> > + skb->dev = dev;
> >
> > raw_dump_table(__func__, "raw skb data dump before receiving",
> > - new->data, new->len);
> > + skb->data, skb->len);
> >
> > - stat = deliver_skb(new, dev);
> > + stat = deliver_skb(skb, dev);
> >
> > - kfree_skb(new);
> > + kfree_skb(skb);
> >
> I know what before but "consume_skb"
>
oh this sentence wasn't complete. I meant:
"I know you didn't touch it but it's consume_skb here:
- Alex
next prev parent reply other threads:[~2014-10-07 16:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-07 15:33 [PATCH bluetooth-next] 6lowpan: Use pskb_expand_head in IPHC decompression Martin Townsend
2014-10-07 15:33 ` Martin Townsend
2014-10-07 15:37 ` Martin Townsend
2014-10-08 10:24 ` Jukka Rissanen
2014-10-08 11:07 ` Martin Townsend
2014-10-08 12:12 ` Jukka Rissanen
2014-10-08 12:52 ` Martin Townsend
2014-10-08 13:35 ` Jukka Rissanen
2014-10-08 13:42 ` Martin Townsend
2014-10-07 16:14 ` Alexander Aring
2014-10-07 16:17 ` Alexander Aring [this message]
2014-10-07 18:25 ` Martin Townsend
2014-10-07 18:58 ` Alexander Aring
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=20141007161709.GB2216@omega \
--to=alex.aring@gmail.com \
--cc=jukka.rissanen@linux.intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-wpan@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=martin.townsend@xsilon.com \
--cc=mtownsend1973@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;
as well as URLs for NNTP newsgroup(s).