Skip to content

Commit a8760d0

Browse files
Sebastian Andrzej Siewiorkuba-moo
authored andcommitted
dev: Remove PREEMPT_RT ifdefs from backlog_lock.*().
The backlog_napi locking (previously RPS) relies on explicit locking if either RPS or backlog NAPI is enabled. If both are disabled then locking was achieved by disabling interrupts except on PREEMPT_RT. PREEMPT_RT was excluded because the needed synchronisation was already provided local_bh_disable(). Since the introduction of backlog NAPI and making it mandatory for PREEMPT_RT the ifdef within backlog_lock.*() is obsolete and can be removed. Remove the ifdefs in backlog_lock.*(). Signed-off-by: Sebastian Andrzej Siewior <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ecefbc0 commit a8760d0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

net/core/dev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,15 @@ static inline void backlog_lock_irq_save(struct softnet_data *sd,
229229
{
230230
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
231231
spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags);
232-
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
232+
else
233233
local_irq_save(*flags);
234234
}
235235

236236
static inline void backlog_lock_irq_disable(struct softnet_data *sd)
237237
{
238238
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
239239
spin_lock_irq(&sd->input_pkt_queue.lock);
240-
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
240+
else
241241
local_irq_disable();
242242
}
243243

@@ -246,15 +246,15 @@ static inline void backlog_unlock_irq_restore(struct softnet_data *sd,
246246
{
247247
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
248248
spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags);
249-
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
249+
else
250250
local_irq_restore(*flags);
251251
}
252252

253253
static inline void backlog_unlock_irq_enable(struct softnet_data *sd)
254254
{
255255
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
256256
spin_unlock_irq(&sd->input_pkt_queue.lock);
257-
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
257+
else
258258
local_irq_enable();
259259
}
260260

0 commit comments

Comments
 (0)