* [RFC PATCH net-next 1/6] drivers/net: Add directory ethernet
From: Joe Perches @ 2010-12-12 12:03 UTC (permalink / raw)
To: David Miller, linux-kernel; +Cc: Jeff Kirsher, Paul Gortmaker, netdev
In-Reply-To: <cover.1292154142.git.joe@perches.com>
Add empty Kconfig files for various speeds and a no effect Makefile.
Modify drivers/net Kconfig and Makefile to include these new files.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/Kconfig | 6 ++++++
drivers/net/Makefile | 2 ++
drivers/net/ethernet/Kconfig.10-100 | 3 +++
drivers/net/ethernet/Kconfig.1000 | 3 +++
drivers/net/ethernet/Kconfig.10000 | 3 +++
drivers/net/ethernet/Makefile | 9 +++++++++
6 files changed, 26 insertions(+), 0 deletions(-)
create mode 100644 drivers/net/ethernet/Kconfig.10-100
create mode 100644 drivers/net/ethernet/Kconfig.1000
create mode 100644 drivers/net/ethernet/Kconfig.10000
create mode 100644 drivers/net/ethernet/Makefile
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index a20693f..c1d1be8 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -222,6 +222,8 @@ menuconfig NET_ETHERNET
if NET_ETHERNET
+source "drivers/net/ethernet/Kconfig.10-100"
+
config MACB
tristate "Atmel MACB support"
depends on HAVE_NET_MACB
@@ -2041,6 +2043,8 @@ menuconfig NETDEV_1000
if NETDEV_1000
+source "drivers/net/ethernet/Kconfig.1000"
+
config ACENIC
tristate "Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support"
depends on PCI
@@ -2569,6 +2573,8 @@ menuconfig NETDEV_10000
if NETDEV_10000
+source "drivers/net/ethernet/Kconfig.10000"
+
config MDIO
tristate
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 652fc6b..bfb5ade 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -2,6 +2,8 @@
# Makefile for the Linux network (ethercard) device drivers.
#
+obj-y += ethernet/
+
obj-$(CONFIG_MII) += mii.o
obj-$(CONFIG_MDIO) += mdio.o
obj-$(CONFIG_PHYLIB) += phy/
diff --git a/drivers/net/ethernet/Kconfig.10-100 b/drivers/net/ethernet/Kconfig.10-100
new file mode 100644
index 0000000..8b1ee80
--- /dev/null
+++ b/drivers/net/ethernet/Kconfig.10-100
@@ -0,0 +1,3 @@
+#
+# 10 Mb and 100Mb ethernet device configuration
+#
diff --git a/drivers/net/ethernet/Kconfig.1000 b/drivers/net/ethernet/Kconfig.1000
new file mode 100644
index 0000000..f51b97c
--- /dev/null
+++ b/drivers/net/ethernet/Kconfig.1000
@@ -0,0 +1,3 @@
+#
+# 1 Gb ethernet device configuration
+#
diff --git a/drivers/net/ethernet/Kconfig.10000 b/drivers/net/ethernet/Kconfig.10000
new file mode 100644
index 0000000..a8e28fe
--- /dev/null
+++ b/drivers/net/ethernet/Kconfig.10000
@@ -0,0 +1,3 @@
+#
+# 10 Gb ethernet device configuration
+#
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
new file mode 100644
index 0000000..f2aebec
--- /dev/null
+++ b/drivers/net/ethernet/Makefile
@@ -0,0 +1,9 @@
+#
+# Makefile for ethernet device drivers
+#
+
+# Dummy object just to avoid breaking build
+# These comments and the line below will be deleted on the
+# first addition to this file
+
+obj-$(CONFIG_ETHERNET_DUMMY_DRIVER) += /dev/null/dummy.o
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* [RFC PATCH net-next 2/6] ethernet: Move ethoc.c
From: Joe Perches @ 2010-12-12 12:03 UTC (permalink / raw)
To: David Miller, linux-kernel; +Cc: Jeff Kirsher, Paul Gortmaker, netdev
In-Reply-To: <cover.1292154142.git.joe@perches.com>
Move ethernet Open Core file to ethernet directory.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/Kconfig | 10 ----------
drivers/net/Makefile | 1 -
drivers/net/ethernet/Kconfig.10-100 | 10 ++++++++++
drivers/net/ethernet/Makefile | 6 +-----
drivers/net/{ => ethernet}/ethoc.c | 0
5 files changed, 11 insertions(+), 16 deletions(-)
rename drivers/net/{ => ethernet}/ethoc.c (100%)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index c1d1be8..ea9dbaf 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1021,16 +1021,6 @@ config ENC28J60_WRITEVERIFY
Enable the verify after the buffer write useful for debugging purpose.
If unsure, say N.
-config ETHOC
- tristate "OpenCores 10/100 Mbps Ethernet MAC support"
- depends on NET_ETHERNET && HAS_IOMEM && HAS_DMA
- select MII
- select PHYLIB
- select CRC32
- select BITREVERSE
- help
- Say Y here if you want to use the OpenCores 10/100 Mbps Ethernet MAC.
-
config GRETH
tristate "Aeroflex Gaisler GRETH Ethernet MAC support"
depends on SPARC
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index bfb5ade..1265d0e 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -257,7 +257,6 @@ obj-$(CONFIG_PASEMI_MAC) += pasemi_mac_driver.o
pasemi_mac_driver-objs := pasemi_mac.o pasemi_mac_ethtool.o
obj-$(CONFIG_MLX4_CORE) += mlx4/
obj-$(CONFIG_ENC28J60) += enc28j60.o
-obj-$(CONFIG_ETHOC) += ethoc.o
obj-$(CONFIG_GRETH) += greth.o
obj-$(CONFIG_XTENSA_XT2000_SONIC) += xtsonic.o
diff --git a/drivers/net/ethernet/Kconfig.10-100 b/drivers/net/ethernet/Kconfig.10-100
index 8b1ee80..a5c62bc 100644
--- a/drivers/net/ethernet/Kconfig.10-100
+++ b/drivers/net/ethernet/Kconfig.10-100
@@ -1,3 +1,13 @@
#
# 10 Mb and 100Mb ethernet device configuration
#
+
+config ETHOC
+ tristate "OpenCores 10/100 Mbps Ethernet MAC support"
+ depends on NET_ETHERNET && HAS_IOMEM && HAS_DMA
+ select MII
+ select PHYLIB
+ select CRC32
+ select BITREVERSE
+ help
+ Say Y here if you want to use the OpenCores 10/100 Mbps Ethernet MAC.
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index f2aebec..ad2afc1 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -2,8 +2,4 @@
# Makefile for ethernet device drivers
#
-# Dummy object just to avoid breaking build
-# These comments and the line below will be deleted on the
-# first addition to this file
-
-obj-$(CONFIG_ETHERNET_DUMMY_DRIVER) += /dev/null/dummy.o
+obj-$(CONFIG_ETHOC) += ethoc.o
diff --git a/drivers/net/ethoc.c b/drivers/net/ethernet/ethoc.c
similarity index 100%
rename from drivers/net/ethoc.c
rename to drivers/net/ethernet/ethoc.c
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* [RFC PATCH net-next 3/6] ethernet: Move dnet.[ch]
From: Joe Perches @ 2010-12-12 12:03 UTC (permalink / raw)
To: David Miller, linux-kernel; +Cc: Jeff Kirsher, Paul Gortmaker, netdev
In-Reply-To: <cover.1292154142.git.joe@perches.com>
Move dnet files to ethernet directory.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/Kconfig | 11 -----------
drivers/net/Makefile | 1 -
drivers/net/ethernet/Kconfig.10-100 | 11 +++++++++++
drivers/net/ethernet/Makefile | 1 +
drivers/net/{ => ethernet}/dnet.c | 0
drivers/net/{ => ethernet}/dnet.h | 0
6 files changed, 12 insertions(+), 12 deletions(-)
rename drivers/net/{ => ethernet}/dnet.c (100%)
rename drivers/net/{ => ethernet}/dnet.h (100%)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index ea9dbaf..c0716d9 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -1114,17 +1114,6 @@ config NI65
To compile this driver as a module, choose M here. The module
will be called ni65.
-config DNET
- tristate "Dave ethernet support (DNET)"
- depends on NET_ETHERNET && HAS_IOMEM
- select PHYLIB
- help
- The Dave ethernet interface (DNET) is found on Qong Board FPGA.
- Say Y to include support for the DNET chip.
-
- To compile this driver as a module, choose M here: the module
- will be called dnet.
-
source "drivers/net/tulip/Kconfig"
config AT1700
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 1265d0e..0379639 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -261,7 +261,6 @@ obj-$(CONFIG_GRETH) += greth.o
obj-$(CONFIG_XTENSA_XT2000_SONIC) += xtsonic.o
-obj-$(CONFIG_DNET) += dnet.o
obj-$(CONFIG_MACB) += macb.o
obj-$(CONFIG_S6GMAC) += s6gmac.o
diff --git a/drivers/net/ethernet/Kconfig.10-100 b/drivers/net/ethernet/Kconfig.10-100
index a5c62bc..e4fa897 100644
--- a/drivers/net/ethernet/Kconfig.10-100
+++ b/drivers/net/ethernet/Kconfig.10-100
@@ -2,6 +2,17 @@
# 10 Mb and 100Mb ethernet device configuration
#
+config DNET
+ tristate "Dave ethernet support (DNET)"
+ depends on NET_ETHERNET && HAS_IOMEM
+ select PHYLIB
+ help
+ The Dave ethernet interface (DNET) is found on Qong Board FPGA.
+ Say Y to include support for the DNET chip.
+
+ To compile this driver as a module, choose M here: the module
+ will be called dnet.
+
config ETHOC
tristate "OpenCores 10/100 Mbps Ethernet MAC support"
depends on NET_ETHERNET && HAS_IOMEM && HAS_DMA
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index ad2afc1..6e419ed 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -2,4 +2,5 @@
# Makefile for ethernet device drivers
#
+obj-$(CONFIG_DNET) += dnet.o
obj-$(CONFIG_ETHOC) += ethoc.o
diff --git a/drivers/net/dnet.c b/drivers/net/ethernet/dnet.c
similarity index 100%
rename from drivers/net/dnet.c
rename to drivers/net/ethernet/dnet.c
diff --git a/drivers/net/dnet.h b/drivers/net/ethernet/dnet.h
similarity index 100%
rename from drivers/net/dnet.h
rename to drivers/net/ethernet/dnet.h
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* [RFC PATCH net-next 4/6] ethernet: Move Sun Happymeal sunhme.[ch]
From: Joe Perches @ 2010-12-12 12:03 UTC (permalink / raw)
To: David Miller, linux-kernel; +Cc: Jeff Kirsher, Paul Gortmaker, netdev
In-Reply-To: <cover.1292154142.git.joe@perches.com>
Move Sun Happymeal files to ethernet directory.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/Kconfig | 13 -------------
drivers/net/Makefile | 1 -
drivers/net/ethernet/Kconfig.10-100 | 13 +++++++++++++
drivers/net/ethernet/Makefile | 1 +
drivers/net/{ => ethernet}/sunhme.c | 0
drivers/net/{ => ethernet}/sunhme.h | 0
6 files changed, 14 insertions(+), 14 deletions(-)
rename drivers/net/{ => ethernet}/sunhme.c (100%)
rename drivers/net/{ => ethernet}/sunhme.h (100%)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index c0716d9..926f090 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -558,19 +558,6 @@ config SUNLANCE
To compile this driver as a module, choose M here: the module
will be called sunlance.
-config HAPPYMEAL
- tristate "Sun Happy Meal 10/100baseT support"
- depends on SBUS || PCI
- select CRC32
- help
- This driver supports the "hme" interface present on most Ultra
- systems and as an option on older Sbus systems. This driver supports
- both PCI and Sbus devices. This driver also supports the "qfe" quad
- 100baseT device available in both PCI and Sbus configurations.
-
- To compile this driver as a module, choose M here: the module
- will be called sunhme.
-
config SUNBMAC
tristate "Sun BigMAC 10/100baseT support (EXPERIMENTAL)"
depends on SBUS && EXPERIMENTAL
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 0379639..8f2c0ee 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -56,7 +56,6 @@ obj-$(CONFIG_PLIP) += plip.o
obj-$(CONFIG_ROADRUNNER) += rrunner.o
-obj-$(CONFIG_HAPPYMEAL) += sunhme.o
obj-$(CONFIG_SUNLANCE) += sunlance.o
obj-$(CONFIG_SUNQE) += sunqe.o
obj-$(CONFIG_SUNBMAC) += sunbmac.o
diff --git a/drivers/net/ethernet/Kconfig.10-100 b/drivers/net/ethernet/Kconfig.10-100
index e4fa897..dbb95d3 100644
--- a/drivers/net/ethernet/Kconfig.10-100
+++ b/drivers/net/ethernet/Kconfig.10-100
@@ -22,3 +22,16 @@ config ETHOC
select BITREVERSE
help
Say Y here if you want to use the OpenCores 10/100 Mbps Ethernet MAC.
+
+config HAPPYMEAL
+ tristate "Sun Happy Meal 10/100baseT support"
+ depends on SBUS || PCI
+ select CRC32
+ help
+ This driver supports the "hme" interface present on most Ultra
+ systems and as an option on older Sbus systems. This driver supports
+ both PCI and Sbus devices. This driver also supports the "qfe" quad
+ 100baseT device available in both PCI and Sbus configurations.
+
+ To compile this driver as a module, choose M here: the module
+ will be called sunhme.
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index 6e419ed..0daa85c 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -4,3 +4,4 @@
obj-$(CONFIG_DNET) += dnet.o
obj-$(CONFIG_ETHOC) += ethoc.o
+obj-$(CONFIG_HAPPYMEAL) += sunhme.o
diff --git a/drivers/net/sunhme.c b/drivers/net/ethernet/sunhme.c
similarity index 100%
rename from drivers/net/sunhme.c
rename to drivers/net/ethernet/sunhme.c
diff --git a/drivers/net/sunhme.h b/drivers/net/ethernet/sunhme.h
similarity index 100%
rename from drivers/net/sunhme.h
rename to drivers/net/ethernet/sunhme.h
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* [RFC PATCH net-next 5/6] ethernet: Move Sun GEM sungem*.[ch]
From: Joe Perches @ 2010-12-12 12:03 UTC (permalink / raw)
To: David Miller, linux-kernel; +Cc: Jeff Kirsher, Paul Gortmaker, netdev
In-Reply-To: <cover.1292154142.git.joe@perches.com>
Move Sun GEM files to ethernet directory.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/Kconfig | 8 --------
drivers/net/Makefile | 1 -
drivers/net/ethernet/Kconfig.10-100 | 8 ++++++++
drivers/net/ethernet/Makefile | 1 +
drivers/net/{ => ethernet}/sungem.c | 0
drivers/net/{ => ethernet}/sungem.h | 0
drivers/net/{ => ethernet}/sungem_phy.c | 0
drivers/net/{ => ethernet}/sungem_phy.h | 0
8 files changed, 9 insertions(+), 9 deletions(-)
rename drivers/net/{ => ethernet}/sungem.c (100%)
rename drivers/net/{ => ethernet}/sungem.h (100%)
rename drivers/net/{ => ethernet}/sungem_phy.c (100%)
rename drivers/net/{ => ethernet}/sungem_phy.h (100%)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index 926f090..fbae645 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -581,14 +581,6 @@ config SUNQE
To compile this driver as a module, choose M here: the module
will be called sunqe.
-config SUNGEM
- tristate "Sun GEM support"
- depends on PCI
- select CRC32
- help
- Support for the Sun GEM chip, aka Sun GigabitEthernet/P 2.0. See also
- <http://www.sun.com/products-n-solutions/hardware/docs/pdf/806-3985-10.pdf>.
-
config CASSINI
tristate "Sun Cassini support"
depends on PCI
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 8f2c0ee..129aa08 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -60,7 +60,6 @@ obj-$(CONFIG_SUNLANCE) += sunlance.o
obj-$(CONFIG_SUNQE) += sunqe.o
obj-$(CONFIG_SUNBMAC) += sunbmac.o
obj-$(CONFIG_MYRI_SBUS) += myri_sbus.o
-obj-$(CONFIG_SUNGEM) += sungem.o sungem_phy.o
obj-$(CONFIG_CASSINI) += cassini.o
obj-$(CONFIG_SUNVNET) += sunvnet.o
diff --git a/drivers/net/ethernet/Kconfig.10-100 b/drivers/net/ethernet/Kconfig.10-100
index dbb95d3..f0430da 100644
--- a/drivers/net/ethernet/Kconfig.10-100
+++ b/drivers/net/ethernet/Kconfig.10-100
@@ -35,3 +35,11 @@ config HAPPYMEAL
To compile this driver as a module, choose M here: the module
will be called sunhme.
+
+config SUNGEM
+ tristate "Sun GEM support"
+ depends on PCI
+ select CRC32
+ help
+ Support for the Sun GEM chip, aka Sun GigabitEthernet/P 2.0. See also
+ <http://www.sun.com/products-n-solutions/hardware/docs/pdf/806-3985-10.pdf>.
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index 0daa85c..d7c6304 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -5,3 +5,4 @@
obj-$(CONFIG_DNET) += dnet.o
obj-$(CONFIG_ETHOC) += ethoc.o
obj-$(CONFIG_HAPPYMEAL) += sunhme.o
+obj-$(CONFIG_SUNGEM) += sungem.o sungem_phy.o
diff --git a/drivers/net/sungem.c b/drivers/net/ethernet/sungem.c
similarity index 100%
rename from drivers/net/sungem.c
rename to drivers/net/ethernet/sungem.c
diff --git a/drivers/net/sungem.h b/drivers/net/ethernet/sungem.h
similarity index 100%
rename from drivers/net/sungem.h
rename to drivers/net/ethernet/sungem.h
diff --git a/drivers/net/sungem_phy.c b/drivers/net/ethernet/sungem_phy.c
similarity index 100%
rename from drivers/net/sungem_phy.c
rename to drivers/net/ethernet/sungem_phy.c
diff --git a/drivers/net/sungem_phy.h b/drivers/net/ethernet/sungem_phy.h
similarity index 100%
rename from drivers/net/sungem_phy.h
rename to drivers/net/ethernet/sungem_phy.h
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* [RFC PATCH net-next 6/6] ethernet: Move Sun Cassini cassini.[ch]
From: Joe Perches @ 2010-12-12 12:03 UTC (permalink / raw)
To: David Miller, linux-kernel; +Cc: Jeff Kirsher, Paul Gortmaker, netdev
In-Reply-To: <cover.1292154142.git.joe@perches.com>
Move Sun Cassini files to ethernet directory.
Signed-off-by: Joe Perches <joe@perches.com>
---
drivers/net/Kconfig | 8 --------
drivers/net/Makefile | 1 -
drivers/net/ethernet/Kconfig.10-100 | 8 ++++++++
drivers/net/ethernet/Makefile | 1 +
drivers/net/{ => ethernet}/cassini.c | 0
drivers/net/{ => ethernet}/cassini.h | 0
6 files changed, 9 insertions(+), 9 deletions(-)
rename drivers/net/{ => ethernet}/cassini.c (100%)
rename drivers/net/{ => ethernet}/cassini.h (100%)
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
index fbae645..847dfbe 100644
--- a/drivers/net/Kconfig
+++ b/drivers/net/Kconfig
@@ -581,14 +581,6 @@ config SUNQE
To compile this driver as a module, choose M here: the module
will be called sunqe.
-config CASSINI
- tristate "Sun Cassini support"
- depends on PCI
- select CRC32
- help
- Support for the Sun Cassini chip, aka Sun GigaSwift Ethernet. See also
- <http://www.sun.com/products-n-solutions/hardware/docs/pdf/817-4341-10.pdf>
-
config SUNVNET
tristate "Sun Virtual Network support"
depends on SUN_LDOMS
diff --git a/drivers/net/Makefile b/drivers/net/Makefile
index 129aa08..3972e16 100644
--- a/drivers/net/Makefile
+++ b/drivers/net/Makefile
@@ -60,7 +60,6 @@ obj-$(CONFIG_SUNLANCE) += sunlance.o
obj-$(CONFIG_SUNQE) += sunqe.o
obj-$(CONFIG_SUNBMAC) += sunbmac.o
obj-$(CONFIG_MYRI_SBUS) += myri_sbus.o
-obj-$(CONFIG_CASSINI) += cassini.o
obj-$(CONFIG_SUNVNET) += sunvnet.o
obj-$(CONFIG_MACE) += mace.o
diff --git a/drivers/net/ethernet/Kconfig.10-100 b/drivers/net/ethernet/Kconfig.10-100
index f0430da..2bb39fc 100644
--- a/drivers/net/ethernet/Kconfig.10-100
+++ b/drivers/net/ethernet/Kconfig.10-100
@@ -23,6 +23,14 @@ config ETHOC
help
Say Y here if you want to use the OpenCores 10/100 Mbps Ethernet MAC.
+config CASSINI
+ tristate "Sun Cassini support"
+ depends on PCI
+ select CRC32
+ help
+ Support for the Sun Cassini chip, aka Sun GigaSwift Ethernet. See also
+ <http://www.sun.com/products-n-solutions/hardware/docs/pdf/817-4341-10.pdf>
+
config HAPPYMEAL
tristate "Sun Happy Meal 10/100baseT support"
depends on SBUS || PCI
diff --git a/drivers/net/ethernet/Makefile b/drivers/net/ethernet/Makefile
index d7c6304..bba207a 100644
--- a/drivers/net/ethernet/Makefile
+++ b/drivers/net/ethernet/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_DNET) += dnet.o
obj-$(CONFIG_ETHOC) += ethoc.o
obj-$(CONFIG_HAPPYMEAL) += sunhme.o
obj-$(CONFIG_SUNGEM) += sungem.o sungem_phy.o
+obj-$(CONFIG_CASSINI) += cassini.o
diff --git a/drivers/net/cassini.c b/drivers/net/ethernet/cassini.c
similarity index 100%
rename from drivers/net/cassini.c
rename to drivers/net/ethernet/cassini.c
diff --git a/drivers/net/cassini.h b/drivers/net/ethernet/cassini.h
similarity index 100%
rename from drivers/net/cassini.h
rename to drivers/net/ethernet/cassini.h
--
1.7.3.3.398.g0b0cd.dirty
^ permalink raw reply related
* [RFC][PATCH] Export DNSSL RA option to userspace
From: Pierre Ossman @ 2010-12-12 13:43 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
[-- Attachment #1.1: Type: text/plain, Size: 766 bytes --]
RFC 6106 specifies a new RA option for DNS resolver configuration that
therefore needs to end up in userspace.
This first patch just exports the new option, but I started thinking
that this seems overly complex that the kernel needs to be updated
every time there is something new of interest to userspace in the RA.
So I also have a second patch that exports everything that the kernel
doesn't want.
Patches only compile tested so far as I'm still hacking away at
userspace. Comments very much welcome though.
Rgds
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by FRA, a
Swedish intelligence agency. Make sure your server uses
encryption for SMTP traffic and consider using PGP for
end-to-end encryption.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-ipv6-export-DNS-search-list-option-to-userspace.patch --]
[-- Type: text/x-patch, Size: 1544 bytes --]
From a5b60e80eeed87763c811ecfb0d7aa5695d0a2bf Mon Sep 17 00:00:00 2001
From: Pierre Ossman <pierre@ossman.eu>
Date: Sun, 12 Dec 2010 00:06:48 +0100
Subject: [PATCH 1/2] ipv6: export DNS search list option to userspace
Like DNS resolver addresses, the suffixes to be used in DNS lookups need
to be configured by userspace. Make sure userspace has access to the
option containing that information.
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
---
include/net/ndisc.h | 3 ++-
net/ipv6/ndisc.c | 8 +++++++-
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 895997b..9c8698a 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -33,7 +33,8 @@ enum {
ND_OPT_MTU = 5, /* RFC2461 */
__ND_OPT_ARRAY_MAX,
ND_OPT_ROUTE_INFO = 24, /* RFC4191 */
- ND_OPT_RDNSS = 25, /* RFC5006 */
+ ND_OPT_RDNSS = 25, /* RFC5006 / RFC6106 */
+ ND_OPT_DNSSL = 31, /* RFC6106 */
__ND_OPT_MAX
};
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index 58841c4..c5b01e3 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -233,7 +233,13 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
static inline int ndisc_is_useropt(struct nd_opt_hdr *opt)
{
- return (opt->nd_opt_type == ND_OPT_RDNSS);
+ switch (opt->nd_opt_type) {
+ case ND_OPT_RDNSS:
+ case ND_OPT_DNSSL:
+ return 1;
+ default:
+ return 0;
+ }
}
static struct nd_opt_hdr *ndisc_next_useropt(struct nd_opt_hdr *cur,
--
1.7.2.3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply related
* [RFC][PATCH] Export all RA options that we don't handle to userspace
From: Pierre Ossman @ 2010-12-12 13:47 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <20101212144300.68e0fb16@mjolnir.ossman.eu>
[-- Attachment #1.1: Type: text/plain, Size: 897 bytes --]
Second patch that exports everything. If noone objects to this model,
then merge the two patches and just use the commit message from the
second one.
Pros:
- Kernel doesn't need to be updated for every new RA option that might
show up.
Cons:
- Possible security issue if it requires less privilege to read these
netlink messages than to open a raw ICMPv6 socket.
- List of types the kernel is interested in is now in two places in the
code, creating a risk for getting out of sync. I tried to come up
with a structure that would prevent this, but couldn't think of
anything that wouldn't require large changes. Ideas welcome...
Rgds
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by FRA, a
Swedish intelligence agency. Make sure your server uses
encryption for SMTP traffic and consider using PGP for
end-to-end encryption.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0002-ipv6-give-userspace-all-RA-options-that-we-do-not-ca.patch --]
[-- Type: text/x-patch, Size: 2561 bytes --]
From 00cdbb6f65ad4c8d71aec12a615a83aeedcf541c Mon Sep 17 00:00:00 2001
From: Pierre Ossman <pierre@ossman.eu>
Date: Sun, 12 Dec 2010 12:49:29 +0100
Subject: [PATCH 2/2] ipv6: give userspace all RA options that we do not care about
Instead of having to update the kernel for every new RA option that needs
to be dealt with in userspace, just send over everything that we don't
handle ourselves in the kernel.
Signed-off-by: Pierre Ossman <pierre@ossman.eu>
---
net/ipv6/ndisc.c | 38 +++++++++++++++++++-------------------
1 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
index c5b01e3..192e90b 100644
--- a/net/ipv6/ndisc.c
+++ b/net/ipv6/ndisc.c
@@ -233,12 +233,17 @@ static struct nd_opt_hdr *ndisc_next_option(struct nd_opt_hdr *cur,
static inline int ndisc_is_useropt(struct nd_opt_hdr *opt)
{
+ /* Keep in sync with ndisc_parse_options() ! */
switch (opt->nd_opt_type) {
- case ND_OPT_RDNSS:
- case ND_OPT_DNSSL:
- return 1;
- default:
+ case ND_OPT_SOURCE_LL_ADDR:
+ case ND_OPT_TARGET_LL_ADDR:
+ case ND_OPT_MTU:
+ case ND_OPT_REDIRECT_HDR:
+ case ND_OPT_PREFIX_INFO:
+ case ND_OPT_ROUTE_INFO:
return 0;
+ default:
+ return 1;
}
}
@@ -268,6 +273,7 @@ static struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
l = nd_opt->nd_opt_len << 3;
if (opt_len < l || l == 0)
return NULL;
+ /* Keep in sync with ndisc_is_useropt() ! */
switch (nd_opt->nd_opt_type) {
case ND_OPT_SOURCE_LL_ADDR:
case ND_OPT_TARGET_LL_ADDR:
@@ -295,21 +301,15 @@ static struct ndisc_options *ndisc_parse_options(u8 *opt, int opt_len,
break;
#endif
default:
- if (ndisc_is_useropt(nd_opt)) {
- ndopts->nd_useropts_end = nd_opt;
- if (!ndopts->nd_useropts)
- ndopts->nd_useropts = nd_opt;
- } else {
- /*
- * Unknown options must be silently ignored,
- * to accommodate future extension to the
- * protocol.
- */
- ND_PRINTK2(KERN_NOTICE
- "%s(): ignored unsupported option; type=%d, len=%d\n",
- __func__,
- nd_opt->nd_opt_type, nd_opt->nd_opt_len);
- }
+ /*
+ * Unknown options must be silently ignored,
+ * to accommodate future extension to the
+ * protocol. We also provide them to userspace
+ * for things like DNS configuration.
+ */
+ ndopts->nd_useropts_end = nd_opt;
+ if (!ndopts->nd_useropts)
+ ndopts->nd_useropts = nd_opt;
}
opt_len -= l;
nd_opt = ((void *)nd_opt) + l;
--
1.7.2.3
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply related
* Re: [PATCH net-next 1/4] bnx2x: LSO code was broken on BE platforms
From: Vladislav Zolotarov @ 2010-12-12 13:54 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Dave Miller, netdev list, Eilon Greenstein
In-Reply-To: <1292127293.3136.261.camel@localhost>
> This fix looks like it should go into the stable/longterm series. Since
> this driver has changed a lot since 2.6.32, you would need to provide a
> backported patch for that.
Ben, u r right. I'm preparing a similar patch series for net-2.6 at the
moment. Since the broken code was 57712 only, the only "stable" version
affected is a current net-2.6.
thanks,
vlad
^ permalink raw reply
* Re: [RFC][PATCH] Export DNSSL RA option to userspace
From: Pierre Ossman @ 2010-12-12 14:07 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Alexey Kuznetsov, Pekka Savola (ipv6),
James Morris, Hideaki YOSHIFUJI, Patrick McHardy
In-Reply-To: <20101212144300.68e0fb16@mjolnir.ossman.eu>
[-- Attachment #1: Type: text/plain, Size: 1382 bytes --]
I've also noticed a problem in the nduseropt code that I'm not sure how
to solve (given that this is now a stable userspace interface). Both
RFC5006 and RFC6106 state the following:
Note: An RDNSS address or a DNSSL domain name MUST be used only as
long as both the RA router Lifetime (advertised by a Router
Advertisement message [RFC4861]) and the corresponding option
Lifetime have not expired.
But the RA router lifetime is not included in the information sent.
Normally this is probably not an issue as the RDNSS and DNSSL lifetime
will be shorter than the router lifetime. One exception is when the
router is disabled at which point it will send a RA with router
lifetime to 0 (RFC4861 section 6.2.5). That means userspace will not be
informed that the DNS information should be removed immediately*.
Is there any way we can safely extend the interface with this
information? I'm not familiar enough with it myself yet to determine if
it's possible...
* Unless the router has a workaround for this client bug and also sets
RDNSS and DNSSL lifetimes to 0 as part of the final message.
Rgds
--
-- Pierre Ossman
WARNING: This correspondence is being monitored by FRA, a
Swedish intelligence agency. Make sure your server uses
encryption for SMTP traffic and consider using PGP for
end-to-end encryption.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 230 bytes --]
^ permalink raw reply
* [PATCH net-2.6 1/3] bnx2x: LSO code was broken on BE platforms
From: Vladislav Zolotarov @ 2010-12-12 14:11 UTC (permalink / raw)
To: Dave Miller; +Cc: netdev list, Eilon Greenstein
Make the LSO code work on BE platforms: parsing_data field of
a parsing BD (PBD) for 57712 was improperly composed which made FW read wrong
values for TCP header's length and offset and, as a result, the corresponding
PCI device was performing bad DMA reads triggering EEH.
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_cmn.c | 42 +++++++++++++++++++++++++---------------
1 files changed, 26 insertions(+), 16 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index 94d5f59..0af361e 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -1782,15 +1782,15 @@ exit_lbl:
}
#endif
-static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb,
- struct eth_tx_parse_bd_e2 *pbd,
- u32 xmit_type)
+static inline void bnx2x_set_pbd_gso_e2(struct sk_buff *skb, u32 *parsing_data,
+ u32 xmit_type)
{
- pbd->parsing_data |= cpu_to_le16(skb_shinfo(skb)->gso_size) <<
- ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT;
+ *parsing_data |= (skb_shinfo(skb)->gso_size <<
+ ETH_TX_PARSE_BD_E2_LSO_MSS_SHIFT) &
+ ETH_TX_PARSE_BD_E2_LSO_MSS;
if ((xmit_type & XMIT_GSO_V6) &&
(ipv6_hdr(skb)->nexthdr == NEXTHDR_IPV6))
- pbd->parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR;
+ *parsing_data |= ETH_TX_PARSE_BD_E2_IPV6_WITH_EXT_HDR;
}
/**
@@ -1835,15 +1835,15 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb,
* @return header len
*/
static inline u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
- struct eth_tx_parse_bd_e2 *pbd,
- u32 xmit_type)
+ u32 *parsing_data, u32 xmit_type)
{
- pbd->parsing_data |= cpu_to_le16(tcp_hdrlen(skb)/4) <<
- ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT;
+ *parsing_data |= ((tcp_hdrlen(skb)/4) <<
+ ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
+ ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
- pbd->parsing_data |= cpu_to_le16(((unsigned char *)tcp_hdr(skb) -
- skb->data) / 2) <<
- ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT;
+ *parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) <<
+ ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
+ ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data;
}
@@ -1912,6 +1912,7 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct eth_tx_bd *tx_data_bd, *total_pkt_bd = NULL;
struct eth_tx_parse_bd_e1x *pbd_e1x = NULL;
struct eth_tx_parse_bd_e2 *pbd_e2 = NULL;
+ u32 pbd_e2_parsing_data = 0;
u16 pkt_prod, bd_prod;
int nbd, fp_index;
dma_addr_t mapping;
@@ -2033,8 +2034,9 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
memset(pbd_e2, 0, sizeof(struct eth_tx_parse_bd_e2));
/* Set PBD in checksum offload case */
if (xmit_type & XMIT_CSUM)
- hlen = bnx2x_set_pbd_csum_e2(bp,
- skb, pbd_e2, xmit_type);
+ hlen = bnx2x_set_pbd_csum_e2(bp, skb,
+ &pbd_e2_parsing_data,
+ xmit_type);
} else {
pbd_e1x = &fp->tx_desc_ring[bd_prod].parse_bd_e1x;
memset(pbd_e1x, 0, sizeof(struct eth_tx_parse_bd_e1x));
@@ -2076,10 +2078,18 @@ netdev_tx_t bnx2x_start_xmit(struct sk_buff *skb, struct net_device *dev)
bd_prod = bnx2x_tx_split(bp, fp, tx_buf, &tx_start_bd,
hlen, bd_prod, ++nbd);
if (CHIP_IS_E2(bp))
- bnx2x_set_pbd_gso_e2(skb, pbd_e2, xmit_type);
+ bnx2x_set_pbd_gso_e2(skb, &pbd_e2_parsing_data,
+ xmit_type);
else
bnx2x_set_pbd_gso(skb, pbd_e1x, xmit_type);
}
+
+ /* Set the PBD's parsing_data field if not zero
+ * (for the chips newer than 57711).
+ */
+ if (pbd_e2_parsing_data)
+ pbd_e2->parsing_data = cpu_to_le32(pbd_e2_parsing_data);
+
tx_data_bd = (struct eth_tx_bd *)tx_start_bd;
/* Handle fragmented skb */
--
1.7.0.4
^ permalink raw reply related
* [PATCH 0/3 net-2.6] bnx2x: Backporting BE fixes from net-next
From: Vladislav Zolotarov @ 2010-12-12 14:11 UTC (permalink / raw)
To: Dave Miller; +Cc: netdev list, Eilon Greenstein, Ben Hutchings
Backporting the fix for a broken 57712 LSO code as for Ben's
suggestions. Also fixing the same compilation warning that has been
fixed in the net-next.
thanks,
vlad
^ permalink raw reply
* [PATCH net-2.6 2/3] bnx2x: Fixed a compilation warning
From: Vladislav Zolotarov @ 2010-12-12 14:12 UTC (permalink / raw)
To: Dave Miller; +Cc: netdev list, Eilon Greenstein
bnx2x_src_init_t2() is used only when BCM_CNIC is defined.
So, to avoid a compilation warning, we won't define it unless
BCM_CNIC is defined.
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x_init_ops.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x_init_ops.h b/drivers/net/bnx2x/bnx2x_init_ops.h
index a306b0e..66df29f 100644
--- a/drivers/net/bnx2x/bnx2x_init_ops.h
+++ b/drivers/net/bnx2x/bnx2x_init_ops.h
@@ -838,7 +838,7 @@ static void bnx2x_qm_init_ptr_table(struct bnx2x *bp, int qm_cid_count,
/****************************************************************************
* SRC initializations
****************************************************************************/
-
+#ifdef BCM_CNIC
/* called during init func stage */
static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,
dma_addr_t t2_mapping, int src_cid_count)
@@ -862,5 +862,5 @@ static void bnx2x_src_init_t2(struct bnx2x *bp, struct src_ent *t2,
U64_HI((u64)t2_mapping +
(src_cid_count-1) * sizeof(struct src_ent)));
}
-
+#endif
#endif /* BNX2X_INIT_OPS_H */
--
1.7.0.4
^ permalink raw reply related
* [PATCH net-2.6 3/3] bnx2x: Advance a version number to 1.60.01-0
From: Vladislav Zolotarov @ 2010-12-12 14:12 UTC (permalink / raw)
To: Dave Miller; +Cc: netdev list, Eilon Greenstein
Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
drivers/net/bnx2x/bnx2x.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/bnx2x/bnx2x.h b/drivers/net/bnx2x/bnx2x.h
index 863e73a..dca1762 100644
--- a/drivers/net/bnx2x/bnx2x.h
+++ b/drivers/net/bnx2x/bnx2x.h
@@ -20,8 +20,8 @@
* (you will need to reboot afterwards) */
/* #define BNX2X_STOP_ON_ERROR */
-#define DRV_MODULE_VERSION "1.60.00-4"
-#define DRV_MODULE_RELDATE "2010/11/01"
+#define DRV_MODULE_VERSION "1.60.01-0"
+#define DRV_MODULE_RELDATE "2010/11/12"
#define BNX2X_BC_VER 0x040200
#define BNX2X_MULTI_QUEUE
--
1.7.0.4
^ permalink raw reply related
* System blocks (hangs) on ifconfig up
From: Shmulik Hen @ 2010-12-12 15:00 UTC (permalink / raw)
To: netdev
Hello,
My system is Ubuntu 10.04, running kernel 2.6.32-26-generic.
Whenever I try to bring up a specific ethernet interface for the second
time, my
system becomes unresponsive for 60 seconds - i.e. no mouse, no keyboard, no
screen refresh. etc.
Looking at the driver's code, I could see that it's dev->open() method calls
wait_event_interruptible_timeout() with a timeout of 60 seconds - exactly
the delay I'm seeing.
I have narrowed the code to a bare minimum (see below - loosely based on
dummy.c), which only calls mdelay(10000) in it's dev->open() method, and
still, my system blocks for exactly 10 seconds when I run the following
sequence:
> sudo ifconfig shmulik0 up
> sudo ifconfig shmulik0 down
> sudo ifconfig shmulik0 up
At this point - the system is stuck for 10 seconds.
Thanks,
Shmulik.
------------------------------------------------------------------------------
shmulik.c:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
MODULE_AUTHOR("Shmulik Hen");
MODULE_DESCRIPTION("Shmulik's sample network driver");
MODULE_LICENSE("GPL");
static struct net_device *g_dev = NULL;
static int shmulik_set_mac_address(struct net_device *dev, void *p)
{
struct sockaddr *sa = p;
if (!is_valid_ether_addr(sa->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
return 0;
}
static netdev_tx_t shmulik_start_xmit(struct sk_buff *skb, struct
net_device *dev)
{
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
static int shmulik_open(struct net_device *dev)
{
mdelay(10000);
netif_carrier_on(dev);
netif_start_queue(dev);
return 0;
}
static int shmulik_close(struct net_device *dev)
{
netif_stop_queue(dev);
netif_carrier_off(dev);
return 0;
}
static const struct net_device_ops shmulik_drv_ops =
{
.ndo_open = shmulik_open,
.ndo_stop = shmulik_close,
.ndo_start_xmit = shmulik_start_xmit,
.ndo_set_mac_address = shmulik_set_mac_address,
};
static int __init shmulik_drv_init(void)
{
int rc;
struct net_device *dev;
if (g_dev)
return -EEXIST;
dev = alloc_etherdev(0);
if (!dev)
return -ENOMEM;
sprintf(dev->name, "%s%d" , "shmulik", 0);
dev->tx_queue_len = 0;
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
random_ether_addr(dev->dev_addr);
dev->netdev_ops = &shmulik_drv_ops;
rc = register_netdev(dev);
if (rc)
goto err_exit;
g_dev = dev;
return 0;
err_exit:
free_netdev(dev);
return rc;
}
static void __exit shmulik_drv_exit(void)
{
if (g_dev)
{
unregister_netdev(g_dev);
free_netdev(g_dev);
g_dev = NULL;
}
}
module_init(shmulik_drv_init);
module_exit(shmulik_drv_exit);
^ permalink raw reply
* System blocks (hangs) on ifconfig up
From: Shmulik Hen @ 2010-12-12 15:08 UTC (permalink / raw)
To: netdev
Hello,
My system is Ubuntu 10.04, running kernel 2.6.32-26-generic.
Whenever I try to bring up a specific ethernet interface for the second
time, my
system becomes unresponsive for 60 seconds - i.e. no mouse, no keyboard, no
screen refresh. etc.
Looking at the driver's code, I could see that it's dev->open() method
calls
wait_event_interruptible_timeout() with a timeout of 60 seconds - exactly
the delay I'm seeing.
I have narrowed the code to a bare minimum (see below - loosely based on
dummy.c), which only calls mdelay(10000) in it's dev->open() method, and
still, my system blocks for exactly 10 seconds when I run the following
sequence:
> sudo ifconfig shmulik0 up
> sudo ifconfig shmulik0 down
> sudo ifconfig shmulik0 up
At this point - the system is stuck for 10 seconds.
Thanks,
Shmulik.
------------------------------------------------------------------------------
shmulik.c:
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/skbuff.h>
MODULE_AUTHOR("Shmulik Hen");
MODULE_DESCRIPTION("Shmulik's sample network driver");
MODULE_LICENSE("GPL");
static struct net_device *g_dev = NULL;
static int shmulik_set_mac_address(struct net_device *dev, void *p)
{
struct sockaddr *sa = p;
if (!is_valid_ether_addr(sa->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
return 0;
}
static netdev_tx_t shmulik_start_xmit(struct sk_buff *skb, struct
net_device *dev)
{
dev_kfree_skb(skb);
return NETDEV_TX_OK;
}
static int shmulik_open(struct net_device *dev)
{
mdelay(10000);
netif_carrier_on(dev);
netif_start_queue(dev);
return 0;
}
static int shmulik_close(struct net_device *dev)
{
netif_stop_queue(dev);
netif_carrier_off(dev);
return 0;
}
static const struct net_device_ops shmulik_drv_ops =
{
.ndo_open = shmulik_open,
.ndo_stop = shmulik_close,
.ndo_start_xmit = shmulik_start_xmit,
.ndo_set_mac_address = shmulik_set_mac_address,
};
static int __init shmulik_drv_init(void)
{
int rc;
struct net_device *dev;
if (g_dev)
return -EEXIST;
dev = alloc_etherdev(0);
if (!dev)
return -ENOMEM;
sprintf(dev->name, "%s%d" , "shmulik", 0);
dev->tx_queue_len = 0;
dev->flags |= IFF_NOARP;
dev->flags &= ~IFF_MULTICAST;
random_ether_addr(dev->dev_addr);
dev->netdev_ops = &shmulik_drv_ops;
rc = register_netdev(dev);
if (rc)
goto err_exit;
g_dev = dev;
return 0;
err_exit:
free_netdev(dev);
return rc;
}
static void __exit shmulik_drv_exit(void)
{
if (g_dev)
{
unregister_netdev(g_dev);
free_netdev(g_dev);
g_dev = NULL;
}
}
module_init(shmulik_drv_init);
module_exit(shmulik_drv_exit);
^ permalink raw reply
* Re: [PATCH net-next-2.6 v8 20/20] CAN : Replace netif_rx to netif_receive_skb
From: Marc Kleine-Budde @ 2010-12-12 15:15 UTC (permalink / raw)
To: Tomoya MORINAGA
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w,
qi.wang-ral2JQCrhuEAvxtiuMwx3w,
margie.foster-ral2JQCrhuEAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
joel.clark-ral2JQCrhuEAvxtiuMwx3w, Wolfgang Grandegger
In-Reply-To: <4CFE16A3.6070903-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 1170 bytes --]
On 12/07/2010 12:12 PM, Tomoya MORINAGA wrote:
> Since this driver is implemented as NAPI,
> netif_receive_skb must be used not netif_rx.
>
> Signed-off-by: Tomoya MORINAGA <tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
Looks good.
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
Marc
> ---
> drivers/net/can/pch_can.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index 4697b1c..8d45fdd 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -572,7 +572,7 @@ static void pch_can_error(struct net_device *ndev, u32 status)
> cf->data[7] = (errc & PCH_REC) >> 8;
>
> priv->can.state = state;
> - netif_rx(skb);
> + netif_receive_skb(skb);
>
> stats->rx_packets++;
> stats->rx_bytes += cf->can_dlc;
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [PATCH net-next-2.6 v8 18/20] CAN : Optimize "if" condition in rx/tx processing
From: Marc Kleine-Budde @ 2010-12-12 15:16 UTC (permalink / raw)
To: Tomoya MORINAGA
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w,
qi.wang-ral2JQCrhuEAvxtiuMwx3w,
margie.foster-ral2JQCrhuEAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
joel.clark-ral2JQCrhuEAvxtiuMwx3w, Wolfgang Grandegger
In-Reply-To: <4CFE166D.8040805-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 2720 bytes --]
On 12/07/2010 12:11 PM, Tomoya MORINAGA wrote:
> For reduce "if" condition, easy to read/understand the code,
> optimize "if" condition in rx/tx processing.
>
> Signed-off-by: Tomoya MORINAGA <tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
Acked-by: Marc Kleine-Budde <mkl-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
> ---
> drivers/net/can/pch_can.c | 26 ++++++++++----------------
> 1 files changed, 10 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index 8efbe35..dcd8f00 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -746,19 +746,16 @@ static int pch_can_poll(struct napi_struct *napi, int quota)
>
> if (int_stat == PCH_STATUS_INT) {
> reg_stat = ioread32(&priv->regs->stat);
> - if (reg_stat & (PCH_BUS_OFF | PCH_LEC_ALL)) {
> - if (reg_stat & PCH_BUS_OFF ||
> - (reg_stat & PCH_LEC_ALL) != PCH_LEC_ALL) {
> - pch_can_error(ndev, reg_stat);
> - quota--;
> - }
> - }
>
> - if (reg_stat & PCH_TX_OK)
> - pch_can_bit_clear(&priv->regs->stat, PCH_TX_OK);
> + if ((reg_stat & (PCH_BUS_OFF | PCH_LEC_ALL)) &&
> + ((reg_stat & PCH_LEC_ALL) != PCH_LEC_ALL)) {
> + pch_can_error(ndev, reg_stat);
> + quota--;
> + }
>
> - if (reg_stat & PCH_RX_OK)
> - pch_can_bit_clear(&priv->regs->stat, PCH_RX_OK);
> + if (reg_stat & (PCH_TX_OK | PCH_RX_OK))
> + pch_can_bit_clear(&priv->regs->stat,
> + reg_stat & (PCH_TX_OK | PCH_RX_OK));
>
> int_stat = pch_can_int_pending(priv);
> }
> @@ -900,14 +897,13 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
> if (can_dropped_invalid_skb(ndev, skb))
> return NETDEV_TX_OK;
>
> + tx_obj_no = priv->tx_obj;
> if (priv->tx_obj == PCH_TX_OBJ_END) {
> if (ioread32(&priv->regs->treq2) & PCH_TREQ2_TX_MASK)
> netif_stop_queue(ndev);
>
> - tx_obj_no = priv->tx_obj;
> priv->tx_obj = PCH_TX_OBJ_START;
> } else {
> - tx_obj_no = priv->tx_obj;
> priv->tx_obj++;
> }
>
> @@ -926,9 +922,7 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
> id2 |= PCH_ID_MSGVAL;
>
> /* If remote frame has to be transmitted.. */
> - if (cf->can_id & CAN_RTR_FLAG)
> - id2 &= ~PCH_ID2_DIR;
> - else
> + if (!(cf->can_id & CAN_RTR_FLAG))
> id2 |= PCH_ID2_DIR;
>
> iowrite32(id2, &priv->regs->ifregs[1].id2);
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [PATCH net-next-2.6 v8 01/20] CAN : Add flow control processing.
From: Marc Kleine-Budde @ 2010-12-12 15:26 UTC (permalink / raw)
To: Tomoya MORINAGA
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w,
qi.wang-ral2JQCrhuEAvxtiuMwx3w,
margie.foster-ral2JQCrhuEAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
joel.clark-ral2JQCrhuEAvxtiuMwx3w, Wolfgang Grandegger
In-Reply-To: <4CFE13E4.2020707-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 3115 bytes --]
On 12/07/2010 12:00 PM, Tomoya MORINAGA wrote:
> Currently, there is no flow control processing.
> Thus, Add flow control processing as
> when there is no empty of tx buffer,
> netif_stop_queue is called.
> When there is empty buffer, netif_wake_queue is called.
See comment inline.
> Signed-off-by: Tomoya MORINAGA <tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
> ---
> drivers/net/can/pch_can.c | 31 ++++++++++++-------------------
> 1 files changed, 12 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index a9b6a65..f0f1404 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -102,6 +102,10 @@
>
> #define PCH_FIFO_THRESH 16
>
> +/* TxRqst2 show status of MsgObjNo.17~32 */
> +#define PCH_TREQ2_TX_MASK (((1 << PCH_TX_OBJ_NUM) - 1) <<\
> + (PCH_RX_OBJ_END - 16))
> +
> enum pch_ifreg {
> PCH_RX_IFREG,
> PCH_TX_IFREG,
> @@ -871,6 +875,8 @@ MSG_OBJ:
> dlc = 8;
> stats->tx_bytes += dlc;
> stats->tx_packets++;
> + if (int_stat == PCH_TX_OBJ_END)
> + netif_wake_queue(ndev);
> }
>
> int_stat = pch_can_int_pending(priv);
> @@ -1009,18 +1015,6 @@ static int pch_close(struct net_device *ndev)
> return 0;
> }
>
> -static int pch_get_msg_obj_sts(struct net_device *ndev, u32 obj_id)
> -{
> - u32 buffer_status = 0;
> - struct pch_can_priv *priv = netdev_priv(ndev);
> -
> - /* Getting the message object status. */
> - buffer_status = (u32) pch_can_get_buffer_status(priv);
> -
> - return buffer_status & obj_id;
> -}
> -
> -
> static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
> {
> int i, j;
> @@ -1031,17 +1025,16 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
> if (can_dropped_invalid_skb(ndev, skb))
> return NETDEV_TX_OK;
>
> - if (priv->tx_obj == PCH_TX_OBJ_END) { /* Point tail Obj */
> - while (pch_get_msg_obj_sts(ndev, (((1 << PCH_TX_OBJ_NUM)-1) <<
> - PCH_RX_OBJ_NUM)))
> - udelay(500);
> + if (priv->tx_obj == PCH_TX_OBJ_END) {
> + if (ioread32(&priv->regs->treq2) & PCH_TREQ2_TX_MASK)
> + netif_stop_queue(ndev);
David asked you in his previous review to implement a pure software
solution without relying on the hardware because it tends to be racy.
>
> - priv->tx_obj = PCH_TX_OBJ_START; /* Point head of Tx Obj ID */
> - tx_buffer_avail = priv->tx_obj; /* Point Tail of Tx Obj */
> + tx_buffer_avail = priv->tx_obj;
> + priv->tx_obj = PCH_TX_OBJ_START;
> } else {
> tx_buffer_avail = priv->tx_obj;
> + priv->tx_obj++;
> }
> - priv->tx_obj++;
>
> /* Reading the Msg Obj from the Msg RAM to the Interface register. */
> iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[1].cmask);
cheers, Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: [PATCH net-next-2.6 v8 03/20] CAN : Fix endianness issue.
From: Marc Kleine-Budde @ 2010-12-12 15:30 UTC (permalink / raw)
To: Tomoya MORINAGA
Cc: andrew.chih.howe.khor-ral2JQCrhuEAvxtiuMwx3w,
qi.wang-ral2JQCrhuEAvxtiuMwx3w,
margie.foster-ral2JQCrhuEAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-kernel-u79uwXL29TY76Z2rM5mHXA,
yong.y.wang-ral2JQCrhuEAvxtiuMwx3w,
socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
kok.howg.ewe-ral2JQCrhuEAvxtiuMwx3w,
joel.clark-ral2JQCrhuEAvxtiuMwx3w, Wolfgang Grandegger
In-Reply-To: <4CFE1489.4030808-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
[-- Attachment #1.1: Type: text/plain, Size: 5298 bytes --]
On 12/07/2010 12:03 PM, Tomoya MORINAGA wrote:
> there is endianness issue both Tx and Rx.
> Currently, data is set like below.
> Register:
> MSB--LSB
> x x D0 D1
> x x D2 D3
> x x D4 D5
> x x D6 D7
>
> But Data to be sent must be set like below.
> Register:
> MSB--LSB
> x x D1 D0
> x x D3 D2
> x x D5 D4
> x x D7 D6 (x means reserved area.)
Nitpick inline, please fix it, then add my Acked-by
Marc
> Signed-off-by: Tomoya MORINAGA <tomoya-linux-ECg8zkTtlr0C6LszWs/t0g@public.gmane.org>
> ---
> drivers/net/can/pch_can.c | 47 +++++++++++++++++++-------------------------
> 1 files changed, 20 insertions(+), 27 deletions(-)
>
> diff --git a/drivers/net/can/pch_can.c b/drivers/net/can/pch_can.c
> index 0b6d4f4..b17ca0c 100644
> --- a/drivers/net/can/pch_can.c
> +++ b/drivers/net/can/pch_can.c
> @@ -138,10 +138,7 @@ struct pch_can_if_regs {
> u32 id1;
> u32 id2;
> u32 mcont;
> - u32 dataa1;
> - u32 dataa2;
> - u32 datab1;
> - u32 datab2;
> + u32 data[4];
> u32 rsv[13];
> };
>
> @@ -424,10 +421,10 @@ static void pch_can_clear_buffers(struct pch_can_priv *priv)
> iowrite32(0x0, &priv->regs->ifregs[0].id1);
> iowrite32(0x0, &priv->regs->ifregs[0].id2);
> iowrite32(0x0, &priv->regs->ifregs[0].mcont);
> - iowrite32(0x0, &priv->regs->ifregs[0].dataa1);
> - iowrite32(0x0, &priv->regs->ifregs[0].dataa2);
> - iowrite32(0x0, &priv->regs->ifregs[0].datab1);
> - iowrite32(0x0, &priv->regs->ifregs[0].datab2);
> + iowrite32(0x0, &priv->regs->ifregs[0].data[0]);
> + iowrite32(0x0, &priv->regs->ifregs[0].data[1]);
> + iowrite32(0x0, &priv->regs->ifregs[0].data[2]);
> + iowrite32(0x0, &priv->regs->ifregs[0].data[3]);
> iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
> PCH_CMASK_ARB | PCH_CMASK_CTRL,
> &priv->regs->ifregs[0].cmask);
> @@ -441,10 +438,10 @@ static void pch_can_clear_buffers(struct pch_can_priv *priv)
> iowrite32(0x0, &priv->regs->ifregs[1].id1);
> iowrite32(0x0, &priv->regs->ifregs[1].id2);
> iowrite32(0x0, &priv->regs->ifregs[1].mcont);
> - iowrite32(0x0, &priv->regs->ifregs[1].dataa1);
> - iowrite32(0x0, &priv->regs->ifregs[1].dataa2);
> - iowrite32(0x0, &priv->regs->ifregs[1].datab1);
> - iowrite32(0x0, &priv->regs->ifregs[1].datab2);
> + iowrite32(0x0, &priv->regs->ifregs[1].data[0]);
> + iowrite32(0x0, &priv->regs->ifregs[1].data[1]);
> + iowrite32(0x0, &priv->regs->ifregs[1].data[2]);
> + iowrite32(0x0, &priv->regs->ifregs[1].data[3]);
> iowrite32(PCH_CMASK_RDWR | PCH_CMASK_MASK |
> PCH_CMASK_ARB | PCH_CMASK_CTRL,
> &priv->regs->ifregs[1].cmask);
> @@ -707,12 +704,13 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
> canid_t id;
> u32 ide;
> u32 rtr;
> - int i, j, k;
> + int i, k;
> int rcv_pkts = 0;
> struct sk_buff *skb;
> struct can_frame *cf;
> struct pch_can_priv *priv = netdev_priv(ndev);
> struct net_device_stats *stats = &(priv->ndev->stats);
> + u16 data_reg;
>
> /* Reading the messsage object from the Message RAM */
> iowrite32(PCH_CMASK_RX_TX_GET, &priv->regs->ifregs[0].cmask);
> @@ -778,12 +776,10 @@ static int pch_can_rx_normal(struct net_device *ndev, u32 int_stat)
> ((ioread32(&priv->regs->ifregs[0].mcont)) & 0x0f);
> }
>
> - for (i = 0, j = 0; i < cf->can_dlc; j++) {
> - reg = ioread32(&priv->regs->ifregs[0].dataa1 + j*4);
> - cf->data[i++] = cpu_to_le32(reg & 0xff);
> - if (i == cf->can_dlc)
> - break;
> - cf->data[i++] = cpu_to_le32((reg >> 8) & 0xff);
> + for (i = 0; i < cf->can_dlc; i += 2) {
> + data_reg = ioread16(&priv->regs->ifregs[0].data[i / 2]);
> + cf->data[i] = data_reg & 0xff;
The & 0xff is not needed cf->data is only 8bit wide.
> + cf->data[i + 1] = data_reg >> 8;
> }
>
> netif_receive_skb(skb);
> @@ -1016,10 +1012,10 @@ static int pch_close(struct net_device *ndev)
>
> static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
> {
> - int i, j;
> struct pch_can_priv *priv = netdev_priv(ndev);
> struct can_frame *cf = (struct can_frame *)skb->data;
> int tx_buffer_avail = 0;
> + int i;
>
> if (can_dropped_invalid_skb(ndev, skb))
> return NETDEV_TX_OK;
> @@ -1060,13 +1056,10 @@ static netdev_tx_t pch_xmit(struct sk_buff *skb, struct net_device *ndev)
> if (cf->can_id & CAN_RTR_FLAG)
> pch_can_bit_clear(&priv->regs->ifregs[1].id2, PCH_ID2_DIR);
>
> - for (i = 0, j = 0; i < cf->can_dlc; j++) {
> - iowrite32(le32_to_cpu(cf->data[i++]),
> - (&priv->regs->ifregs[1].dataa1) + j*4);
> - if (i == cf->can_dlc)
> - break;
> - iowrite32(le32_to_cpu(cf->data[i++] << 8),
> - (&priv->regs->ifregs[1].dataa1) + j*4);
> + /* Copy data to register */
> + for (i = 0; i < cf->can_dlc; i += 2) {
> + iowrite16(cf->data[i] | (cf->data[i + 1] << 8),
> + &priv->regs->ifregs[1].data[i / 2]);
> }
>
> can_put_echo_skb(skb, ndev, tx_buffer_avail - PCH_RX_OBJ_END - 1);
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]
[-- Attachment #2: Type: text/plain, Size: 188 bytes --]
_______________________________________________
Socketcan-core mailing list
Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org
https://lists.berlios.de/mailman/listinfo/socketcan-core
^ permalink raw reply
* Re: Loopback performance from kernel 2.6.12 to 2.6.37
From: Arnaldo Carvalho de Melo @ 2010-12-12 15:48 UTC (permalink / raw)
To: Jesper Dangaard Brouer; +Cc: Eric Dumazet, netdev
In-Reply-To: <1289388256.15004.66.camel@firesoul.comx.local>
Em Wed, Nov 10, 2010 at 12:24:16PM +0100, Jesper Dangaard Brouer escreveu:
> > BUT perf top reveals that its probably related to the function
> > 'find_busiest_group' ... any kernel config hints how I get rid of that?
>
> The 'find_busiest_group' seems to be an artifact of "perf top", if I use
> "perf record" then the 'find_busiest_group' function disappears. Which
> is kind of strange, as 'find_busiest_group' seem the be related to
> sched_fair.c.
>
> perf --version
> perf version 2.6.35.7.1.g60d9c
perf top does sytemwide sampling, while when you use 'perf record
./workload' its not systemwide.
Take a look at 'perf top --help' to see how to limit this to an existing
pid, tid, cpu list, etc.
- Arnaldo
^ permalink raw reply
* [PATCH 1/9] drivers/net: remove unnecessary flush_scheduled_work() calls
From: Tejun Heo @ 2010-12-12 15:52 UTC (permalink / raw)
To: linux-kernel, netdev, davem
Cc: Tejun Heo, Wolfgang Grandegger, Stephen Hemminger,
Ramkrishna Vepa, Sivakumar Subramani, Sreenivasa Honnur,
Jon Mason
In-Reply-To: <1292169185-10579-1-git-send-email-tj@kernel.org>
janz-ican3, sh_eth, skge and vxge don't use workqueue at all and there
is no reason to flush the system_wq. Drop flush_scheduled_work()
calls and references to workqueue.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: Ramkrishna Vepa <ramkrishna.vepa@exar.com>
Cc: Sivakumar Subramani <sivakumar.subramani@exar.com>
Cc: Sreenivasa Honnur <sreenivasa.honnur@exar.com>
Cc: Jon Mason <jon.mason@exar.com>
Cc: netdev@vger.kernel.org
---
drivers/net/can/janz-ican3.c | 9 ---------
drivers/net/sh_eth.c | 1 -
drivers/net/sh_eth.h | 1 -
drivers/net/skge.c | 2 --
drivers/net/vxge/vxge-main.c | 2 --
5 files changed, 0 insertions(+), 15 deletions(-)
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c
index 6e533dc..b9a6d7a 100644
--- a/drivers/net/can/janz-ican3.c
+++ b/drivers/net/can/janz-ican3.c
@@ -1114,11 +1114,6 @@ static bool ican3_txok(struct ican3_dev *mod)
/*
* Recieve one CAN frame from the hardware
*
- * This works like the core of a NAPI function, but is intended to be called
- * from workqueue context instead. This driver already needs a workqueue to
- * process control messages, so we use the workqueue instead of using NAPI.
- * This was done to simplify locking.
- *
* CONTEXT: must be called from user context
*/
static int ican3_recv_skb(struct ican3_dev *mod)
@@ -1251,7 +1246,6 @@ static irqreturn_t ican3_irq(int irq, void *dev_id)
* Reset an ICAN module to its power-on state
*
* CONTEXT: no network device registered
- * LOCKING: work function disabled
*/
static int ican3_reset_module(struct ican3_dev *mod)
{
@@ -1262,9 +1256,6 @@ static int ican3_reset_module(struct ican3_dev *mod)
/* disable interrupts so no more work is scheduled */
iowrite8(1 << mod->num, &mod->ctrl->int_disable);
- /* flush any pending work */
- flush_scheduled_work();
-
/* the first unallocated page in the DPM is #9 */
mod->free_page = DPM_FREE_START;
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index b12660d..819c175 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -1552,7 +1552,6 @@ static int sh_eth_drv_remove(struct platform_device *pdev)
sh_mdio_release(ndev);
unregister_netdev(ndev);
- flush_scheduled_work();
pm_runtime_disable(&pdev->dev);
free_netdev(ndev);
platform_set_drvdata(pdev, NULL);
diff --git a/drivers/net/sh_eth.h b/drivers/net/sh_eth.h
index 8b47763..efa6422 100644
--- a/drivers/net/sh_eth.h
+++ b/drivers/net/sh_eth.h
@@ -26,7 +26,6 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/spinlock.h>
-#include <linux/workqueue.h>
#include <linux/netdevice.h>
#include <linux/phy.h>
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index 220e039..8c1404b 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -4012,8 +4012,6 @@ static void __devexit skge_remove(struct pci_dev *pdev)
if (!hw)
return;
- flush_scheduled_work();
-
dev1 = hw->dev[1];
if (dev1)
unregister_netdev(dev1);
diff --git a/drivers/net/vxge/vxge-main.c b/drivers/net/vxge/vxge-main.c
index b771e4b..537ad87 100644
--- a/drivers/net/vxge/vxge-main.c
+++ b/drivers/net/vxge/vxge-main.c
@@ -3439,8 +3439,6 @@ static void vxge_device_unregister(struct __vxge_hw_device *hldev)
strncpy(buf, dev->name, IFNAMSIZ);
- flush_scheduled_work();
-
/* in 2.6 will call stop() if device is up */
unregister_netdev(dev);
--
1.7.1
^ permalink raw reply related
* [PATCH 3/9] ehea: kill unused ehea_rereg_mr_task
From: Tejun Heo @ 2010-12-12 15:52 UTC (permalink / raw)
To: linux-kernel, netdev, davem; +Cc: Tejun Heo, Breno Leitao
In-Reply-To: <1292169185-10579-1-git-send-email-tj@kernel.org>
ehea_rereg_mr_task is not used. Remove it and drop @work parameter
from ehea_rereg_mrs().
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Breno Leitao <leitao@linux.vnet.ibm.com>
Cc: netdev@vger.kernel.org
---
drivers/net/ehea/ehea.h | 2 --
drivers/net/ehea/ehea_main.c | 9 +++------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 8e745e7..1f2a675 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -515,6 +515,4 @@ void ehea_set_ethtool_ops(struct net_device *netdev);
int ehea_sense_port_attr(struct ehea_port *port);
int ehea_set_portspeed(struct ehea_port *port, u32 port_speed);
-extern struct work_struct ehea_rereg_mr_task;
-
#endif /* __EHEA_H__ */
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 69f6152..d51def1 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -101,7 +101,6 @@ MODULE_PARM_DESC(use_lro, " Large Receive Offload, 1: enable, 0: disable, "
static int port_name_cnt;
static LIST_HEAD(adapter_list);
static unsigned long ehea_driver_flags;
-struct work_struct ehea_rereg_mr_task;
static DEFINE_MUTEX(dlpar_mem_lock);
struct ehea_fw_handle_array ehea_fw_handles;
struct ehea_bcmc_reg_array ehea_bcmc_regs;
@@ -2984,7 +2983,7 @@ out:
mutex_unlock(&dlpar_mem_lock);
}
-static void ehea_rereg_mrs(struct work_struct *work)
+static void ehea_rereg_mrs(void)
{
int ret, i;
struct ehea_adapter *adapter;
@@ -3659,14 +3658,14 @@ static int ehea_mem_notifier(struct notifier_block *nb,
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages))
goto out_unlock;
- ehea_rereg_mrs(NULL);
+ ehea_rereg_mrs();
break;
case MEM_GOING_OFFLINE:
ehea_info("memory is going offline");
set_bit(__EHEA_STOP_XFER, &ehea_driver_flags);
if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages))
goto out_unlock;
- ehea_rereg_mrs(NULL);
+ ehea_rereg_mrs();
break;
default:
break;
@@ -3742,8 +3741,6 @@ int __init ehea_module_init(void)
printk(KERN_INFO "IBM eHEA ethernet device driver (Release %s)\n",
DRV_VERSION);
-
- INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs);
memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles));
memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
--
1.7.1
^ permalink raw reply related
* [PATCH 4/9] ehea: don't use flush_scheduled_work()
From: Tejun Heo @ 2010-12-12 15:53 UTC (permalink / raw)
To: linux-kernel, netdev, davem; +Cc: Tejun Heo, Breno Leitao
In-Reply-To: <1292169185-10579-1-git-send-email-tj@kernel.org>
Directly cancel port->reset_task from ehea_shutdown_single_port()
instead. As this cancels the work for each port on driver detach,
flushing system_wq from ehea_remove() or ehea_module_exit() is no
longer necessary.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Breno Leitao <leitao@linux.vnet.ibm.com>
Cc: netdev@vger.kernel.org
---
drivers/net/ehea/ehea_main.c | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index d51def1..81e5b7b 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -3318,6 +3318,8 @@ out_err:
static void ehea_shutdown_single_port(struct ehea_port *port)
{
struct ehea_adapter *adapter = port->adapter;
+
+ cancel_work_sync(&port->reset_task);
unregister_netdev(port->netdev);
ehea_unregister_port(port);
kfree(port->mc_list);
@@ -3607,8 +3609,6 @@ static int __devexit ehea_remove(struct platform_device *dev)
ehea_remove_device_sysfs(dev);
- flush_scheduled_work();
-
ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
tasklet_kill(&adapter->neq_tasklet);
@@ -3797,7 +3797,6 @@ static void __exit ehea_module_exit(void)
{
int ret;
- flush_scheduled_work();
driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
ibmebus_unregister_driver(&ehea_driver);
unregister_reboot_notifier(&ehea_reboot_nb);
--
1.7.1
^ permalink raw reply related
* [PATCH 7/9] sungem: update gp->reset_task flushing
From: Tejun Heo @ 2010-12-12 15:53 UTC (permalink / raw)
To: linux-kernel, netdev, davem; +Cc: Tejun Heo
In-Reply-To: <1292169185-10579-1-git-send-email-tj@kernel.org>
gp->reset_task_pending is always set right before reset_task is
scheduled and as there is no synchronization between the setting and
scheduling, busy looping on reset_task_pending before flushing
reset_task doesn't really buy anything.
Directly flush gp->reset_task on suspend and cancel on detach.
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
---
drivers/net/sungem.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
index 4ceb3cf..9e992ca 100644
--- a/drivers/net/sungem.c
+++ b/drivers/net/sungem.c
@@ -2380,10 +2380,8 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
*/
mutex_unlock(&gp->pm_mutex);
- /* Wait for a pending reset task to complete */
- while (gp->reset_task_pending)
- yield();
- flush_scheduled_work();
+ /* Wait for the pending reset task to complete */
+ flush_work_sync(&gp->reset_task);
/* Shut the PHY down eventually and setup WOL */
gem_stop_phy(gp, gp->asleep_wol);
@@ -2928,10 +2926,8 @@ static void gem_remove_one(struct pci_dev *pdev)
/* We shouldn't need any locking here */
gem_get_cell(gp);
- /* Wait for a pending reset task to complete */
- while (gp->reset_task_pending)
- yield();
- flush_scheduled_work();
+ /* Cancel reset task */
+ cancel_work_sync(&gp->reset_task);
/* Shut the PHY down */
gem_stop_phy(gp, 0);
--
1.7.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox