/*-
* BSD LICENSE
- *
+ *
* Copyright(c) 2010-2014 Intel Corporation. All rights reserved.
* Copyright(c) 2014 6WIND S.A.
* All rights reserved.
- *
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
- *
+ *
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* * Neither the name of Intel Corporation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
- *
+ *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
#define no_hpet "--no-hpet"
#define no_huge "--no-huge"
#define no_shconf "--no-shconf"
-#define use_device "--use-device"
+#define pci_whitelist "--pci-whitelist"
+#define vdev "--vdev"
#define memtest "memtest"
#define memtest1 "memtest1"
#define memtest2 "memtest2"
rte_snprintf(file_path, sizeof(file_path),
"%s/%s", hugedir, dirent->d_name);
-
+
/* remove file */
if (remove(file_path) < 0) {
printf("Error deleting %s - %s!\n",
const char *wlinval[][11] = {
{prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "error", "", ""},
+ pci_whitelist, "error", "", ""},
{prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "0:0:0", "", ""},
+ pci_whitelist, "0:0:0", "", ""},
{prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "0:error:0.1", "", ""},
+ pci_whitelist, "0:error:0.1", "", ""},
{prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "0:0:0.1error", "", ""},
+ pci_whitelist, "0:0:0.1error", "", ""},
{prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "error0:0:0.1", "", ""},
+ pci_whitelist, "error0:0:0.1", "", ""},
{prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "0:0:0.1.2", "", ""},
+ pci_whitelist, "0:0:0.1.2", "", ""},
};
/* Test with valid whitelist option */
const char *wlval1[] = {prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "00FF:09:0B.3"};
+ pci_whitelist, "00FF:09:0B.3"};
const char *wlval2[] = {prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "09:0B.3", use_device, "0a:0b.1"};
+ pci_whitelist, "09:0B.3", pci_whitelist, "0a:0b.1"};
const char *wlval3[] = {prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "09:0B.3,type=test",
- use_device, "08:00.1,type=normal"};
+ pci_whitelist, "09:0B.3,type=test",
+ pci_whitelist, "08:00.1,type=normal",
+#ifdef CONFIG_RTE_LIBRTE_PMD_RING
+ vdev, "eth_ring,arg=test",
+#endif
+ };
for (i = 0; i < sizeof(wlinval) / sizeof(wlinval[0]); i++) {
if (launch_proc(wlinval[i]) == 0) {
printf("Error - process did not run ok with --no-shconf flag\n");
return -1;
}
-
+
return 0;
}
#else
const char *argv11[] = {prgname, "--file-prefix=virtaddr",
"-c", "1", "-n", "2", "--base-virtaddr=0x12345678"};
+ /* try running with --vfio-intr INTx flag */
+ const char *argv12[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", "--vfio-intr=legacy"};
+
+ /* try running with --vfio-intr MSI flag */
+ const char *argv13[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", "--vfio-intr=msi"};
+
+ /* try running with --vfio-intr MSI-X flag */
+ const char *argv14[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", "--vfio-intr=msix"};
+
+ /* try running with --vfio-intr invalid flag */
+ const char *argv15[] = {prgname, "--file-prefix=intr",
+ "-c", "1", "-n", "2", "--vfio-intr=invalid"};
+
if (launch_proc(argv0) == 0) {
printf("Error - process ran ok with invalid flag\n");
printf("Error - process did not run ok with --base-virtaddr parameter\n");
return -1;
}
+ if (launch_proc(argv12) != 0) {
+ printf("Error - process did not run ok with "
+ "--vfio-intr INTx parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv13) != 0) {
+ printf("Error - process did not run ok with "
+ "--vfio-intr MSI parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv14) != 0) {
+ printf("Error - process did not run ok with "
+ "--vfio-intr MSI-X parameter\n");
+ return -1;
+ }
+ if (launch_proc(argv15) == 0) {
+ printf("Error - process run ok with "
+ "--vfio-intr invalid parameter\n");
+ return -1;
+ }
return 0;
}
#endif