PCIE的验证
****************

在J6RC + J6EP的环境下，可以通过hbpcie_test来进行PCIe通路的测试。

在RC上查看EP设备节点是否已经创建：

.. code:: bash

	root@j6dvb:/# ls /dev/hobot_pcie*

	/dev/hobot_pcie_hybrid_00_02

例如出现了/dev/hobot_pcie_hybrid_00_02，就表示J6
EP识别到了（不同的硬件拓扑下，id可能有差异）。

如果没有出现EP设备，可能是RC枚举的过程中EP还没有初始化完成，可以重新进行一次扫描，在RC端运行：

.. code:: bash

	pcirescan

如果提示没有上面的命令，那么运行：

.. code:: bash

	echo 1 > /sys/bus/pci/devices/0000:00:00.0/remove

	echo 1 > /sys/bus/pci/rescan

正常识别到EP设备后可使用hbpcie_test来测试PCIe通路。

在RC端运行：

.. code:: bash

	/app/testcase/S13_HSIS/S13E01_PCIe/bin/hbpcie_test 0 2 -r -1 -e

然后在EP端运行：

.. code:: bash

	/app/testcase/S13_HSIS/S13E01_PCIe/bin/hbpcie_test 0 0 -w -1 -e

两端无错误异常log，且X2模式下显示PCIe带宽在3000MB/s左右，则说明PCIe链路正常

RC：

.. code:: bash

	root@hobot:/app/testcase/S13_HSIS/S13E01_PCIe/bin/hbpcie_test 0 2 -r -1 -e
	pcie_dma_test perf: 1
	Test recv start with dma pkt 100000
	recv_status_print start
	hb_pcie_init success. handle: 0
	hb pcie mem alloc dma_buf_phys: 47af00000,dma_buf_iova: fe900000
	wait init handshake
	remote_iova: fffffbd00000, local_iova: fe900000
	0: 2: Recv frames:1180, speed:589.410589 MB/s
	0: 2: Recv frames:7234, speed:3023.976024 MB/s
	0: 2: Recv frames:13282, speed:3020.979021 MB/s
	0: 2: Recv frames:19340, speed:3025.974026 MB/s
	0: 2: Recv frames:25393, speed:3023.476523 MB/s
	0: 2: Recv frames:31461, speed:3030.969031 MB/s
	0: 2: Recv frames:37514, speed:3023.476523 MB/s

EP：

.. code:: bash

	root@hobot:/app/testcase/S13_HSIS/S13E01_PCIe/bin/hbpcie_test 0 0 -w -1 -e
	pcie_dma_test perf: 1
	Test send start with dma pkt 100000
	hb_pcie_init success. handle: 0
	hb pcie mem alloc dma_buf_phys: 43c400000, dma_buf_iova: fffffbd00000
	remote_iova: fe900000, local_iova: fffffbd00000
	0: 0: Send frames301, speed:150.349650 MB/s
	0: 0: Send frames6355, speed:3023.976024 MB/s
	0: 0: Send frames12401, speed:3019.980020 MB/s
	0: 0: Send frames18459, speed:3025.974026 MB/s
	0: 0: Send frames24509, speed:3021.978022 MB/s
	0: 0: Send frames30577, speed:3030.969031 MB/s
	0: 0: Send frames36631, speed:3023.976024 MB/s

