#define time_before(x, y) ((x) < (y))
#endif
+/*
+ * Testing aid: name a gen_syndrome implementation to use instead of the
+ * boot-time benchmark winner, e.g. raid6_pq.algo=avx2x1.
+ */
+static char *raid6_algo_force;
+module_param_named(algo, raid6_algo_force, charp, 0444);
+MODULE_PARM_DESC(algo, "force this gen_syndrome implementation instead of benchmarking (testing aid)");
+
#define RAID6_TEST_DISKS 8
#define RAID6_TEST_DISKS_ORDER 3
const struct raid6_calls *const *algo;
const struct raid6_calls *best;
+ if (raid6_algo_force) {
+ for (algo = raid6_algos; *algo; algo++) {
+ if (strcmp((*algo)->name, raid6_algo_force))
+ continue;
+ if ((*algo)->valid && !(*algo)->valid()) {
+ pr_err("raid6: forced algorithm %s not usable on this CPU, benchmarking instead\n",
+ raid6_algo_force);
+ break;
+ }
+ raid6_call = **algo;
+ pr_info("raid6: using FORCED algorithm %s (raid6_pq.algo=)\n",
+ (*algo)->name);
+ return *algo;
+ }
+ if (!*algo)
+ pr_err("raid6: forced algorithm %s not found, benchmarking instead\n",
+ raid6_algo_force);
+ }
+
for (bestgenperf = 0, best = NULL, algo = raid6_algos; *algo; algo++) {
if (!best || (*algo)->priority >= best->priority) {
if ((*algo)->valid && !(*algo)->valid())