netdev/upper: Fix wrong CPU when RSS is disabled
Some checks failed
Build Documentation / build-html (push) Has been cancelled
Some checks failed
Build Documentation / build-html (push) Has been cancelled
When `CONFIG_NETDEV_RSS` is disabled, `NETDEV_THREAD_COUNT` will be 1, and we should not access `upper->sem[cpu]` with `cpu > 0`. Signed-off-by: Zhe Weng <wengzhe@xiaomi.com>
This commit is contained in:
parent
233e175f28
commit
286de7df01
1 changed files with 4 additions and 0 deletions
|
@ -754,7 +754,11 @@ static inline void netdev_upper_queue_work(FAR struct net_driver_s *dev)
|
||||||
FAR struct netdev_upperhalf_s *upper = dev->d_private;
|
FAR struct netdev_upperhalf_s *upper = dev->d_private;
|
||||||
|
|
||||||
#ifdef CONFIG_NETDEV_WORK_THREAD
|
#ifdef CONFIG_NETDEV_WORK_THREAD
|
||||||
|
# ifdef CONFIG_NETDEV_RSS
|
||||||
int cpu = this_cpu();
|
int cpu = this_cpu();
|
||||||
|
# else
|
||||||
|
const int cpu = 0;
|
||||||
|
# endif
|
||||||
int semcount;
|
int semcount;
|
||||||
|
|
||||||
if (nxsem_get_value(&upper->sem[cpu], &semcount) == OK &&
|
if (nxsem_get_value(&upper->sem[cpu], &semcount) == OK &&
|
||||||
|
|
Loading…
Reference in a new issue