bridge: allow creating/deleting fdb entries via netlink
Use RTM_NEWNEIGH and RTM_DELNEIGH to allow updating of entries
in bridge forwarding table. This allows manipulating static entries
which is not possible with existing tools.
Example (using bridge extensions to iproute2)
# br fdb add 00:02:03:04:05:06 dev eth0
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
bridge: add netlink notification on forward entry changes
This allows applications to query and monitor bridge forwarding
table in the same method used for neighbor table. The forward table
entries are returned in same structure format as used by the ioctl.
If more information is desired in future, the netlink method is
extensible.
Example (using bridge extensions to iproute2)
# br monitor
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
In some cases, look up of forward database entry is done with RCU;
and for others no RCU is needed because of locking. Split the two
cases into two differnt loops (and take off inline).
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Later patch provides ability to create non-local static entry.
To make this easier move the updating of the flag values to
after the code that creates entry.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This is an implementation of the Quick Fair Queue scheduler developed
by Fabio Checconi. The same algorithm is already implemented in ipfw
in FreeBSD. Fabio had an earlier version developed on Linux, I just
cleaned it up. Thanks to Eric Dumazet for testing this under load.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ian Campbell [Mon, 4 Apr 2011 18:07:57 +0000 (11:07 -0700)]
xen: netfront: assume all hw features are available until backend connection setup
We need to assume that all features will be available when registering the
netdev otherwise they are ommitted from the initial set of
dev->wanted_features. When we connect to the backed we reduce the set as
necessary due to the call to netdev_update_features() in xennet_connect().
Signed-off-by: Ian Campbell <ian.campbell@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michał Mirosław [Sun, 3 Apr 2011 05:49:12 +0000 (22:49 -0700)]
vlan: convert VLAN devices to use ndo_fix_features()
Note: get_flags was actually broken, because it should return the
flags capped with vlan_features. This is now done implicitly by
limiting netdev->hw_features.
RX checksumming offload control is (and was) broken, as there was no way
before to say whether it's done for tagged packets.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Michał Mirosław [Sun, 3 Apr 2011 05:48:47 +0000 (22:48 -0700)]
net: Call netdev_features_change() from netdev_update_features()
Issue FEAT_CHANGE notification when features are changed by
netdev_update_features(). This will allow changes made by extra constraints
on e.g. MTU change to be properly propagated like changes via ethtool.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Ilpo Järvinen [Sat, 2 Apr 2011 04:47:41 +0000 (21:47 -0700)]
tcp: len check is unnecessarily devastating, change to WARN_ON
All callers are prepared for alloc failures anyway, so this error
can safely be boomeranged to the callers domain without super
bad consequences. ...At worst the connection might go into a state
where each RTO tries to (unsuccessfully) re-fragment with such
a mis-sized value and eventually dies.
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
Wei Yongjun [Thu, 31 Mar 2011 23:38:54 +0000 (23:38 +0000)]
sctp: fix auth_hmacs field's length of struct sctp_cookie
auth_hmacs field of struct sctp_cookie is used for store
Requested HMAC Algorithm Parameter, and each HMAC Identifier
is 2 bytes, so the length should be:
SCTP_AUTH_NUM_HMACS * sizeof(__u16) + 2
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michał Mirosław [Sat, 2 Apr 2011 03:56:23 +0000 (20:56 -0700)]
net: convert SMSC USB net drivers to hw_features
There's a race (not fixed here) in smsc75xx in setting RFE_CTL that's not
properly handled via rfe_ctl_lock. Spinlock is not a good tool here, as
this has to wait for URB completion (or maybe just submission) after issuing
register write request. Otherwise, the rfe_ctl might be changed just after
spin_unlock() and device left programmed with other value.
smsc95xx has increased hard_header_len for the case of TX checksumming.
smsc75xx is fixed to advertise IP+IPV6_CSUM instead of HW_CSUM as it does
not use csum_start/csum_offset.
Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
The documentation for the USB ethernet devices suggests that
only some devices are supposed to use usb0 as the network interface
name instead of eth0. The logic used there, and documented in
Kconfig for CDC is that eth0 will be used when the mac address
is a globally assigned one, but usb0 is used for the locally
managed range that is typically used on point-to-point links.
Unfortunately, this has caused a lot of pain on the smsc95xx
device that is used on the popular pandaboard without an
EEPROM to store the MAC address, which causes the driver to
call random_ether_address().
Obviously, there should be a proper MAC addressed assigned to
the device, and discussions are ongoing about how to solve
this, but this patch at least makes sure that the default
interface naming gets a little saner and matches what the
user can expect based on the documentation, including for
new devices.
The approach taken here is to flag whether a device might be a
point-to-point link with the new FLAG_POINTTOPOINT setting in
the usbnet driver_info. A driver can set both FLAG_POINTTOPOINT
and FLAG_ETHER if it is not sure (e.g. cdc_ether), or just one
of the two. The usbnet framework only looks at the MAC address
for device naming if both flags are set, otherwise it trusts the
flag.
Signed-off-by: Arnd Bergmann <arnd.bergmann@linaro.org> Tested-by: Andy Green <andy.green@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
bnx2x, cnic: Disable iSCSI if DCBX negotiation is successful
With current bnx2x firmware 6.2.9, iSCSI is not supported in DCB
network, so we need to disable it. Add cnic command to disconnect
iSCSI connections and prevent future connections when DCBX negotiation
succeeds.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
bnx2x: don't write dcb/llfc fields in STORM memory
We could get hardware attention during DCB/FCoE traffic without this
fix.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
To fix bugs when running offloaded FCoE/iSCSI traffic in multiple
Class of Service environments. In some scenarios, traffic could stop
on certain rings and eventually all traffic would stop.
Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Yevgeny Petrilin [Wed, 30 Mar 2011 23:30:17 +0000 (23:30 +0000)]
mlx4: Fixing bad size of event queue buffer
We should reduce the number of reserved completion queues from the total
number of entries. Since the queue size is power of two, not reducing the
reserved entries, caused a double queue size, which may lead to allocation
failures in some cases.
Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
Yevgeny Petrilin [Wed, 30 Mar 2011 23:28:52 +0000 (23:28 +0000)]
mlx4: Fixing use after free
In case of allocation failure, tried to use the promiscuous QP
entry that was previously freed.
Now freeing this entry only in case we will not put it back to the list
of promiscuous entries.
Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il> Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net: Remove IRQF_SAMPLE_RANDOM flag from network drivers
The IRQF_SAMPLE_RANDOM flag is marked as deprecated and will be removed.
Every input point to the kernel's entropy pool have to better document the
type of entropy source it is.
drivers/char/random.c now implements a set of interfaces that can be used for
devices to collect enviromental noise. IRQF_SAMPLE_RANDOM will be replaced
with these add_*_randomness exported functions.
Network drivers are not a good source of entropy. They use as a source of
entropy essentially a remote host. Which means that the source of entropy can
be potentially controlled by an attacker. Also, with heavy workloads the
entropy decreases due to less hardware interrupts happening thanks to irq
mitigation and NAPI.
If a system relies in its network interface as a entropy source it has a false
sense of security. Systems that don't have devices whose drivers are good
sources of entropy, should either use a hardware random number generator or
feed the kernel's entropy pool from userspace using other sources of entropy
such as EGD, video_entropyd, timer_entropyd and audio-entropyd.
Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Tue, 29 Mar 2011 20:36:07 +0000 (20:36 +0000)]
enic: Add support for PORT_REQUEST_PREASSOCIATE_RR
Current enic code only supports ASSOCIATE and DISASSOCIATE port profile
operations. This patch adds enic support for port profile
PORT_REQUEST_PREASSOCIATE_RR operation. The VIC adapter (8021qbh) is capable
of handling port profile requests done in two steps namely PREASSOCIATE_RR
and ASSOCIATE today. The motivation to support PREASSOCIATE_RR comes mainly
from its use as an optimization during VM migration ie, to do resource
reservation on destination host before resources on source host are released.
PREASSOCIATE_RR is a VDP operation and according to the latest at IEEE,
8021qbh will also need to support VDP commands.
In addition to handling the new PORT_REQUEST_PREASSOCIATE_RR operation
this patch also does the below:
- Introduces handlers for PORT_REQUEST operations
- Moves most of the port profile handling code to new files enic_pp.[ch]
- Uses new fw devcmds for port profile operations
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Tue, 29 Mar 2011 20:36:02 +0000 (20:36 +0000)]
enic: Cleanups in port profile helper code
This patch does the following:
- Introduces a new macro VIC_PROVINFO_ADD_TLV
- Adds a new OS type in vic_generic_prov_os_type
- Changes some vic_provinfo* helper routine args to constants
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Tue, 29 Mar 2011 20:35:56 +0000 (20:35 +0000)]
enic: Add wrapper routines for new fw devcmds for port profile handling
This patch adds wrapper routines to new port profile related fw devcmds and
removes the old ones
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Tue, 29 Mar 2011 20:35:51 +0000 (20:35 +0000)]
enic: Add support for new fw devcmds for port profile handling
This patch introduces new fw devcmds for port profile handling.
These new commands are similar to the current fw commands for
port profile handling. The only difference being that the new
commands split the existing port profile handling devcmds into multiple
fw commands, giving the driver finer control over port profile operations.
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com> Signed-off-by: David Wang <dwang2@cisco.com> Signed-off-by: Christian Benvenuti <benve@cisco.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Fri, 25 Mar 2011 14:21:22 +0000 (14:21 +0000)]
smsc911x: Use pr_fmt, netdev_<level>, and netif_<level>
Use the more common/verbose logging styles.
Add #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
Remove smsc911x prefixes from format strings.
Rename SMSC_WARNING to SMSC_WARN.
Remove DPRINTK macro.
Use netif_<level> in SMSC_<level> macros.
Convert NETIF_MSG_<foo> uses to lower case.
Add no_printk verification in non-debug uses.
Add pdata to SMSC_<level> uses to avoid hidden variable uses.
Convert printks to netdev_<level> as appropriate.
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Mon, 21 Mar 2011 20:49:25 +0000 (20:49 +0000)]
be2net: refactor code that decides adapter->num_rx_queues
The code has been refactored to not set num_rx_qs inside be_enable_msix().
num_rx_qs is now set at the time of queue creation based on the number of
available msix vectors.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Thu, 31 Mar 2011 00:51:36 +0000 (17:51 -0700)]
sctp: Pass __GFP_NOWARN to hash table allocation attempts.
Like DCCP and other similar pieces of code, there are mechanisms
here to try allocating smaller hash tables if the allocation
fails. So pass in __GFP_NOWARN like the others do instead of
emitting a scary message.
Reported-by: Dave Jones <davej@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy [Mon, 28 Mar 2011 08:39:36 +0000 (08:39 +0000)]
connector: convert to synchronous netlink message processing
Commits 01a16b21 (netlink: kill eff_cap from struct netlink_skb_parms)
and c53fa1ed (netlink: kill loginuid/sessionid/sid members from struct
netlink_skb_parms) removed some members from struct netlink_skb_parms
that depend on the current context, all netlink users are now required
to do synchronous message processing.
connector however queues received messages and processes them in a work
queue, which is not valid anymore. This patch converts connector to do
synchronous message processing by invoking the registered callback handler
directly from the netlink receive function.
In order to avoid invoking the callback with connector locks held, a
reference count is added to struct cn_callback_entry, the reference
is taken when finding a matching callback entry on the device's queue_list
and released after the callback handler has been invoked.
Signed-off-by: Patrick McHardy <kaber@trash.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Wed, 30 Mar 2011 23:57:46 +0000 (16:57 -0700)]
fib: add rtnl locking in ip_fib_net_exit
Daniel J Blueman reported a lockdep splat in trie_firstleaf(), caused by
RTNL being not locked before a call to fib_table_flush()
Reported-by: Daniel J Blueman <daniel.blueman@gmail.com> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
atm/solos-pci: Don't flap VCs when carrier state changes
Don't flap VCs when carrier state changes; higher-level protocols
can detect loss of connectivity and act accordingly. This is more
consistent with how other network interfaces work.
We no longer use release_vccs() so we can delete it.
release_vccs() was duplicated from net/atm/common.c; make the
corresponding function exported, since other code duplicates it
and could leverage it if it were public.
Signed-off-by: Philip A. Prindeville <philipp@redfish-solutions.com> Signed-off-by: David S. Miller <davem@davemloft.net>
atm/solos-pci: Don't include frame pseudo-header on transmit hex-dump
Omit pkt_hdr preamble when dumping transmitted packet as hex-dump;
we can pull this up because the frame has already been sent, and
dumping it is the last thing we do with it before freeing it.
Also include the size, vpi, and vci in the debug as is done on
receive.
Use "port" consistently instead of "device" intermittently.
Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Torvalds [Wed, 30 Mar 2011 16:35:52 +0000 (09:35 -0700)]
Merge branch 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'irq-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
avr32: Fix missing irq namespace conversion
powerpc: qe_ic: Rename get_irq_desc_data and get_irq_desc_chip
genirq: Remove the now obsolete config options and select statements
arm: versatile : Fix typo introduced in irq namespace cleanup
sound: Fixup the last user of the old irq functions
genirq: Remove obsolete comment
genirq: Remove now obsolete set_irq_wake()
sh: Fix irq cleanup fallout
x86: apb_timer: Fixup genirq fallout
genirq: Fix misnamed label in handle_edge_eoi_irq
Fix up crazy conflict in arch/powerpc/include/asm/qe_ic.h:
- commit eead4d5c63ff ("powerpc: qe_ic: Rename get_irq_desc_data and
get_irq_desc_chip") made the helper functions use
irq_desc_get_handler_data() instead of the legacy (and no longer
existing) get_irq_desc_data.
- commit d4db35e8dc96 ("powerpc/qe_ic: Fix another breakage from the
irq_data conversion") used irq_desc_get_chip_data() instead.
According to Thomas, the former is the correct direct conversion, but it
does look like both should work (arch/powerpc/sysdev/qe_lib/qe_ic.c
seems to initialize both to the same thing), and the chip data in some
ways is the more logical. Somebody should really decide on one of the
other.
This merge picks irq_desc_get_handler_data() as the straightforward pure
conversion to new names, as per Thomas.
Linus Torvalds [Wed, 30 Mar 2011 14:53:17 +0000 (07:53 -0700)]
Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc/qe_ic: Fix another breakage from the irq_data conversion
powerpc/8xx: Fix another breakage from the irq_data conversion
powerpc/cell: Use handle_edge_eoi_irq for real
powerpc/pseries: Enable Chelsio network and iWARP drivers
powerpc/mm: Move the STAB0 location to 0x8000 to make room in low memory
powerpc: Fix accounting of softirq time when idle
powerpc/pseries/smp: query-cpu-stopped-state support won't change
powerpc/xics: Use hwirq for xics domain irq number
powerpc/xics: Fix numberspace mismatch from irq_desc conversion
powerpc: Wire up new syscalls
powerpc/booke: Correct the SPRN_MAS5 definition.
powerpc: ARCH_PFN_OFFSET should be unsigned long
powerpc: Implement dma_mmap_coherent()
powerpc/nvram: Don't overwrite oops/panic report on normal shutdown
powerpc: Restore some misc devices to our configs
Linus Torvalds [Wed, 30 Mar 2011 14:51:29 +0000 (07:51 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
Blackfin: bitops: fix include order after little endian inclusion
Blackfin: defconfigs: update after misc devices defaulted to N
Blackfin: use more standard pr_fmt in the module loader
Grant Likely [Wed, 30 Mar 2011 06:02:29 +0000 (00:02 -0600)]
arm: versatile : Fix typo introduced in irq namespace cleanup
Commit 6845664(arm: Cleanup the irq namespace) introduces a typo
causing a build failure for the versatile platform.
[ tglx: Sorry, my bad. Have no idea how I fatfingered that ]
Signed-off-by: Grant Likely <grant.likely@secretlab.ca> Cc: Catalin Marinas <catalin.marinas@arm.com> Cc: Russell King <linux@arm.linux.org.uk> Cc: linux-arm-kernel@lists.infradead.org
LKML-Reference: <20110330060229.27397.7628.stgit@ponder> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Jesper Juhl [Sun, 27 Mar 2011 09:16:12 +0000 (09:16 +0000)]
Atheros, atl2: Fix mem leaks in error paths of atl2_set_eeprom
We leak in some error paths of drivers/net/atlx/atl2.c:atl2_set_eeprom().
The memory allocated to 'eeprom_buff' is not freed when we return -EIO.
This patch fixes that up and also removes a pointless explicit cast.
Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Lezcano [Wed, 30 Mar 2011 09:42:17 +0000 (02:42 -0700)]
netdev: fix mtu check when TSO is enabled
In case the device where is coming from the packet has TSO enabled,
we should not check the mtu size value as this one could be bigger
than the expected value.
This is the case for the macvlan driver when the lower device has
TSO enabled. The macvlan inherit this feature and forward the packets
without fragmenting them. Then the packets go through dev_forward_skb
and are dropped. This patch fix this by checking TSO is not enabled
when we want to check the mtu size.
Signed-off-by: Daniel Lezcano <daniel.lezcano@free.fr> Acked-by: "Eric W. Biederman" <ebiederm@xmission.com> Signed-off-by: David S. Miller <davem@davemloft.net>
net/usb: Ethernet quirks for the LG-VL600 4G modem
This adds a driver for the CDC Ethernet part of this modem. The
device's ID is blacklisted in cdc_ether.c and is white-listed in
this new driver because of the quirks needed to make it useful.
The modem's firmware exposes a CDC ACM port for modem control and a
CDC Ethernet port for network data. The descriptors look fine but
both ports actually are some sort of multiplexers requiring non-
standard headers added/removed from every packet or they get
ignored. All information is based on a usb traffic log from a
Windows machine.
On the Verizon 4G network I've seen speeds up to 1.1MB/s so far with
this driver, a speed-o-meter site reports 16.2Mbps/10.5Mbps.
Userspace scripts are required to talk to the CDC ACM port.
Signed-off-by: Andrzej Zaborowski <balrogg@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
phylib: phy_attach_direct: phy_init_hw can fail, add cleanup
The function phy_attach_direct attaches the phy and calls phy_init_hw.
phy_init_hw can fail, but the phy is still marked as attached. Successive
calls to phy_attach_direct will fail because the phy is busy.
[ 1.020000] eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:00, irq=-1)
[ 1.030000] eth1: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, irq=-1)
[ 2.050000] Sending DHCP requests .
[ 3.020000] PHY: 1:00 - Link is Up - 100/Full
[ 5.110000] ..... timed out!
[ 87.660000] IP-Config: Reopening network devices...
[ 88.190000] FEC: MDIO read timeout
[ 88.190000] eth0: could not attach to PHY
[ 88.190000] IP-Config: Failed to open eth0
[ 88.210000] FEC: MDIO read timeout
[ 88.210000] eth1: could not attach to PHY
[ 88.210000] IP-Config: Failed to open eth1
[ 88.220000] IP-Config: No network devices available.
[ 88.220000] Freeing init memory: 6968K
[...]
starting network interfaces...
ip: RTNETLINK answers: File exists
[ 94.000000] net eth0: PHY already attached
[ 94.010000] eth0: could not attach to PHY
ip: SIOCSIFFLAGS: Device or resource busy
This patch adds phy_detach to clean up if phy_init_hw fails.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Linus Lüssing [Sat, 26 Mar 2011 20:27:24 +0000 (20:27 +0000)]
bridge: mcast snooping, fix length check of snooped MLDv1/2
"len = ntohs(ip6h->payload_len)" does not include the length of the ipv6
header itself, which the rest of this function assumes, though.
This leads to a length check less restrictive as it should be in the
following line for one thing. For another, it very likely leads to an
integer underrun when substracting the offset and therefore to a very
high new value of 'len' due to its unsignedness. This will ultimately
lead to the pskb_trim_rcsum() practically never being called, even in
the cases where it should.
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Mon, 28 Mar 2011 17:12:52 +0000 (17:12 +0000)]
via-ircc: Pass PCI device pointer to dma_{alloc, free}_coherent()
via-ircc has been passing a NULL pointer to DMA allocation functions,
which is completely invalid and results in a BUG on PowerPC. Now
that we always have the device pointer available, pass it in.
Reference: http://bugs.debian.org/619450 Reported-by: Andrew Buckeridge <andrewb@bgc.com.au> Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Tested-by: Andrew Buckeridge <andrewb@bgc.com.au> [against 2.6.32] Signed-off-by: David S. Miller <davem@davemloft.net>
Ben Hutchings [Mon, 28 Mar 2011 17:10:43 +0000 (17:10 +0000)]
via-ircc: Use pci_{get, set}_drvdata() instead of static pointer variable
via-ircc still maintains its own array of device pointers in Linux 2.4
style. Worse, it always uses index 0, so it will crash if there are
multiple suitable devices in the system.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Timo Teräs [Mon, 28 Mar 2011 22:40:53 +0000 (22:40 +0000)]
net: gre: provide multicast mappings for ipv4 and ipv6
My commit 6d55cb91a0020ac0 (gre: fix hard header destination
address checking) broke multicast.
The reason is that ip_gre used to get ipgre_header() calls with
zero destination if we have NOARP or multicast destination. Instead
the actual target was decided at ipgre_tunnel_xmit() time based on
per-protocol dissection.
Instead of allowing the "abuse" of ->header() calls with invalid
destination, this creates multicast mappings for ip_gre. This also
fixes "ip neigh show nud noarp" to display the proper multicast
mappings used by the gre device.
Reported-by: Doug Kehn <rdkehn@yahoo.com> Signed-off-by: Timo Teräs <timo.teras@iki.fi> Acked-by: Doug Kehn <rdkehn@yahoo.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Balaji G [Tue, 29 Mar 2011 06:20:04 +0000 (06:20 +0000)]
bridge: Fix compilation warning in function br_stp_recalculate_bridge_id()
net/bridge/br_stp_if.c: In function ‘br_stp_recalculate_bridge_id’:
net/bridge/br_stp_if.c:216:3: warning: ‘return’ with no value, in function returning non-void
Signed-off-by: G.Balaji <balajig81@gmail.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 30 Mar 2011 06:34:08 +0000 (23:34 -0700)]
net: Fix warnings caused by MAX_SKB_FRAGS change.
After commit a715dea3c8e9ef2771c534e05ee1d36f65987e64 ("net: Always
allocate at least 16 skb frags regardless of page size"), the value
of MAX_SKB_FRAGS can now take on either an "unsigned long" or an
"int" value.
This causes warnings like:
net/packet/af_packet.c: In function ‘tpacket_fill_skb’:
net/packet/af_packet.c:948: warning: format ‘%lu’ expects type ‘long unsigned int’, but argument 2 has type ‘int’
Fix by forcing the constant to be unsigned long, otherwise we have
a situation where the type of a system wide constant is variable.
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Rothwell [Tue, 29 Mar 2011 23:55:12 +0000 (10:55 +1100)]
genirq: fix CONFIG_IRQ_EDGE_EOI_HANDLER build
Fixes these errors:
kernel/irq/chip.c: In function 'handle_edge_eoi_irq':
kernel/irq/chip.c:517: warning: label 'out_unlock' defined but not used
kernel/irq/chip.c:503: error: label 'out_eoi' used but not defined
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
powerpc/mm: Move the STAB0 location to 0x8000 to make room in low memory
Recent upstream builds with allmodconfig fail due to lack of space
between 0x3000 and 0x6000. We have a hard block at 0x7000 but we can
spare a page by moving the STAB0 from 0x6000 to 0x8000.
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Anton Blanchard [Sun, 20 Mar 2011 15:28:03 +0000 (15:28 +0000)]
powerpc: Fix accounting of softirq time when idle
commit cf9efce0ce31 (powerpc: Account time using timebase rather
than PURR) used in_irq() to detect if the time was spent in
interrupt processing. This only catches hardirq context so if we
are in softirq context and in the idle loop we end up accounting it
as idle time. If we instead use in_interrupt() we catch both softirq
and hardirq time.
The issue was found when running a network intensive workload. top
showed the following:
Milton Miller [Mon, 21 Mar 2011 11:38:02 +0000 (11:38 +0000)]
powerpc/xics: Fix numberspace mismatch from irq_desc conversion
commit 79f26c268ebad29bd75d078cfc09d3d82b30ccbd (powerpc:
platforms/pseries irq_data conversion) pushed irq_desc down into many
functions, dererencing the descriptor irq field as late as possible.
But it incorrectly passed a linix virtural irq number to RTAS,
resulting in the interrupt not being disabled and possibly
other bad things, such as another interrupt being disabled and/or
a checkstop.
In addition this missed the point of xics_mask_unknown_vec and
the seperation of xics_mask_real_irq from xics_mask_irq. When
xics_mask_unknown_vec is called it's because the hardware delivered an
irq source for which we have no linux irq allocated, and thefore we can
not have an irq_desc allocated.
Revert xics_mask_real_irq to its prior version, naming the argument
hwirq to highlight the difference.
Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Varun Sethi [Thu, 24 Mar 2011 11:50:26 +0000 (11:50 +0000)]
powerpc/booke: Correct the SPRN_MAS5 definition.
339 is the SPR number for MAS5 documented by Power ISA 2.06, and
implemented by e500mc. It is not yet used anywhere in the kernel,
so nothing should be relying on the wrong number.
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com> Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Scott Wood [Thu, 24 Mar 2011 11:51:19 +0000 (11:51 +0000)]
powerpc: ARCH_PFN_OFFSET should be unsigned long
pfns are unsigned long, but MEMORY_START is phys_addr_t. This leads
to page_to_pfn() returning phys_addr_t, and thus type mismatches in a few
print statements.
Signed-off-by: Scott Wood <scottwood@freescale.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
This is used by Alsa to mmap buffers allocated with dma_alloc_coherent()
into userspace. We need a special variant to handle machines with
non-coherent DMAs as those buffers have "special" virt addresses and
require non-cachable mappings
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Jim Keniston [Fri, 25 Mar 2011 12:47:58 +0000 (12:47 +0000)]
powerpc/nvram: Don't overwrite oops/panic report on normal shutdown
For normal halt, reboot, and poweroff events, refrain from overwriting
the lnx,oops-log partition. Also, don't save the dmesg buffer on an
emergency-restart event if we've already saved it earlier in panic().
Signed-off-by: Jim Keniston <jkenisto@us.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>