git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto/dpaa2_sec: fix HMAC supported key sizes
[dpdk.git]
/
lib
/
librte_distributor
/
rte_distributor.c
diff --git
a/lib/librte_distributor/rte_distributor.c
b/lib/librte_distributor/rte_distributor.c
index
06df13d
..
20ba9ff
100644
(file)
--- a/
lib/librte_distributor/rte_distributor.c
+++ b/
lib/librte_distributor/rte_distributor.c
@@
-41,7
+41,8
@@
#include <rte_errno.h>
#include <rte_string_fns.h>
#include <rte_eal_memconfig.h>
#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"
#include "rte_distributor_private.h"
#include "rte_distributor.h"
#include "rte_distributor_v20.h"
@@
-555,7
+556,7
@@
total_outstanding(const struct rte_distributor *d)
int
rte_distributor_flush_v1705(struct rte_distributor *d)
{
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) {
unsigned int wkr;
if (d->alg_type == RTE_DIST_ALG_SINGLE) {
@@
-563,6
+564,8
@@
rte_distributor_flush_v1705(struct rte_distributor *d)
return rte_distributor_flush_v20(d->d_v20);
}
return rte_distributor_flush_v20(d->d_v20);
}
+ flushed = total_outstanding(d);
+
while (total_outstanding(d) > 0)
rte_distributor_process(d, NULL, 0);
while (total_outstanding(d) > 0)
rte_distributor_process(d, NULL, 0);
@@
-590,6
+593,7
@@
rte_distributor_clear_returns_v1705(struct rte_distributor *d)
if (d->alg_type == RTE_DIST_ALG_SINGLE) {
/* Call the old API */
rte_distributor_clear_returns_v20(d->d_v20);
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 */
}
/* throw away returns, so workers can exit */
@@
-621,9
+625,14
@@
rte_distributor_create_v1705(const char *name,
if (alg_type == RTE_DIST_ALG_SINGLE) {
d = malloc(sizeof(struct rte_distributor));
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) {
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;
}
/* rte_errno will have been set */
return NULL;
}
@@
-648,12
+657,10
@@
rte_distributor_create_v1705(const char *name,
d->num_workers = num_workers;
d->alg_type = alg_type;
d->num_workers = num_workers;
d->alg_type = alg_type;
+ d->dist_match_fn = RTE_DIST_MATCH_SCALAR;
#if defined(RTE_ARCH_X86)
#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
#endif
- d->dist_match_fn = RTE_DIST_MATCH_SCALAR;
/*
* Set up the backog tags so they're pointing at the second cache
/*
* Set up the backog tags so they're pointing at the second cache