So I did it yesterday and today I got pcie 4x to M2 adapter and Micron 2450 512GB NVME SSD and the speed is not exactly great. Maybe there is a reason such high pci-e speeds are not enabled. Here is test of speed at 4x 5GT/s
ubuntu@ubuntu:~$ sudo dd if=/dev/nvme0n1 of=/dev/null bs=1M count=10000
10000+0 records in
10000+0 records out
10485760000 bytes (10 GB, 9.8 GiB) copied, 14.4331 s, 727 MB/s
when booting it says
[ 0.508539] pci 0000:01:00.0: 16.000 Gb/s available PCIe bandwidth, limited by 5.0 GT/s PCIe x4 link at 0000:00:02.1 (capable of 63.012 Gb/s with 16.0 GT/s PCIe x4 link)
lspci says
00:02.1 PCI bridge: Advanced Micro Devices, Inc. [AMD] Family 16h Processor Functions 5:1 (prog-if 00 [Normal decode])
...
LnkCap: Port #0, Speed 5GT/s, Width x4, ASPM L0s L1, Exit Latency L0s <512ns, L1 <64us
ClockPM- Surprise- LLActRep+ BwNot+ ASPMOptComp+
LnkCtl: ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s (ok), Width x4 (ok)
TrErr- Train- SlotClk+ DLActive+ BWMgmt+ ABWMgmt-
...
01:00.0 Non-Volatile memory controller: Micron Technology Inc Device 5411 (rev 01) (prog-if 02 [NVM Express])
Subsystem: Micron Technology Inc Device 1100
...
LnkCap: Port #1, Speed 16GT/s, Width x4, ASPM L1, Exit Latency L1 unlimited
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp+
LnkCtl: ASPM L1 Enabled; RCB 64 bytes, Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s (downgraded), Width x4 (ok)
TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
I already tested this SSD still with gen1 and it was slower but not that much (maybe 500-600MB?)
So I guess there is some other bottleneck - cpu or chipset. This ssd does 4-5GB/s in my current laptop with gen4. i don't have any 'slower' (gen3 or gen2) SSD to test now.
This is latest ubuntu 22.04 LTS, kernel 5.15.0-67-generic.
I wonder how it improves those networking cards people benchmarked here previously.
EDIT:
Oh, BTW the block size makes some difference, 128K being the best
ubuntu@ubuntu:~$ sudo dd if=/dev/nvme0n1 of=/dev/null bs=64K count=100000
100000+0 records in
100000+0 records out
6553600000 bytes (6.6 GB, 6.1 GiB) copied, 7.29548 s, 898 MB/s
ubuntu@ubuntu:~$ sudo dd if=/dev/nvme0n1 of=/dev/null bs=32K count=100000
100000+0 records in
100000+0 records out
3276800000 bytes (3.3 GB, 3.1 GiB) copied, 3.73048 s, 878 MB/s
ubuntu@ubuntu:~$ sudo dd if=/dev/nvme0n1 of=/dev/null bs=128K count=100000
100000+0 records in
100000+0 records out
13107200000 bytes (13 GB, 12 GiB) copied, 13.6644 s, 959 MB/s
ubuntu@ubuntu:~$ sudo dd if=/dev/nvme0n1 of=/dev/null bs=256K count=100000
100000+0 records in
100000+0 records out
26214400000 bytes (26 GB, 24 GiB) copied, 27.5715 s, 951 MB/s