Subject: Re: [PATCH net-next v1 2/5] net: sched: Introduce helpers for qevent blocks

From: Petr Machata <[email-masked]>
Date: Wed, 08 Jul 2020 23:04:36 +0200

Cong Wang <[email-masked]> writes:

> On Wed, Jul 8, 2020 at 5:35 AM Petr Machata <[email-masked]> wrote:
>> Do you have another solution in mind here? I think the deadlock (in both
>> classification and qevents) is an issue, but really don't know how to
>> avoid it except by dropping the lock.
>
> Ideally we should only take the lock once, but it clearly requires some
> work to teach the dev_queue_xmit() in act_mirred not to acquire it again.

act_mirred does not acquire it though. The egress path does. And the
packet can traverse several mirred instances on several devices before
it gets to the deadlock. Currently I don't see a way to give the egress
path a way to know that the lock is already taken.

I'll think about it some more. For now I will at least fix the lack of
locking.