Code Review
/
deb_dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
New upstream version 16.11.4
[deb_dpdk.git]
/
examples
/
performance-thread
/
common
/
lthread_sched.c
diff --git
a/examples/performance-thread/common/lthread_sched.c
b/examples/performance-thread/common/lthread_sched.c
index
c64c21f
..
fbda112
100644
(file)
--- a/
examples/performance-thread/common/lthread_sched.c
+++ b/
examples/performance-thread/common/lthread_sched.c
@@
-562,11
+562,14
@@
void lthread_run(void)
* Return the scheduler for this lcore
*
*/
* Return the scheduler for this lcore
*
*/
-struct lthread_sched *_lthread_sched_get(int lcore_id)
+struct lthread_sched *_lthread_sched_get(
unsigned
int lcore_id)
{
{
- if (lcore_id > LTHREAD_MAX_LCORES)
- return NULL;
- return schedcore[lcore_id];
+ struct lthread_sched *res = NULL;
+
+ if (lcore_id < LTHREAD_MAX_LCORES)
+ res = schedcore[lcore_id];
+
+ return res;
}
/*
}
/*
@@
-578,10
+581,9
@@
int lthread_set_affinity(unsigned lcoreid)
struct lthread *lt = THIS_LTHREAD;
struct lthread_sched *dest_sched;
struct lthread *lt = THIS_LTHREAD;
struct lthread_sched *dest_sched;
- if (unlikely(lcoreid > LTHREAD_MAX_LCORES))
+ if (unlikely(lcoreid >
=
LTHREAD_MAX_LCORES))
return POSIX_ERRNO(EINVAL);
return POSIX_ERRNO(EINVAL);
-
DIAG_EVENT(lt, LT_DIAG_LTHREAD_AFFINITY, lcoreid, 0);
dest_sched = schedcore[lcoreid];
DIAG_EVENT(lt, LT_DIAG_LTHREAD_AFFINITY, lcoreid, 0);
dest_sched = schedcore[lcoreid];