Skip to content

Commit 021a17e

Browse files
Paolo Abenidavem330
authored andcommitted
pfifo_fast: drop unneeded additional lock on dequeue
After the previous patch, for NOLOCK qdiscs, q->seqlock is always held when the dequeue() is invoked, we can drop any additional locking to protect such operation. Signed-off-by: Paolo Abeni <pabeni@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 96009c7 commit 021a17e

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

include/linux/skb_array.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ static inline bool skb_array_empty_any(struct skb_array *a)
9797
return ptr_ring_empty_any(&a->ring);
9898
}
9999

100+
static inline struct sk_buff *__skb_array_consume(struct skb_array *a)
101+
{
102+
return __ptr_ring_consume(&a->ring);
103+
}
104+
100105
static inline struct sk_buff *skb_array_consume(struct skb_array *a)
101106
{
102107
return ptr_ring_consume(&a->ring);

net/sched/sch_generic.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc)
656656
if (__skb_array_empty(q))
657657
continue;
658658

659-
skb = skb_array_consume_bh(q);
659+
skb = __skb_array_consume(q);
660660
}
661661
if (likely(skb)) {
662662
qdisc_qstats_cpu_backlog_dec(qdisc, skb);
@@ -697,7 +697,7 @@ static void pfifo_fast_reset(struct Qdisc *qdisc)
697697
if (!q->ring.queue)
698698
continue;
699699

700-
while ((skb = skb_array_consume_bh(q)) != NULL)
700+
while ((skb = __skb_array_consume(q)) != NULL)
701701
kfree_skb(skb);
702702
}
703703

0 commit comments

Comments
 (0)