Messages in this thread Patch in this message | | | From | Cong Wang <> | Date | Wed, 2 Sep 2020 22:01:17 -0700 | Subject | Re: Packet gets stuck in NOLOCK pfifo_fast qdisc |
| |
Hello, Kehuan
Can you test the attached one-line fix? I think we are overthinking, probably all we need here is a busy wait.
Thanks. diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index d60e7c39d60c..fc1bacdb102b 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -156,8 +156,7 @@ static inline bool qdisc_is_empty(const struct Qdisc *qdisc) static inline bool qdisc_run_begin(struct Qdisc *qdisc) { if (qdisc->flags & TCQ_F_NOLOCK) { - if (!spin_trylock(&qdisc->seqlock)) - return false; + spin_lock(&qdisc->seqlock); WRITE_ONCE(qdisc->empty, false); } else if (qdisc_is_running(qdisc)) { return false; | |