You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/03/19 16:54:50 UTC

[GitHub] [incubator-nuttx] anchao opened a new pull request #3114: usrsock/recv: guarantee all data is received before close

anchao opened a new pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114


   
   ## Summary
   
   usrsock/recv: guarantee all data is received before close 
   
   adjust the close sequence to avoid data discard
   
   Signed-off-by: chao.an <an...@xiaomi.com>
   
   ## Impact
   
   usrsock recv(2)
   
   ## Testing
   
   Ensure the data can be received completed if send/close occur at the same time on peer
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862058548


   > emm... OK, Seems I do not have the wifi add-on module... mark this PR as draft once I get the wifi module
   
   @anchao 
   Yes, you need the Wi-Fi add-on board.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] acassis commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
acassis commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-812079339


   Converted to Draft, waiting for fix


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-861597954


   Hi @masayuki2009 san,
   
   There is a potential issue in the previous pull request, which will lead to the termination of data reception ahead of time. I have updated this PR. Could you please try this again if feel free? Thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-874510299


   @masayuki2009 could you try the new change work with your hardware?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-861906586


   > Hi @masayuki2009 san,
   > 
   > There is a potential issue in the previous pull request, which will lead to the termination of data reception ahead of time. I have updated this PR. Could you please try this again if feel free? Thank you.
   
   @anchao 
   
   Hmm, I noticed that the telnetd with spresense:wifi does not work correctly.
   
   ```
   $ telnet 192.168.10.22
   Trying 192.168.10.22...
   Connected to 192.168.10.22.
   Escape character is '^]'.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-875153993


   @anchao 
   
   The latest PR works so far.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862035319


   Hi, @masayuki2009 san,
   
   Does gs2200m can work normally on the current mainline? I have updated the bootloader via arduino and flash the firmware compiled by config spresense:wifi, 
   
   ```
   $ sudo ./tools/flash.sh -c /dev/ttyUSB2 -b 500000 ../../nuttx/incubator-nuttx/nuttx.spk 
   WARNING: New loader v2.2.0 is required, please download and install.
            Download URL   : https://developer.sony.com/file/download/download-spresense-firmware-v2-2-000
            Install command:
                             1. Extract loader archive into host PC.
                                ./tools/flash.sh -e <download zip file>
                             2. Flash loader into Board.
                                ./tools/flash.sh -l /home/archer/code/spresense/firmware/spresense -c <port>
   >>> Install files ...
   install -b 500000
   Install ../../nuttx/incubator-nuttx/nuttx.spk
   |0%-----------------------------50%------------------------------100%|
   ######################################################################
   
   335424 bytes loaded.
   Package validation is OK.
   Saving package to "nuttx"
   updater# sync
   updater# Restarting the board ...
   reboot
   ```
   
   but I noticed that the program will assert on board startup:
   
   ```
   [    0.420000] up_assert: Assertion failed at file:wireless/gs2200m.c line: 896 task: init                                                      
   [    0.420000] up_registerdump: R0: 00000001 2d052a78 000000e0 2d055068 2d052a78 2d059870 2d055054 000186a0                                     
   [    0.430000] up_registerdump: R8: 0d046aa2 2d058a00 2d05e270 00000000 00000000 2d059870 0d008003 0d00865c
   [    0.440000] up_registerdump: xPSR: 61000000 BASEPRI: 000000e0 CONTROL: 00000004
   [    0.450000] up_registerdump: EXC_RETURN: ffffffe9
   [    0.450000] up_dumpstate: sp:     2d059870
   [    0.460000] up_dumpstate: IRQ stack:
   [    0.460000] up_dumpstate:   base: 2d051d48
   [    0.470000] up_dumpstate:   size: 00000800
   [    0.470000] up_dumpstate:   used: 000000d0
   [    0.470000] up_dumpstate: User stack:
   [    0.480000] up_dumpstate:   base: 2d058e40
   [    0.480000] up_dumpstate:   size: 00000bf0
   [    0.490000] up_dumpstate:   used: 00000488
   [    0.490000] up_stackdump: 2d059860: 2d059870 2d055054 2d051d48 0d008137 000000e0 00000004 00000000 00000000
   [    0.500000] up_stackdump: 2d059880: 2d059870 0d008003 0d00865c 000186a0 2d051cc4 2d05e270 2d0598f2 2d05e9d0
   [    0.510000] up_stackdump: 2d0598a0: 000186a0 0d046aa2 2d05e9d0 0d005f3b 000000ff 0d039f17 000002a5 1c05dc00
   [    0.520000] up_stackdump: 2d0598c0: ffffffff ffffffff 2d051d0c 00000000 0d04f05c 0d046aa2 2d051d0c 0d039ff7
   [    0.530000] up_stackdump: 2d0598e0: 00000000 0d000c75 8b010101 8b010101 00000007 0d039aed 00000002 0d03ca35
   [    0.540000] up_stackdump: 2d059900: 00000045 2d05e270 0d039aed 2d05e270 0d04f05c 2d05e270 0d04f05c 0d046aa2
   [    0.550000] up_stackdump: 2d059920: 2d051d0c 0d046aa2 00000000 00000000 00000000 0d03b1f3 2d059988 041014a0
   [    0.560000] up_stackdump: 2d059940: 041014a0 00000006 2d051d0c 2d059978 00000005 2d0543e8 2d051d0c 2d059978
   [    0.570000] up_stackdump: 2d059960: 00000005 2d0543e8 2d051d0c 0d032c39 00000057 00000005 97010104 99010104
   [    0.580000] up_stackdump: 2d059980: 9b010104 9d010105 0d051988 00000000 2d0599d0 0d04efbc 0d051988 0d000000
   [    0.590000] up_stackdump: 2d0599a0: 0d051988 0d0326ab 00000000 deadbeef deadbeef 00000000 00000000 43410000
   [    0.600000] up_stackdump: 2d0599c0: a3000100 a5000100 a7000100 a9000100 ab000100 ad000100 00000000 2d058e30
   [    0.610000] up_stackdump: 2d0599e0: 0d051988 0d01d44d 00000001 0d00fcab 00000000 00000000 00000000 00000064
   [    0.620000] up_stackdump: 2d059a00: 0d041bbc 00000001 00000000 2d052a38 0d00d99d 0d006141 0d00d99d 00000001
   [    0.630000] up_stackdump: 2d059a20: 00000000 0d00441d 00000000 00000000 3e8b8dc6 97f71afd 000000b0 80000c40
   [    0.640000] up_taskdump: Idle Task: PID=0 Stack Used=320 of 976
   [    0.640000] up_taskdump: hpwork: PID=1 Stack Used=324 of 2032
   [    0.650000] up_taskdump: lpwork: PID=2 Stack Used=324 of 2032
   [    0.650000] up_taskdump: init: PID=3 Stack Used=1160 of 3056
   [    0.660000] up_taskdump: cxd56_pm_task: PID=4 Stack Used=400 of 1000
   
   ```
   
   https://github.com/apache/incubator-nuttx/blob/69fce77718ab564c16a47f4891f0f4e814de068a/drivers/wireless/gs2200m.c#L896
   
   the value of res[1]  in case here is 0xFF, the trace as below:
   
   ```
   gs2200m_initialize
   |
    -->gs2200m_start
       |
        -->gs2200m_recv_pkt
           |
            -->gs2200m_hal_read
               |
                -->_read_data_len
                   |
                    -->ASSERT
   ```
   
   Do you have any suggestions? I am not sure what I missed  


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 merged pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 merged pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862124601


   @xiaoxiang781216 
   We recommend the following online shop.
   https://www.chip1stop.com/USA/en/view/dispDetail/DispDetail?partId=IDYC-0000001
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862114672


   > > > emm... OK, Seems I do not have the wifi add-on module... mark this PR as draft once I get the wifi module
   > > 
   > > 
   > > @anchao
   > > Yes, you need the Wi-Fi add-on board.
   > 
   > @masayuki2009 we just have spresense main board, and it's hard to buy wifi board in China. It will take at least two weeks to buy from Japan Amazon. Do you have FAE in China who can borrow one board for testing?
   
   @xiaoxiang781216 
   According to the Spresense team, you have to buy the Wi-Fi add-on board from Japan.
   Sorry for the inconvenience.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-861974906


   > Hmm, I noticed that the telnetd with spresense:wifi does not work correctly.
   
   Hi, @masayuki2009  san,
   
   Thanks for the quick reply, give me some time I will try to setup the spresense board to reproduce this issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862184434


   @masayuki2009 could you help us debugging the change before the board arrive our office? The change look reasonable and we find that the receive side has chance to lose the last serveral bytes in the presure test.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-874551078


   > @masayuki2009 could you try the new change work with your hardware?
   
   @anchao @xiaoxiang781216 
   Sure but could you rebase the branch to the latest master? 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862054818


   emm... OK, Seems I do not have the wifi add-on module... mark this PR as draft once I get the wifi module


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] jerpelea commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
jerpelea commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862150081


   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-874510299


   @masayuki2009 could you try the new change work with your hardware?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 edited a comment on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 edited a comment on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862124601


   @xiaoxiang781216 
   We recommend the following online shop.
   https://www.chip1stop.com/view/dispDetail/DispDetail?lang=en&cont=CHN&partId=IDYC-0000001&mpn=SPRESENSE+Wi-Fi+%2F+iS110B
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] jerpelea removed a comment on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
jerpelea removed a comment on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862150081


   LGTM


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-874551078


   > @masayuki2009 could you try the new change work with your hardware?
   
   @anchao @xiaoxiang781216 
   Sure but could you rebase the branch to the latest master? 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] xiaoxiang781216 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-862065872


   > > emm... OK, Seems I do not have the wifi add-on module... mark this PR as draft once I get the wifi module
   > 
   > @anchao
   > Yes, you need the Wi-Fi add-on board.
   
   @masayuki2009 we just have spresense main board, and it's hard to buy wifi board in China. It will take at least two weeks to buy from Japan Amazon. Do you have FAE in China who can borrow one board for testing?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] anchao commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
anchao commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-874751217


   > > @masayuki2009 could you try the new change work with your hardware?
   > 
   > @anchao @xiaoxiang781216
   > Sure but could you rebase the branch to the latest master?
   
   @masayuki2009 san, I rebase the PR to the master, please help to verify, thank you.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [incubator-nuttx] masayuki2009 commented on pull request #3114: usrsock/recv: guarantee all data is received before close

Posted by GitBox <gi...@apache.org>.
masayuki2009 commented on pull request #3114:
URL: https://github.com/apache/incubator-nuttx/pull/3114#issuecomment-803700810


   @anchao 
   
   I tried this PR with spresense:wifi but I noticed that telnet connection is unstable.
   
   ```
   $ telnet 192.168.10.21
   Trying 192.168.10.21...
   Connected to 192.168.10.21.
   Escape character is '^]'.
   
   NuttShell (NSH) NuttX-3.6.1
   nsh> ps
     PID PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK   STACK   USED  FILLED COMMAND
       0   0 FIFO     Kthread N-- Ready              00000000 001024 000324  31.6%  Idle Task
       1 224 RR       Kthread --- Waiting  Signal    00000000 002036 000596  29.2%  hpwork
       2  60 RR       Kthread --- Waiting  Signal    00000000 002036 000828  40.6%  lpwork
       3 100 RR       Task    --- Waiting  Semaphore 00000000 003060 001540  50.3%  init
       4 200 RR       Task    --- Waiting  MQ empty  00000000 001004 000400  39.8%  cxd56_pm_task
       5  50 RR       Task    --- Ready              00000000 002004 001356  67.6%  gs2200m raspi3-g wifi-test-24g
       8 100 RR       Task    --- Waiting  Semaphore 00000000 002012 000596  29.6%  Telnet daemon 0xd05d580
       9 100 RR       Kthread --- Waiting  Semaphore 00000000 001004 000540  53.7%  telnet_io
      10 100 RR       Task    --- Running            00000000 002028 001276  62.9%  Telnet session
   nsh> free
   
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org