#include <rte_errno.h>
#include <rte_string_fns.h>
#include <rte_eal_memconfig.h>
-#include <rte_compat.h>
+#include <rte_pause.h>
+
#include "rte_distributor_private.h"
#include "rte_distributor.h"
#include "rte_distributor_v20.h"
int
rte_distributor_flush_v1705(struct rte_distributor *d)
{
- const unsigned int flushed = total_outstanding(d);
+ unsigned int flushed;
unsigned int wkr;
if (d->alg_type == RTE_DIST_ALG_SINGLE) {
return rte_distributor_flush_v20(d->d_v20);
}
+ flushed = total_outstanding(d);
+
while (total_outstanding(d) > 0)
rte_distributor_process(d, NULL, 0);
if (d->alg_type == RTE_DIST_ALG_SINGLE) {
/* Call the old API */
rte_distributor_clear_returns_v20(d->d_v20);
+ return;
}
/* throw away returns, so workers can exit */
if (alg_type == RTE_DIST_ALG_SINGLE) {
d = malloc(sizeof(struct rte_distributor));
+ if (d == NULL) {
+ rte_errno = ENOMEM;
+ return NULL;
+ }
d->d_v20 = rte_distributor_create_v20(name,
socket_id, num_workers);
if (d->d_v20 == NULL) {
+ free(d);
/* rte_errno will have been set */
return NULL;
}
d->num_workers = num_workers;
d->alg_type = alg_type;
+ d->dist_match_fn = RTE_DIST_MATCH_SCALAR;
#if defined(RTE_ARCH_X86)
- if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_SSE4_2))
- d->dist_match_fn = RTE_DIST_MATCH_VECTOR;
- else
+ d->dist_match_fn = RTE_DIST_MATCH_VECTOR;
#endif
- d->dist_match_fn = RTE_DIST_MATCH_SCALAR;
/*
* Set up the backog tags so they're pointing at the second cache