From: Lennert Buytenhek <buytenh@wantstofly.org>
To: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Michael-Luke Jones <mlj28@cam.ac.uk>,
Jeff Garzik <jeff@garzik.org>,
netdev@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>,
Russell King <rmk@arm.linux.org.uk>,
ARM Linux Mailing List <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCH] Intel IXP4xx network drivers v.3 - QMGR
Date: Tue, 8 May 2007 16:40:01 +0200 [thread overview]
Message-ID: <20070508144001.GC387@xi.wantstofly.org> (raw)
In-Reply-To: <m3k5vj76bi.fsf@maximus.localdomain>
On Tue, May 08, 2007 at 04:12:17PM +0200, Krzysztof Halasa wrote:
> > The queue manager interrupts should probably be implemented as an
> > irqchip, in the same way that GPIO interrupts are implemented. (I.e.
> > allocate 'real' interrupt numbers for them, and use the interrupt
> > cascade mechanism.) You probably want to have separate irqchips for
> > the upper and lower halves, too. This way, drivers can just use
> > request_irq() instead of having to bother with platform-specific
> > qmgr_set_irq() methods.
>
> Is there a sample somewhere?
See for example arch/arm/mach-ep93xx/core.c, handling of the A/B/F
port GPIO interrupts.
In a nutshell, it goes like this.
1) Allocate a set of IRQ numbers. E.g. in include/asm-arm/arch-ixp4xx/irqs.h:
#define IRQ_IXP4XX_QUEUE_0 64
#define IRQ_IXP4XX_QUEUE_1 65
[...]
Adjust NR_IRQS, too.
2) Implement interrupt chip functions:
static void ixp4xx_queue_low_irq_mask_ack(unsigned int irq)
{
[...]
}
static void ixp4xx_queue_low_irq_mask(unsigned int irq)
{
[...]
}
static void ixp4xx_queue_low_irq_unmask(unsigned int irq)
{
[...]
}
static void ixp4xx_queue_low_irq_set_type(unsigned int irq)
{
[...]
}
static struct irq_chip ixp4xx_queue_low_irq_chip = {
.name = "QMGR low",
.ack = ixp4xx_queue_low_irq_mask_ack,
.mask = ixp4xx_queue_low_irq_mask,
.unmask = ixp4xx_queue_low_irq_unmask,
.set_type = ixp4xx_queue_low_irq_set_type,
};
3) Hook up the queue interrupts:
for (i = IRQ_IXP4XX_QUEUE_0; i <= IRQ_IXP4XX_QUEUE_31; i++) {
set_irq_chip(i, &ixp4xx_queue_low_irq_chip);
set_irq_handler(i, handle_level_irq);
set_irq_flags(i, IRQF_VALID);
}
4) Implement an interrupt handler for the parent interrupt:
static void ixp4xx_qmgr_low_irq_handler(unsigned int irq, struct irq_des c *desc)
{
u32 status;
int i;
status = __raw_readl(IXP4XX_WHATEVER_QMGR_LOW_STATUS_REGISTER);
for (i = 0; i < 32; i++) {
if (status & (1 << i)) {
desc = irq_desc + IRQ_IXP4XX_QUEUE_0 + i;
desc_handle_irq(IRQ_IXP4XX_QUEUE_0 + i, desc);
}
}
}
5) Hook up the parent interrupt:
set_irq_chained_handler(IRQ_IXP4XX_QM1, ixp4xx_qmgr_low_irq_handler);
Or something like that.
> > As with Christian's driver, I don't know whether an SRAM allocator
> > makes much sense. We can just set up a static allocation map for the
> > in-tree drivers and leave out the allocator altogether. I.e. I don't
> > think it's worth the complexity (and just because the butt-ugly Intel
> > code has an allocator isn't a very good reason. :-)
>
> It's a very simple allocator. I don't whink we have enough SRAM
> without it. For now it would work but it's probably too small
> for all potential users at a time.
>
> There may be up to 6 Ethernet ports (not sure about hardware
> status, not yet supported even by Intel) - 7 queues * 128 entries
> each = ~ 3.5 KB. Add 2 long queues (RX) for HSS and something
> for TX, and then crypto, and maybe other things.
You're unlikely to be using all of those at the same time, though.
And what do you do if the user does compile all of these features into
his kernel and then tries to use them all at the same time? Return
-ENOMEM?
Shouldn't we make sure that at least the features that are compiled in
can be used at the same time? If you want that guarantee, then you
might as well determine the SRAM map at compile time.
next prev parent reply other threads:[~2007-05-08 14:40 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-06 23:46 [PATCH 0/3] Intel IXP4xx network drivers Krzysztof Halasa
2007-05-07 0:06 ` [PATCH 1/3] WAN Kconfig: change "depends on HDLC" to "select" Krzysztof Halasa
2007-05-07 1:44 ` Roman Zippel
2007-05-07 9:35 ` Krzysztof Halasa
2007-05-07 11:22 ` Roman Zippel
2007-05-07 11:56 ` Krzysztof Halasa
2007-05-07 13:17 ` Roman Zippel
2007-05-07 13:21 ` Jeff Garzik
2007-05-07 13:46 ` Roman Zippel
2007-05-07 16:50 ` Krzysztof Halasa
2007-05-07 17:07 ` Roman Zippel
2007-05-07 18:15 ` Satyam Sharma
2007-05-07 20:31 ` Jeff Garzik
2007-05-07 20:49 ` Satyam Sharma
2007-05-07 20:50 ` Randy Dunlap
2007-05-07 22:39 ` Satyam Sharma
2007-05-07 22:52 ` Randy Dunlap
2007-05-07 20:57 ` Roman Zippel
2007-05-07 20:54 ` Krzysztof Halasa
2007-05-07 21:02 ` [PATCH] Use menuconfig objects II - netdev/wan Krzysztof Halasa
2007-05-07 21:08 ` [PATCH 1a/3] WAN Kconfig: change "depends on HDLC" to "select" Krzysztof Halasa
2007-05-07 0:07 ` [PATCH 2/3] ARM: include IXP4xx "fuses" support Krzysztof Halasa
2007-05-07 5:24 ` Alexey Zaytsev
2007-05-07 10:24 ` Krzysztof Halasa
2007-05-07 0:07 ` [PATCH 3/3] Intel IXP4xx network drivers Krzysztof Halasa
2007-05-07 12:59 ` Michael-Luke Jones
2007-05-07 17:12 ` Krzysztof Halasa
2007-05-07 17:52 ` Christian Hohnstaedt
2007-05-07 20:00 ` Krzysztof Halasa
2007-05-08 11:48 ` Lennert Buytenhek
2007-05-08 13:47 ` Krzysztof Halasa
2007-05-07 18:14 ` Michael-Luke Jones
2007-05-07 19:57 ` Krzysztof Halasa
2007-05-07 20:18 ` Michael-Luke Jones
2007-05-08 11:46 ` Lennert Buytenhek
2007-05-08 0:11 ` [PATCH] Intel IXP4xx network drivers v.2 Krzysztof Halasa
2007-05-08 0:36 ` [PATCH] Intel IXP4xx network drivers v.2 - NPE Krzysztof Halasa
2007-05-08 7:02 ` Michael-Luke Jones
2007-05-08 13:56 ` Krzysztof Halasa
2007-05-08 0:46 ` [PATCH] Intel IXP4xx network drivers v.3 - QMGR Krzysztof Halasa
2007-05-08 7:05 ` Michael-Luke Jones
2007-05-08 13:57 ` Krzysztof Halasa
2007-05-08 11:32 ` Lennert Buytenhek
2007-05-08 12:47 ` Alexey Zaytsev
2007-05-08 12:59 ` Lennert Buytenhek
2007-05-08 14:12 ` Krzysztof Halasa
2007-05-08 14:40 ` Lennert Buytenhek [this message]
2007-05-08 16:59 ` Krzysztof Halasa
2007-05-09 10:21 ` Lennert Buytenhek
2007-05-10 14:08 ` Krzysztof Halasa
2007-05-08 1:19 ` [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS Krzysztof Halasa
2007-05-08 5:28 ` Jeff Garzik
2007-05-08 7:22 ` Michael-Luke Jones
2007-05-08 11:37 ` Lennert Buytenhek
2007-05-08 14:31 ` Krzysztof Halasa
2007-05-08 14:53 ` Lennert Buytenhek
2007-05-08 17:17 ` Krzysztof Halasa
2007-05-08 11:40 ` [PATCH 3/3] Intel IXP4xx network drivers Lennert Buytenhek
2007-05-07 10:27 ` [PATCH 2a/3] " Krzysztof Halasa
2007-05-08 1:40 ` [PATCH 0/3] " Krzysztof Halasa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070508144001.GC387@xi.wantstofly.org \
--to=buytenh@wantstofly.org \
--cc=jeff@garzik.org \
--cc=khc@pm.waw.pl \
--cc=linux-arm-kernel@lists.arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=mlj28@cam.ac.uk \
--cc=netdev@vger.kernel.org \
--cc=rmk@arm.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).