# @name PCI SATA Write/Read Performance test with MSI
# @desc format PCI sata device first and then mount it and do read write perf test when using MSI
# @requires pci || pcie
# @setup_requires pcisatacard

PCI_S_PERF_MSI_SATA_EXT2_100M source 'common.sh'; source 'blk_device_common.sh'; check_config_options "ym" CONFIG_SATA_AHCI; check_config_options "ym" CONFIG_PCI_MSI; pre=`cat /proc/interrupts|grep -Ei "pci-msi.*ahci" |awk '{print $2}' `||die "No PCI-MSI interrupt entry"; echo "MSI interrupt before test is: $pre"; pci_sata_basenode=`pci_sata_search_device.sh` || die "Failed to get pci sata devnode:: $pci_sata_basenode"; echo "pci_sata_basenode: $pci_sata_basenode "; pci_sata_node=`find_part_with_biggest_size "/dev/$pci_sata_basenode" "sata"` || die "error getting partition with biggest size: $pci_sata_node"; blk_device_filesystem_perf_test.sh -n $pci_sata_node -f ext2 -s 100 -B "262144" -d "pci"; post=`cat /proc/interrupts|grep -Ei "pci-msi.*ahci" |awk '{print $2}' `; echo "MSI interrupt after test is: $post"; [[ $post -gt $pre ]]

PCI_S_PERF_MSI_SATA_VFAT_100M source 'common.sh'; source 'blk_device_common.sh'; check_config_options "ym" CONFIG_SATA_AHCI; check_config_options "ym" CONFIG_PCI_MSI; pre=`cat /proc/interrupts|grep -Ei "pci-msi.*ahci" |awk '{print $2}' `||die "No PCI-MSI interrupt entry"; echo "MSI interrupt before test is: $pre"; pci_sata_basenode=`pci_sata_search_device.sh` || die "Failed to get pci sata devnode:: $pci_sata_basenode"; echo "pci_sata_basenode: $pci_sata_basenode "; pci_sata_node=`find_part_with_biggest_size "/dev/$pci_sata_basenode" "sata"` || die "error getting partition with biggest size: $pci_sata_node"; blk_device_filesystem_perf_test.sh -n $pci_sata_node -f vfat -s 100 -B "262144" -d "pci"; post=`cat /proc/interrupts|grep -Ei "pci-msi.*ahci" |awk '{print $2}' `; echo "MSI interrupt after test is: $post"; [[ $post -gt $pre ]]





