net: dev: Simplify the conditional of backlog lock functions
Subsystems (2)
PATCH 1/1 net: dev: Simplify the conditional of backlog lock functions
The use_backlog_threads() contains the conditional of PREEMPT_RT, so we don't need to add PREEMPT_RT in the backlog lock.
Remove the conditional of PREEMPT_RT in the backlog lock.
Signed-off-by Yajun Deng <[email protected]>
--- net/core/dev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/core/dev.c +4 -4
@@ -229,7 +229,7 @@ static inline void backlog_lock_irq_save(struct softnet_data *sd, {if (IS_ENABLED (CONFIG_RPS ) ||use_backlog_threads ())spin_lock_irqsave (&sd->input_pkt_queue.lock, *flags); -else if (!IS_ENABLED (CONFIG_PREEMPT_RT )) +else local_irq_save (*flags); }
@@ -237,7 +237,7 @@ static inline void backlog_lock_irq_disable(struct softnet_data *sd) {if (IS_ENABLED (CONFIG_RPS ) ||use_backlog_threads ())spin_lock_irq (&sd->input_pkt_queue.lock); -else if (!IS_ENABLED (CONFIG_PREEMPT_RT )) +else local_irq_disable (); }
@@ -246,7 +246,7 @@ static inline void backlog_unlock_irq_restore(struct softnet_data *sd, {if (IS_ENABLED (CONFIG_RPS ) ||use_backlog_threads ())spin_unlock_irqrestore (&sd->input_pkt_queue.lock, *flags); -else if (!IS_ENABLED (CONFIG_PREEMPT_RT )) +else local_irq_restore (*flags); }
@@ -254,7 +254,7 @@ static inline void backlog_unlock_irq_enable(struct softnet_data *sd) {if (IS_ENABLED (CONFIG_RPS ) ||use_backlog_threads ())spin_unlock_irq (&sd->input_pkt_queue.lock); -else if (!IS_ENABLED (CONFIG_PREEMPT_RT )) +else local_irq_enable (); }
Signature · 1 line
2.34.1
Quoted 4 lines · Yajun Deng
The
use_backlog_threads()contains the conditional ofPREEMPT_RT, so we don't need to addPREEMPT_RTin the backlog lock.Remove the conditional of
PREEMPT_RTin the backlog lock.
This is part of
https://lore.kernel.org/all/[email protected]/
Quoted 1 line
Signed-off-by Yajun Deng <[email protected]>
Sebastian