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
net/bnxt: fix null dereference in session cleanup
[dpdk.git]
/
lib
/
distributor
/
rte_distributor_single.c
diff --git
a/lib/distributor/rte_distributor_single.c
b/lib/distributor/rte_distributor_single.c
index
f4725b1
..
2c77ac4
100644
(file)
--- a/
lib/distributor/rte_distributor_single.c
+++ b/
lib/distributor/rte_distributor_single.c
@@
-4,9
+4,7
@@
#include <stdio.h>
#include <sys/queue.h>
#include <stdio.h>
#include <sys/queue.h>
-#include <string.h>
#include <rte_mbuf.h>
#include <rte_mbuf.h>
-#include <rte_memory.h>
#include <rte_memzone.h>
#include <rte_errno.h>
#include <rte_string_fns.h>
#include <rte_memzone.h>
#include <rte_errno.h>
#include <rte_string_fns.h>
@@
-33,9
+31,8
@@
rte_distributor_request_pkt_single(struct rte_distributor_single *d,
union rte_distributor_buffer_single *buf = &d->bufs[worker_id];
int64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS)
| RTE_DISTRIB_GET_BUF;
union rte_distributor_buffer_single *buf = &d->bufs[worker_id];
int64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS)
| RTE_DISTRIB_GET_BUF;
- while (unlikely(__atomic_load_n(&buf->bufptr64, __ATOMIC_RELAXED)
- & RTE_DISTRIB_FLAGS_MASK))
- rte_pause();
+ RTE_WAIT_UNTIL_MASKED(&buf->bufptr64, RTE_DISTRIB_FLAGS_MASK,
+ ==, 0, __ATOMIC_RELAXED);
/* Sync with distributor on GET_BUF flag. */
__atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE);
/* Sync with distributor on GET_BUF flag. */
__atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE);
@@
-74,9
+71,8
@@
rte_distributor_return_pkt_single(struct rte_distributor_single *d,
union rte_distributor_buffer_single *buf = &d->bufs[worker_id];
uint64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS)
| RTE_DISTRIB_RETURN_BUF;
union rte_distributor_buffer_single *buf = &d->bufs[worker_id];
uint64_t req = (((int64_t)(uintptr_t)oldpkt) << RTE_DISTRIB_FLAG_BITS)
| RTE_DISTRIB_RETURN_BUF;
- while (unlikely(__atomic_load_n(&buf->bufptr64, __ATOMIC_RELAXED)
- & RTE_DISTRIB_FLAGS_MASK))
- rte_pause();
+ RTE_WAIT_UNTIL_MASKED(&buf->bufptr64, RTE_DISTRIB_FLAGS_MASK,
+ ==, 0, __ATOMIC_RELAXED);
/* Sync with distributor on RETURN_BUF flag. */
__atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE);
/* Sync with distributor on RETURN_BUF flag. */
__atomic_store_n(&(buf->bufptr64), req, __ATOMIC_RELEASE);
@@
-249,8
+245,7
@@
rte_distributor_process_single(struct rte_distributor_single *d,
* worker given by the bit-position
*/
for (i = 0; i < d->num_workers; i++)
* worker given by the bit-position
*/
for (i = 0; i < d->num_workers; i++)
- match |= (!(d->in_flight_tags[i] ^ new_tag)
- << i);
+ match |= ((uint64_t)!(d->in_flight_tags[i] ^ new_tag) << i);
/* Only turned-on bits are considered as match */
match &= d->in_flight_bitmask;
/* Only turned-on bits are considered as match */
match &= d->in_flight_bitmask;