netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v2 0/5] 6lowpan: trivial changes
@ 2013-10-26 13:53 Alexander Aring
  2013-10-26 13:53 ` [PATCH net-next v2 1/5] 6lowpan: remove unnecessary ret variable Alexander Aring
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 13:53 UTC (permalink / raw)
  To: alex.bluesman.smirnov
  Cc: linux-zigbee-devel, werner, dbaryshkov, netdev, Alexander Aring

This patch series includes some trivial changes to prepare the 6lowpan stack
for upcomming patch-series which mainly fix fragmentation according to rfc4944
and udp handling(which is currently broken).

Changes since v2:
  - change intendation in patch 3/5
  - fix typo in 5/5 unecessary -> unnecessary
  - add missing 6lowpan tag in cover-letter

Alexander Aring (5):
  6lowpan: remove unnecessary ret variable
  6lowpan: remove unnecessary check on err >= 0
  6lowpan: use netdev_alloc_skb instead dev_alloc_skb
  6lowpan: remove skb->dev assignment
  6lowpan: remove unnecessary break

 net/ieee802154/6lowpan.c | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

-- 
1.8.4.1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH net-next v2 1/5] 6lowpan: remove unnecessary ret variable
  2013-10-26 13:53 [PATCH net-next v2 0/5] 6lowpan: trivial changes Alexander Aring
@ 2013-10-26 13:53 ` Alexander Aring
  2013-10-26 13:53 ` [PATCH net-next v2 2/5] 6lowpan: remove unnecessary check on err >= 0 Alexander Aring
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 13:53 UTC (permalink / raw)
  To: alex.bluesman.smirnov
  Cc: linux-zigbee-devel, werner, dbaryshkov, netdev, Alexander Aring

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Werner Almesberger <werner@almesberger.net>
---
 net/ieee802154/6lowpan.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index ff41b4d..d288035 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1120,7 +1120,7 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
 			int mlen, int plen, int offset, int type)
 {
 	struct sk_buff *frag;
-	int hlen, ret;
+	int hlen;
 
 	hlen = (type == LOWPAN_DISPATCH_FRAG1) ?
 			LOWPAN_FRAG1_HEAD_SIZE : LOWPAN_FRAGN_HEAD_SIZE;
@@ -1145,9 +1145,7 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
 	lowpan_raw_dump_table(__func__, " raw fragment dump", frag->data,
 								frag->len);
 
-	ret = dev_queue_xmit(frag);
-
-	return ret;
+	return dev_queue_xmit(frag);
 }
 
 static int
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next v2 2/5] 6lowpan: remove unnecessary check on err >= 0
  2013-10-26 13:53 [PATCH net-next v2 0/5] 6lowpan: trivial changes Alexander Aring
  2013-10-26 13:53 ` [PATCH net-next v2 1/5] 6lowpan: remove unnecessary ret variable Alexander Aring
@ 2013-10-26 13:53 ` Alexander Aring
       [not found] ` <1382795642-12501-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 13:53 UTC (permalink / raw)
  To: alex.bluesman.smirnov
  Cc: linux-zigbee-devel, werner, dbaryshkov, netdev, Alexander Aring

The err variable can only be zero in this case.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Werner Almesberger <werner@almesberger.net>
---
 net/ieee802154/6lowpan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index d288035..9057f83 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1179,7 +1179,7 @@ lowpan_skb_fragmentation(struct sk_buff *skb, struct net_device *dev)
 	head[0] &= ~LOWPAN_DISPATCH_FRAG1;
 	head[0] |= LOWPAN_DISPATCH_FRAGN;
 
-	while ((payload_length - offset > 0) && (err >= 0)) {
+	while (payload_length - offset > 0) {
 		int len = LOWPAN_FRAG_SIZE;
 
 		head[4] = offset / 8;
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next v2 3/5] 6lowpan: use netdev_alloc_skb instead dev_alloc_skb
       [not found] ` <1382795642-12501-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-10-26 13:54   ` Alexander Aring
       [not found]     ` <1382795642-12501-4-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 13:54 UTC (permalink / raw)
  To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

This patch uses the netdev_alloc_skb instead dev_alloc_skb function and
drops the seperate assignment to skb->dev.

Signed-off-by: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Reviewed-by: Werner Almesberger <werner-SEdMjqphH88wryQfseakQg@public.gmane.org>
---
 net/ieee802154/6lowpan.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 9057f83..1884a84 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1127,12 +1127,12 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
 
 	lowpan_raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
 
-	frag = dev_alloc_skb(hlen + mlen + plen + IEEE802154_MFR_SIZE);
+	frag = netdev_alloc_skb(skb->dev, hlen + mlen +
+				plen + IEEE802154_MFR_SIZE);
 	if (!frag)
 		return -ENOMEM;
 
 	frag->priority = skb->priority;
-	frag->dev = skb->dev;
 
 	/* copy header, MFR and payload */
 	memcpy(skb_put(frag, mlen), skb->data, mlen);
-- 
1.8.4.1


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next v2 4/5] 6lowpan: remove skb->dev assignment
  2013-10-26 13:53 [PATCH net-next v2 0/5] 6lowpan: trivial changes Alexander Aring
                   ` (2 preceding siblings ...)
       [not found] ` <1382795642-12501-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-10-26 13:54 ` Alexander Aring
  2013-10-26 13:54 ` [PATCH net-next v2 5/5] 6lowpan: remove unnecessary break Alexander Aring
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 13:54 UTC (permalink / raw)
  To: alex.bluesman.smirnov
  Cc: linux-zigbee-devel, werner, dbaryshkov, netdev, Alexander Aring

This patch removes the assignment of skb->dev. We don't need it here because
we use the netdev_alloc_skb_ip_align function which already sets the
skb->dev.

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Werner Almesberger <werner@almesberger.net>
---
 net/ieee802154/6lowpan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 1884a84..665b118 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -785,7 +785,6 @@ lowpan_alloc_new_frame(struct sk_buff *skb, u16 len, u16 tag)
 		goto skb_err;
 
 	frame->skb->priority = skb->priority;
-	frame->skb->dev = skb->dev;
 
 	/* reserve headroom for uncompressed ipv6 header */
 	skb_reserve(frame->skb, sizeof(struct ipv6hdr));
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH net-next v2 5/5] 6lowpan: remove unnecessary break
  2013-10-26 13:53 [PATCH net-next v2 0/5] 6lowpan: trivial changes Alexander Aring
                   ` (3 preceding siblings ...)
  2013-10-26 13:54 ` [PATCH net-next v2 4/5] 6lowpan: remove skb->dev assignment Alexander Aring
@ 2013-10-26 13:54 ` Alexander Aring
  4 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 13:54 UTC (permalink / raw)
  To: alex.bluesman.smirnov
  Cc: linux-zigbee-devel, werner, dbaryshkov, netdev, Alexander Aring

Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Reviewed-by: Werner Almesberger <werner@almesberger.net>
---
 net/ieee802154/6lowpan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 665b118..6d75038 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -440,7 +440,6 @@ lowpan_uncompress_udp_header(struct sk_buff *skb, struct udphdr *uh)
 		default:
 			pr_debug("ERROR: unknown UDP format\n");
 			goto err;
-			break;
 		}
 
 		pr_debug("uncompressed UDP ports: src = %d, dst = %d\n",
-- 
1.8.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH net-next v2 3/5] 6lowpan: use netdev_alloc_skb instead dev_alloc_skb
       [not found]     ` <1382795642-12501-4-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2013-10-26 15:09       ` Alexander Aring
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2013-10-26 15:09 UTC (permalink / raw)
  To: alex.bluesman.smirnov-Re5JQEeQqe8AvxtiuMwx3w
  Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
	linux-zigbee-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Sat, Oct 26, 2013 at 03:54:00PM +0200, Alexander Aring wrote:
> This patch uses the netdev_alloc_skb instead dev_alloc_skb function and
> drops the seperate assignment to skb->dev.
> 
> Signed-off-by: Alexander Aring <alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Reviewed-by: Werner Almesberger <werner-SEdMjqphH88wryQfseakQg@public.gmane.org>
> ---
>  net/ieee802154/6lowpan.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
> index 9057f83..1884a84 100644
> --- a/net/ieee802154/6lowpan.c
> +++ b/net/ieee802154/6lowpan.c
> @@ -1127,12 +1127,12 @@ lowpan_fragment_xmit(struct sk_buff *skb, u8 *head,
>  
>  	lowpan_raw_dump_inline(__func__, "6lowpan fragment header", head, hlen);
>  
> -	frag = dev_alloc_skb(hlen + mlen + plen + IEEE802154_MFR_SIZE);
> +	frag = netdev_alloc_skb(skb->dev, hlen + mlen +
> +				plen + IEEE802154_MFR_SIZE);
mhh, I do the same mistake again. I will resend them.

Sorry for the noise.

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-10-26 15:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-26 13:53 [PATCH net-next v2 0/5] 6lowpan: trivial changes Alexander Aring
2013-10-26 13:53 ` [PATCH net-next v2 1/5] 6lowpan: remove unnecessary ret variable Alexander Aring
2013-10-26 13:53 ` [PATCH net-next v2 2/5] 6lowpan: remove unnecessary check on err >= 0 Alexander Aring
     [not found] ` <1382795642-12501-1-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-26 13:54   ` [PATCH net-next v2 3/5] 6lowpan: use netdev_alloc_skb instead dev_alloc_skb Alexander Aring
     [not found]     ` <1382795642-12501-4-git-send-email-alex.aring-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-10-26 15:09       ` Alexander Aring
2013-10-26 13:54 ` [PATCH net-next v2 4/5] 6lowpan: remove skb->dev assignment Alexander Aring
2013-10-26 13:54 ` [PATCH net-next v2 5/5] 6lowpan: remove unnecessary break Alexander Aring

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).