netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Aring <alex.aring@gmail.com>
To: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	linux-zigbee-devel@lists.sourceforge.net
Subject: Re: [Linux-zigbee-devel] [PATCH net-next 4/6] 6lowpan: fix fragmentation
Date: Wed, 14 May 2014 17:56:57 +0200	[thread overview]
Message-ID: <20140514155503.GA14689@omega> (raw)
In-Reply-To: <1400082191-16493-5-git-send-email-phoebe.buckheister@itwm.fraunhofer.de>

Hi Phoebe,

that's a nice solution for the DSN increment on fragmentation. This
stands long time on my ToDo list and you did a very nice solution.

Thanks. :-)

On Wed, May 14, 2014 at 05:43:09PM +0200, Phoebe Buckheister wrote:
> Currently, 6lowpan creates one 802.15.4 MAC header for the original
> packet the device was given by upper layers and reuses this header for
> all fragments, if fragmentation is required. This also reuses frame
> sequence numbers, which must not happen. 6lowpan also has issues with
> fragmentation in the presence of security headers, since those may imply
> the presence of trailing fields that are not accounted for by the
> fragmentation code right now.
> 
> Fix both of these issues by properly allocating fragment skbs with
> headromm and tailroom as specified by the underlying device, create one
> header for each skb instead of reusing the original header, let the
> underlying device do the rest.
> 
> Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
> ---
>  net/ieee802154/6lowpan_rtnl.c |  198 ++++++++++++++++++++++-------------------
>  1 file changed, 104 insertions(+), 94 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan_rtnl.c b/net/ieee802154/6lowpan_rtnl.c
> index d0191c5..1ae8a56 100644
> --- a/net/ieee802154/6lowpan_rtnl.c
> +++ b/net/ieee802154/6lowpan_rtnl.c
> @@ -220,139 +220,149 @@ static int lowpan_set_address(struct net_device *dev, void *p)
>  	return 0;
>  }
>  
> -static int
> -lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
> -		     int mlen, int plen, int offset, int type)
> +static struct sk_buff*
> +lowpan_alloc_frag(struct sk_buff *skb, int size,
> +		  const struct ieee802154_hdr *master_hdr)
>  {
> +	struct net_device *real_dev = lowpan_dev_info(skb->dev)->real_dev;
>  	struct sk_buff *frag;
> -	int hlen;
> -
> -	hlen = (type == LOWPAN_DISPATCH_FRAG1) ?
> -			LOWPAN_FRAG1_HEAD_SIZE : LOWPAN_FRAGN_HEAD_SIZE;
> -
> -	raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
> +	int rc;
> +
> +	frag = alloc_skb(real_dev->hard_header_len +
> +			 real_dev->needed_tailroom + size,
> +			 GFP_ATOMIC);

Why not keep netdev_alloc_skb for the real_dev?

But then we need to use dev_kfree_skb.

- Alex

  reply	other threads:[~2014-05-14 15:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-14 15:43 [PATCH net-next v2 0/6] 802154: some cleanups and fixes Phoebe Buckheister
2014-05-14 15:43 ` [PATCH net-next 1/6] ieee802154: add definitions for link-layer security and header functions Phoebe Buckheister
     [not found] ` <1400082191-16493-1-git-send-email-phoebe.buckheister-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2014-05-14 15:43   ` [PATCH net-next 2/6] mac802154: account for all header parts during wpan header creationg Phoebe Buckheister
2014-05-14 15:43   ` [PATCH net-next 4/6] 6lowpan: fix fragmentation Phoebe Buckheister
2014-05-14 15:56     ` Alexander Aring [this message]
2014-05-14 16:06       ` [Linux-zigbee-devel] " Phoebe Buckheister
2014-05-14 15:43 ` [PATCH net-next 3/6] ieee802154: change _cb handling slightly Phoebe Buckheister
2014-05-14 15:43 ` [PATCH net-next 5/6] ieee802154: fix dgram socket sendmsg() Phoebe Buckheister
2014-05-14 15:43 ` [PATCH net-next 6/6] mac802154: make mac802154_wpan_open static Phoebe Buckheister
2014-05-15 19:52 ` [PATCH net-next v2 0/6] 802154: some cleanups and fixes David Miller

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=20140514155503.GA14689@omega \
    --to=alex.aring@gmail.com \
    --cc=davem@davemloft.net \
    --cc=linux-zigbee-devel@lists.sourceforge.net \
    --cc=netdev@vger.kernel.org \
    --cc=phoebe.buckheister@itwm.fraunhofer.de \
    /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).