So I ran some more tests:
with that Applicatta quattro board and the TX2 develoment board I get this results. Note that I am not using iflag=direct, which I don’t know why but seems to impact the results a lot, making it much faster:
These results are basically reading 1GB with different block sizes and without the iflag=direct
nvidia@tegra-ubuntu:~$ ./test_speeds.sh
1M block
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.14724 s, 914 MB/s
10M block
100+0 records in
100+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.41301 s, 742 MB/s
100M block
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.18232 s, 887 MB/s
1000M block
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.82126 s, 576 MB/s
These results are basically reading 1GB with different block sizes and with the iflag=direct
1M block
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 2.14356 s, 489 MB/s
10M block
100+0 records in
100+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 0.832407 s, 1.3 GB/s
100M block
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 0.768115 s, 1.4 GB/s
1000M block
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.08226 s, 969 MB/s
These results are basically reading 5GB with different block sizes and with the iflag=direct
1M block
5000+0 records in
5000+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 11.0604 s, 474 MB/s
10M block
500+0 records in
500+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 4.17893 s, 1.3 GB/s
100M block
50+0 records in
50+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 3.69602 s, 1.4 GB/s
1000M block
5+0 records in
5+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 3.73779 s, 1.4 GB/s
These are still not Gen2x4 speeds, but they are much better. According to lspci my SSDs have still negotiated to Gen2x4. I am still curious why I can’t get them to Gen3x4 but since the TX2 root port is Gen2x4 I guess it is not that important. All I want is to get closer to the theoretical speed (of about 2GB/s since this is Gen2x4).
If I run the same tests on my custom board I get the following:
These results are basically reading 1GB with different block sizes and without the iflag=direct
nvidia@tegra-ubuntu:~$ ./test_speed.sh
1M block
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 4.59133 s, 228 MB/s
10M block
100+0 records in
100+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 5.45304 s, 192 MB/s
100M block
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 5.54286 s, 189 MB/s
1000M block
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 5.25225 s, 200 MB/s
These results are basically reading 1GB with different block sizes and with the iflag=direct
1M block
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 2.73153 s, 384 MB/s
10M block
100+0 records in
100+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.09067 s, 961 MB/s
100M block
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 1.45053 s, 723 MB/s
1000M block
1+0 records in
1+0 records out
1048576000 bytes (1.0 GB, 1000 MiB) copied, 2.47037 s, 424 MB/s
These results are basically reading 5GB with different block sizes and with the iflag=direct
1M block
5000+0 records in
5000+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 16.9431 s, 309 MB/s
10M block
500+0 records in
500+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 5.67265 s, 924 MB/s
100M block
50+0 records in
50+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 5.99964 s, 874 MB/s
1000M block
5+0 records in
5+0 records out
5242880000 bytes (5.2 GB, 4.9 GiB) copied, 7.46426 s, 702 MB/s
The speeds are “close” but the difference is too big to be negligible. We drop from 1.4GB/s to 920MB/s, and in theory we should be going close to 2GB.
One of the few differences between these two tests is that in my custom board I have disabled the “clkreq” signal in the PCIe express, so that hopefully that clock will be active no matter what.
This is the configuraiton for the pcie root port in my customized device tree:
pcie-controller@10003000 {
compatible = "nvidia,tegra186-pcie";
power-domains = <0xcc>;
device_type = "pci";
reg = <0x0 0x10003000 0x0 0x800 0x0 0x10003800 0x0 0x800 0x0 0x40000000 0x0 0x10000000>;
reg-names = "pads", "afi", "cs";
clocks = <0xd 0x4 0xd 0x3 0xd 0x261>;
clock-names = "afi", "pcie", "clk_m";
resets = <0xd 0x1 0xd 0x1d 0xd 0x1e>;
reset-names = "afi", "pcie", "pciex";
interrupts = <0x0 0x48 0x4 0x0 0x49 0x4>;
interrupt-names = "intr", "msi";
#interrupt-cells = <0x1>;
interrupt-map-mask = <0x0 0x0 0x0 0x0>;
interrupt-map = <0x0 0x0 0x0 0x0 0x1 0x0 0x48 0x4>;
#stream-id-cells = <0x1>;
bus-range = <0x0 0xff>;
#address-cells = <0x3>;
#size-cells = <0x2>;
ranges = <0x82000000 0x0 0x10000000 0x0 0x10000000 0x0 0x1000 0x82000000 0x0 0x10001000 0x0 0x10001000 0x0 0x1000 0x82000000 0x0 0x10004000 0x0 0x10004000 0x0 0x1000 0x81000000 0x0 0x0 0x0 0x50000000 0x0 0x10000 0x82000000 0x0 0x50100000 0x0 0x50100000 0x0 0x7f00000 0xc2000000 0x0 0x58000000 0x0 0x58000000 0x0 0x28000000>;
status = "okay";
vddio-pexctl-aud-supply = <0xe>;
linux,phandle = <0x76>;
phandle = <0x76>;
pci@1,0 {
device_type = "pci";
assigned-addresses = <0x82000800 0x0 0x10000000 0x0 0x1000>;
reg = <0x800 0x0 0x0 0x0 0x0>;
status = "okay";
#address-cells = <0x3>;
#size-cells = <0x2>;
ranges;
nvidia,num-lanes = <0x4>;
nvidia,afi-ctl-offset = <0x110>;
nvidia,disable-clock-request;
};
pci@2,0 {
device_type = "pci";
assigned-addresses = <0x82001000 0x0 0x10001000 0x0 0x1000>;
reg = <0x1000 0x0 0x0 0x0 0x0>;
status = "disabled";
#address-cells = <0x3>;
#size-cells = <0x2>;
ranges;
nvidia,num-lanes = <0x1>;
nvidia,afi-ctl-offset = <0x118>;
nvidia,disable-clock-request;
};
pci@3,0 {
device_type = "pci";
assigned-addresses = <0x82001800 0x0 0x10004000 0x0 0x1000>;
reg = <0x1800 0x0 0x0 0x0 0x0>;
status = "disabled";
#address-cells = <0x3>;
#size-cells = <0x2>;
ranges;
nvidia,num-lanes = <0x1>;
nvidia,afi-ctl-offset = <0x19c>;
nvidia,disable-clock-request;
};
prod-settings {
#prod-cells = <0x3>;
prod_c_pad {
prod = <0xc8 0xffffffff 0x80b880b8 0xcc 0xffffffff 0x480b8>;
};
};
};