[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAF=yD-+Z=u5Vh=z73BSDrAQZSSXvwOYAxZNLzVMksz5pdfmP=Q@mail.gmail.com>
Date: Mon, 29 Apr 2019 12:15:52 -0400
From: Willem de Bruijn <willemdebruijn.kernel@...il.com>
To: Rafał Miłecki <zajec5@...il.com>
Cc: "David S . Miller" <davem@...emloft.net>,
Network Development <netdev@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>,
Rafał Miłecki <rafal@...ecki.pl>
Subject: Re: [PATCH] net-sysfs: expose IRQ number
On Mon, Apr 29, 2019 at 2:01 AM Rafał Miłecki <zajec5@...il.com> wrote:
>
> From: Rafał Miłecki <rafal@...ecki.pl>
>
> Knowing IRQ number makes e.g. reading /proc/interrupts much simpler.
> It's more reliable than guessing device name used by a driver when
> calling request_irq().
>
> Signed-off-by: Rafał Miłecki <rafal@...ecki.pl>
> ---
> I found a script parsing /proc/interrupts for a given interface name. It wasn't
> working for me as it assumed request_irq() was called with a device name. It's
> not a case for all drivers.
>
> I also found some other people looking for a proper solution for that:
> https://unix.stackexchange.com/questions/275075/programmatically-determine-the-irqs-associated-with-a-network-interface
> https://stackoverflow.com/questions/7516984/retrieving-irq-number-of-a-nic
>
> Let me know if this solution makes sense. I can say it works for me ;)
If parsing /proc/interrupts is problematic, also see the
/sys/kernel/irq interface added in commit ecb3f394c5db ("genirq:
Expose interrupt information through sysfs"). Does that address your
use-case as well? Though it does the inverse mapping from IRQ to name.
Another practical issue is that many network devices register more
than one interrupt. Perhaps one control interrupt, plus one per
receive queue and possibly one per transmit queue. Unfortunately those
cannot be identified in a driver-independent manner. Because an
interface /sys/class/net/$DEV/queues/rx-$i/irq would be useful.
Powered by blists - more mailing lists