Skip to content

RockPro64 - Firewall mit zwei LAN Schnittstellen!

Verschoben ROCKPro64
  • Ich benutze ja schon länger für verschiedene Einsatzzwecke USB3-to-LAN-Schnittstellen. Einen dieser Adapter, habe ich schon jahrelang an meiner IPFire (IntelNUC).

    Nun wollte ich mal versuchen, wie das so aussieht am ROCKPro64. Wird sie erkannt, läuft sie, was für Probleme tauchen auf usw. Ich habe mich so ziemlich an folgenden Beitrag gehalten https://forum.frank-mankel.org/topic/120/ubuntu-bionic-ip-adresse-ändern

    Also, was haben wir vor? Zwei Schnittstellen, eth0 holt sich per DHCP die Informationen aus meinem LAN. Die Schnittstelle enx000acd26e2c8 bildet ein LAN, das ganze soll durch iptables geschützt sein. Kein Zugriff von außen!

    Hardware

    • ROCKPro64 v2.1 2GB RAM
    • USB-to-LAN DeLock 62121

    Software

    rock64@rockpro64v2_1:/etc$ uname -a
    Linux rockpro64v2_1 4.4.132-1077-rockchip-ayufan-gbaf35a9343cb #1 SMP Mon Jul 30 14:06:57 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux
    

    Schnittstellen

    eth0

    • DHCP
    • 192.168.3.x

    enx000acd26e2c8

    • 192.168.0.0/24

    Ähm, kleine Anmerkung: Geht das nicht einheitlich, also eth0,eth1 usw. Ich glaube das ist veraltet, das neue ist dann dieses enx000acd26e2c8. Also, einheitlich wäre mir lieber!?!

    Hier die Lösung.

    Konfiguration netplan

    /etc/netplan/eth0.yaml

    network:
      version: 2
      renderer: networkd
      ethernets:
        eth0:
          dhcp4: true
        enx000acd26e2c8:
          dhcp4: no
          addresses: [192.168.0.1/24]
    

    Netzwerk neustarten

    Direkt mit

    netplan apply      
    

    oder mit

    netplan try
    

    netplan try ermöglicht, das man eine falsche Konfiguration automatisch wieder zurücksetzen lassen kann.

    Nach dem Neustart sieht das dann so aus.

    rock64@rockpro64v2_1:~$ ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host 
           valid_lft forever preferred_lft forever
    2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN group default qlen 1000
        link/ether 1e:0e:99:52:8e:40 brd ff:ff:ff:ff:ff:ff
        inet 192.168.3.17/24 brd 192.168.3.255 scope global dynamic eth0
           valid_lft 2224sec preferred_lft 2224sec
        inet6 fe80::1c0e:99ff:fe52:8e40/64 scope link 
           valid_lft forever preferred_lft forever
    3: enx000acd26e2c8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
        link/ether 00:0a:cd:26:e2:c8 brd ff:ff:ff:ff:ff:ff
        inet 192.168.0.1/24 brd 192.168.0.255 scope global enx000acd26e2c8
           valid_lft forever preferred_lft forever
        inet6 fe80::20a:cdff:fe26:e2c8/64 scope link 
           valid_lft forever preferred_lft forever
    

    Konfiguration iptables

    Dazu erstellen wir ein Script /etc/firewall.sh

    #!/bin/sh
    # This is a more complex setup, for a home firewall:
    # * One interface plug to the ISP conection (eth0). Using DHCP.
    # * One interface plug to the local LAN switch (eth1). Using 192.168.0.0/24.
    # * Traffic open from the LAN to the SSH in the firewall.
    # * Traffic open and translated, from the local LAN to internet.
    # * Traffic open from internet, to a local web server.
    # * Logging of dropped traffic, using a specific ''log level'' to configure a separate file in syslog/rsyslog.
    
    PATH='/sbin'
    
    ## INIT
    
    # Flush previous rules, delete chains and reset counters
    iptables -F
    iptables -X
    iptables -Z
    iptables -t nat -F
    
    # Default policies
    iptables -P INPUT DROP
    iptables -P OUTPUT DROP
    iptables -P FORWARD DROP
    
    echo -n '1' > /proc/sys/net/ipv4/ip_forward
    echo -n '0' > /proc/sys/net/ipv4/conf/all/accept_source_route
    echo -n '0' > /proc/sys/net/ipv4/conf/all/accept_redirects
    echo -n '1' > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
    echo -n '1' > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
    
    # Enable loopback traffic
    iptables -A INPUT -i lo -j ACCEPT
    iptables -A OUTPUT -o lo -j ACCEPT
    
    # Enable statefull rules (after that, only need to allow NEW conections)
    iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
    iptables -A OUTPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
    iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
    
    # Drop invalid state packets
    iptables -A INPUT -m conntrack --ctstate INVALID -j DROP
    iptables -A OUTPUT -m conntrack --ctstate INVALID -j DROP
    iptables -A FORWARD -m conntrack --ctstate INVALID -j DROP
    
    ## INPUT
    
    # Incoming ssh from the LAN
    iptables -A INPUT -i enx000acd26e2c8 -s 192.168.0.0/24 \
    -p tcp --dport 22 -m conntrack --ctstate NEW -j ACCEPT
       
    # Allow any connection from this host.
    iptables -A INPUT -i lo -j ACCEPT
       
    # Allow any connection from the local network.
    iptables -A INPUT -s 192.168.0.0/24 -j ACCEPT
      
    # Allow all broadcast traffic.
    iptables -A INPUT -m pkttype --pkt-type broadcast -j ACCEPT
       
    ## OUTPUT
      
    # Enable al outgoing traffic to internet
    iptables -A OUTPUT -o eth0 -d 192.16.3.0/0 -j ACCEPT
       
    # Enable access traffic, from the firewall to the LAN network
    iptables -A OUTPUT -o enx000acd26e2c8 -d 192.168.0.0/24 -j ACCEPT
    
    ## FORWARD
          
    # We have dynamic IP (DHCP), so we've to masquerade
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    iptables -A FORWARD -o eth0 -i enx000acd26e2c8 -s 192.168.0.0/24 \
    -m conntrack --ctstate NEW -j ACCEPT
          
    # Redirect HTTP (tcp/80) to the web server (192.168.0.2)
    #iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 \
    # -j DNAT --to-destination 192.168.0.2:80
    #
    #iptables -A FORWARD -i eth0 -p tcp --dport 80 \
    # -o eth1 -d 192.168.0.2 \
    # -m conntrack --ctstate NEW -j ACCEPT
          
    ## LOGGING
          
    iptables -A INPUT -j LOG --log-level 4 --log-prefix '[FW INPUT]: '
    iptables -A OUTPUT -j LOG --log-level 4 --log-prefix '[FW OUTPUT]: '
    iptables -A FORWARD -j LOG --log-level 4 --log-prefix '[FW FORWARD ]: '
    

    Das starten wir nun mal zum Testen.

    sudo chmod +x firewall.sh
    sudo ./firewall.sh
    

    Achtung! Die offene Konsole bleibt bestehen, aber einmal den ROCKPro64 neustarten und die Konsole ist weg. Dann hilft nur noch die serielle Schnittstelle, oder ein angeschlossenes Notebook am LAN. Wenn denn alles funktioniert 😉 Also Konsole nicht zumachen!!

    Nun kann man testen ob alles so funktioniert, wie es soll. Sollte dies nun alles problemlos funktionieren schreiben wir ein Script, so das das Firewall-Script automatisch beim Starten des ROCKPro64 ausgeführt wird.

    Unter /etc/rc.local folgendes Script erstellen.

    #!/bin/sh
    #
    # rc.local
    #
    # This script is executed at the end of each multiuser runlevel.
    # Make sure that the script will "exit 0" on success or any other
    # value on error.
    #
    # In order to enable or disable this script just change the execution
    # bits.
    #
    # By default this script does nothing.
    
    set -e
    
    # Launch my netfilter rules
    if [ -e '/etc/firewall.sh' ]
    then
    /bin/sh '/etc/firewall.sh'
    fi
    
    exit 0
    

    Rechte entsprechend anpassen.

    sudo chmod +x rc.local
    

    Danach den Rechner neu starten. Macht dies bitte ganz zum Schluss, wenn alles klappt.


    Sollen die Rechner im LAN (enx000acd26e2c8) automatisch eine IP-Adresse bekommen, so brauchen wir einen DHCP-Server, der diese an die entsprechenden Teilnehmer verteilt.

    DHCP-Server

    Nach einer kurzen Testphase, habe ich begriffen, das man DNSMASQ nur mit tiefgreifenden Änderungen am Grundsystem von Ubuntu 18.04.1 benutzen kann. Da scheint es doch viele Änderungen gegeben zu haben. Da ich zu viele Änderungen am Grundsystem nicht mag, muss ich mich wohl oder übel mit den neuen Sachen vertraut machen.

    Nach Recherche im Netz habe ich den hoffentlich richtigen DHCP-Server gefunden.

    Installation

    sudo apt-get install isc-dhcp-server

    Konfiguration /etc/dhcp/dhcpd.conf

    Der DHCP-Server stellt auf der enx000acd26e2c8-Schnittstelle IP-Adressen zur Verfügung. Die 3.1 ist mein DNS-Server im lokalen Netz.(eth0)

    # Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
    
    # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
    #DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
    #DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
    
    # Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
    #DHCPDv4_PID=/var/run/dhcpd.pid
    #DHCPDv6_PID=/var/run/dhcpd6.pid
    
    # Additional options to start dhcpd with.
    # Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
    #OPTIONS=""
    
    # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
    # Separate multiple interfaces with spaces, e.g. "eth0 eth1".
    INTERFACESv4="enx000acd26e2c8";
    INTERFACESv6="";
    
    #authoritative;
        
    # Sample /etc/dhcpd.conf
    # (add your comments here) 
    default-lease-time 600;
    max-lease-time 7200;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.0.255;
    option routers 192.168.0.1;
    option domain-name-servers 192.168.3.1, 1.1.1.1;
    option domain-name "mydomain.example";
    
    subnet 192.168.0.0 netmask 255.255.255.0 {
    range 192.168.0.10 192.168.0.100;
    #range 192.168.1.10 192.168.1.20;
    }
    

    Ich hatte ein paar Probleme mit der Konfig, weil da ; fehlten. Mit folgendem Befehl kann man die Konfig testen.

    dhcpd -t -cf /etc/dhcp/dhcpd.conf   
    

    Starten

    sudo service isc-dhcp-server start
    

    Status

    sudo service isc-dhcp-server status
    

    Am Ende klappt alles so, wie ich es mir vorgestellt habe.

    Speedtest

    Konsole

    rock64@rockpro64v2_1:~$ iperf3 -c 192.168.3.213
    Connecting to host 192.168.3.213, port 5201
    [  4] local 192.168.3.17 port 45344 connected to 192.168.3.213 port 5201
    [ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
    [  4]   0.00-1.01   sec   108 MBytes   890 Mbits/sec    0   5.65 MBytes       
    [  4]   1.01-2.00   sec   114 MBytes   964 Mbits/sec    0   5.65 MBytes       
    [  4]   2.00-3.00   sec   112 MBytes   942 Mbits/sec    0   5.65 MBytes       
    [  4]   3.00-4.00   sec   112 MBytes   940 Mbits/sec   11   2.82 MBytes       
    [  4]   4.00-5.01   sec   112 MBytes   943 Mbits/sec    0   2.82 MBytes       
    [  4]   5.01-6.00   sec   111 MBytes   937 Mbits/sec   11   1.41 MBytes       
    [  4]   6.00-7.00   sec   112 MBytes   941 Mbits/sec   11    723 KBytes       
    [  4]   7.00-8.00   sec   112 MBytes   943 Mbits/sec   11    363 KBytes       
    [  4]   8.00-9.01   sec   112 MBytes   943 Mbits/sec    0    416 KBytes       
    [  4]   9.01-10.00  sec   111 MBytes   936 Mbits/sec   11    300 KBytes       
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bandwidth       Retr
    [  4]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec   55             sender
    [  4]   0.00-10.00  sec  1.09 GBytes   935 Mbits/sec                  receiver
    
    iperf Done.
    rock64@rockpro64v2_1:~$ iperf3 -c 192.168.3.213 -R
    Connecting to host 192.168.3.213, port 5201
    Reverse mode, remote host 192.168.3.213 is sending
    [  4] local 192.168.3.17 port 45348 connected to 192.168.3.213 port 5201
    [ ID] Interval           Transfer     Bandwidth
    [  4]   0.00-1.00   sec   110 MBytes   922 Mbits/sec                  
    [  4]   1.00-2.00   sec   112 MBytes   941 Mbits/sec                  
    [  4]   2.00-3.00   sec   112 MBytes   939 Mbits/sec                  
    [  4]   3.00-4.00   sec   111 MBytes   932 Mbits/sec                  
    [  4]   4.00-5.00   sec   112 MBytes   941 Mbits/sec                  
    [  4]   5.00-6.00   sec   112 MBytes   941 Mbits/sec                  
    [  4]   6.00-7.00   sec   112 MBytes   941 Mbits/sec                  
    [  4]   7.00-8.00   sec   112 MBytes   941 Mbits/sec                  
    [  4]   8.00-9.00   sec   112 MBytes   942 Mbits/sec                  
    [  4]   9.00-10.00  sec   112 MBytes   941 Mbits/sec                  
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bandwidth       Retr
    [  4]   0.00-10.00  sec  1.09 GBytes   939 Mbits/sec    0             sender
    [  4]   0.00-10.00  sec  1.09 GBytes   938 Mbits/sec                  receiver
    
    iperf Done.
    

    LAN Notebook

    frank@thinkpad:~$ iperf3 -c 192.168.3.213
    Connecting to host 192.168.3.213, port 5201
    [  4] local 192.168.0.10 port 38566 connected to 192.168.3.213 port 5201
    [ ID] Interval           Transfer     Bandwidth       Retr  Cwnd
    [  4]   0.00-1.00   sec  58.5 MBytes   491 Mbits/sec   91   1.19 MBytes       
    [  4]   1.00-2.00   sec  57.9 MBytes   485 Mbits/sec    0   1.32 MBytes       
    [  4]   2.00-3.00   sec  57.7 MBytes   484 Mbits/sec    0   1.42 MBytes       
    [  4]   3.00-4.00   sec  57.8 MBytes   485 Mbits/sec    1   1.05 MBytes       
    [  4]   4.00-5.00   sec  58.0 MBytes   487 Mbits/sec    0   1.13 MBytes       
    [  4]   5.00-6.00   sec  57.9 MBytes   485 Mbits/sec    0   1.18 MBytes       
    [  4]   6.00-7.00   sec  58.0 MBytes   486 Mbits/sec    0   1.22 MBytes       
    [  4]   7.00-8.00   sec  58.0 MBytes   486 Mbits/sec    0   1.24 MBytes       
    [  4]   8.00-9.00   sec  57.9 MBytes   485 Mbits/sec    0   1.25 MBytes       
    [  4]   9.00-10.00  sec  57.8 MBytes   485 Mbits/sec    0   1.26 MBytes       
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bandwidth       Retr
    [  4]   0.00-10.00  sec   579 MBytes   486 Mbits/sec   92             sender
    [  4]   0.00-10.00  sec   577 MBytes   484 Mbits/sec                  receiver
    
    iperf Done.
    frank@thinkpad:~$ iperf3 -c 192.168.3.213 -R
    Connecting to host 192.168.3.213, port 5201
    Reverse mode, remote host 192.168.3.213 is sending
    [  4] local 192.168.0.10 port 38570 connected to 192.168.3.213 port 5201
    [ ID] Interval           Transfer     Bandwidth
    [  4]   0.00-1.00   sec  73.4 MBytes   615 Mbits/sec                  
    [  4]   1.00-2.00   sec  91.9 MBytes   771 Mbits/sec                  
    [  4]   2.00-3.00   sec  90.6 MBytes   760 Mbits/sec                  
    [  4]   3.00-4.00   sec  91.5 MBytes   767 Mbits/sec                  
    [  4]   4.00-5.00   sec  90.6 MBytes   760 Mbits/sec                  
    [  4]   5.00-6.00   sec  91.5 MBytes   767 Mbits/sec                  
    [  4]   6.00-7.00   sec  90.5 MBytes   759 Mbits/sec                  
    [  4]   7.00-8.00   sec  91.7 MBytes   769 Mbits/sec                  
    [  4]   8.00-9.00   sec  91.7 MBytes   769 Mbits/sec                  
    [  4]   9.00-10.00  sec  91.2 MBytes   765 Mbits/sec                  
    - - - - - - - - - - - - - - - - - - - - - - - - -
    [ ID] Interval           Transfer     Bandwidth       Retr
    [  4]   0.00-10.00  sec   896 MBytes   752 Mbits/sec    0             sender
    [  4]   0.00-10.00  sec   895 MBytes   751 Mbits/sec                  receiver
    
    iperf Done.
    

    Fazit

    War mal wieder ein hartes Stück Arbeit. Und an alle Experten, die das hier lesen, wenn was falsch ist freue ich mich über konstruktive Kritik.

    Und für Einsteiger, bitte nutzt das so nicht an einer Internetleitung. Damit der Server sicher ist benötigt es noch viel mehr Arbeit. Dazu gibt es viele Hilfeseiten im Netz.

    Links

    https://linoxide.com/linux-how-to/install-configure-dhcp-ubuntu/

  • 0 Stimmen
    1 Beiträge
    94 Aufrufe
    Niemand hat geantwortet
  • ROCKPro64 - USB-C -> LAN

    ROCKPro64
    1
    0 Stimmen
    1 Beiträge
    277 Aufrufe
    Niemand hat geantwortet
  • ROCKPro64 - USB-C -> HDMi

    ROCKPro64
    3
    0 Stimmen
    3 Beiträge
    409 Aufrufe
    FrankMF

    @hannescam Hallo! Das ist ja schon ein paar Tage her, gut das wir den Screenshot haben. Du könntest genau diese Kernel-Version vom Kamil suchen und benutzen. Da musste man kein Linux Held sein, Kable einstecken - Bild da.

    Ob das mit was Aktuellerem geht, weiß ich nicht. Debian kann man ja so installieren, wie findest Du hier im Forum. Ob Debian die USB-C Schnittstelle nutzt weiß ich nicht. muss man ausprobieren.

    Da für mich die Platinen immer nur ohne Desktop Sinn gemacht haben, habe ich so was immer nur ganz kurz angetestet. Nutze die SOCs eigentlich ausschließlich Headless.

  • 0 Stimmen
    8 Beiträge
    1k Aufrufe
    FrankMF

    Die Verlinkung hatte ich überlesen, sorry.

    Es gibt nur eine Handvoll Karten, die im PCIe Port funktionieren. Warum, kann ich dir leider nicht beantworten. Es liegt aber mit Sicherheit an falschen Einstellungen im Kernel und an fehlenden Treibern. Ich habe hier auch eine andere Karte rumliegen, die erzeugt immer nur eine Kernel Panic 😞

    In diesem Thread steht einiges was geht und was nicht.
    https://forum.pine64.org/showthread.php?tid=6459

  • ROCKPro64 - Armbian Desktop Variante

    Verschoben Armbian
    1
    0 Stimmen
    1 Beiträge
    502 Aufrufe
    Niemand hat geantwortet
  • ROCKPro64 - kein WLan-Modul möglich?

    ROCKPro64
    4
    0 Stimmen
    4 Beiträge
    2k Aufrufe
    FrankMF

    Heute, 5 Monate später, kann ich bestätigen das WLan möglich ist 🙂 Getestet auf einem ROCKPro64 v2.1 mit 2GB RAM.

    Eine Vorabversion von Recalbox machte es das erste Mal für mich möglich das WLan zu benutzen. Bericht

    Und PCIe ist abgeschaltet im dts File.

    pcie-phy { compatible = "rockchip,rk3399-pcie-phy"; #phy-cells = <0x0>; rockchip,grf = <0x15>; clocks = <0x8 0x8a>; clock-names = "refclk"; resets = <0x8 0x87>; reset-names = "phy"; status = "disabled"; phandle = <0x8b>; }; pcie@f8000000 { compatible = "rockchip,rk3399-pcie"; #address-cells = <0x3>; #size-cells = <0x2>; aspm-no-l0s; clocks = <0x8 0xc5 0x8 0xc4 0x8 0x147 0x8 0xa0>; clock-names = "aclk", "aclk-perf", "hclk", "pm"; bus-range = <0x0 0x1f>; max-link-speed = <0x2>; linux,pci-domain = <0x0>; msi-map = <0x0 0x89 0x0 0x1000>; interrupts = <0x0 0x31 0x4 0x0 0x0 0x32 0x4 0x0 0x0 0x33 0x4 0x0>; interrupt-names = "sys", "legacy", "client"; #interrupt-cells = <0x1>; interrupt-map-mask = <0x0 0x0 0x0 0x7>; interrupt-map = <0x0 0x0 0x0 0x1 0x8a 0x0 0x0 0x0 0x0 0x2 0x8a 0x1 0x0 0x0 0x0 0x3 0x8a 0x2 0x0 0x0 0x0 0x4 0x8a 0x3>; phys = <0x8b>; phy-names = "pcie-phy"; ranges = <0x83000000 0x0 0xfa000000 0x0 0xfa000000 0x0 0x1e00000 0x81000000 0x0 0xfbe00000 0x0 0xfbe00000 0x0 0x100000>; reg = <0x0 0xf8000000 0x0 0x2000000 0x0 0xfd000000 0x0 0x1000000>; reg-names = "axi-base", "apb-base"; resets = <0x8 0x82 0x8 0x83 0x8 0x84 0x8 0x85 0x8 0x86 0x8 0x81 0x8 0x80>; reset-names = "core", "mgmt", "mgmt-sticky", "pipe", "pm", "pclk", "aclk"; status = "disabled";

    Also bleibt weiterhin ungeklärt, ob auch beides zusammen möglich ist. Also gleichzeitig das WLan-Modul und eine PCIe Karte.

  • stretch-minimal-rockpro64

    Verschoben Linux
    3
    0 Stimmen
    3 Beiträge
    982 Aufrufe
    FrankMF

    Mal ein Test was der Speicher so kann.

    rock64@rockpro64:~/tinymembench$ ./tinymembench tinymembench v0.4.9 (simple benchmark for memory throughput and latency) ========================================================================== == Memory bandwidth tests == == == == Note 1: 1MB = 1000000 bytes == == Note 2: Results for 'copy' tests show how many bytes can be == == copied per second (adding together read and writen == == bytes would have provided twice higher numbers) == == Note 3: 2-pass copy means that we are using a small temporary buffer == == to first fetch data into it, and only then write it to the == == destination (source -> L1 cache, L1 cache -> destination) == == Note 4: If sample standard deviation exceeds 0.1%, it is shown in == == brackets == ========================================================================== C copy backwards : 2812.7 MB/s C copy backwards (32 byte blocks) : 2811.9 MB/s C copy backwards (64 byte blocks) : 2632.8 MB/s C copy : 2667.2 MB/s C copy prefetched (32 bytes step) : 2633.5 MB/s C copy prefetched (64 bytes step) : 2640.8 MB/s C 2-pass copy : 2509.8 MB/s C 2-pass copy prefetched (32 bytes step) : 2431.6 MB/s C 2-pass copy prefetched (64 bytes step) : 2424.1 MB/s C fill : 4887.7 MB/s (0.5%) C fill (shuffle within 16 byte blocks) : 4883.0 MB/s C fill (shuffle within 32 byte blocks) : 4889.3 MB/s C fill (shuffle within 64 byte blocks) : 4889.2 MB/s --- standard memcpy : 2807.3 MB/s standard memset : 4890.4 MB/s (0.3%) --- NEON LDP/STP copy : 2803.7 MB/s NEON LDP/STP copy pldl2strm (32 bytes step) : 2802.1 MB/s NEON LDP/STP copy pldl2strm (64 bytes step) : 2800.7 MB/s NEON LDP/STP copy pldl1keep (32 bytes step) : 2745.5 MB/s NEON LDP/STP copy pldl1keep (64 bytes step) : 2745.8 MB/s NEON LD1/ST1 copy : 2801.9 MB/s NEON STP fill : 4888.9 MB/s (0.3%) NEON STNP fill : 4850.1 MB/s ARM LDP/STP copy : 2803.8 MB/s ARM STP fill : 4893.0 MB/s (0.5%) ARM STNP fill : 4851.7 MB/s ========================================================================== == Framebuffer read tests. == == == == Many ARM devices use a part of the system memory as the framebuffer, == == typically mapped as uncached but with write-combining enabled. == == Writes to such framebuffers are quite fast, but reads are much == == slower and very sensitive to the alignment and the selection of == == CPU instructions which are used for accessing memory. == == == == Many x86 systems allocate the framebuffer in the GPU memory, == == accessible for the CPU via a relatively slow PCI-E bus. Moreover, == == PCI-E is asymmetric and handles reads a lot worse than writes. == == == == If uncached framebuffer reads are reasonably fast (at least 100 MB/s == == or preferably >300 MB/s), then using the shadow framebuffer layer == == is not necessary in Xorg DDX drivers, resulting in a nice overall == == performance improvement. For example, the xf86-video-fbturbo DDX == == uses this trick. == ========================================================================== NEON LDP/STP copy (from framebuffer) : 602.5 MB/s NEON LDP/STP 2-pass copy (from framebuffer) : 551.6 MB/s NEON LD1/ST1 copy (from framebuffer) : 667.1 MB/s NEON LD1/ST1 2-pass copy (from framebuffer) : 605.6 MB/s ARM LDP/STP copy (from framebuffer) : 445.3 MB/s ARM LDP/STP 2-pass copy (from framebuffer) : 428.8 MB/s ========================================================================== == Memory latency test == == == == Average time is measured for random memory accesses in the buffers == == of different sizes. The larger is the buffer, the more significant == == are relative contributions of TLB, L1/L2 cache misses and SDRAM == == accesses. For extremely large buffer sizes we are expecting to see == == page table walk with several requests to SDRAM for almost every == == memory access (though 64MiB is not nearly large enough to experience == == this effect to its fullest). == == == == Note 1: All the numbers are representing extra time, which needs to == == be added to L1 cache latency. The cycle timings for L1 cache == == latency can be usually found in the processor documentation. == == Note 2: Dual random read means that we are simultaneously performing == == two independent memory accesses at a time. In the case if == == the memory subsystem can't handle multiple outstanding == == requests, dual random read has the same timings as two == == single reads performed one after another. == ========================================================================== block size : single random read / dual random read 1024 : 0.0 ns / 0.0 ns 2048 : 0.0 ns / 0.0 ns 4096 : 0.0 ns / 0.0 ns 8192 : 0.0 ns / 0.0 ns 16384 : 0.0 ns / 0.0 ns 32768 : 0.0 ns / 0.0 ns 65536 : 4.5 ns / 7.2 ns 131072 : 6.8 ns / 9.7 ns 262144 : 9.8 ns / 12.8 ns 524288 : 11.4 ns / 14.7 ns 1048576 : 16.0 ns / 22.6 ns 2097152 : 114.0 ns / 175.3 ns 4194304 : 161.7 ns / 219.9 ns 8388608 : 190.7 ns / 241.5 ns 16777216 : 205.3 ns / 250.5 ns 33554432 : 212.9 ns / 255.5 ns 67108864 : 222.3 ns / 271.1 ns
  • Vorserienmodell

    ROCKPro64
    1
    0 Stimmen
    1 Beiträge
    529 Aufrufe
    Niemand hat geantwortet