Re: [Linux-zigbee-devel] [PATCH 5/7] 6lowpan: allow to skip bytes in lowpan_fetch_skb
Hi, On Sun, Sep 29, 2013 at 02:03:14AM -0300, Werner Almesberger wrote: > Alexander Aring wrote: > > This is necessary for upcomming patches. > > Hmm, I didn't spot any case where you'd pass NULL, but maybe I didn't > search hard enough. Is this for patchs in this set or in a future > set ? If it's in the current set, do you have an example where this > check is needed ? You can find it at [1]. Sometimes contiki devices don't make any header compression if it fits into a dataframe PDU. So this function have a check inside to see if we can pull. It doesn't really make sense there because we derefernce the byte before [2]. But it's okay for this moment, or not? I just want to don't use the skb_pull function. - Alex [1] https://github.com/linux-wpan/linux-net-next/commit/af2191adee6fc5010c3f32f4124367b9dba4502a#L0R1269 [2] https://github.com/linux-wpan/linux-net-next/commit/af2191adee6fc5010c3f32f4124367b9dba4502a#L0L1294 -- 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=60133471&iu=/4140/ostg.clktrk ___ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel
Re: [Linux-zigbee-devel] [PATCH 2/7] 6lowpan: clean lowpan netdev setup
Hi, On Sun, Sep 29, 2013 at 01:57:18AM -0300, Werner Almesberger wrote: > Alexander Aring wrote: > > This patch removes some magic number. > > Instead of magic numbers we use some defines. > > This may be misunderstood. When I read it, my first question was in > which other patch you defined MAC802154_FRAME_HARD_HEADER_LEN. But > of course, it already exists. So I'd say something like > > This patch replaces a redundant open-coded calculation > with the already defined MAC802154_FRAME_HARD_HEADER_LEN. > Ok. > > Acked-by: Werner Almesberger > > By the way, you should use the Acked-by only on patches I've seen. > While we discussed many things, I didn't comment on all of them. > Well, I probably will eventually, so it's hypothetical in this > case. > Okay, that confused me a little bit too while I add your Acked-by on these patches. In this time I thought "Should I ask him to add his Acked-by really" I simple misunderstood you in IRC, there you said I can put a Acked-by because you had helped a little bit on these patches. BIG sorry about that and shame on me! - Alex -- 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=60133471&iu=/4140/ostg.clktrk ___ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel
Re: [Linux-zigbee-devel] [PATCH 3/7] 6lowpan: remove several copies of sk_buff
On Sat, Sep 28, 2013 at 11:15:43PM +0200, Alexander Aring wrote: > The current implementation does many copies of the sk_buff for > increasing headroom which are not necessary. > > This patch increases the headroom in the maclayer for a worst case > scenario of (sizeof(struct ipv6hdr) + sizeof(struct udphdr)). > > Signed-off-by: Alexander Aring > Acked-by: Werner Almesberger > --- > net/ieee802154/6lowpan.c | 86 > +--- > net/mac802154/wpan.c | 4 ++- > 2 files changed, 19 insertions(+), 71 deletions(-) > > diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c > index f4cdf46..cb1997c 100644 > --- a/net/ieee802154/6lowpan.c > +++ b/net/ieee802154/6lowpan.c > @@ -706,21 +706,15 @@ static int lowpan_header_create(struct sk_buff *skb, > static int lowpan_give_skb_to_devices(struct sk_buff *skb) > { > struct lowpan_dev_record *entry; > - struct sk_buff *skb_cp; > int stat = NET_RX_SUCCESS; > > rcu_read_lock(); > - list_for_each_entry_rcu(entry, &lowpan_devices, list) > + list_for_each_entry_rcu(entry, &lowpan_devices, list) { > if (lowpan_dev_info(entry->ldev)->real_dev == skb->dev) { > - skb_cp = skb_copy(skb, GFP_ATOMIC); > - if (!skb_cp) { > - stat = -ENOMEM; > - break; > - } > - > - skb_cp->dev = entry->ldev; > - stat = netif_rx(skb_cp); > + skb->dev = entry->ldev; > + stat = netif_rx(skb); Mhh, I think we can put a break here because we have only one real_dev. A little improvement for a crazy setup with more than one lowpan device on more than one virtual wpan device which all running on a physical wpan device, or something else :-) > } > + } > rcu_read_unlock(); > > return stat; - Alex -- 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=60133471&iu=/4140/ostg.clktrk ___ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel
Re: [Linux-zigbee-devel] [PATCH 6/7] 6lowpan: fix fragmentation on receiving side
On Sat, Sep 28, 2013 at 11:15:46PM +0200, Alexander Aring wrote: > diff --git a/net/ieee802154/6lowpan.h b/net/ieee802154/6lowpan.h > index 1b1b5db..05a2a37 100644 > --- a/net/ieee802154/6lowpan.h > +++ b/net/ieee802154/6lowpan.h > @@ -246,4 +246,32 @@ static inline bool lowpan_fetch_skb(struct sk_buff *skb, > return false; > } > > +/* Checks if ieee802154_addr are equals, > + * if yes return 1 otherwise 0 > + */ > +static inline int lowpan_equal_ieee802154_addr(struct ieee802154_addr *a, > + struct ieee802154_addr *b) > +{ > + if (a->pan_id != b->pan_id) > + return 0; > + Don't know if it's right to check the pan_id here. Maybe somebody knows more about this? > + if (a->addr_type != b->addr_type) > + return 0; > + > + switch (a->addr_type) { > + case IEEE802154_ADDR_LONG: > + if (memcmp(a->hwaddr, b->hwaddr, IEEE802154_ADDR_LEN)) > + return 0; > + break; > + case IEEE802154_ADDR_SHORT: > + if (a->short_addr != b->short_addr) > + return 0; > + break; > + default: > + return 0; > + } > + > + return 1; > +} > + > #endif /* __6LOWPAN_H__ */ > -- > 1.8.4 > - Alex -- 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=60133471&iu=/4140/ostg.clktrk ___ Linux-zigbee-devel mailing list Linux-zigbee-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel