Skip to content

at86rf2xx: release framebuffer on recv with (len > 0) && (buf == NULL)#9509

Merged
kYc0o merged 1 commit intoRIOT-OS:masterfrom
Josar:pr/at86rf2xx_framebuffer
Oct 29, 2018
Merged

at86rf2xx: release framebuffer on recv with (len > 0) && (buf == NULL)#9509
kYc0o merged 1 commit intoRIOT-OS:masterfrom
Josar:pr/at86rf2xx_framebuffer

Conversation

@Josar
Copy link
Contributor

@Josar Josar commented Jul 6, 2018

The upper layer calls the recieve function to get back the size of the frame.
At the moment the frame buffer is released when returning the size, but this should not be done.
see #9172 (comment)

This PR sets the tranceiver in PLL_ON state to avoid corruption of the data in the frame buffer and sets it back to the the last state which the transceiver had before changing into transmit mode after the data is read out.

Issues/PRs references

#9172

@Josar Josar force-pushed the pr/at86rf2xx_framebuffer branch from 69db2a7 to 1ed5f7c Compare July 6, 2018 12:06
@kYc0o kYc0o requested a review from miri64 July 6, 2018 14:29
@kYc0o kYc0o self-assigned this Jul 6, 2018
@kYc0o kYc0o added Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Jul 6, 2018
@kYc0o kYc0o modified the milestones: Release 2018.10, Release 2018.07 Jul 6, 2018

/* just return length when buf == NULL */
if (buf == NULL) {
at86rf2xx_fb_stop(dev);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be if (len > 0), instead of removed

@Josar Josar force-pushed the pr/at86rf2xx_framebuffer branch from 1ed5f7c to c67681b Compare July 7, 2018 00:56
@Josar
Copy link
Contributor Author

Josar commented Jul 7, 2018

@gebart got that covered.

@miri64
Copy link
Member

miri64 commented Jul 7, 2018

@Josar for future reference, can you please provide your changes as fixup commits, so your changes can be tracked during the review? Thank you!

miri64
miri64 previously approved these changes Jul 7, 2018
Copy link
Member

@miri64 miri64 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

@miri64 miri64 changed the title Pr/at86rf2xx framebuffer at86rf2xx: release framebuffer on recv with (len > 0) && (buf == NULL) Jul 7, 2018
Copy link
Member

@jnohlgard jnohlgard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested ACK

Copy link
Member

@jnohlgard jnohlgard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This leaves the spi bus hanging, there's a spi release call in FB stop

Copy link
Member

@jnohlgard jnohlgard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not the correct fix, the frame buffer protection is not handled correctly with this PR either.

@Josar
Copy link
Contributor Author

Josar commented Jul 8, 2018

I tried to find the proper way of handling this and used Atmel-8351E-MCU_Wireless-AT86RF233_Datasheet_072014 as reference to get some ideas. All page number refer to this if not stated otherwise.

page 170 Dynamic Frame Buffer Protection.
The SPI release indicated by /SEL = H is what releases the frame buffer protection.

I can think of this possible solutions.

  1. Using Dynamic FBP (page 170) but Read PHR after IRQ_2 (RX_START) (page 24) with SRAM acces and not framebuffer acces. I think this can also be done in _rec which is a while after IRQ_2.
    But as state in AT86RF231 manual page 23 "The frame length information can be accessed only
    using Frame Buffer access.". So this seems not possible for all at86rx2xx.

  2. Using Dynamic FBP (page 170) call at86rf2xx_fb_start in the if when returning the size and keep the spi bus locked. Then read out the data when the second call to _rev is executed. And unlock the spi after read out is finished.

This would ensure that Dynamic frame buffer protection works and the radio transceiver automatically enters the power save mode (page 174). I think in both cases 1 and 2.

  1. set Static Frame Buffer Protection with RX_PDT_DIS bit of RX_SYN. Manual page 112

  2. Set receiver state from RX_AACK_ON to PLL_ON directly after IRQ_3 (TRX_END) (page 118)

Which one (2,3,4) do you think is the best ore would you prefer?

@miri64 miri64 dismissed their stale review July 9, 2018 06:08

I think my ACK was a bit premature, considering that I did not even properly test this PR. I agree however with the spirit of this PR.

@kYc0o
Copy link
Contributor

kYc0o commented Jul 9, 2018

I tested it and it actually breaks the at86rf2xx driver.

@jnohlgard
Copy link
Member

Option 2 (keeping spi bus locked between calls) is not acceptable. It would block any other spi device drivers from communicating while waiting for the recv call and could cause deadlocks. We need to remember that netdev is not only for gnrc and the network stack may not always have the same behavior in the future, so depending on knowledge of the access pattern of the network stack is not a feasible solution.

@Josar
Copy link
Contributor Author

Josar commented Jul 9, 2018

With this an the fact that setting static requires a read modify write operation solution 4 would be appropriate, imho.

@Josar Josar force-pushed the pr/at86rf2xx_framebuffer branch 2 times, most recently from c18dc08 to 244b3ea Compare July 9, 2018 14:28
@Josar
Copy link
Contributor Author

Josar commented Jul 9, 2018

Implemented solution 4 could someone with access to hardware make some test?

@jnohlgard
Copy link
Member

Solution 4 sounds like the best option in theory. I am in holidays and will not be able to test this PR.

@kYc0o
Copy link
Contributor

kYc0o commented Jul 9, 2018

Implemented solution 4 could someone with access to hardware make some test?

I'm on it.

@kYc0o
Copy link
Contributor

kYc0o commented Jul 9, 2018

It works again. @gebart do you ACK?

@kYc0o
Copy link
Contributor

kYc0o commented Aug 28, 2018

I just tested and got not super satisfying results with this PR. It seems to drop more packets with large payload than on current master.

With this PR:

2018-08-28 15:13:05,402 - INFO #  ping6 100 fe80::7b62:548:7cb3:d1a6 128 5
2018-08-28 15:13:05,438 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=1 hop limit=64 time = 21.929 ms
2018-08-28 15:13:05,464 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=2 hop limit=64 time = 22.571 ms
2018-08-28 15:13:05,500 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=3 hop limit=64 time = 22.906 ms
2018-08-28 15:13:06,512 - INFO # ping timeout
2018-08-28 15:13:06,554 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=5 hop limit=64 time = 23.867 ms
2018-08-28 15:13:06,583 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=6 hop limit=64 time = 22.262 ms
2018-08-28 15:13:07,596 - INFO # ping timeout
2018-08-28 15:13:08,608 - INFO # ping timeout
2018-08-28 15:13:08,651 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=9 hop limit=64 time = 25.467 ms
2018-08-28 15:13:08,681 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=10 hop limit=64 time = 22.266 ms
2018-08-28 15:13:08,717 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=11 hop limit=64 time = 23.526 ms
2018-08-28 15:13:09,731 - INFO # ping timeout
2018-08-28 15:13:09,768 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=13 hop limit=64 time = 23.531 ms
2018-08-28 15:13:09,801 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=14 hop limit=64 time = 21.283 ms
2018-08-28 15:13:10,815 - INFO # ping timeout
2018-08-28 15:13:11,825 - INFO # ping timeout
2018-08-28 15:13:11,865 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=17 hop limit=64 time = 23.218 ms
2018-08-28 15:13:12,873 - INFO # ping timeout
2018-08-28 15:13:13,886 - INFO # ping timeout
2018-08-28 15:13:13,924 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=20 hop limit=64 time = 23.865 ms
2018-08-28 15:13:13,958 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=21 hop limit=64 time = 23.213 ms
2018-08-28 15:13:14,970 - INFO # ping timeout
2018-08-28 15:13:15,983 - INFO # ping timeout
2018-08-28 15:13:16,018 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=24 hop limit=64 time = 21.613 ms
2018-08-28 15:13:16,053 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=25 hop limit=64 time = 22.917 ms
2018-08-28 15:13:16,089 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=26 hop limit=64 time = 23.227 ms
2018-08-28 15:13:17,101 - INFO # ping timeout
2018-08-28 15:13:17,136 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=28 hop limit=64 time = 21.972 ms
2018-08-28 15:13:17,171 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=29 hop limit=64 time = 22.604 ms
2018-08-28 15:13:17,207 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=30 hop limit=64 time = 22.876 ms
2018-08-28 15:13:17,243 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=31 hop limit=64 time = 23.560 ms
2018-08-28 15:13:17,278 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=32 hop limit=64 time = 22.571 ms
2018-08-28 15:13:17,316 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=33 hop limit=64 time = 24.521 ms
2018-08-28 15:13:18,328 - INFO # ping timeout
2018-08-28 15:13:19,340 - INFO # ping timeout
2018-08-28 15:13:20,352 - INFO # ping timeout
2018-08-28 15:13:20,390 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=37 hop limit=64 time = 22.891 ms
2018-08-28 15:13:20,426 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=38 hop limit=64 time = 25.468 ms
2018-08-28 15:13:20,460 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=39 hop limit=64 time = 21.951 ms
2018-08-28 15:13:20,499 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=40 hop limit=64 time = 21.942 ms
2018-08-28 15:13:20,532 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=41 hop limit=64 time = 24.520 ms
2018-08-28 15:13:21,544 - INFO # ping timeout
2018-08-28 15:13:21,580 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=43 hop limit=64 time = 22.591 ms
2018-08-28 15:13:21,614 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=44 hop limit=64 time = 22.905 ms
2018-08-28 15:13:21,649 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=45 hop limit=64 time = 20.959 ms
2018-08-28 15:13:21,684 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=46 hop limit=64 time = 23.244 ms
2018-08-28 15:13:22,697 - INFO # ping timeout
2018-08-28 15:13:22,738 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=48 hop limit=64 time = 23.868 ms
2018-08-28 15:13:22,768 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=49 hop limit=64 time = 22.566 ms
2018-08-28 15:13:23,782 - INFO # ping timeout
2018-08-28 15:13:24,794 - INFO # ping timeout
2018-08-28 15:13:24,829 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=52 hop limit=64 time = 21.924 ms
2018-08-28 15:13:24,862 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=53 hop limit=64 time = 20.693 ms
2018-08-28 15:13:25,875 - INFO # ping timeout
2018-08-28 15:13:26,886 - INFO # ping timeout
2018-08-28 15:13:26,923 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=56 hop limit=64 time = 24.198 ms
2018-08-28 15:13:26,958 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=57 hop limit=64 time = 22.573 ms
2018-08-28 15:13:26,994 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=58 hop limit=64 time = 22.563 ms
2018-08-28 15:13:27,030 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=59 hop limit=64 time = 22.901 ms
2018-08-28 15:13:27,064 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=60 hop limit=64 time = 22.593 ms
2018-08-28 15:13:27,101 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=61 hop limit=64 time = 23.820 ms
2018-08-28 15:13:27,137 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=62 hop limit=64 time = 21.616 ms
2018-08-28 15:13:28,148 - INFO # ping timeout
2018-08-28 15:13:29,160 - INFO # ping timeout
2018-08-28 15:13:29,199 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=65 hop limit=64 time = 22.900 ms
2018-08-28 15:13:29,234 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=66 hop limit=64 time = 26.108 ms
2018-08-28 15:13:29,269 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=67 hop limit=64 time = 21.598 ms
2018-08-28 15:13:29,306 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=68 hop limit=64 time = 25.131 ms
2018-08-28 15:13:29,340 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=69 hop limit=64 time = 21.647 ms
2018-08-28 15:13:29,380 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=70 hop limit=64 time = 22.260 ms
2018-08-28 15:13:29,410 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=71 hop limit=64 time = 22.588 ms
2018-08-28 15:13:30,422 - INFO # ping timeout
2018-08-28 15:13:31,434 - INFO # ping timeout
2018-08-28 15:13:31,468 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=74 hop limit=64 time = 21.011 ms
2018-08-28 15:13:31,503 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=75 hop limit=64 time = 22.271 ms
2018-08-28 15:13:31,549 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=76 hop limit=64 time = 23.839 ms
2018-08-28 15:13:31,579 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=77 hop limit=64 time = 24.173 ms
2018-08-28 15:13:31,615 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=78 hop limit=64 time = 21.609 ms
2018-08-28 15:13:31,651 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=79 hop limit=64 time = 22.899 ms
2018-08-28 15:13:32,658 - INFO # ping timeout
2018-08-28 15:13:33,669 - INFO # ping timeout
2018-08-28 15:13:33,713 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=82 hop limit=64 time = 24.206 ms
2018-08-28 15:13:33,742 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=83 hop limit=64 time = 23.267 ms
2018-08-28 15:13:33,778 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=84 hop limit=64 time = 23.237 ms
2018-08-28 15:13:33,822 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=85 hop limit=64 time = 24.819 ms
2018-08-28 15:13:33,853 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=86 hop limit=64 time = 25.132 ms
2018-08-28 15:13:33,888 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=87 hop limit=64 time = 21.620 ms
2018-08-28 15:13:33,924 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=88 hop limit=64 time = 24.208 ms
2018-08-28 15:13:34,937 - INFO # ping timeout
2018-08-28 15:13:35,949 - INFO # ping timeout
2018-08-28 15:13:35,992 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=91 hop limit=64 time = 23.842 ms
2018-08-28 15:13:36,998 - INFO # ping timeout
2018-08-28 15:13:37,033 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=93 hop limit=64 time = 21.643 ms
2018-08-28 15:13:37,067 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=94 hop limit=64 time = 22.288 ms
2018-08-28 15:13:37,101 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=95 hop limit=64 time = 21.277 ms
2018-08-28 15:13:37,138 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=96 hop limit=64 time = 24.205 ms
2018-08-28 15:13:37,173 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=97 hop limit=64 time = 22.254 ms
2018-08-28 15:13:38,186 - INFO # ping timeout
2018-08-28 15:13:38,229 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=99 hop limit=64 time = 24.189 ms
2018-08-28 15:13:38,258 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=90 seq=100 hop limit=64 time = 22.575 ms
2018-08-28 15:13:38,263 - INFO # --- fe80::7b62:548:7cb3:d1a6 ping statistics ---
2018-08-28 15:13:38,271 - INFO # 100 packets transmitted, 70 received, 30% packet loss, time 32.06889464 s
2018-08-28 15:13:38,275 - INFO # rtt min/avg/max = 20.693/22.976/26.108 ms

On current master:

2018-08-28 15:20:09,287 - INFO #  ping6 100 fe80::7b62:548:7cb3:d1a6 128 5
2018-08-28 15:20:09,325 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=1 hop limit=64 time = 22.334 ms
2018-08-28 15:20:09,352 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=2 hop limit=64 time = 24.219 ms
2018-08-28 15:20:09,389 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=3 hop limit=64 time = 24.272 ms
2018-08-28 15:20:09,425 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=4 hop limit=64 time = 23.611 ms
2018-08-28 15:20:09,461 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=5 hop limit=64 time = 22.973 ms
2018-08-28 15:20:09,494 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=6 hop limit=64 time = 21.077 ms
2018-08-28 15:20:09,530 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=7 hop limit=64 time = 23.598 ms
2018-08-28 15:20:09,565 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=8 hop limit=64 time = 22.293 ms
2018-08-28 15:20:09,599 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=9 hop limit=64 time = 21.685 ms
2018-08-28 15:20:09,634 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=10 hop limit=64 time = 21.989 ms
2018-08-28 15:20:09,666 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=11 hop limit=64 time = 19.768 ms
2018-08-28 15:20:09,702 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=12 hop limit=64 time = 22.322 ms
2018-08-28 15:20:09,739 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=13 hop limit=64 time = 23.268 ms
2018-08-28 15:20:09,774 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=14 hop limit=64 time = 23.607 ms
2018-08-28 15:20:09,806 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=15 hop limit=64 time = 19.735 ms
2018-08-28 15:20:09,839 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=16 hop limit=64 time = 20.704 ms
2018-08-28 15:20:09,874 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=17 hop limit=64 time = 21.986 ms
2018-08-28 15:20:09,915 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=18 hop limit=64 time = 25.827 ms
2018-08-28 15:20:09,947 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=19 hop limit=64 time = 21.656 ms
2018-08-28 15:20:09,981 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=20 hop limit=64 time = 21.348 ms
2018-08-28 15:20:10,018 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=21 hop limit=64 time = 23.939 ms
2018-08-28 15:20:10,051 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=22 hop limit=64 time = 20.712 ms
2018-08-28 15:20:10,086 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=23 hop limit=64 time = 22.020 ms
2018-08-28 15:20:10,122 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=24 hop limit=64 time = 23.298 ms
2018-08-28 15:20:10,154 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=25 hop limit=64 time = 19.766 ms
2018-08-28 15:20:10,188 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=26 hop limit=64 time = 21.685 ms
2018-08-28 15:20:10,225 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=27 hop limit=64 time = 23.934 ms
2018-08-28 15:20:10,258 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=28 hop limit=64 time = 20.737 ms
2018-08-28 15:20:10,295 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=29 hop limit=64 time = 23.258 ms
2018-08-28 15:20:10,328 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=30 hop limit=64 time = 21.348 ms
2018-08-28 15:20:10,365 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=31 hop limit=64 time = 23.580 ms
2018-08-28 15:20:10,400 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=32 hop limit=64 time = 21.709 ms
2018-08-28 15:20:10,431 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=33 hop limit=64 time = 19.437 ms
2018-08-28 15:20:10,467 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=34 hop limit=64 time = 23.272 ms
2018-08-28 15:20:10,503 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=35 hop limit=64 time = 23.296 ms
2018-08-28 15:20:10,536 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=36 hop limit=64 time = 20.694 ms
2018-08-28 15:20:10,569 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=37 hop limit=64 time = 20.096 ms
2018-08-28 15:20:10,602 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=38 hop limit=64 time = 20.708 ms
2018-08-28 15:20:10,635 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=39 hop limit=64 time = 20.067 ms
2018-08-28 15:20:10,670 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=40 hop limit=64 time = 22.653 ms
2018-08-28 15:20:10,703 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=41 hop limit=64 time = 20.098 ms
2018-08-28 15:20:10,739 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=42 hop limit=64 time = 23.604 ms
2018-08-28 15:20:10,773 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=43 hop limit=64 time = 20.707 ms
2018-08-28 15:20:10,808 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=44 hop limit=64 time = 22.324 ms
2018-08-28 15:20:10,844 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=45 hop limit=64 time = 21.989 ms
2018-08-28 15:20:10,876 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=46 hop limit=64 time = 20.403 ms
2018-08-28 15:20:10,911 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=47 hop limit=64 time = 23.272 ms
2018-08-28 15:20:10,950 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=48 hop limit=64 time = 25.828 ms
2018-08-28 15:20:10,984 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=49 hop limit=64 time = 21.349 ms
2018-08-28 15:20:11,022 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=50 hop limit=64 time = 22.356 ms
2018-08-28 15:20:11,054 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=51 hop limit=64 time = 22.329 ms
2018-08-28 15:20:11,089 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=52 hop limit=64 time = 22.326 ms
2018-08-28 15:20:11,123 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=53 hop limit=64 time = 21.685 ms
2018-08-28 15:20:11,158 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=54 hop limit=64 time = 21.375 ms
2018-08-28 15:20:11,192 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=55 hop limit=64 time = 21.651 ms
2018-08-28 15:20:11,227 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=56 hop limit=64 time = 22.654 ms
2018-08-28 15:20:11,261 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=57 hop limit=64 time = 21.380 ms
2018-08-28 15:20:11,296 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=58 hop limit=64 time = 22.327 ms
2018-08-28 15:20:11,331 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=59 hop limit=64 time = 22.631 ms
2018-08-28 15:20:11,365 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=60 hop limit=64 time = 20.712 ms
2018-08-28 15:20:11,401 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=61 hop limit=64 time = 23.272 ms
2018-08-28 15:20:11,434 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=62 hop limit=64 time = 21.025 ms
2018-08-28 15:20:11,468 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=63 hop limit=64 time = 20.711 ms
2018-08-28 15:20:11,503 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=64 hop limit=64 time = 22.330 ms
2018-08-28 15:20:11,538 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=65 hop limit=64 time = 22.968 ms
2018-08-28 15:20:11,575 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=66 hop limit=64 time = 23.914 ms
2018-08-28 15:20:11,616 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=67 hop limit=64 time = 22.648 ms
2018-08-28 15:20:11,644 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=68 hop limit=64 time = 21.076 ms
2018-08-28 15:20:11,680 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=69 hop limit=64 time = 22.967 ms
2018-08-28 15:20:11,713 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=70 hop limit=64 time = 20.376 ms
2018-08-28 15:20:11,746 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=71 hop limit=64 time = 21.047 ms
2018-08-28 15:20:11,782 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=72 hop limit=64 time = 21.356 ms
2018-08-28 15:20:11,816 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=73 hop limit=64 time = 22.641 ms
2018-08-28 15:20:11,849 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=74 hop limit=64 time = 20.705 ms
2018-08-28 15:20:11,883 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=75 hop limit=64 time = 21.016 ms
2018-08-28 15:20:11,915 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=76 hop limit=64 time = 20.101 ms
2018-08-28 15:20:11,959 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=77 hop limit=64 time = 24.887 ms
2018-08-28 15:20:11,987 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=78 hop limit=64 time = 21.381 ms
2018-08-28 15:20:12,023 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=79 hop limit=64 time = 22.966 ms
2018-08-28 15:20:12,055 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=80 hop limit=64 time = 19.768 ms
2018-08-28 15:20:12,089 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=81 hop limit=64 time = 21.050 ms
2018-08-28 15:20:12,121 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=82 hop limit=64 time = 19.736 ms
2018-08-28 15:20:12,158 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=83 hop limit=64 time = 24.246 ms
2018-08-28 15:20:12,195 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=84 hop limit=64 time = 23.912 ms
2018-08-28 15:20:12,229 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=85 hop limit=64 time = 21.664 ms
2018-08-28 15:20:12,267 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=86 hop limit=64 time = 23.264 ms
2018-08-28 15:20:12,308 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=87 hop limit=64 time = 24.877 ms
2018-08-28 15:20:12,339 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=88 hop limit=64 time = 23.578 ms
2018-08-28 15:20:12,375 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=89 hop limit=64 time = 23.608 ms
2018-08-28 15:20:12,411 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=90 hop limit=64 time = 22.941 ms
2018-08-28 15:20:12,445 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=91 hop limit=64 time = 20.710 ms
2018-08-28 15:20:12,481 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=92 hop limit=64 time = 23.273 ms
2018-08-28 15:20:12,516 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=93 hop limit=64 time = 23.274 ms
2018-08-28 15:20:12,549 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=94 hop limit=64 time = 20.710 ms
2018-08-28 15:20:12,586 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=95 hop limit=64 time = 23.913 ms
2018-08-28 15:20:12,622 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=96 hop limit=64 time = 23.269 ms
2018-08-28 15:20:12,659 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=97 hop limit=64 time = 22.641 ms
2018-08-28 15:20:12,692 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=98 hop limit=64 time = 22.328 ms
2018-08-28 15:20:12,728 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=99 hop limit=64 time = 23.610 ms
2018-08-28 15:20:12,763 - INFO # 136 bytes from fe80::7b62:548:7cb3:d1a6: id=84 seq=100 hop limit=64 time = 21.686 ms
2018-08-28 15:20:12,773 - INFO # --- fe80::7b62:548:7cb3:d1a6 ping statistics ---
2018-08-28 15:20:12,776 - INFO # 100 packets transmitted, 100 received, 0% packet loss, time 3.06482869 s
2018-08-28 15:20:12,777 - INFO # rtt min/avg/max = 19.437/22.169/25.828 ms

@Josar Josar force-pushed the pr/at86rf2xx_framebuffer branch from 17f87fa to 4c753ec Compare August 28, 2018 21:08
@Josar
Copy link
Contributor Author

Josar commented Aug 28, 2018

@kYc0o i know my last change was wrong so i reverted it. Could you test it again.

But i don`t think this should have an effect to the observed problem.

@kYc0o
Copy link
Contributor

kYc0o commented Aug 29, 2018

But i don`t think this should have an effect to the observed problem.

True, this PR somehow adds a delay between releasing the device and be ready to receive the next packet.

I'm afraid then this behaviour needs more study to catch the real problem.

Copy link
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm blocking it until we find why we experience a performance decrease.

@Josar
Copy link
Contributor Author

Josar commented Sep 11, 2018

I have ping timeouts with the atmega256rfr2 and a atxmega256 with at86rf233 when sending bigger payload.
With the jiminy i have a 98% rate when not on master rebasing to master makes error rate go up. And with the other board on master it is 75%.
One difference i found is that the Acknowledge Request Flag in the 802.15.4 datagram is not set for the xmega board. I don't know why it is disabled and how to enable in, any one a suggestion?

But the test with the old branch compared with master make me think there was a change which impacts this which is not related to this commit.
The good working jiminy was based on 2412c001cf904dbda531bfe91f2b6df7f2091f0d.

@Josar
Copy link
Contributor Author

Josar commented Sep 12, 2018

So activating NETDEV_IEEE802154_ACK_REQ got me 100% received.

I am not sure when this changed and where and if it was on purpose or not.
But in previous builds it was active and now it is not anymore.

@Josar
Copy link
Contributor Author

Josar commented Sep 13, 2018

@kYc0o can you spot a difference when observing the packets with wireshark?

@Josar
Copy link
Contributor Author

Josar commented Sep 19, 2018

@kYc0o please check if the ack_req flag is set, see #9957 .
If not, set it with ifconfig 7 ack_req and test again. For me this resulted in pretty good pings.

@Josar
Copy link
Contributor Author

Josar commented Oct 18, 2018

@kYc0o did you have time to check the ack_req?

@Josar
Copy link
Contributor Author

Josar commented Oct 25, 2018

@kYc0o is it getting better with #10250 merged?

@kYc0o
Copy link
Contributor

kYc0o commented Oct 26, 2018

@Josar I'll rebase my local branch on master to test, would you mind to rebase yours?

@kYc0o kYc0o added Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines labels Oct 26, 2018
@kYc0o
Copy link
Contributor

kYc0o commented Oct 26, 2018

Everything OK with #10250 in. Please squash and rebase.

@kYc0o kYc0o added the Reviewed: 3-testing The PR was tested according to the maintainer guidelines label Oct 26, 2018
This PR sets the tranceiver in PLL_ON state to avoid corruption of the
data in the frame buffer and sets it back to the last state which the
 transceiver had before changing into transmit mode after the data is
read out. This is done to avoid data corruption when `_recv(...)` is
called to retrieve the buffer size and frame buffer protection is released.
@Josar Josar force-pushed the pr/at86rf2xx_framebuffer branch from 8c38b39 to d1261a7 Compare October 26, 2018 17:22
@Josar
Copy link
Contributor Author

Josar commented Oct 26, 2018

Rebased and squashed.

@jia200x
Copy link
Member

jia200x commented Oct 29, 2018

This needs to be backported to the 2018.04-branch as well. I will add the label.

@jia200x jia200x added the Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch label Oct 29, 2018
Copy link
Contributor

@kYc0o kYc0o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK.

@kYc0o kYc0o merged commit fc139f3 into RIOT-OS:master Oct 29, 2018
@jia200x
Copy link
Member

jia200x commented Oct 29, 2018

@Josar thank you for your contribution! Could you open a PR against 2018.10-branch to merge this bugfix in the Release?

@Josar
Copy link
Contributor Author

Josar commented Oct 29, 2018

@jia200x see #10285

But while rebasing for #9172 i had some second thoughts about setting the right mode after reading out the buffer.

As it is now it is hard to understand where the idle state is saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: drivers Area: Device drivers CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Process: needs backport Integration Process: The PR is required to be backported to a release or feature branch Reviewed: 1-fundamentals The fundamentals of the PR were reviewed according to the maintainer guidelines Reviewed: 2-code-design The code design of the PR was reviewed according to the maintainer guidelines Reviewed: 3-testing The PR was tested according to the maintainer guidelines Reviewed: 4-code-style The adherence to coding conventions by the PR were reviewed according to the maintainer guidelines Reviewed: 5-documentation The documentation details of the PR were reviewed according to the maintainer guidelines Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants