Commit Graph

312590 Commits

Author SHA1 Message Date
David S. Miller 97cac0821a ipv6: Store route neighbour in rt6_info struct.
This makes for a simplified conversion away from dst_get_neighbour*().

All code outside of ipv6 will use neigh lookups via dst_neigh_lookup*().

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 02:41:58 -07:00
David S. Miller 534cb283ef cxgb3: Convert t3_l2t_get() over to dst_neigh_lookup().
This means passing in a suitable destination address.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 02:29:40 -07:00
David S. Miller 1d248b1cf4 net: Pass neighbours and dest address into NETEVENT_REDIRECT events.
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 02:21:55 -07:00
David S. Miller fccd7d5c77 decnet: Use neighbours privately in dn_route struct.
This allows an easy conversion away from dst_get_neighbour*().

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:12:14 -07:00
David S. Miller 13a43d94ab neigh: Convert over to dst_neigh_lookup_skb().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:12:00 -07:00
David S. Miller f9d751667f br_netfilter: Convert to dst_neigh_lookup_skb().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:10:05 -07:00
David S. Miller c473737765 cxgb4i: Convert over to dst_neigh_lookup().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:10:04 -07:00
David S. Miller 0b399d46b3 cxgbi: Convert over to dst_neigh_lookup().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:09:53 -07:00
David S. Miller 24db1ba866 qeth: Convert over to dst_neigh_lookup_skb().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:09:43 -07:00
David S. Miller 178709bbfe ipoib: Convert over to dev_lookup_neigh_skb().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:09:36 -07:00
David S. Miller dbedbe6d56 sch_teql: Convert over to dev_neigh_lookup_skb().
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:09:06 -07:00
David S. Miller f894cbf847 net: Add optional SKB arg to dst_ops->neigh_lookup().
Causes the handler to use the daddr in the ipv4/ipv6 header when
the route gateway is unspecified (local subnet).

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:04:01 -07:00
David S. Miller 5110effee8 net: Do delayed neigh confirmation.
When a dst_confirm() happens, mark the confirmation as pending in the
dst.  Then on the next packet out, when we have the neigh in-hand, do
the update.

This removes the dependency in dst_confirm() of dst's having an
attached neigh.

While we're here, remove the explicit 'dst' NULL check, all except 2
or 3 call sites ensure it's not NULL.  So just fix those cases up.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:03:06 -07:00
David S. Miller 60d354ebeb sunrpc: Don't do a dst_confirm() on an input routes.
xs_udp_data_ready() is operating on received packets, and tries to
do a dst_confirm() on the dst attached to the SKB.

This isn't right, dst confirmation is for output routes, not input
rights.  It's for resetting the timers on the nexthop neighbour entry
for the route, indicating that we've got good evidence that we've
successfully reached it.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:02:43 -07:00
David S. Miller 3c521f2ba9 ipv4: Don't report neigh uptodate state in rtcache procfs.
Soon routes will not have a cached neigh attached, nor will we
be able to necessarily go directly to a neigh from an arbitrary
route.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:02:31 -07:00
David S. Miller a263b30936 ipv4: Make neigh lookups directly in output packet path.
Do not use the dst cached neigh, we'll be getting rid of that.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-05 01:02:12 -07:00
David S. Miller 11604721a3 ipv4: Fix crashes in ip_options_compile().
The spec_dst uses should be guarded by skb_rtable() being non-NULL
not just the SKB being non-null.

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-04 16:13:17 -07:00
David S. Miller e87183c2b5 Included changes:
- The last batch of patches aimed to clean the batman-adv namespace
 - a couple of style fixes
 - a fix for the ethtool support
 - a fix to prevent sending unicast packets with an uninitialised header
   field
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAk/w3hYACgkQpGgxIkP9cwfnbACeIMwib/b1Vi0Fc8IpHlXlBv1N
 +xwAoIyt8bNqui7bot/+BbVYTwPpR+uy
 =KzmF
 -----END PGP SIGNATURE-----

Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge

Included changes:
- The last batch of patches aimed to clean the batman-adv namespace
- a couple of style fixes
- a fix for the ethtool support
- a fix to prevent sending unicast packets with an uninitialised header
  field

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-01 17:56:33 -07:00
Sven Eckelmann 162d549c69 batman-adv: Don't leak information through uninitialized packet fields
The reserved fields in batman-adv packets are not set to a constant value. The
content of these memory regions is leaked unintentionally to the network.

This regression was introduced in 3b27ffb00f

Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-07-01 22:47:24 +02:00
Marek Lindner 0c5e45b63d batman-adv: fix counter summary length
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-07-01 22:47:23 +02:00
Sven Eckelmann 0aca2369b1 batman-adv: Fix alignment after opened parentheses
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-07-01 22:47:23 +02:00
Sven Eckelmann cb4cca7103 batman-adv: Remove space before semicolon
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
2012-07-01 22:47:23 +02:00
Sven Eckelmann b706b13b6c batman-adv: Remove bat_ prefix from bat_{debugfs, sysfs}.{c, h}
The "bat_" prefix in the source files implementing the batman-adv sysfs and
debugfs interface doesn't have a special meaning and are only used by these
files and files that implement the actual B.A.T.M.A.N. path finding algorithm.

The prefix is better suited to mark files that are used to implement the main
part of the path finding. All other files should not use it and therefore gets
renamed.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:22 +02:00
Sven Eckelmann a8a0a62d1f batman-adv: Transform BATADV_LOG_BUFF(idx) into function
The linux Documentation/CodingStyle says that:
 * Chapter 12: "inline functions are preferable to macros resembling functions"
 * Chapter 12.2: Depending on local variables with a magic name is bad
 * Chapter 12.3: Macros with arguments used as l-value are bad

Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:22 +02:00
Sven Eckelmann 56303d34a3 batman-adv: Prefix types structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:21 +02:00
Sven Eckelmann 9641269011 batman-adv: Prefix packet structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:21 +02:00
Sven Eckelmann b4d66b877b batman-adv: Prefix local sysfs struct with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:21 +02:00
Sven Eckelmann 5bf74e9ca1 batman-adv: Prefix hash struct and typedef with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:20 +02:00
Sven Eckelmann 7f223c0c32 batman-adv: Prefix local debugfs structs with batadv_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:20 +02:00
Sven Eckelmann 39c75a51ed batman-adv: Prefix main enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:19 +02:00
Sven Eckelmann acd34afa89 batman-adv: Prefix packet enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:19 +02:00
Sven Eckelmann d69909d2fc batman-adv: Prefix types enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:19 +02:00
Sven Eckelmann e9a4f295eb batman-adv: Prefix hard-interface enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:18 +02:00
Sven Eckelmann cd646ab1e2 batman-adv: Prefix gateway enum with BATADV_
Reported-by: Martin Hundebøll <martin@hundeboll.net>
Signed-off-by: Sven Eckelmann <sven@narfation.org>
2012-07-01 22:47:18 +02:00
Giuseppe CAVALLARO a59a4d1921 phy: add the EEE support and the way to access to the MMD registers.
This patch adds the support for the Energy-Efficient Ethernet (EEE)
to the Physical Abstraction Layer.
To support the EEE we have to access to the MMD registers 3.20 and
7.60/61. So two new functions have been added to read/write the MMD
registers (clause 45).

An Ethernet driver (I tested the stmmac) can invoke the phy_init_eee to properly
check if the EEE is supported by the PHYs and it can also set the clock
stop enable bit in the 3.0 register.
The phy_get_eee_err can be used for reporting the number of time where
the PHY failed to complete its normal wake sequence.

In the end, this patch also adds the EEE ethtool support implementing:
 o phy_ethtool_set_eee
 o phy_ethtool_get_eee

v1: initial patch
v2: fixed some errors especially on naming convention
v3: renamed again the mmd read/write functions thank to Ben's feedback
v4: moved file to phy.c and added the ethtool support.
v5: fixed phy_adv_to_eee, phy_eee_to_supported, phy_eee_to_adv return
    values according to ethtool API (thanks to Ben's feedback).
    Renamed some macros to avoid too long names.
v6: fixed kernel-doc comments to be properly parsed.
    Fixed the phy_init_eee function: we need to check which link mode
    was autonegotiated and then the corresponding bits in 7.60 and 7.61
    registers.
v7: reviewed the way to get the negotiated settings.
v8: fixed a problem in the phy_init_eee return value erroneously added
    when included the phy_read_status call.
v9: do not remove the MDIO_AN_EEE_ADV_100TX and MDIO_AN_EEE_ADV_1000T
    and fixed the eee_{cap,lp,adv} declaration as "int" instead of u16.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Reviewed-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-01 03:34:50 -07:00
Giuseppe CAVALLARO d765955d2a stmmac: add the Energy Efficient Ethernet support
This patch adds the Energy Efficient Ethernet support to the stmmac.

Please see the driver's documentation for further details about this support
in the driver.

Thanks also goes to Rayagond Kokatanur for his first implementation.

Note:
 to clearly manage and expose the lpi interrupt status and eee ethtool
 stats I've had to do some modifications to the driver's design and I
 found really useful to move other parts of the code (e.g. mmc irq stat)
 in the main directly. So this means that some core has been reworked
 to introduce the EEE.

v1: initial patch
v2: fixed some sparse issues (typos)
v3: erroneously sent the v2 renamed as v3
v4:
	o Fixed the return value of the stmmac_eee_init as suggested by D.Miller
	o Totally reviewed the ethtool support for EEE
	o Added a new internal parameter to tune the SW timer for TX LPI.
v5: do not change any eee setting in case of the stmmac_ethtool_op_set_eee fails
    (it has to return -EOPNOTSUPP in that case).

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-01 03:34:50 -07:00
Giuseppe CAVALLARO 0ec2ccd080 stmmac: update the driver Documentation and add EEE
This patch updates the stmmac's documentation adding
some missing files in the section used to describe the
internal driver's structure.

Also the patch adds a new section to describe the EEE support.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-01 03:34:49 -07:00
Giuseppe CAVALLARO ea2ab8711b stmmac: do not use strict_strtoul but kstrtoint
This patch replaces the obsolete strict_strtoul with kstrtoint.

v2: also removed casting on kstrtoul.
v3: use kstrtoint instead of kstrtoul due to all vars are integer.
    thanks to E. Dumazet.

Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-07-01 03:34:49 -07:00
David S. Miller c801e3cc19 ipv4: Clarify in docs that accept_local requires rp_filter.
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-30 22:39:27 -07:00
Dan Carpenter f7eadafb13 netfilter: use kfree_skb() not kfree()
This was should be a kfree_skb() here to free the sk_buff pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-30 17:26:51 -07:00
Jiri Pirko 0d1632b46a dummy: use IFF_LIVE_ADDR_CHANGE priv_flag
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-30 01:08:00 -07:00
Jiri Pirko 5a1d1c8c78 team: use IFF_LIVE_ADDR_CHANGE priv_flag
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-30 01:08:00 -07:00
Jiri Pirko f2f2c8b42d virtio_net: use IFF_LIVE_ADDR_CHANGE priv_flag
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-30 01:08:00 -07:00
Jiri Pirko bb35f67195 net: introduce new priv_flag indicating iface capable of change mac when running
Introduce IFF_LIVE_ADDR_CHANGE priv_flag and use it to disable
netif_running() check in eth_mac_addr()

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-30 01:08:00 -07:00
Pablo Neira Ayuso 03292745b0 netlink: add nlk->netlink_bind hook for module auto-loading
This patch adds a hook in the binding path of netlink.

This is used by ctnetlink to allow module autoloading for the case
in which one user executes:

 conntrack -E

So far, this resulted in nfnetlink loaded, but not
nf_conntrack_netlink.

I have received in the past many complains on this behaviour.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-29 16:46:06 -07:00
Pablo Neira Ayuso a31f2d17b3 netlink: add netlink_kernel_cfg parameter to netlink_kernel_create
This patch adds the following structure:

struct netlink_kernel_cfg {
        unsigned int    groups;
        void            (*input)(struct sk_buff *skb);
        struct mutex    *cb_mutex;
};

That can be passed to netlink_kernel_create to set optional configurations
for netlink kernel sockets.

I've populated this structure by looking for NULL and zero parameters at the
existing code. The remaining parameters that always need to be set are still
left in the original interface.

That includes optional parameters for the netlink socket creation. This allows
easy extensibility of this interface in the future.

This patch also adapts all callers to use this new interface.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-29 16:46:02 -07:00
David S. Miller dd7f36ba3c Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John Linville says:

====================
Here is another batch of updates intended for 3.6.  This includes a
number of pulls, including ones from the mac80211, iwlwifi, ath6kl, and
wl12xx trees.  I also pulled from the wireless tree to avoid potential
build conflicts.  There are a number of other patches applied directly,
including a number for the Broadcom drivers and the mwifiex driver.

The updates cover the usual variety of new hardware support and feature
enhancements.  It's all good work, but there aren't any big headliners.
This does resolve a net-next/wireless-next merge conflict reported
by Stephen.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-29 16:28:28 -07:00
Michael Chan ae0eef6608 cnic: Fix mmap regression.
commit 1f85d58cdf
    cnic: Remove uio mem[0].

introduced a regression as older versions of userspace app still rely
on this mmap.  Restore the mmap functionality and get the base address
from pci_resource_start() as the nedev->base_addr has been deprecated for
PCI devices.

Update version to 2.5.12.

Signed-off-by: Michael Chan <mchan@broadocm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2012-06-29 15:33:28 -07:00
John W. Linville 8732baafc3 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
	drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
2012-06-29 12:42:14 -04:00
John W. Linville 42fb0b0278 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless 2012-06-29 12:07:37 -04:00