public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Halasa <khc@pm.waw.pl>
To: Lennert Buytenhek <buytenh@wantstofly.org>
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.2 - Ethernet and HSS
Date: Tue, 08 May 2007 19:17:16 +0200	[thread overview]
Message-ID: <m3lkfz5j6r.fsf@maximus.localdomain> (raw)
In-Reply-To: <20070508145340.GD387@xi.wantstofly.org> (Lennert Buytenhek's message of "Tue, 8 May 2007 16:53:40 +0200")

Lennert Buytenhek <buytenh@wantstofly.org> writes:

> The board support code knows such things as that the "front ethernet
> port" on the board is connected to the CPU's MII port number #2, but
> the board support code does _not_ know that MII port number #2
> corresponds to "ixp4xx hardware queue #5."

Sure. And I don't want it to know.

It has to pick up any available queue for RX, that is. If the
board code knows it uses ETH connected to NPE-B and NPE-C, and
HSS-0 connected (obviously) to NPE-A, and it wants some crypto
functions etc., it can pick a queue which normally belongs to
HSS-1. If the code knows the board has both HSS and only NPE-B
Ethernet, it can use one of NPE-C Ethernet's queues. It's that
simple.

The Ethernet (and HSS etc.) driver knows it has to use queue 24 for
NPE-B Ethernet's TX and 27 for TX and so on, this is fixed in the
firmware so I don't let the board code mess with that. The
Ethernet RX queue is different, we can just make something up and
tell NPE about that.

That's BTW the same thing you would want to do with SRAM - except
that the SRAM allocator is technically possible, while making
queue assignments needs knowledge about the hardware.

> If Intel puts out a firmware update next month, and your ethernet
> driver is modified to take advantage of the new features in that
> firmware and starts depending on the newer version of that firmware,
> we will have to modify every ixp4xx board support file in case the
> firmware update modifies the ixp4xx queue numbers in use.

Nope, we just modify Ethernet driver:
drivers/net/arm/ixp4xx_eth.c:
#define TX_QUEUE(plat)          (NPE_ID(port) + 23)
#define RXFREE_QUEUE(plat)      (NPE_ID(port) + 26)
#define TXDONE_QUEUE            31

> The
> mapping from hardware ports (MII port #0, MII port #6, HSS port
> #42, whatever) to ixp4xx hardware queue numbers (0-63) should _not_
> be put in every single ixp4xx board support file.

I've never considered doing that :-)

drivers/net/wan/ixp4xx_hss.c:
/* Queue IDs */
#define HSS0_CHL_RXTRIG_QUEUE   12      /* orig size = 32 dwords */
#define HSS0_PKT_RX_QUEUE       13      /* orig size = 32 dwords */
#define HSS0_PKT_TX0_QUEUE      14      /* orig size = 16 dwords */
#define HSS0_PKT_TX1_QUEUE      15
#define HSS0_PKT_TX2_QUEUE      16
#define HSS0_PKT_TX3_QUEUE      17
#define HSS0_PKT_RXFREE0_QUEUE  18      /* orig size = 16 dwords */
#define HSS0_PKT_RXFREE1_QUEUE  19
#define HSS0_PKT_RXFREE2_QUEUE  20
#define HSS0_PKT_RXFREE3_QUEUE  21
#define HSS0_PKT_TXDONE_QUEUE   22      /* orig size = 64 dwords */

#define HSS1_CHL_RXTRIG_QUEUE   10
#define HSS1_PKT_RX_QUEUE       0
#define HSS1_PKT_TX0_QUEUE      5
#define HSS1_PKT_TX1_QUEUE      6
#define HSS1_PKT_TX2_QUEUE      7
#define HSS1_PKT_TX3_QUEUE      8
#define HSS1_PKT_RXFREE0_QUEUE  1
#define HSS1_PKT_RXFREE1_QUEUE  2
#define HSS1_PKT_RXFREE2_QUEUE  3
#define HSS1_PKT_RXFREE3_QUEUE  4
#define HSS1_PKT_TXDONE_QUEUE   9

>> Without them the code in question is hardly readable,
>
> You can read Polish, how can you complain about code readability. :-))

Well, you may have the point, but I also care about others :-)
-- 
Krzysztof Halasa

  reply	other threads:[~2007-05-08 17:17 UTC|newest]

Thread overview: 94+ 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
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2007-05-08  8:26 [PATCH] Intel IXP4xx network drivers v.2 - Ethernet and HSS Mikael Pettersson
2007-05-08  8:35 ` Michael-Luke Jones
2007-05-08  8:29 Tomasz Chmielewski
2007-05-08  8:48 ` Alexey Zaytsev
2007-05-08  8:54   ` Michael-Luke Jones
2007-05-08  8:55   ` Tomasz Chmielewski
2007-05-08 13:44   ` Gordon Farquharson
2007-05-08 15:28   ` Krzysztof Halasa
2007-05-08 15:52     ` Lennert Buytenhek
2007-05-08 17:20       ` Krzysztof Halasa
2007-05-08 17:31         ` Tomasz Chmielewski
2007-05-08 17:51           ` Krzysztof Halasa
2007-05-09  8:58         ` Marcus Better
2007-05-09  9:12           ` Koen Kooi
2007-05-09  9:21           ` Lennert Buytenhek
2007-05-09  9:35             ` Marcus Better
2007-05-09 11:04               ` Lennert Buytenhek
2007-05-09 14:22                 ` David Acker
2007-05-09 14:45                   ` Michael-Luke Jones
2007-05-15 21:20                     ` Lennert Buytenhek
2007-05-08 16:34 ` Krzysztof Halasa
2007-05-16  7:13 ` Christoph Hellwig
2007-05-16  7:35   ` Michael-Luke Jones
2007-05-16  9:41   ` Lennert Buytenhek
2007-05-16 10:20     ` Michael-Luke Jones
2007-05-16 10:46     ` Rod Whitby
2007-05-16 10:56       ` Lennert Buytenhek
2007-05-16 11:35         ` Rod Whitby
2007-05-16 12:00           ` Lennert Buytenhek
2007-05-16 14:58           ` Krzysztof Halasa
2007-05-16 14:44   ` Krzysztof Halasa
2007-05-09 10:35 Mikael Pettersson
2007-05-09 11:07 ` Lennert Buytenhek
2007-05-09 10:58 Tomasz Chmielewski

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=m3lkfz5j6r.fsf@maximus.localdomain \
    --to=khc@pm.waw.pl \
    --cc=buytenh@wantstofly.org \
    --cc=jeff@garzik.org \
    --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