Skip to contentSkip to conversation

net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

PATCH Superseded Mans Rullgard 2 participants 5 messages Nov 16, 2015

Subsystems (2)

v6 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 net: ethernet: add driver for Aurora VLSI NB8800 Ethernet controller

This adds a driver for the Aurora VLSI NB8800 Ethernet controller. It is an almost complete rewrite of a driver originally found in a Sigma Designs 2.6.22 tree.

---
Changes:
- Use napi_gro_receive()
- Ignore xmit_more if using last tx descriptor
- Perform tx cleanup from napi poll
- Improve tx dma restart
- Fix return value of irq handler if no interrupt indicated by device
- Minor style fixes

It was suggested that the tx dma restart could be done from napi context. I tried this and could not get it to perform well.

---
 drivers/net/ethernet/Kconfig         |    1 +
 drivers/net/ethernet/Makefile        |    1 +
 drivers/net/ethernet/aurora/Kconfig  |   20 +
 drivers/net/ethernet/aurora/Makefile |    1 +
 drivers/net/ethernet/aurora/nb8800.c | 1551 ++++++++++++++++++++++++++++++++++
 drivers/net/ethernet/aurora/nb8800.h |  316 +++++++
 6 files changed, 1890 insertions(+)
 create mode 100644 drivers/net/ethernet/aurora/Kconfig
 create mode 100644 drivers/net/ethernet/aurora/Makefile
 create mode 100644 drivers/net/ethernet/aurora/nb8800.c
 create mode 100644 drivers/net/ethernet/aurora/nb8800.h
drivers/net/ethernet/Kconfig +1 -0
index 05aa759..8310163 100644
@@ -29,6 +29,7 @@ source "drivers/net/ethernet/apm/Kconfig"
 source "drivers/net/ethernet/apple/Kconfig"
 source "drivers/net/ethernet/arc/Kconfig"
 source "drivers/net/ethernet/atheros/Kconfig"
+source "drivers/net/ethernet/aurora/Kconfig"
 source "drivers/net/ethernet/cadence/Kconfig"
 source "drivers/net/ethernet/adi/Kconfig"
 source "drivers/net/ethernet/broadcom/Kconfig"
drivers/net/ethernet/Makefile +1 -0
index ddfc808..b435fb0 100644
@@ -15,6 +15,7 @@ obj-$(CONFIG_NET_XGENE) += apm/
 obj-$(CONFIG_NET_VENDOR_APPLE) += apple/
 obj-$(CONFIG_NET_VENDOR_ARC) += arc/
 obj-$(CONFIG_NET_VENDOR_ATHEROS) += atheros/
+obj-$(CONFIG_NET_VENDOR_AURORA) += aurora/
 obj-$(CONFIG_NET_CADENCE) += cadence/
 obj-$(CONFIG_NET_BFIN) += adi/
 obj-$(CONFIG_NET_VENDOR_BROADCOM) += broadcom/
drivers/net/ethernet/aurora/Kconfig new file +20 -0
new file mode 100644
index 0000000..a3c7106
@@ -0,0 +1,20 @@
+config NET_VENDOR_AURORA
+	bool "Aurora VLSI devices"
+	help
+	  If you have a network (Ethernet) device belonging to this class,
+	  say Y.
+
+	  Note that the answer to this question doesn't directly affect the
+	  kernel: saying N will just cause the configurator to skip all
+	  questions about Aurora devices. If you say Y, you will be asked
+	  for your specific device in the following questions.
+
+if NET_VENDOR_AURORA
+
+config AURORA_NB8800
+	tristate "Aurora AU-NB8800 support"
+	select PHYLIB
+	help
+	 Support for the AU-NB8800 gigabit Ethernet controller.
+
+endif
drivers/net/ethernet/aurora/Makefile new file +1 -0
new file mode 100644
index 0000000..6cb528a
@@ -0,0 +1 @@
+obj-$(CONFIG_AURORA_NB8800) += nb8800.o
drivers/net/ethernet/aurora/nb8800.c new file +1551 -0

1,551 lines not on this page · raw message

drivers/net/ethernet/aurora/nb8800.h new file +316 -0

316 lines not on this page · raw message

Signature · 1 line
2.6.3
maintainer
#1 lore raw

From: Mans Rullgard <[email protected]>
Date: Mon, 16 Nov 2015 18:23:35 +0000

Quoted 1 line

+static int nb8800_alloc_rx(struct net_device *dev, int i, bool napi)

"i" is passed in as a signed int here, but:

Quoted 1 line

+static void nb8800_receive(struct net_device *dev, unsigned i, unsigned len)

...

drivers/net/ethernet/aurora/nb8800.c line 257

Quoted 1 line
drivers/net/ethernet/aurora/nb8800.c new file +1 -0
+		err = nb8800_alloc_rx(dev, i, true);

It comes from an 'unsigned' value.

Please pick one type and use it consistently.

Also, always fully spell out "unsigned int" rather than use "unsigned" as a shorthand.

Thanks.

#2 lore raw
Quoted 7 lines · David Miller

From: Mans Rullgard <[email protected]>
Date: Mon, 16 Nov 2015 18:23:35 +0000

Quoted 1 line

+static int nb8800_alloc_rx(struct net_device *dev, int i, bool napi)

"i" is passed in as a signed int here, but:

Quoted 7 lines
Quoted 1 line

+static void nb8800_receive(struct net_device *dev, unsigned i, unsigned len)

...

drivers/net/ethernet/aurora/nb8800.c line 257

Quoted 1 line
drivers/net/ethernet/aurora/nb8800.c new file +1 -0
+		err = nb8800_alloc_rx(dev, i, true);

It comes from an 'unsigned' value.

Please pick one type and use it consistently.

Darn, missed one.

Quoted 2 lines

Also, always fully spell out "unsigned int" rather than use "unsigned" as a shorthand.

OK

Anything else?

Signature · 2 lines
Måns Rullgård
[email protected]
maintainer
#3 lore raw

From: Måns Rullgård <[email protected]>
Date: Mon, 16 Nov 2015 20:59:18 +0000

Quoted 1 line

Anything else?

Sorry, when I find one problem I give you the feedback for that and move on to the 100s of other patches I have in my queue.

Or would you like me to devote all of my time to just your driver instead of taking everyone's submissions into consideration?

#4 lore raw
Quoted 7 lines · David Miller

From: Måns Rullgård <[email protected]>
Date: Mon, 16 Nov 2015 20:59:18 +0000

Quoted 1 line

Anything else?

Sorry, when I find one problem I give you the feedback for that and move on to the 100s of other patches I have in my queue.

Some people prefer to comment on more than one issue, if present, per patch iteration. Apparently you're not one of them.

Quoted 2 lines

Or would you like me to devote all of my time to just your driver instead of taking everyone's submissions into consideration?

Of course not.

Signature · 2 lines
Måns Rullgård
[email protected]