What it is: vhost net is a character device that can be used to reduce
the number of system calls involved in virtio networking.
Existing virtio net code is used in the guest without modification.
There's similarity with vringfd, with some differences and reduced scope
- uses eventfd for signalling
- structures can be moved around in memory at any time (good for
migration, bug work-arounds in userspace)
- write logging is supported (good for migration)
- support memory table and not just an offset (needed for kvm)
common virtio related code has been put in a separate file vhost.c and
can be made into a separate module if/when more backends appear. I used
Rusty's lguest.c as the source for developing this part : this supplied
me with witty comments I wouldn't be able to write myself.
What it is not: vhost net is not a bus, and not a generic new system
call. No assumptions are made on how guest performs hypercalls.
Userspace hypervisors are supported as well as kvm.
How it works: Basically, we connect virtio frontend (configured by
userspace) to a backend. The backend could be a network device, or a tap
device. Backend is also configured by userspace, including vlan/mac
etc.
Status: This works for me, and I haven't see any crashes.
Compared to userspace, people reported improved latency (as I save up to
4 system calls per packet), as well as better bandwidth and CPU
utilization.
Features that I plan to look at in the future:
- mergeable buffers
- zero copy
- scalability tuning: figure out the best threading model to use
Note on RCU usage (this is also documented in vhost.h, near
private_pointer which is the value protected by this variant of RCU):
what is happening is that the rcu_dereference() is being used in a
workqueue item. The role of rcu_read_lock() is taken on by the start of
execution of the workqueue item, of rcu_read_unlock() by the end of
execution of the workqueue item, and of synchronize_rcu() by
flush_workqueue()/flush_work(). In the future we might need to apply
some gcc attribute or sparse annotation to the function passed to
INIT_WORK(). Paul's ack below is for this RCU usage.
(Includes fixes by Alan Cox <alan@linux.intel.com>,
David L Stevens <dlstevens@us.ibm.com>,
Chris Wright <chrisw@redhat.com>)
Acked-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
vhost net module wants to do copy to/from user from a kernel thread,
which needs use_mm. Export it to modules.
Acked-by: Andrea Arcangeli <aarcange@redhat.com> Acked-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Tun device looks similar to a packet socket
in that both pass complete frames from/to userspace.
This patch fills in enough fields in the socket underlying tun driver
to support sendmsg/recvmsg operations, and message flags
MSG_TRUNC and MSG_DONTWAIT, and exports access to this socket
to modules. Regular read/write behaviour is unchanged.
This way, code using raw sockets to inject packets
into a physical device, can support injecting
packets into host network stack almost without modification.
First user of this interface will be vhost virtualization
accelerator.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch adds error checking of ctrlmode values for CAN devices. As
an example all availabe bits are implemented in the mcp251x driver.
Signed-off-by: Christian Pellegrin <chripell@fsfe.org> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Dobriyan [Thu, 14 Jan 2010 11:10:54 +0000 (03:10 -0800)]
proc_fops: convert drivers/isdn/ to seq_file
Convert code away from ->read_proc/->write_proc interfaces. Switch to
proc_create()/proc_create_data() which make addition of proc entries
reliable wrt NULL ->proc_fops, NULL ->data and so on.
Einar Lueck [Mon, 11 Jan 2010 02:50:52 +0000 (02:50 +0000)]
qeth: default BLKT values for new OSA/3 hardware
Set default BLKT values for new OSA/3 hardware.
Signed-off-by: Einar Lueck <elelueck@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Mon, 11 Jan 2010 02:50:51 +0000 (02:50 +0000)]
qeth: avoid recovery during device online setting
If a qeth device is set online, several initialisation steps are
performed. If a failure in one of these steps occurs, the qeth
device is reset into DOWN state. If due to the failure a qeth recovery
is scheduled and started in another thread, this might cause all kinds
of conflicts, even a kernel panic. The patch forbids scheduling of a
qeth recovery while online processing is performed till the card is in
state SOFTSETUP.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Mon, 11 Jan 2010 02:50:50 +0000 (02:50 +0000)]
qeth: HiperSockets Network Traffic Analyzer
New feature to trace HiperSockets network traffic for debugging
purposes.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Wed, 13 Jan 2010 02:05:38 +0000 (02:05 +0000)]
e1000e: genericize the update multicast address list
Make updating the multicast address list generic for all families and
enforce the requirement to update the entire multicast table array all at
once instead of piecemeal which causes problems on some parts.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Wed, 13 Jan 2010 02:05:18 +0000 (02:05 +0000)]
e1000e: provide MAC-family-specific function to set LAN ID
Provide MAC-specific function pointer to determine the LAN ID (PCI func).
The LAN ID is used internally by the driver to determine which h/w lock
to use to protect accessing the PHY on ESB2 as well as help to determine
the alternate MAC address on some parts.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Wed, 13 Jan 2010 02:04:58 +0000 (02:04 +0000)]
e1000e: use alternate MAC address on ESB2 if available
Similar to 82571/2/3 parts that already do this, if ESB2/80003es2lan parts
have an alternate MAC address provided in the EEPROM use it instead of the
default MAC address. This patch makes the the actual code that does this
generic so that it can be better used by both MAC families.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Oliver Hartkopp [Tue, 12 Jan 2010 10:00:46 +0000 (02:00 -0800)]
can: Unify droping of invalid tx skbs and netdev stats
To prevent the CAN drivers to operate on invalid socketbuffers the skbs are
now checked and silently dropped at the xmit-function consistently.
Also the netdev stats are consistently using the CAN data length code (dlc)
for [rx|tx]_bytes now.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net> Acked-by: Wolfgang Grandegger <wg@grandegger.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch adds the kernel portions needed to implement
RFC 5082 Generalized TTL Security Mechanism (GTSM).
It is a lightweight security measure against forged
packets causing DoS attacks (for BGP).
This is already implemented the same way in BSD kernels.
For the necessary Quagga patch
http://www.gossamer-threads.com/lists/quagga/dev/17389
Description from Cisco
http://www.cisco.com/en/US/docs/ios/12_3t/12_3t7/feature/guide/gt_btsh.html
It does add one byte to each socket structure, but I did
a little rearrangement to reuse a hole (on 64 bit), but it
does grow the structure on 32 bit
This should be documented on ip(4) man page and the Glibc in.h
file also needs update. IPV6_MINHOPLIMIT should also be added
(although BSD doesn't support that).
Only TCP is supported, but could also be added to UDP, DCCP, SCTP
if desired.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:27:05 +0000 (02:27 +0000)]
ixgbe: Fix ethtool diag test for VT mode operation
Skip MAC loopback test when the adapter is set to a VT mode such as SR-IOV
or VMDq
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:26:46 +0000 (02:26 +0000)]
ixgbe: Add SR-IOV features to main module
Adds SR-IOV features supported by the 82599 controller to the main driver
module. If the CONFIG_PCI_IOV kernel option is selected then the SR-IOV
features are enabled. Use the max_vfs module option to allocate up to 63
virtual functions per physical port.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:26:26 +0000 (02:26 +0000)]
ixgbe: Add SR-IOV feature enablement code
Adds code to the core 82599 module to support SR-IOV features of the 82599
network controller
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Acked-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:26:07 +0000 (02:26 +0000)]
ixgbe: Add SR-IOV specific modules to driver Makefile
Add the mailbox and SR-IOV feature modules to the ixgbe driver Makefile.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:25:48 +0000 (02:25 +0000)]
ixgbe: Add SR-IOV specific features
This module and header file add functions to support SR-IOV features of the
82599 10Gbe controller.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:25:29 +0000 (02:25 +0000)]
ixgbe: Add SR-IOV register, structure and bit defines
This patch adds register definitions, bit definitions and structures used by
the driver to support SR-IOV features of the 82599 controller.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:25:10 +0000 (02:25 +0000)]
ixgbe: Mailbox header and code module
The 82599 virtual function device and the master 82599 physical function
device implement a mailbox utility for communication between the devices
using some SRAM scratch memory and a doorbell/answering mechanism enabled
via interrupt and/or polling. This C module and accompanying header
file implement the base functions for use of this feature.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:24:50 +0000 (02:24 +0000)]
ixgbevf: Kconfig, Makefile and Documentation
Modifications for the Kconfig and network device Makefile to add the ixgbevf
driver module to the kernel plus basic driver documentation.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:24:31 +0000 (02:24 +0000)]
ixgbevf: Driver Makefile
82599 Virtual Function Device Driver Makefile
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:24:10 +0000 (02:24 +0000)]
ixgbevf: Driver main and ethool interface module and main header
These modules and header contain the Linux OS network interface code and core
interrupt and network send/receive handlers.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:23:50 +0000 (02:23 +0000)]
ixgbevf: Mailbox communication
The 82599 virtual function device and the master 82599 physical function
device implement a mailbox utility for communication between the devices
using some SRAM scratch memory and a doorbell/answering mechanism enabled
via interrupt and/or polling. This C module and accompanying header
file implement the base functions for use of this feature.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:23:31 +0000 (02:23 +0000)]
ixgbevf: 82599 Virtual Function core functions and header
This module and header file contain the core functions for the 82599
virtual function device.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Greg Rose [Sat, 9 Jan 2010 02:23:11 +0000 (02:23 +0000)]
ixgbevf: Macros, data structures, useful defines and registers
These two headers define the commonly used macros, data structures,
register bits and register offsets used by the ixgbevf driver on the
82599 virtual function device
Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Slaby [Sun, 10 Jan 2010 01:17:34 +0000 (01:17 +0000)]
NET: irda, remove unnecessary checks
Stanse found a potential null dereference in ircomm_tty_close
and ircomm_tty_hangup. There is a check for tty being NULL,
but it is dereferenced earlier. But it is bogus, the tty cannot
be NULL, so remove the !tty checks.
Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: Samuel Ortiz <samuel@sortiz.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alan Cox <alan@linux.intel.com> Cc: Greg Kroah-Hartman <gregkh@suse.de> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Jiri Slaby [Sun, 10 Jan 2010 00:43:03 +0000 (00:43 +0000)]
NET: ipv6, remove unnecessary check
Stanse found a potential null dereference in snmp6_unregister_dev.
There is a check for idev being NULL, but it is dereferenced
earlier. But idev cannot be NULL when passed to
snmp6_unregister_dev, so remove the test.
Signed-off-by: Jiri Slaby <jslaby@suse.cz> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru> Cc: "Pekka Savola (ipv6)" <pekkas@netcore.fi> Cc: James Morris <jmorris@namei.org> Cc: Hideaki YOSHIFUJI <yoshfuji@linux-ipv6.org> Cc: Patrick McHardy <kaber@trash.net> Cc: netdev@vger.kernel.org Signed-off-by: David S. Miller <davem@davemloft.net>
Alexander Duyck [Thu, 7 Jan 2010 17:41:00 +0000 (17:41 +0000)]
igb: add support for device reset interrupt
This patch adds support for the global device reset interrupt. Without
this change the drivers will report tx hangs on all ports when a global
device reset occurs.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
powerpc/mpc5xxx: add OF platform binding doc for FSL MSCAN devices
This patch adds documentation for the MSCAN OF device bindings for
the MPC512x and moves the one for the MPC5200 to the new common file
"Documentation/powerpc/dts-bindings/fsl/can.txt".
Signed-off-by: Wolfgang Grandegger <wg@denx.de> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
can: mscan-mpc5xxx: add support for the MPC512x processor
The main differences compared to the MSCAN on the MPC5200 are:
- More flexibility in choosing the CAN source clock and frequency:
Three different clock sources can be selected: "ip", "ref" or "sys".
For the latter two, a clock divider can be defined as well. If the
clock source is not specified by the device tree, we first try to
find an optimal CAN source clock based on the system clock. If that
is not possible, the reference clock will be used.
- The behavior of bus-off recovery is configurable:
To comply with the usual handling of Socket-CAN bus-off recovery,
"recovery on request" is selected (instead of automatic recovery).
Note that only MPC5121 Rev. 2 and later is supported.
Signed-off-by: Wolfgang Grandegger <wg@denx.de> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
can: mscan: fix improper return if dlc < 8 in start_xmit function
The start_xmit function of the MSCAN Driver did return improperly if
the CAN dlc check failed (skb not freed and invalid return code). This
patch adds a proper check of the frame lenght and data size and returns
now correctly. The invalid skb packets are dropped silently as suggested
by David Miller in the thread "[RFC] ndo_validate_skb: Let the netdev
check a valid skb content" on the netdev mailing list.
Furthermore, a typo has been fixed.
Signed-off-by: Wolfgang Grandegger <wg@denx.de> Reviewed-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
1) Use pr_fmt() to prefix the module name and __func__ to the error
messages.
2) <linux/io.h> instead of <asm/io.h>
3) <mach/hardware.h> instead of <mach/ep93xx-regs.h> and <mach/platform.h>
4) Move the ep93xx_mdio_read (and ep93xx_mdio_write) function to eliminate
the function prototype.
5) Change all the printk(<level> messages to pr_<level> and remove the
__func__ argument.
6) Use platform_get_{resource/irq} to get the platform resources and add
an error check.
7) Use resource_size() for request_mem_region() and ioremap().
8) Use %pM to print the MAC address at the end of the probe.
9) Use dev->dev_addr not data->dev_addr for the MAC argument because a
random address could be used if the platform does not supply one.
The message at the end of the probe is left as a printk since it displays
cleaner without the function name that would be displayed with pr_info().
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Lennert Buytenhek <kernel@wantstofly.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Benjamin Li [Fri, 8 Jan 2010 08:51:21 +0000 (00:51 -0800)]
bnx2: Flush the register writes which setup the MSI-X table
The MSI-X table size needs to be properly set before pci_enable_msix()
is called. But on certain machines, the writes are delayed and the
MSI-X table size is incorrectly read. By reading the
BNX2_PCI_MSIX_CONTROL register, the writes are flushed and now
ensure that the MSI-X table is set correctly before MSI-X
is enable on the device.
This patch was originally diagnosed and authored by
Kalyan Ram Chintalapati <kalyanc@vmware.com>.
Signed-off-by: Benjamin Li <benli@broadcom.com> Signed-off-by: Kalyan Ram Chintalapati <kalyanc@vmware.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Thu, 7 Jan 2010 16:32:13 +0000 (16:32 +0000)]
e1000e: fix and commonize code for setting the receive address registers
Fix e1000e_rar_set() to flush consecutive register writes to avoid write
combining which some parts cannot handle. Update e1000e_init_rx_addrs()
to call the fixed e1000e_rar_set() instead of duplicating code.
Also change e1000e_rar_set() to _not_ set the Address Valid bit if the MAC
address is all zeros.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Thu, 7 Jan 2010 16:31:54 +0000 (16:31 +0000)]
e1000e: e1000e_enable_tx_pkt_filtering() returns wrong value
e1000e_enable_tx_pkt_filtering() will return a non-zero value if the
driver fails to enable the manageability interface on the host for
any reason; instead it should retun zero to indicate filtering has been
disabled. Also provide a single exit point for the function.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Thu, 7 Jan 2010 16:31:35 +0000 (16:31 +0000)]
e1000e: perform 10/100 adaptive IFS only on parts that support it
Adaptive IFS which involves writing to the Adaptive IFS Throttle register
was being done for all devices supported by the driver even though it is
not supported (i.e. the register doesn't even exist) on some devices. The
feature is supported on 8257x/82583 and ICH/PCH based devices, but not
on ESB2.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Thu, 7 Jan 2010 16:31:16 +0000 (16:31 +0000)]
e1000e: don't accumulate PHY statistics on PHY read failure
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Bruce Allan [Thu, 7 Jan 2010 16:30:56 +0000 (16:30 +0000)]
e1000e: call pci_save_state() after pci_restore_state()
Due to a change in pci_restore_state()[1] which clears the saved_state
flag, the driver should call pci_save_state() to set the flag once again
to avoid issues with EEH (same fix that recently was submitted for ixgbe).
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
o If tx and rx resources are not available, during set mac request.
Then this request wont be passed to firmware and it will be added to
driver mac list and will never make it to firmware.
So if resources are not available, don't add it to driver mac list.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sriram [Thu, 7 Jan 2010 00:22:37 +0000 (00:22 +0000)]
TI DaVinci EMAC: Handle emac module clock correctly.
In the driver probe function the emac module clock needs to
be enabled before calling register_netdev(). As soon as the
device is registered the driver get_stats function can be invoked
by the core - the module clock must be switched on to be able to
read from stats registers. Also explicitly call matching clk_disable
for failure conditions in probe function.
Signed-off-by: Sriramakrishnan <srk@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Thu, 7 Jan 2010 02:41:51 +0000 (02:41 +0000)]
dmfe/tulip: Let dmfe handle DM910x except for SPARC on-board chips
The Davicom DM9100 and DM9102 chips are used on the motherboards of
some SPARC systems (supported by the tulip driver) and also in PCI
expansion cards (supported by the dmfe driver). There is no
difference in the PCI device ids for the two different configurations,
so these drivers both claim the device ids. However, it is possible
to distinguish the two configurations by the presence of Open Firmware
properties for them, so we do that.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Grant Grundler <grundler@parisc-linux.org> Signed-off-by: David S. Miller <davem@davemloft.net>
PJ Waskiewicz [Wed, 6 Jan 2010 17:50:29 +0000 (17:50 +0000)]
ixgbe: Fix compiler warning about variable being used uninitialized
tc is still throwing a warning that is could be used
uninitialized. This fixes it, and properly formats the device ID
checks for the use of this variable.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
stmmac: rename the gmac as dwmac1000 and split core and dma parts
Use dwmac1000 naming instead of gmac.
The patch also splits the gmac.c file in two new ones:
dwmac1000_core.c and dwmac1000_dma.c.
This could actually help on some architectures where different
DMA engines are used.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
stmmac: rename mac100 as dwmac100 and fix spare coding style
This patch renames the mac100.[ch] as dwmac100.[ch]; this
looks more specific and appropriate for these chip series.
The patch also fixes some spare coding style issues.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch reorganises the internal stmmac ops structure.
The stmmac_ops has been splitted into other three structures named:
stmmac_ops
stmmac_dma_ops
stmmac_desc_ops
This makes the code more clear and also helps the next work to
make the driver more generic.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
On some platforms, fix_mac_speed is used for
configuring some sysconf registers according
to the working speed.
This patch fixes the fix_mac_speed invocation
that cannot be done if it is a NULL pointer.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
On some platforms it can be required a different
configuration of the bus. This can be done
by invoking the bus_setup. It is defined
for all the platforms that needs this kind of
configuration.
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Thu, 7 Jan 2010 13:27:46 +0000 (13:27 +0000)]
drivers/net/skfp/skfddi.c: use %pMF to show MAC address
Use the %pMF kernel extension to display the MAC address.
The address will still be displayed in the FDDI Canonical format.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Thu, 7 Jan 2010 13:24:19 +0000 (13:24 +0000)]
drivers/net/defxx.c: use %pMF to show MAC address
Use the %pMF kernel extension to display the MAC address.
The address will still be displayed in the FDDI Canonical format.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: Maciej W. Rozycki <macro@linux-mips.org> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Thu, 7 Jan 2010 11:43:50 +0000 (11:43 +0000)]
lib/vsprintf.c: Add %pMF to format FDDI bit reversed MAC addresses
On Mon, 2010-01-04 at 23:43 +0000, Maciej W. Rozycki wrote:
> The example below shows an address, and the sequence of bits or symbols
> that would be transmitted when the address is used in the Source Address
> or Destination Address fields on the MAC header. The transmission line
> shows the address bits in the order transmitted, from left to right. For
> IEEE 802 LANs these correspond to actual bits on the medium. The FDDI
> symbols line shows how the FDDI PHY sends the address bits as encoded
> symbols.
>
> MSB: 35:7B:12:00:00:01
> Canonical: AC-DE-48-00-00-80
> Transmission: 001101010111101100010010000000000000000000000001
> FDDI Symbols: 35 7B 12 00 00 01"
>
> Please note that this address has its group bit clear.
>
> This notation is also defined in the "FDDI MEDIA ACCESS CONTROL-2
> (MAC-2)" (X3T9/92-120) document although that book does not have a need
> to use the MSB form and it's skipped.
Adds 6 bytes to object size for x86
New:
$ size lib/vsprintf.o
text data bss dec hex filename
8664 0 2 8666 21da lib/vsprintf.o
$ size lib/vsprintf.o
text data bss dec hex filename
8658 0 2 8660 21d4 lib/vsprintf.o
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Thu, 7 Jan 2010 17:33:18 +0000 (18:33 +0100)]
netfilter: nf_ct_ftp: fix out of bounds read in update_nl_seq()
As noticed by Dan Carpenter <error27@gmail.com>, update_nl_seq()
currently contains an out of bounds read of the seq_aft_nl array
when looking for the oldest sequence number position.
Fix it to only compare valid positions.
Cc: stable@kernel.org Signed-off-by: Patrick McHardy <kaber@trash.net>
drivers/infiniband/hw/cxgb3/iwch_cm.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
The only difference in the output is that the MAC address is
shown in the usual colon-separated hex notation.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Steve Wise <swise@opengridcomputing.com> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 07:00:57 +0000 (07:00 +0000)]
drivers/net/wimax/i2400m/driver.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:58:12 +0000 (06:58 +0000)]
drivers/net/qlge/qlge_main.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:55:40 +0000 (06:55 +0000)]
drivers/net/atl1e/atl1e_main.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
The only difference in the output is that the MAC address is
shown in the usual colon-separated hex notation.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 07:01:54 +0000 (07:01 +0000)]
drivers/net/wimax/i2400m/fw.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:54:01 +0000 (06:54 +0000)]
drivers/net/atl1c/atl1c_main.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
The only difference in the output is that the MAC address is
shown in the usual colon-separated hex notation.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:59:23 +0000 (06:59 +0000)]
drivers/net/vxge/vxge-main.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:45:21 +0000 (06:45 +0000)]
drivers/media/dvb/dvb-core/dvb_net.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address and mask.
The only difference in the output is that the output is shown in
the usual colon-separated hex notation.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:26:49 +0000 (06:26 +0000)]
drivers/atm/lanai.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:22:20 +0000 (06:22 +0000)]
drivers/atm/fore200e.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:37:43 +0000 (06:37 +0000)]
drivers/firmware/iscsi_ibft.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Also, remove the 'mac' variable and use nic->mac directly.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Acked-by: Peter Jones <pjones@redhat.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:24:23 +0000 (06:24 +0000)]
drivers/atm/idt77252.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:56:52 +0000 (06:56 +0000)]
drivers/net/ixgbe/ixgbe_common.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
The only difference in the output is that the MAC address is
shown in the usual colon-separated hex notation.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>
hartleys [Tue, 5 Jan 2010 06:28:08 +0000 (06:28 +0000)]
drivers/atm/nicstar.c: use %pM to show MAC address
Use the %pM kernel extension to display the MAC address.
Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com> Cc: David S. Miller <davem@davemloft.net> Signed-off-by: David S. Miller <davem@davemloft.net>