tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: RFC: IRQ affinity (aka interrupt routing)
Hi,
Thank you for your idea.
(2014/08/27 10:09), Matt Thomas wrote:
As I've been reading this discussion, it seems very x86 centric.
I've thinking about adding
void intr_distribute(void *ih, const kcpuset_t *newset, kcpuset_t *oldset)
for my ports that can do MP. This could be used to obtain the current
set of cpus setup to receive interrupt for <ih> or set a new sets of
cpus. To set an interrupt across all CPUs, you could use
intr_distribibute(ih, &kcpuset_running, NULL);
By default only the boot CPU would be setup to get interrupts when
the interrupt was established.
It seems good, except return value. IRQ affinity may fail (e.g. when
all cpus are set "nointr" flag), so return value should not be void.
I use the API in MI code like this,
====================
intrctl_ioctl(..., void *data, ...)
{
switch(cmd) {
case IOC_INTR_AFFINITY:
ih = intr_handler(data->intrid);
if (ih == NULL )
return EINVAL;
kcpuset_create(&intr_cpuset, true);
kcpuset_set(intr_cpuset, data->cpuid);
error = intr_distribute(ih, intr_cpuset, NULL);
break;
}
return error;
}
====================
Could you comment this design?
BTW, how do you think about MSI/MSI-X proposal?
- yours
http://mail-index.netbsd.org/tech-kern/2011/08/05/msg011130.html
- dyoung's
http://mail-index.netbsd.org/tech-kern/2014/06/06/msg017209.html
- mine
http://mail-index.netbsd.org/tech-kern/2014/07/10/msg017336.html
Thanks,
--
//////////////////////////////////////////////////////////////////////
Internet Initiative Japan Inc.
Device Engineering Section,
Core Product Development Department,
Product Division,
Technology Unit
Kengo NAKAHARA <k-nakahara%iij.ad.jp@localhost>
Home |
Main Index |
Thread Index |
Old Index