zhhyu7 opened a new pull request, #17692:
URL: https://github.com/apache/nuttx/pull/17692

   ## Summary
   Decouple the impact of net_lock between network cards in multi-network card 
scenarios.
   Replace net_lock with smaller locks such as conn_lock, netdev_lock, 
netdev_list_lock, and conn_list_lock to decouple the sending and receiving 
processes between different network cards. In the scenario where multiple CAN 
and Ethernet network cards are registered simultaneously on a single core, 
ensure low latency and minimal jitter for data sending and receiving of CAN 
network cards. 
   
   Since there are a relatively large number of code changes in the overall 
modification, this PR only includes the complete partial code with logical 
dependencies that has been verified locally. Subsequently, performance 
optimization, code format optimization, and modifications to other 
non-NIC-dependent protocols will be submitted through other PRs. This PR is a 
minimal set that can ensure functional integrity, and removing any patch may 
lead to issues with inadequate lock protection in the corresponding module.
   
   The relevant code has been tested in the internal environment for about two 
months.
   
   ## Impact
   Network protocol stack and network card driver.
   
   ## Testing
   sim:matter and cortex-m33 and Infineon board.
   sim test log as below:
   ```
   NuttShell (NSH) NuttX-12.11.0
   MOTD: username=admin password=Administrator
   nsh> ifconfig eth0 10.0.1.2/24
   nsh> ifconfig
   eth0 Link encap:Ethernet HWaddr 42:e1:c4:3f:48:dd at RUNNING mtu 1500
        inet addr:10.0.1.2 DRaddr:10.0.1.1 Mask:255.255.255.0
        inet6 addr: fe80::40e1:c4ff:fe3f:48dd/64
        inet6 DRaddr: fe80::4000:d7ff:fe82:136b
   
                IPv4  IPv6   TCP   UDP  ICMP ICMPv6 CAN
   Received     0006  0011  0000  000e  0000  0009  0000
   Dropped      0000  0000  0000  0000  0000  0007  0000
     IPv4        VHL: 0000   Frg: 0000
     IPv6        VHL: 0000
     Checksum   0000  ----  0000  0000  ----  ----  ----
     TCP         ACK: 0000   SYN: 0000
                 RST: 0000  0000
     Type       0000  0000  ----  ----  0000  0000  ----
   Sent         0000  0008  0000  0000  0000  0008  0000
     Rexmit     ----  ----  0000  ----  ----  ----  ----
   nsh> ping -c 2 10.0.1.1
   PING 10.0.1.1 56 bytes of data
   56 bytes from 10.0.1.1: icmp_seq=0 time=0.0 ms
   56 bytes from 10.0.1.1: icmp_seq=1 time=0.0 ms
   2 packets transmitted, 2 received, 0% packet loss, time 2020 ms
   rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
   nsh> ping -c 2 10.0.1.3
   PING 10.0.1.3 56 bytes of data
   56 bytes from 10.0.1.3: icmp_seq=0 time=20.0 ms
   56 bytes from 10.0.1.3: icmp_seq=1 time=10.0 ms
   2 packets transmitted, 2 received, 0% packet loss, time 2020 ms
   rtt min/avg/max/mdev = 10.000/15.000/20.000/5.000 ms
   nsh> ping -c 2 10.0.1.2
   PING 10.0.1.2 56 bytes of data
   56 bytes from 10.0.1.2: icmp_seq=0 time=0.0 ms
   56 bytes from 10.0.1.2: icmp_seq=1 time=0.0 ms
   2 packets transmitted, 2 received, 0% packet loss, time 2020 ms
   rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
   nsh> iperf -c 10.0.1.1 -B 10.0.1.2
        IP: 10.0.1.2
   
    mode=tcp-client sip=10.0.1.2:5001,dip=10.0.1.1:5001, interval=3, time=30
   
              Interval         Transfer         Bandwidth
   
      0.00-   7.01 sec  440320000 Bytes  502.50 Mbits/sec
      7.01-  11.93 sec  309985280 Bytes  504.04 Mbits/sec
     11.93-  18.46 sec  414121984 Bytes  507.35 Mbits/sec
     18.46-  26.98 sec  539918336 Bytes  506.97 Mbits/sec
     26.98-  34.46 sec  470908928 Bytes  503.65 Mbits/sec
      0.00-  34.46 sec 2226356224 Bytes  516.86 Mbits/sec
   iperf exit
   nsh> iperf -s -B 10.0.1.2
        IP: 10.0.1.2
   
    mode=tcp-server sip=10.0.1.2:5001,dip=0.0.0.0:5001, interval=3, time=0
   accept: 10.0.1.1:55762
   
              Interval         Transfer         Bandwidth
   
      0.00-   3.01 sec  225084204 Bytes  598.23 Mbits/sec
      3.01-   6.32 sec  269714236 Bytes  651.88 Mbits/sec
      6.32-   9.63 sec  262278780 Bytes  633.91 Mbits/sec
   closed by the peer: 10.0.1.1:55762
   iperf exit
   nsh>
   nsh> iperf -s -B 10.0.1.2 -u
        IP: 10.0.1.2
   
    mode=udp-server sip=10.0.1.2:5001,dip=0.0.0.0:5001, interval=3, time=0
   want recv=16384
   accept: 10.0.1.1:52261
   
              Interval         Transfer         Bandwidth
   
      0.00-   3.01 sec    5292000 Bytes   14.07 Mbits/sec
      3.01-   6.02 sec    5309640 Bytes   14.11 Mbits/sec
      6.02-   9.03 sec    5309640 Bytes   14.11 Mbits/sec
      9.03-  12.04 sec    5309640 Bytes   14.11 Mbits/sec
     12.04-  15.05 sec    5309640 Bytes   14.11 Mbits/sec
     15.05-  18.06 sec    5309640 Bytes   14.11 Mbits/sec
     18.06-  21.07 sec    5309640 Bytes   14.11 Mbits/sec
     21.07-  24.08 sec    5309640 Bytes   14.11 Mbits/sec
     24.08-  27.09 sec    5292000 Bytes   14.07 Mbits/sec
     27.09-  30.10 sec    5309640 Bytes   14.11 Mbits/sec
     30.10-  33.11 sec    5309640 Bytes   14.11 Mbits/sec
     33.11-  36.12 sec    5309640 Bytes   14.11 Mbits/sec
     36.12-  39.13 sec    5309640 Bytes   14.11 Mbits/sec
     39.13-  42.14 sec    5309640 Bytes   14.11 Mbits/sec
     42.14-  45.15 sec    5309640 Bytes   14.11 Mbits/sec
     45.15-  48.16 sec    5309640 Bytes   14.11 Mbits/sec
   ```


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to