[Linux-zigbee-devel] Performance analysis of SPI drivers for ATBEN

2013-04-10 Thread Werner Almesberger
[ Also posted on the qi-hardware list. No cross-post, since few
  people will be on both lists. ]

What this is all about
--

The ATBEN board on the Ben NanoNote needs a bit-banging SPI driver.
There are several ways to implement this, ranging from reuse of the
generic spi-gpio driver to an optimized driver that's specific for
this platform.

I implemented several such approaches and measured their performance
in the Ben NanoNote. Below are my findings.

Comments welcome.


Cast and characters
---

spi_atben_gpio: NanoNote-specific framework for setting up the
AT86RF230/1 with SPI-GPIO or one of the optimized drivers (below).
The name derives from spi_atben (see below) and should be changed
(maybe to atben_spi or atben_spi_gpio ?) since it is not an SPI
driver but merely a framework that provides configuration data and
performs miscellaneous platform setup.
https://github.com/wpwrak/ben-wpan-linux/blob/master/drivers/net/ieee802154/spi_atben_gpio.c

spi_atben: like spi_atben_gpio, but contains a highly optimized
SPI driver for the ATBEN configuration in the Ben NanoNote.
https://github.com/wpwrak/ben-wpan-linux/blob/master/drivers/net/ieee802154/spi_atben.c

spi-jz4740-gpio: SPI-GPIO driver optimized for the Jz4740. Uses the
optimized register accesses from spi_atben but pin assignment is not
restricted to ATBEN. The only limitation is that MOSI, MISO, and
SCLK must be on the same port.
https://github.com/wpwrak/ben-wpan-linux/blob/master/drivers/spi/spi-jz4740-gpio.c

spi-gpio-atben: task-specific SPI-GPIO driver using the #include
"spi-gpio.c" method. Replaces gpiolib functions with register
accesses specific to the ATBEN configuration in the Ben NanoNote.
Note that some of the code could be moved into Jz4740
architecture-specific GPIO support.
https://github.com/wpwrak/ben-wpan-linux/blob/master/drivers/spi/spi-gpio-atben.c

In the following sections, we abbreviate the stack configurations
as follows:

AbbreviationFramework   Transport   Chip driver
--- --- --- ---
spi-gpiospi_atben_gpio  spi-gpioat86rf230
spi-gpio-atben  spi_atben_gpio  spi-gpio-atben  at86rf230
spi-jz4740-gpio spi_atben_gpio  spi-jz4740-gpio at86rf230
spi_atben   spi_atben   at86rf230


Measurements


Access time to AT86RF231 registers and buffer, in microseconds, on
an otherwise idle Ben NanoNote:

Driver  read from 0x51  read 120 bytes from buffer
|   |   write 0x0a to 0x15  write 1 byte to buffer (0x33)
|   |   |   read 1 byte from buffer write 120 bytes
|   |   |   |   |   |   |
spi-gpio 81  85 186 1696 97 1596
spi-gpio-atben   63  59 123  498 65  437
spi-jz4740-gpio  10   8  21  280 10  231
spi_atben10   7  21  280 10  230

Data rate for hypothetical buffer accesses of infinite length.
I.e., kbps = 1000*119*8/(t_write120-t_write1)

Driver  buffer read (kbps)  buffer write (kbps)
--- --- ---
spi-gpio 630 635
spi-gpio-atben  25492559
spi-jz4740-gpio 36764308
spi_atben   36764327

At the air interface, IEEE 802.15.4 has a data rate of 250 kbps.
The AT86RF231 transceiver also supports non-standard higher data
rates up to 2 Mbps.

Driver(s)   Code size (lines)
--- -
spi_atben_gpio   128
spi_atben_gpio + spi-gpio-atben  128+ 53
spi_atben_gpio + spi-jz4740-gpio 128+416
spi_atben423


Computational cost
--

The high-level operations of sending and receiving produce the
following major low-level operations:

Operation   registerbuffer  waitqueue
readwrite   readwrite
--- --- --- --- --- -
reception   1   -   1   -   1
transmission9   4   -   1   1

Using the measured data from above, we get the following total
computational overhead in microseconds, without considering the
waitqueue scheduling delay:

Driver  reception   transmission
1   120 127 1   120 125 (bytes)
--- --- --- --- --- --- ---
spi-gpio 26717771866116626652727
spi-gpio-atben   186 561 583 86812401256
spi-jz4740-gpio   31 290 304 132 353 362

Note that the minimum frame length in IEEE 802.15.4 is 5 bytes.
The values for 125 (excluding CRC) and 127 (including CRC) bytes
are extrapolated.

According to [1], maximum-sized frames can be sent/receive

Re: [Linux-zigbee-devel] 6lowpan.c patches for SLAAC address uncompression (was: Re: Announcing the first public release of SimpleRPL)

2013-04-10 Thread Ralph Droms (rdroms)
I've attached updated patches for link-local address decompression.  They seem 
to apply OK to the latest net-next master.  Are they ready for submission?

- Ralph



On Apr 9, 2013, at 9:25 AM 4/9/13, Ralph Droms (rdroms)  
wrote:

>
> On Apr 9, 2013, at 8:04 AM 4/9/13, Christophe Aeschlimann 
> 
> wrote:
>
>> Hi Ralph,
>>
>> Sorry Tony for the thread hijack. I welcome your RPL implementation
>> which I will be testing soon. Thanks !
>>
>> Le 05.04.2013 14:33, Ralph Droms (rdroms) a écrit :
>>> Attached are the patches for fixing link-local address decompression.
>>> Comments welcome...
>>
>> I tested your patches (They didn't apply cleanly here but I edited the
>> patch by hand).
>>
>> I did have some problem with Link Local addresses (ICMP6 checksum error)
>> before and my problem seem to be gone now.
>>
>> They should probably be mainlined !
>
> Thanks for testing and the feedback.  I read the list out-of-order, and 
> didn't see your feedback when I posted a request for feedback a few minutes 
> ago...
>
> - Ralph
>
>
>>
>> Thanks
>>
>> --
>> Christophe Aeschlimann
>>
>> Embedded Software Engineer & IT Manager
>> ACN Advanced Communications Networks S.A.
>> 2000 - Neuchâtel, Switzerland
>> Tel. +41 32 724 74 31
>
>
> --
> Precog is a next-generation analytics platform capable of advanced
> analytics on semi-structured data. The platform includes APIs for building
> apps and a phenomenal toolset for data science. Developers can use
> our toolset for easy data analysis & visualization. Get a free account!
> http://www2.precog.com/precogplatform/slashdotnewsletter
> ___
> Linux-zigbee-devel mailing list
> Linux-zigbee-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel



sladdr-patches.tgz
Description: sladdr-patches.tgz
--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel


Re: [Linux-zigbee-devel] 6lowpan.c patches for SLAAC address uncompression (was: Re: Announcing the first public release of SimpleRPL)

2013-04-10 Thread Robert Schwebel
On Wed, Apr 10, 2013 at 09:29:55PM +, Ralph Droms (rdroms) wrote:
> I've attached updated patches for link-local address decompression.  They seem
> to apply OK to the latest net-next master.  Are they ready for submission?

Could you post patches inline for easier review? git-send-email does
that in a convenient way.

rsc
-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Linux-zigbee-devel mailing list
Linux-zigbee-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-zigbee-devel