/*-
* 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
*/
#include <stdio.h>
-#include <cmdline_parse.h>
-
#include "test.h"
#ifndef RTE_EXEC_ENV_BAREMETAL
#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",
return prefix;
}
-/* extra function prototypes for internal eal function to test in whitelist
- * ICC 12 doesn't approve of this practice, so temporarily disable warnings for it */
-#ifdef __INTEL_COMPILER
-#pragma warning disable 1419
-#endif
-extern int eal_dev_whitelist_exists(void);
-extern int eal_dev_whitelist_add_entry(const char *);
-extern int eal_dev_whitelist_parse(void);
-extern int eal_dev_is_whitelisted(const char *, const char **);
-extern void eal_dev_whitelist_clear(void);
-#ifdef __INTEL_COMPILER
-#pragma warning enable 1419
-#endif
-
/*
* Test that the app doesn't run with invalid whitelist option.
* Final tests ensures it does run with valid options as sanity check (one
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", "", ""},
- {prgname, prefix, mp_flag, "-n", "1", "-c", "1",
- use_device, "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x",
- use_device, "y,z,1,2,3,4,5,6,7,8,9,0"},
+ 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,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,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) {
return -1;
}
- /* extra-sanity checks of whitelists - to be run only if no whitelist */
- if (eal_dev_whitelist_exists())
- return 0;
-
- /* check that whitelist_parse returns error without whitelist */
- if (eal_dev_whitelist_parse() != -1) {
- printf("ERROR: calling whitelist parse without a whitelist doesn't "
- "return an error\n");
- return -1;
- }
- if (eal_dev_is_whitelisted("adevice", NULL)) {
- printf("Whitelist lookup does not return false if no whitelist\n");
- return -1;
- }
- eal_dev_whitelist_add_entry("0000:00:00.0");
- eal_dev_whitelist_parse();
- if (eal_dev_is_whitelisted("adevice", NULL)) {
- printf("Whitelist lookup does not return false for unlisted dev\n");
- return -1;
- }
- if (!eal_dev_is_whitelisted("0000:00:00.0", NULL)) {
- printf("Whitelist lookup does not return true for whitelisted dev\n");
- return -1;
- }
- eal_dev_whitelist_clear();
-
return 0;
}
printf("Error - process did not run ok with --no-shconf flag\n");
return -1;
}
-
+
return 0;
}
#else