summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* net: Fix (nearly-)kernel-doc comments for various functionsBen Hutchings2012-07-1146-103/+163
| | | | | | | | Fix incorrect start markers, wrapped summary lines, missing section breaks, incorrect separators, and some name mismatches. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net: Properly define functions with no parametersBen Hutchings2012-07-112-2/+2
| | | | | | | | Defining a function with no parameters as 'T foo()' is the deprecated K&R style, and is not strictly equivalent to defining it as 'T foo(void)'. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'metrics_restructure'David S. Miller2012-07-1129-731/+837
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch series works towards the goal of minimizing the amount of things that can change in an ipv4 route. In a regime where the routing cache is removed, route changes will lead to cloning in the FIB tables or similar. The largest trigger of route metrics writes, TCP, now has it's own cache of dynamic metric state. The timewait timestamps are stored there now as well. As a result of that, pre-cowing metrics is no longer necessary, and therefore FLOWI_FLAG_PRECOW_METRICS is removed. Redirect and PMTU handling is moved back into the ipv4 routes. I'm sorry for all the headaches trying to do this in the inetpeer has caused, it was the wrong approach for sure. Since metrics become read-only for ipv4 we no longer need the inetpeer hung off of the ipv4 routes either. So those disappear too. Also, timewait sockets no longer need to hold onto an inetpeer either. After this series, we still have some details to resolve wrt. PMTU and redirects for a route-cache-less system: 1) With just the plain route cache removal, PMTU will continue to work mostly fine. This is because of how the local route users call down into the PMTU update code with the route they already hold. However, if we wish to cache pre-computed routes in fib_info nexthops (which we want for performance), then we need to add route cloning for PMTU events. 2) Redirects require more work. First, redirects must be changed to be handled like PMTU. Wherein we call down into the sockets and other entities, and then they call back into the routing code with the route they were using. So we'll be adding an ->update_nexthop() method alongside ->update_pmtu(). And then, like for PMTU, we'll need cloning support once we start caching routes in the fib_info nexthops. But that's it, we can completely pull the trigger and remove the routing cache with minimal disruptions. As it is, this patch series alone helps a lot of things. For one, routing cache entry creation should be a lot faster, because we no longer do inetpeer lookups (even to check if an entry exists). This patch series also opens the door for non-DST_HOST ipv4 routes, because nothing fundamentally cares about rt->rt_dst any more. It can be removed with the base routing cache removal patch. In fact, that was the primary goal of this patch series. Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv4: Remove inetpeer from routes.David S. Miller2012-07-113-118/+6
| | | | | | | | | | | | No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv4: Calling ->cow_metrics() now is a bug.David S. Miller2012-07-111-28/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nothing every writes to ipv4 metrics any longer. PMTU is stored in rt->rt_pmtu. Dynamic TCP metrics are stored in a special TCP metrics cache, completely outside of the routes. Therefore ->cow_metrics() can simply nothing more than a WARN_ON trigger so we can catch anyone who tries to add new writes to ipv4 route metrics. Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv4: Kill dst_copy_metrics() call from ipv4_blackhole_route().David S. Miller2012-07-111-1/+0
| | | | | | | | | | | | | | | | Blackhole routes have a COW metrics operation that returns NULL always, therefore this dst_copy_metrics() call did absolutely nothing. Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv4: Enforce max MTU metric at route insertion time.David S. Miller2012-07-112-6/+3
| | | | | | | | | | | | Rather than at every struct rtable creation. Signed-off-by: David S. Miller <davem@davemloft.net>
| * ipv4: Maintain redirect and PMTU info in struct rtable again.David S. Miller2012-07-115-154/+41
| | | | | | | | | | | | | | Maintaining this in the inetpeer entries was not the right way to do this at all. Signed-off-by: David S. Miller <davem@davemloft.net>
| * rtnetlink: Remove ts/tsage args to rtnl_put_cacheinfo().David S. Miller2012-07-115-10/+5
| | | | | | | | | | | | Nobody provides non-zero values any longer. Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: Kill FLOWI_FLAG_PRECOW_METRICS.David S. Miller2012-07-116-18/+6
| | | | | | | | | | | | | | | | No longer needed. TCP writes metrics, but now in it's own special cache that does not dirty the route metrics. Therefore there is no longer any reason to pre-cow metrics in this way. Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: Minimize use of cached route inetpeer.David S. Miller2012-07-115-22/+35
| | | | | | | | | | | | | | | | | | | | | | | | Only use it in the absolutely required cases: 1) COW'ing metrics 2) ipv4 PMTU 3) ipv4 redirects Signed-off-by: David S. Miller <davem@davemloft.net>
| * inet: Remove ->get_peer() method.David S. Miller2012-07-113-33/+0
| | | | | | | | | | | | No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: Remove tw->tw_peerDavid S. Miller2012-07-112-15/+2
| | | | | | | | | | | | No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: Move timestamps from inetpeer to metrics cache.David S. Miller2012-07-119-127/+149
| | | | | | | | | | | | With help from Lin Ming. Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: Kill set_dst_metric_rtt().David S. Miller2012-07-111-6/+0
| | | | | | | | | | | | No longer used. Signed-off-by: David S. Miller <davem@davemloft.net>
| * net: Don't report route RTT metric value in cache dumps.David S. Miller2012-07-112-18/+15
| | | | | | | | | | | | | | We don't maintain it dynamically any longer, so reporting it would be extremely misleading. Report zero instead. Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: Maintain dynamic metrics in local cache.David S. Miller2012-07-114-93/+468
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Maintain a local hash table of TCP dynamic metrics blobs. Computed TCP metrics are no longer maintained in the route metrics. The table uses RCU and an extremely simple hash so that it has low latency and low overhead. A simple hash is legitimate because we only make metrics blobs for fully established connections. Some tweaking of the default hash table sizes, metric timeouts, and the hash chain length limit certainly could use some tweaking. But the basic design seems sound. With help from Eric Dumazet and Joe Perches. Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: Abstract back handling peer aliveness test into helper function.David S. Miller2012-07-114-2/+13
| | | | | | | | Signed-off-by: David S. Miller <davem@davemloft.net>
| * tcp: Move dynamnic metrics handling into seperate file.David S. Miller2012-07-114-187/+199
|/ | | | Signed-off-by: David S. Miller <davem@davemloft.net>
* etherdevice: introduce eth_broadcast_addrJohannes Berg2012-07-111-0/+11
| | | | | | | | | | | A lot of code has either the memset or an inefficient copy from a static array that contains the all-ones broadcast address. Introduce eth_broadcast_addr() to fill an address with all ones, making the code clearer and allowing us to get rid of some constant arrays. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* ipv4: Fix crashes in fib_rules_tclass().David S. Miller2012-07-111-0/+1
| | | | | | | | | | | | | All paths assume, when CONFIG_IP_MULTIPLE_TABLES is enabled, that any successful call to fib_lookup() will initialize the fib_result->r value to something. We violated that expectation in the new fib_lookup() fast path. Reported-by: Or Gerlitz <ogerlitz@mellanox.com> Tested-by: Eric Dumazet <eric.dumazet@gmail.com> Tested-by: Greg Rose <gregory.v.rose@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'davem-next.r8169' of git://violet.fr.zoreil.com/romieu/linuxDavid S. Miller2012-07-101-318/+666
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Francois Romieu (4): r8169: mdio_ops signature change. r8169: csi_ops signature change. r8169: ephy, eri and efuse functions signature changes. r8169: abstract out loop conditions. Hayes Wang (2): r8169: add RTL8106E support. r8169: support RTL8168G Signed-off-by: David S. Miller <davem@davemloft.net>
| * r8169: support RTL8168GHayes Wang2012-07-091-0/+291
| | | | | | | | | | | | | | | | | | | | | | | | For RTL8111G, the settings of phy and firmware are replaced with ocp functions. r8168g_mdio_{write / read} redirects the relative settings to suitable ocp functions. A per-device variable is needed to evaluate the real address of ocp functions. rtl_writephy(tp, 0x1f, xxxx) is dedicated to keeping said variable up-to-date. Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
| * r8169: abstract out loop conditions.Francois Romieu2012-07-091-181/+186
| | | | | | | | | | | | | | | | | | Twelve functions can fail silently. Now they have a chance to complain. Macro and pasting abuse has been kept at a level where tags and friends should not be hurt. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
| * r8169: ephy, eri and efuse functions signature changes.Francois Romieu2012-07-091-111/+100
| | | | | | | | Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
| * r8169: csi_ops signature change.Francois Romieu2012-07-091-11/+12
| | | | | | | | Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
| * r8169: mdio_ops signature change.Francois Romieu2012-07-091-20/+26
| | | | | | | | | | | | Further changes need more context down in the call stack. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
| * r8169: add RTL8106E support.Hayes Wang2012-07-091-0/+56
| | | | | | | | | | Signed-off-by: Hayes Wang <hayeswang@realtek.com> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
* | net/fsl_pq_mdio: use spin_event_timeout() to poll the indicator registerTimur Tabi2012-07-101-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | Macro spin_event_timeout() was designed for simple polling of hardware registers with a timeout, so use it when we poll the MIIMIND register. This allows us to return an error code instead of polling indefinitely. Note that PHY_INIT_TIMEOUT is a count of loop iterations, so we can't use it for spin_event_timeout(), which asks for microseconds. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | smsc95xx: support ethtool get_regsEmeric Vigier2012-07-091-0/+31
| | | | | | | | | | | | | | | | Inspired by implementation in smsc911x.c and smsc9420.c Tested on ARM/pandaboard running android Signed-off-by: Emeric Vigier <emeric.vigier@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | r6040: use module_pci_driver macroDevendra Naga2012-07-091-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | as the manual of module_pci_driver says that it can be used when the init and exit functions of the module does nothing but the pci_register_driver and pci_unregister_driver. use it for rdc's r6040 driver, as the init and exit paths does as above, and also this reduces a little amount of code. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* | bnx2x: populate skb->l4_rxhashEric Dumazet2012-07-092-4/+16
|/ | | | | | | | | | | | | | l4_rxhash is set on skb when rxhash is obtained from canonical 4-tuple over transport ports/addresses. We can set skb->l4_rxhash for all incoming TCP packets on bnx2x for free, as cqe status contains a hash type information. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Eilon Greenstein <eilong@broadcom.com> Cc: Willem de Bruijn <willemb@google.com> Acked-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* small cleanup in ax25_addr_parse()Dan Carpenter2012-07-091-2/+4
| | | | | | | | The comments were wrong here because "AX25_MAX_DIGIS" is 8 but the comments say 6. Also I've changed the "7" to "AX25_ADDR_LEN". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* be2net: Fix EndianLi RongQing2012-07-091-1/+1
| | | | | | | | | | | ETH_P_IP is host Endian, skb->protocol is big Endian, when compare them, we should change ETH_P_IP from host endian to big endian, htons, not ntohs. CC: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: Li RongQing <roy.qing.li@gmail.com> Acked-by: Somnath Kotur <somnath.kotur@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bcm87xx: fix reg-init comment typoPeter Korsgaard2012-07-091-1/+1
| | | | | | | | broadcom, not marvell. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Acked-by: David Daney <david.daney@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* phylib: Support registering a bunch of driversChristian Hohnstaedt2012-07-0916-431/+159
| | | | | | | | | | | | | | | | If registering of one of them fails, all already registered drivers of this module will be unregistered. Use the new register/unregister functions in all drivers registering more than one driver. amd.c, realtek.c: Simplify: directly return registration result. Tested with broadcom.c All others compile-tested. Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bcm87xx: disable autonegotiation by defaultPeter Korsgaard2012-07-091-0/+1
| | | | | | | | | The bcm87xx phys don't support autonegotiation, so don't use it by default, as otherwise phy_state_machine() will try to enable it (using c22 requests, which also don't make any sense for the bcm78xx). Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Fix for interrupt handlerMirko Lindner2012-07-091-1/+3
| | | | | | | Re-enable interrupts if it is not our interrupt Signed-off-by: Mirko Lindner <mlindner@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sky2: Added support for Optima EEEMirko Lindner2012-07-092-1/+18
| | | | | | | This patch adds support for the Optima EEE chipset. Signed-off-by: Mirko Lindner <mlindner@marvell.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* net/macb: manage carrier state with call to netif_carrier_{on|off}()Nicolas Ferre2012-07-091-2/+11
| | | | | | | | OFF carrier state is setup in probe() open() and suspend() functions. The carrier ON state is managed in macb_handle_link_change(). Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* sctp: refactor sctp_packet_append_chunk and clenup some memory leaksNeil Horman2012-07-091-27/+52
| | | | | | | | | | | | | | | | | | | | | | | While doing some recent work on sctp sack bundling I noted that sctp_packet_append_chunk was pretty inefficient. Specifially, it was called recursively while trying to bundle auth and sack chunks. Because of that we call sctp_packet_bundle_sack and sctp_packet_bundle_auth a total of 4 times for every call to sctp_packet_append_chunk, knowing that at least 3 of those calls will do nothing. So lets refactor sctp_packet_bundle_auth to have an outer part that does the attempted bundling, and an inner part that just does the chunk appends. This saves us several calls per iteration that we just don't need. Also, noticed that the auth and sack bundling fail to free the chunks they allocate if the append fails, so make sure we add that in Signed-off-by: Neil Horman <nhorman@tuxdriver.com> CC: Vlad Yasevich <vyasevich@gmail.com> CC: "David S. Miller" <davem@davemloft.net> CC: linux-sctp@vger.kernel.org Acked-by: Vlad Yasevich <vyasevich@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* bnx2i: use strlcpy() instead of memcpy() for stringsDan Carpenter2012-07-091-1/+1
| | | | | | | | | | DRV_MODULE_VERSION here is "2.7.2.2" which is only 8 chars but we copy 12 bytes from the stack so it's a small information leak. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Michael Chan <mchan@broadcom.com> Acked-by: Eddie Wai <eddie.wai@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-nextDavid S. Miller2012-07-0811-23/+320
|\
| * net: em_canid: Ematch rule to match CAN frames according to their identifiersRostislav Lisovy2012-07-045-2/+257
| | | | | | | | | | | | | | | | | | | | | | This ematch makes it possible to classify CAN frames (AF_CAN) according to their identifiers. This functionality can not be easily achieved with existing classifiers, such as u32, because CAN identifier is always stored in native endianness, whereas u32 expects Network byte order. Signed-off-by: Rostislav Lisovy <lisovy@gmail.com> Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: flexcan: add hardware controller version supportHui Wang2012-07-031-8/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least in the i.MX series, the flexcan contrller divides into ver_3 and ver_10, current driver is for ver_3 controller. i.MX6 has ver_10 controller, it has more reigsters than ver_3 has. The rxfgmask (Rx FIFO Global Mask) register is one of the new added. Its reset value is 0xffffffff, this means ID Filter Table must be checked when receive a packet, but the driver is designed to accept everything during the chip start, we need to clear this register to follow this design. Use the data entry of the struct of_device_id to point chip specific info, we can set hardware version for each platform. Cc: linux-can@vger.kernel.org Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Hui Wang <jason77.wang@gmail.com> [mkl: add id_table support] Tested-by: Hui Wang <jason77.wang@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: flexcan: use of_property_read_u32 to get DT entry valueHui Wang2012-07-021-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of_property_read_u32() can auto handle endian problems, use this function can make code clean and simple. No need to check return value here since the following got value check will handle this. Cc: linux-can@vger.kernel.org Cc: Marc Kleine-Budde <mkl@pengutronix.de> Cc: Wolfgang Grandegger <wg@grandegger.com> Cc: Shawn Guo <shawn.guo@linaro.org> Signed-off-by: Hui Wang <jason77.wang@gmail.com> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * net: flexcan: clock-frequency is optional for device tree probeShawn Guo2012-07-021-0/+3
| | | | | | | | | | | | | | | | | | | | The property clock-frequency is optional for device tree probe. When it's absent, the flexcan driver will try to get the frequency from clk system by calling clk_get_rate. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Dong Aisheng <dong.aisheng@linaro.org> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: fix sparse warning in af_can.cOliver Hartkopp2012-07-022-3/+3
| | | | | | | | | | | | | | | | | | Put can_rx_alldev_list into the af_can header to fix the following sparse warning: net/can/af_can.c:80:22: warning: symbol 'can_rx_alldev_list' was not declared. Should it be static? Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: dev: fix sparse warning for can_restartMarc Kleine-Budde2012-07-021-1/+1
| | | | | | | | | | | | | | | | Make can_restart static to fix the following sparse warning: drivers/net/can/dev.c:371:6: warning: symbol 'can_restart' was not declared. Should it be static? Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
| * can: cc770: fix sparse warning for cc770_interruptMarc Kleine-Budde2012-07-021-1/+1
| | | | | | | | | | | | | | | | Make cc770_interrupt static to fix the following sparse warning: drivers/net/can/cc770/cc770.c:699:13: warning: symbol 'cc770_interrupt' was not declared. Should it be static? Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>