platform/kernel/linux-starfive.git
11 years agoisdn/gigaset: beautify interface.c
Tilman Schmidt [Mon, 21 Jan 2013 11:57:20 +0000 (11:57 +0000)]
isdn/gigaset: beautify interface.c

Avoid forward declarations and remove a needless initialization.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoisdn/gigaset: leave DLE mode before hanging up
Tilman Schmidt [Mon, 21 Jan 2013 11:57:20 +0000 (11:57 +0000)]
isdn/gigaset: leave DLE mode before hanging up

Some firmware releases of Gigaset M105 do not accept AT+VLS=0 command
in DLE mode, so always leave DLE mode before sending the command.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoisdn/divert: fix readability damage
Tilman Schmidt [Mon, 21 Jan 2013 11:57:20 +0000 (11:57 +0000)]
isdn/divert: fix readability damage

Fix up some of the readibility deterioration caused by last year's
ISDN whitespace coding style cleanup.
Note that the checkpatch complaints all apply to the state of the
source before this patch as well, and in many cases even more so.

Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodrivers/net/ethernet/sfc/ptp.c: adjust duplicate test
Julia Lawall [Mon, 21 Jan 2013 03:02:48 +0000 (03:02 +0000)]
drivers/net/ethernet/sfc/ptp.c: adjust duplicate test

Delete successive tests to the same location.  rc was previously tested and
not subsequently updated.  efx_phc_adjtime can return an error code, so the
call is updated so that is tested instead.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@s exists@
local idexpression y;
expression x,e;
@@

*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
 { ... when forall
   return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
    when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
 { ... when forall
   return ...; }
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Do not try to update "updated" time if neighbour has already gone.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 09:58:50 +0000 (09:58 +0000)]
ndisc: Do not try to update "updated" time if neighbour has already gone.

Commit 2152caea ("ipv6: Do not depend on rt->n in rt6_probe().")
introduce a bug to try to update "updated" time in neighbour
structure.
Update the "updated" time only if neighbour is available.

Bug was found by Dan Carpenter <dan.carpenter@oracle.com>

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'dsa'
David S. Miller [Mon, 21 Jan 2013 20:40:47 +0000 (15:40 -0500)]
Merge branch 'dsa'

Florian Fainelli says:

====================
These two patches are non-critical bugfixes based on net-next which I
stumbled upon while working on Device Tree bindings for DSA (will comme
as a separate patch later).

====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodsa: make dsa_switch_setup check for valid port names
Florian Fainelli [Mon, 21 Jan 2013 09:58:51 +0000 (09:58 +0000)]
dsa: make dsa_switch_setup check for valid port names

This patch changes dsa_switch_setup() to ensure that at least one valid
valid port name is specified and will bail out with an error in case we
walked the maximum number of port with a valid port name found.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agodsa: use an unique and non conflicting bus name for the slave MII bus
Florian Fainelli [Mon, 21 Jan 2013 09:58:50 +0000 (09:58 +0000)]
dsa: use an unique and non conflicting bus name for the slave MII bus

The slave MII bus registered by the DSA code is using the parent MII bus
as part of its name (ds->master_mii_bus_id), in case the parent MII bus
name is already 16 characters long (such as d0072004.mdio-mi) we will
get the following WARN_ON in dsa_switch_setup() when calling
mdiobus_register():

[   79.088782] ------------[ cut here ]------------
[   79.093448] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0x80/0xa0()
[   79.099831] sysfs: cannot create duplicate filename
'/class/mdio_bus/d0072004.mdio-mi'

This is a genuine warning, because the DSA slave MII bus will also be
named d0072004.mdio-mi, and since MII_BUS_ID_SIZE is 17 characters long
(with null-terminator) the following will truncate the slave MII bus id:

snprintf(ds->slave_mii_bus->id, MII_BUS_ID_SIZE, "%s-%d:%.2x",
                        ds->master_mii_bus->id, ds->pd->sw_addr);

Fix this by using dsa-<switch index->:<sw_add> which is guaranteed to be
unique.

Signed-off-by: Florian Fainelli <florian@openwrt.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: move rx and tx hash functions to net/core/flow_dissector.c
Cong Wang [Mon, 21 Jan 2013 00:39:24 +0000 (00:39 +0000)]
net: move rx and tx hash functions to net/core/flow_dissector.c

__skb_tx_hash() and __skb_get_rxhash() are all for calculating hash
value based by some fields in skb, mostly used for selecting queues
by device drivers.

Meanwhile, net/core/dev.c is bloating.

Cc: "David S. Miller" <davem@davemloft.net>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'virtio_mac'
David S. Miller [Mon, 21 Jan 2013 19:14:09 +0000 (14:14 -0500)]
Merge branch 'virtio_mac'

Amos Kong says:

====================
Currenly mac is programmed byte by byte. This means that we
have an intermediate step where mac is wrong.

Third patch introduced a new vq control command to set mac
address, it's atomic.

V2: check return of sending command, delay eth_mac_addr()
V3: restore software address when fail to set hardware address
V4: split eth_mac_addr, fix error handle
V5: rebase patches to net-next tree
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agovirtio-net: introduce a new control to set macaddr
Amos Kong [Mon, 21 Jan 2013 01:17:23 +0000 (01:17 +0000)]
virtio-net: introduce a new control to set macaddr

Currently we write MAC address to pci config space byte by byte,
this means that we have an intermediate step where mac is wrong.
This patch introduced a new control command to set MAC address,
it's atomic.

VIRTIO_NET_F_CTRL_MAC_ADDR is a new feature bit for compatibility.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: split eth_mac_addr for better error handling
Stefan Hajnoczi [Mon, 21 Jan 2013 01:17:22 +0000 (01:17 +0000)]
net: split eth_mac_addr for better error handling

When we set mac address, software mac address in system and hardware mac
address all need to be updated. Current eth_mac_addr() doesn't allow
callers to implement error handling nicely.

This patch split eth_mac_addr() to prepare part and real commit part,
then we can prepare first, and try to change hardware address, then do
the real commit if hardware address is set successfully.

Signed-off-by: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomove virtnet_send_command() above virtnet_set_mac_address()
Amos Kong [Mon, 21 Jan 2013 01:17:21 +0000 (01:17 +0000)]
move virtnet_send_command() above virtnet_set_mac_address()

We want to send vq command to set mac address in
virtnet_set_mac_address(), so do this function moving.
Fixed a little issue of coding style.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'mcast'
David S. Miller [Mon, 21 Jan 2013 19:06:34 +0000 (14:06 -0500)]
Merge branch 'mcast'

Nicolas Dichtel says:

====================
The goal of this serie is to add the support of proxy multicast, ie being able
to build a static multicast tree. In other words, it adds the support of (*,G)
mf[6]c entries.

v2: use INADDR_ANY instead of 0 for IPv4 addresses
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomcast: add multicast proxy support (IPv4 and IPv6)
Nicolas Dichtel [Mon, 21 Jan 2013 06:00:26 +0000 (06:00 +0000)]
mcast: add multicast proxy support (IPv4 and IPv6)

This patch add the support of proxy multicast, ie being able to build a static
multicast tree. It adds the support of (*,*) and (*,G) entries.

The user should define an (*,*) entry which is not used for real forwarding.
This entry defines the upstream in iif and contains all interfaces from the
static tree in its oifs. It will be used to forward packet upstream when they
come from an interface belonging to the static tree.
Hence, the user should define (*,G) entries to build its static tree. Note that
upstream interface must be part of oifs: packets are sent to all oifs
interfaces except the input interface. This ensures to always join the whole
static tree, even if the packet is not coming from the upstream interface.

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agomcast: define and use MRT[6]_MAX in ip[6]_mroute_opt()
Nicolas Dichtel [Mon, 21 Jan 2013 06:00:25 +0000 (06:00 +0000)]
mcast: define and use MRT[6]_MAX in ip[6]_mroute_opt()

This will ease further addition of new MRT[6]_* values and avoid to update
in6.h each time.
Note that we reduce the maximum value from 210 to 209, but 210 does not match
any known value in ip[6]_mroute_setsockopt().

Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
Acked-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoDocumentation: remove obsolete networking/multicast.txt file
Paul Gortmaker [Mon, 21 Jan 2013 06:17:41 +0000 (06:17 +0000)]
Documentation: remove obsolete networking/multicast.txt file

The original intent of this file was to list limitations in
drivers/hardware relating to multicast use, back when some
modest hardware from the early 1990s did not support things
we might take for granted today.

I was intending to delete some now-gone MCA/token ring entries
in this file, but once I opened it, I found it only contained
information on the earliest (pre-2000) linux networking drivers.

Checking the git history shows that the file hasn't been touched
since 2005.  Clearly nobody is actively consulting this file
as a meaningful reference.

Rather than add a "YES YES YES" line for all of the drivers we
currently have, lets just take advantage of the fact that nobody
is using the file to delete it.

This has the side benefit of not having to do a line-by-line
deletion of the file content as each older driver is expired.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'qeth'
David S. Miller [Mon, 21 Jan 2013 18:51:24 +0000 (13:51 -0500)]
Merge branch 'qeth'

Merge s390 networking changes from Frank Blaschka.

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Fix HiperSockets performance regression
Stefan Raspl [Mon, 21 Jan 2013 02:30:23 +0000 (02:30 +0000)]
qeth: Fix HiperSockets performance regression

Commit 46d3ceab "tcp: TCP Small Queues" has severly degraded
performance for single connection RR workloads on HiperSockets with
MTU >=16K due to a conflict of the TCP Small Queues approach with our
buffer scan threshold which releases buffers not frequently enough yet.
This fix restores performance to the same level as before cited commit.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Make s390dbf card entries persistent
Stefan Raspl [Mon, 21 Jan 2013 02:30:22 +0000 (02:30 +0000)]
qeth: Make s390dbf card entries persistent

As of now, s390dbf entries for the cards are discarded as soon as the
device is removed. However, this will also bar us of all chances of
getting valuable debug information after a device has been removed.
This patch will keep the s390dbf entries around until the qeth module
is removed.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Update Kconfig wording
Stefan Raspl [Mon, 21 Jan 2013 02:30:21 +0000 (02:30 +0000)]
qeth: Update Kconfig wording

Refer to virtual NICs instead of GuestLANs.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Support VEPA mode
Stefan Raspl [Mon, 21 Jan 2013 02:30:20 +0000 (02:30 +0000)]
qeth: Support VEPA mode

The existing port isolation mode 'forward' will now verify that the adjacent
switch port supports the required reflective relay (RR) mode. This patch adds
the required error handling for the cases where enabling port isolation mode
'forward' can now fail.
Furthermore, once established, we never fall back from one of the port
isolation modes to a non-isolated mode without further user-interaction.
This includes cases where the isolation mode was enabled successfully, but
ceases to work e.g. due to configuration changes at the switch port.
Finally, configuring an isolation mode with the device being offline
will make onlining the device fail permanently upon errors encountered until
either errors are resolved or the isolation mode is changed by the user to a
different mode.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Remove unused exports
Stefan Raspl [Mon, 21 Jan 2013 02:30:19 +0000 (02:30 +0000)]
qeth: Remove unused exports

Remove exports that are not used anywhere else.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoqeth: Fix retry logic in hardsetup
Stefan Raspl [Mon, 21 Jan 2013 02:30:18 +0000 (02:30 +0000)]
qeth: Fix retry logic in hardsetup

The previous code did never retry any idx setup unless retries were done
for device offline/online at the beginning of the function.

Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'ipv6_ndisc'
David S. Miller [Mon, 21 Jan 2013 18:50:10 +0000 (13:50 -0500)]
Merge branch 'ipv6_ndisc'

YOSHIFUJI Hideaki says:

====================
This series of changes basically clean up NDISC logic,
especially on sender side.

We originally do For NS/NA/RS:
 1) build temporary ICMPv6 header
 2) ndisc_build_skb() with temporary ICMPv6 header and rather
    criptic arguments.
    - Calculate total length and allocate sk_buff
    - Build IPv6 header.
    - copy ICMPv6 header, additional data and ND options.
    - Fill-in ICMPv6 checksum.
    Here, structures defined for message format was not used
    at all, it is difficult to understand what is being sent,
    and it was not generic.
 3) __ndisc_send()
    - Allocate temporary dst.
    - Send it.

Several issues:
- We could not defer decision if we should/can send some ND
  option.
- It is hard to see the packet format at a glance.
- ICMPv6 header was built as temporary variable, and then
  copied to the buffer.
- Some code path for Redirect was not shared.

With these patches, we do:
 1) Calculate (or estimate) message length and option length.
 2) Allocate skb (via new ndisc_skb_alloc()).
 3) Fill-in ICMPv6 message directly using compound literals.
 4) Fill-in ICMPv6 checksum
 5) Build IPv6 header (including length)
 6) Send the packet (via ndisc_send_skb()).
    - allocate temporary dst and send it.

- We can defer calculating real length of the packet.
  For example, we can give up filling some option at when
  filling in.
- Message is built directly without temporary buffer.
- Structures defined for message format is easier to understand
  what is being built.
- NS/NA/RS/Redirect share same logic.
- Reduced code/data size:
   text    data     bss     dec     hex filename
 265407   14133    3488  283028   45194 old/net/ipv6/ipv6.o
 264955   14109    3488  282552   44fb8 new/net/ipv6/ipv6.o
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Use compound literals to build redirect message.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:49:25 +0000 (06:49 +0000)]
ndisc: Use compound literals to build redirect message.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Break down ndisc_build_skb() and build message directly.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:49:17 +0000 (06:49 +0000)]
ndisc: Break down ndisc_build_skb() and build message directly.

Construct NS/NA/RS message directly using C99 compound literals.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Break down __ndisc_send().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:49:13 +0000 (06:49 +0000)]
ndisc: Break down __ndisc_send().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Fill in ICMPv6 checksum and IPv6 header in ndisc_send_skb().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:49:08 +0000 (06:49 +0000)]
ndisc: Fill in ICMPv6 checksum and IPv6 header in ndisc_send_skb().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Use ndisc_send_skb() for redirect.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:49:03 +0000 (06:49 +0000)]
ndisc: Use ndisc_send_skb() for redirect.

Reuse dst if one is attached with skb.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Remove icmp6h argument from ndisc_send_skb().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:58 +0000 (06:48 +0000)]
ndisc: Remove icmp6h argument from ndisc_send_skb().

skb_transport_header() (thus icmp6_hdr()) is available here,
use it.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Make ndisc_fill_xxx_option() for sk_buff.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:53 +0000 (06:48 +0000)]
ndisc: Make ndisc_fill_xxx_option() for sk_buff.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Calculate message body length and option length separately.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:49 +0000 (06:48 +0000)]
ndisc: Calculate message body length and option length separately.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Reset skb->trasport_headner inside ndisc_alloc_send_skb().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:44 +0000 (06:48 +0000)]
ndisc: Reset skb->trasport_headner inside ndisc_alloc_send_skb().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Defer building IPv6 header.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:39 +0000 (06:48 +0000)]
ndisc: Defer building IPv6 header.

Build ICMPv6 message first and make buffer management easier;
we can use skb->len when filling checksum in ICMPv6 header,
and then build IP header with length field.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Remove dev argument for ndisc_send_skb().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:34 +0000 (06:48 +0000)]
ndisc: Remove dev argument for ndisc_send_skb().

Since we have skb->dev, use it.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Set skb->dev and skb->protocol inside ndisc_alloc_skb().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:29 +0000 (06:48 +0000)]
ndisc: Set skb->dev and skb->protocol inside ndisc_alloc_skb().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Simplify arguments for ip6_nd_hdr().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:24 +0000 (06:48 +0000)]
ndisc: Simplify arguments for ip6_nd_hdr().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Unshare ip6_nd_hdr() and change return type to void.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:19 +0000 (06:48 +0000)]
ipv6: Unshare ip6_nd_hdr() and change return type to void.

- move ip6_nd_hdr() to its users' source files.
  In net/ipv6/mcast.c, it will be called ip6_mc_hdr().
- make return type to void since this function never fails.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Introduce ndisc_alloc_skb() helper.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:14 +0000 (06:48 +0000)]
ndisc: Introduce ndisc_alloc_skb() helper.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Introduce ndisc_fill_redirect_hdr_option().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:09 +0000 (06:48 +0000)]
ndisc: Introduce ndisc_fill_redirect_hdr_option().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Use skb_linearize() instead of pskb_may_pull(skb, skb->len).
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:48:03 +0000 (06:48 +0000)]
ndisc: Use skb_linearize() instead of pskb_may_pull(skb, skb->len).

Suggested by Eric Dumazet <edumazet@google.com>.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Move ndisc_opt_addr_space() to include/net/ndisc.h.
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:47:56 +0000 (06:47 +0000)]
ndisc: Move ndisc_opt_addr_space() to include/net/ndisc.h.

This also makes ndisc_opt_addr_data() and ndisc_fill_addr_option()
use ndisc_opt_addr_space().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Reduce number of arguments for ndisc_fill_addr_option().
YOSHIFUJI Hideaki / 吉藤英明 [Mon, 21 Jan 2013 06:47:50 +0000 (06:47 +0000)]
ndisc: Reduce number of arguments for ndisc_fill_addr_option().

Add pointer to struct net_device (dev) and remove
data_len (= dev->addr_len) and addr_type (= dev->type).

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: ethernet: davinci: Fix build breakage
Thierry Reding [Mon, 21 Jan 2013 09:38:39 +0000 (10:38 +0100)]
net: ethernet: davinci: Fix build breakage

The correct name of the transmit DMA channel field in struct emac_priv
is txchan, not txch.

Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agofirewire net: Use LL_RESERVED_SPACE(), HH_DATA_OFF().
YOSHIFUJI Hideaki / 吉藤英明 [Sat, 19 Jan 2013 22:03:07 +0000 (22:03 +0000)]
firewire net: Use LL_RESERVED_SPACE(), HH_DATA_OFF().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agofirewire net: Ensure checksumming in upper layer.
YOSHIFUJI Hideaki / 吉藤英明 [Sat, 19 Jan 2013 21:43:40 +0000 (21:43 +0000)]
firewire net: Ensure checksumming in upper layer.

It is wrong to set skb->ip_summed to CHECKSUM_UNNECESSARY unless
the device has already checked it.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agousbnet: pegasus: set wakeup enable in set_wol
Ming Lei [Sat, 19 Jan 2013 01:32:01 +0000 (01:32 +0000)]
usbnet: pegasus: set wakeup enable in set_wol

This patch calls device_set_wakeup_enable() inside set_wol
callback, so that turning on WOL from user mode utility
can make the 'wakeup' of pegasus device to be enabled, then
remote wakeup may be enabled before putting into sleep.

Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Petko Manolov <petkan@users.sourceforge.net>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet/mlx4_en: remove redundant code
Eric Dumazet [Thu, 17 Jan 2013 05:26:07 +0000 (05:26 +0000)]
net/mlx4_en: remove redundant code

remove redundant code from build_inline_wqe()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-By: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Make several arguments for ndisc_send_na() boolean.
YOSHIFUJI Hideaki / 吉藤英明 [Sun, 20 Jan 2013 07:39:18 +0000 (07:39 +0000)]
ndisc: Make several arguments for ndisc_send_na() boolean.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Optimize ipv6_addr_is_ll_all_{nodes,routers}().
YOSHIFUJI Hideaki / 吉藤英明 [Sun, 20 Jan 2013 07:38:52 +0000 (07:38 +0000)]
ipv6: Optimize ipv6_addr_is_ll_all_{nodes,routers}().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Optimize ipv6_addr_is_solict_mult().
YOSHIFUJI Hideaki / 吉藤英明 [Sun, 20 Jan 2013 07:39:07 +0000 (07:39 +0000)]
ipv6: Optimize ipv6_addr_is_solict_mult().

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Introduce ipv6_addr_is_solict_mult() to check Solicited Node Multicast Addresses.
YOSHIFUJI Hideaki / 吉藤英明 [Sun, 20 Jan 2013 07:39:00 +0000 (07:39 +0000)]
ipv6: Introduce ipv6_addr_is_solict_mult() to check Solicited Node Multicast Addresses.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Make ipv6_addr_is_XXX() return boolean.
YOSHIFUJI Hideaki [Sun, 20 Jan 2013 17:38:38 +0000 (02:38 +0900)]
ipv6: Make ipv6_addr_is_XXX() return boolean.

ipv6_addr_is_{multicast,ll_all_nodes,ll_all_routers,isatap}()
return boolean.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: asix: ax88772_unbind() can be static
Wu Fengguang [Fri, 18 Jan 2013 15:36:56 +0000 (15:36 +0000)]
net: asix: ax88772_unbind() can be static

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Sat, 19 Jan 2013 15:52:45 +0000 (10:52 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
This series contains updates to ixgbe, ixgbevf and igb.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge
David S. Miller [Sat, 19 Jan 2013 15:47:47 +0000 (10:47 -0500)]
Merge tag 'batman-adv-for-davem' of git://git.open-mesh.org/linux-merge

Included changes:
- sysfs removal postponement during interface un-registration
- random32() function renaming
- struct refactoring
- kernel doc improvement
- deleyed_work initialisation clean up work
- copyright year and internal version number update
- kernel doc improvement

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agobatman-adv: Start new development cycle
Antonio Quartulli [Thu, 3 Jan 2013 11:22:10 +0000 (12:22 +0100)]
batman-adv: Start new development cycle

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: update copyright years
Antonio Quartulli [Fri, 4 Jan 2013 02:05:31 +0000 (03:05 +0100)]
batman-adv: update copyright years

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
11 years agobatman-adv: postpone sysfs removal when unregistering
Simon Wunderlich [Fri, 11 Jan 2013 09:19:51 +0000 (10:19 +0100)]
batman-adv: postpone sysfs removal when unregistering

When processing the unregister notify for a hard interface, removing
the sysfs files may lead to a circular deadlock (rtnl mutex <->
s_active).

To overcome this problem, postpone the sysfs removal in a worker.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Reported-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: rename random32() to prandom_u32()
Akinobu Mita [Mon, 24 Dec 2012 02:14:07 +0000 (11:14 +0900)]
batman-adv: rename random32() to prandom_u32()

Use more preferable function name which implies using a pseudo-random
number generator.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Acked-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Cc: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Cc: Antonio Quartulli <ordex@autistici.org>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Cc: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: kernel doc for types.h
Marek Lindner [Tue, 25 Dec 2012 13:45:12 +0000 (21:45 +0800)]
batman-adv: kernel doc for types.h

Thanks to Sven Eckelmann and Simon Wunderlich for their support.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: rename batadv_claim struct to make clear it is used by bla
Marek Lindner [Tue, 25 Dec 2012 09:03:25 +0000 (17:03 +0800)]
batman-adv: rename batadv_claim struct to make clear it is used by bla

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: rename batadv_backbone_gw struct to make clear it is used by bla
Marek Lindner [Tue, 25 Dec 2012 09:03:24 +0000 (17:03 +0800)]
batman-adv: rename batadv_backbone_gw struct to make clear it is used by bla

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: rename batadv_recvlist_node struct to make clear it is used by vis
Marek Lindner [Tue, 25 Dec 2012 09:03:23 +0000 (17:03 +0800)]
batman-adv: rename batadv_recvlist_node struct to make clear it is used by vis

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: rename batadv_if_list_entry struct to make clear it is used by vis
Marek Lindner [Tue, 25 Dec 2012 09:03:22 +0000 (17:03 +0800)]
batman-adv: rename batadv_if_list_entry struct to make clear it is used by vis

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: group tt type definitions together
Marek Lindner [Tue, 25 Dec 2012 09:03:21 +0000 (17:03 +0800)]
batman-adv: group tt type definitions together

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: mark debug_log struct as bat_priv only struct
Marek Lindner [Tue, 25 Dec 2012 09:03:20 +0000 (17:03 +0800)]
batman-adv: mark debug_log struct as bat_priv only struct

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: align kernel doc properly
Marek Lindner [Tue, 25 Dec 2012 09:03:19 +0000 (17:03 +0800)]
batman-adv: align kernel doc properly

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <ordex@autistici.org>
11 years agobatman-adv: a delayed_work has to be initialised once
Antonio Quartulli [Tue, 25 Dec 2012 12:14:37 +0000 (13:14 +0100)]
batman-adv: a delayed_work has to be initialised once

A delayed_work struct does not need to be initialized each
every time before being enqueued. Therefore the
INIT_DELAYED_WORK() macro should be used during the
initialization process only.

Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
11 years agoigb: Copyright string update to year 2013
Akeem G. Abodunrin [Tue, 8 Jan 2013 18:31:12 +0000 (18:31 +0000)]
igb: Copyright string update to year 2013

This patch updates Copyright year to 2013

v2: Changed Copyright year on Makefile

Signed-off-by: Akeem G. Abodunrin <akeem.g.abodunrin@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Replace rmb in Tx cleanup with read_barrier_depends
Alexander Duyck [Tue, 8 Jan 2013 07:01:03 +0000 (07:01 +0000)]
igb: Replace rmb in Tx cleanup with read_barrier_depends

The rmb in the Tx cleanup path is a much stronger barrier than we really need.
All that is really needed is a read_barrier_depends since the location of the
EOP descriptor is dependent on the eop_desc value.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Fix statistics corruption
Greg Rose [Fri, 4 Jan 2013 07:37:31 +0000 (07:37 +0000)]
ixgbevf: Fix statistics corruption

When the physical function (PF) is reset for any reason the statistics
collection in ixgbevf_update_stats needs to wait to update until after
the reset synchronization ensures that the PF driver is up and running
and is finished with its own reset.  Go ahead and clear the link flag to
indicate this when the control message from the PF is received.  The
reset synchronization and recovery in the watchdog task will eventually
set the link flag up when the PF has resumed.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Fix link up messages
Greg Rose [Fri, 4 Jan 2013 07:37:26 +0000 (07:37 +0000)]
ixgbevf: Fix link up messages

Use dev_info to log link up/down messages.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbevf: Synch out of tree and in tree mailbox interrupt handlers
Greg Rose [Fri, 4 Jan 2013 07:37:20 +0000 (07:37 +0000)]
ixgbevf: Synch out of tree and in tree mailbox interrupt handlers

The out of tree driver and the in kernel driver should use the same
interrupt handling logic for mailbox interrupts.  The difference in
the handlers was causing dissimilar behavior between the two drivers
complicating debug and trouble shooting.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Improve performance and reduce size of ixgbe_tx_map
Alexander Duyck [Tue, 30 Oct 2012 06:01:55 +0000 (06:01 +0000)]
ixgbe: Improve performance and reduce size of ixgbe_tx_map

This change is meant to both improve the performance and reduce the size of
ixgbe_tx_map.  To do this I have expanded the work done in the main loop by
pushing first into tx_buffer.  This allows us to pull in the dma_mapping_error
check, the tx_buffer value assignment, and the initial DMA value assignment to
the Tx descriptor.  The net result is that the function reduces in size by a
little over a 100 bytes and is about 1% or 2% faster.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Update ixgbe Tx flags to improve code efficiency
Alexander Duyck [Wed, 7 Nov 2012 02:34:28 +0000 (02:34 +0000)]
ixgbe: Update ixgbe Tx flags to improve code efficiency

This change is meant to improve the efficiency of the Tx flags in ixgbe by
aligning them with the values that will later be written into either the
cmd_type or olinfo.  By doing this we are able to reduce most of these
functions to either just a simple shift followed by an or in the case of
cmd_type, or an and followed by an or in the case of olinfo.

To do this I also needed to change the logic and/or drop some flags.  I
dropped the IXGBE_TX_FLAGS_FSO and it was replaced by IXGBE_TX_FLAGS_TSO since
the only place it was ever checked was in conjunction with IXGBE_TX_FLAGS_TSO.
I replaced IXGBE_TX_FLAGS_TXSW with IXGBE_TX_FLAGS_CC, this way we have a
clear point for what the flag is meant to do.  Finally the
IXGBE_TX_FLAGS_NO_IFCS was dropped since were are already carrying the data
for that flag in the skb.  Instead we can just check the bitflag in the skb.

In order to avoid type conversion errors I also adjusted the locations
where we were switching between CPU and little endian.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Always use context 0, even for FCoE and TSO
Alexander Duyck [Tue, 30 Oct 2012 06:01:45 +0000 (06:01 +0000)]
ixgbe: Always use context 0, even for FCoE and TSO

We were spending cycles separating the FCoE and TSO contexts even though we
always overwriting the context anyway.  Instead of doing that we can just
use context 0 for all descriptors.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: Make TSO check for CHECKSUM_PARTIAL to avoid skb_is_gso check
Alexander Duyck [Tue, 30 Oct 2012 06:01:40 +0000 (06:01 +0000)]
ixgbe: Make TSO check for CHECKSUM_PARTIAL to avoid skb_is_gso check

This change is meant to reduce the overhead for workloads that are not
using either TSO or checksum offloads.  Most of the time the compiler
should jump ahead after failing this check to the VLAN check since in the
ixgbe_tx_csum call we start with that check as well.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoixgbe: SR-IOV: dynamic IEEE DCBx default priority changes
John Fastabend [Fri, 19 Oct 2012 02:34:34 +0000 (02:34 +0000)]
ixgbe: SR-IOV: dynamic IEEE DCBx default priority changes

IEEE DCBx has a mechanism to change the default user priority. In
the normal case the OS can handle this via cgroups, iptables, socket,
options etc.

With SR-IOV and direct assigned VF devices the default priority
needs to be set by the PF device so the inserted VLAN tag is
correct.

Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Marcus Dennis <marcusx.e.dennis@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoipv6: remove unneeded check to pskb_may_pull in ipip6_rcv
Hannes Frederic Sowa [Fri, 18 Jan 2013 09:18:17 +0000 (09:18 +0000)]
ipv6: remove unneeded check to pskb_may_pull in ipip6_rcv

This is already checked by the caller (tunnel64_rcv) and brings ipip6_rcv
in line with ipip_rcv.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agondisc: Check NS message length before access.
YOSHIFUJI Hideaki / 吉藤英明 [Fri, 18 Jan 2013 02:05:03 +0000 (02:05 +0000)]
ndisc: Check NS message length before access.

Check message length before accessing "target" field,
as we do for other types.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoipv6: Remove unused neigh argument for icmp6_dst_alloc() and its callers.
YOSHIFUJI Hideaki / 吉藤英明 [Fri, 18 Jan 2013 02:00:24 +0000 (02:00 +0000)]
ipv6: Remove unused neigh argument for icmp6_dst_alloc() and its callers.

Because of rt->n removal, we do not need neigh argument any more.

Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoenic: change sprintf() to snprintf()
Dan Carpenter [Thu, 17 Jan 2013 21:46:18 +0000 (21:46 +0000)]
enic: change sprintf() to snprintf()

These are copying data into 16 char arrays.  They all specify that the
first string can't be more than 11 characters but once you add on the
"-rx-" and the NUL character there isn't space for the %d.

The first string is probably never going to be 11 characters, but if it
is then let's truncate the string instead of corrupting memory.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agosmsc: smc911x: Fix sparse warnings
Fabio Estevam [Thu, 17 Jan 2013 16:46:02 +0000 (16:46 +0000)]
smsc: smc911x: Fix sparse warnings

ioremap returns 'void __iomem *' type.

Fix the following build warnings:

drivers/net/ethernet/smsc/smc911x.c:2079:14: warning: incorrect type in assignment (different address spaces)
drivers/net/ethernet/smsc/smc911x.c:2079:14:    expected unsigned int *addr
drivers/net/ethernet/smsc/smc911x.c:2079:14:    got void [noderef] <asn:2>*
drivers/net/ethernet/smsc/smc911x.c:2086:18: warning: incorrect type in assignment (different address spaces)
drivers/net/ethernet/smsc/smc911x.c:2086:18:    expected void [noderef] <asn:2>*base
drivers/net/ethernet/smsc/smc911x.c:2086:18:    got unsigned int *addr
drivers/net/ethernet/smsc/smc911x.c:2091:25: warning: incorrect type in argument 1 (different address spaces)
drivers/net/ethernet/smsc/smc911x.c:2091:25:    expected void volatile [noderef] <asn:2>*addr
drivers/net/ethernet/smsc/smc911x.c:2091:25:    got unsigned int *addr

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: usb: initialize tmp in dm9601.c to avoid warning
Simon Que [Thu, 17 Jan 2013 09:29:49 +0000 (09:29 +0000)]
net: usb: initialize tmp in dm9601.c to avoid warning

In two places, tmp is initialized implicitly by being passed as a
pointer during a function call.  However, this is not obvious to the
compiler, which logs a warning.

Signed-off-by: Simon Que <sque@chromium.org>
Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: ethernet: davinci_cpdma: Add boundary for rx and tx descriptors
Mugunthan V N [Thu, 17 Jan 2013 06:31:34 +0000 (06:31 +0000)]
net: ethernet: davinci_cpdma: Add boundary for rx and tx descriptors

When there is heavy transmission traffic in the CPDMA, then Rx descriptors
memory is also utilized as tx desc memory looses all rx descriptors and the
driver stops working then.

This patch adds boundary for tx and rx descriptors in bd ram dividing the
descriptor memory to ensure that during heavy transmission tx doesn't use
rx descriptors.

This patch is already applied to davinci_emac driver, since CPSW and
davici_dmac shares the same CPDMA, moving the boundry seperation from
Davinci EMAC driver to CPDMA driver which was done in the following
commit

commit 86d8c07ff2448eb4e860e50f34ef6ee78e45c40c
Author: Sascha Hauer <s.hauer@pengutronix.de>
Date:   Tue Jan 3 05:27:47 2012 +0000

    net/davinci: do not use all descriptors for tx packets

    The driver uses a shared pool for both rx and tx descriptors.
    During open it queues fixed number of 128 descriptors for receive
    packets. For each received packet it tries to queue another
    descriptor. If this fails the descriptor is lost for rx.
    The driver has no limitation on tx descriptors to use, so it
    can happen during a nmap / ping -f attack that the driver
    allocates all descriptors for tx and looses all rx descriptors.
    The driver stops working then.
    To fix this limit the number of tx descriptors used to half of
    the descriptors available, the rx path uses the other half.

    Tested on a custom board using nmap / ping -f to the board from
    two different hosts.

Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago6lowpan: Handle uncompressed IPv6 packets over 6LoWPAN
Alan Ott [Wed, 16 Jan 2013 19:09:48 +0000 (19:09 +0000)]
6lowpan: Handle uncompressed IPv6 packets over 6LoWPAN

Handle the reception of uncompressed packets (dispatch type = IPv6).

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years ago6lowpan: Refactor packet delivery into a function
Alan Ott [Wed, 16 Jan 2013 19:09:47 +0000 (19:09 +0000)]
6lowpan: Refactor packet delivery into a function

Refactor the handing of the skb's to the individual lowpan devices into a
function.

Signed-off-by: Alan Ott <alan@signal11.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: fec: enable pause frame to improve rx prefomance for 1G network
Frank Li [Wed, 16 Jan 2013 16:55:58 +0000 (16:55 +0000)]
net: fec: enable pause frame to improve rx prefomance for 1G network

The limition of imx6 internal bus cause fec can't achieve 1G perfomance.
There will be many packages lost because FIFO over run.

This patch enable pause frame flow control.

Before this patch
iperf -s -i 1
TCP window size: 85.3 KByte (default)
------------------------------------------------------------
[  4] local 10.192.242.153 port 5001 connected with 10.192.242.94 port 49773
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  6.35 MBytes  53.3 Mbits/sec
[  4]  1.0- 2.0 sec  3.39 MBytes  28.5 Mbits/sec
[  4]  2.0- 3.0 sec  2.63 MBytes  22.1 Mbits/sec
[  4]  3.0- 4.0 sec  1.10 MBytes  9.23 Mbits/sec

ifconfig
   RX packets:46195 errors:1859 dropped:1 overruns:1859 frame:1859

After this patch
iperf -s -i 1

[  4] local 10.192.242.153 port 5001 connected with 10.192.242.94 port 49757
[ ID] Interval       Transfer     Bandwidth
[  4]  0.0- 1.0 sec  49.8 MBytes   418 Mbits/sec
[  4]  1.0- 2.0 sec  50.1 MBytes   420 Mbits/sec
[  4]  2.0- 3.0 sec  47.5 MBytes   399 Mbits/sec
[  4]  3.0- 4.0 sec  45.9 MBytes   385 Mbits/sec
[  4]  4.0- 5.0 sec  44.8 MBytes   376 Mbits/sec

ifconfig
   RX packets:2348454 errors:0 dropped:16 overruns:0 frame:0

Signed-off-by: Frank Li <Frank.Li@freescale.com>
Signed-off-by: Fugang Duan <B38611@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: asix: handle packets crossing URB boundaries
Lucas Stach [Wed, 16 Jan 2013 04:24:07 +0000 (04:24 +0000)]
net: asix: handle packets crossing URB boundaries

ASIX AX88772B started to pack data even more tightly. Packets and the ASIX packet
header may now cross URB boundaries. To handle this we have to introduce
some state between individual calls to asix_rx_fixup().

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agonet: asix: init ASIX AX88772B MAC from EEPROM
Lucas Stach [Wed, 16 Jan 2013 04:24:06 +0000 (04:24 +0000)]
net: asix: init ASIX AX88772B MAC from EEPROM

The device comes up with a MAC address of all zeros. We need to read the
initial device MAC from EEPROM so it can be set properly later.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoMerge branch 'intel'
David S. Miller [Fri, 18 Jan 2013 19:12:11 +0000 (14:12 -0500)]
Merge branch 'intel'

Jeff Kirsher says:

====================
This series contains updates to e1000e and igb.  Most notably is the
added timestamp support in e1000e and additional software timestamp
support in igb.  As well as, the added thermal data support and SR-IOV
configuration support in igb.

v2- dropped the following patches from the previous 14 patch series
because changes were requested from the community:
  e1000e: add support for IEEE-1588 PTP
  igb: Report L4 Rx hash via skb->l4_rxhash
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
11 years agoigb: Use in-kernel PTP_EV_PORT #define
Matthew Vick [Thu, 13 Dec 2012 07:20:36 +0000 (07:20 +0000)]
igb: Use in-kernel PTP_EV_PORT #define

Rather than use an extra #define for something that already exists, use the
kernel #define for the PTP port.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Free any held skb that should have been timestamped on remove
Matthew Vick [Thu, 13 Dec 2012 07:20:37 +0000 (07:20 +0000)]
igb: Free any held skb that should have been timestamped on remove

To prevent a race condition where an skb has been saved to return the Tx
timestamp later and the driver is removed, add a check to determine if we
have an skb stored and, if so, free it.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Add mechanism for detecting latched hardware Rx timestamp
Matthew Vick [Thu, 13 Dec 2012 07:20:35 +0000 (07:20 +0000)]
igb: Add mechanism for detecting latched hardware Rx timestamp

Add a check against possible Rx timestamp freezing in the hardware via
watchdog mechanism. This situation can occur when an Rx timestamp has been
latched, but the packet has been dropped because the Rx ring is full.

Whenever a packet comes in that should be timestamped, the Rx timestamp
gets latched into the hardware registers and we will store the jiffy value
in the rx_ring. The watchdog will keep track of his own jiffy timer
whenever there is no valid timestamp in the registers.

If the watchdog detects a valid timestamp in the registers, meaning that no
Rx packet has consumed it yet, it will check which time is most recent: the
last time in the watchdog or any time in the rx_rings. If the most recent
"event" was more than 5 seconds ago, it will flush the Rx timestamp and
print a warning message to the syslog.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Add timeout for PTP Tx work item
Matthew Vick [Thu, 13 Dec 2012 07:20:34 +0000 (07:20 +0000)]
igb: Add timeout for PTP Tx work item

When transmitting a packet that must return a Tx timestamp, a work item
gets scheduled to poll for the Tx timestamp being completed in hardware.
Add a timeout on this work item of 15 seconds from when the driver gets the
skb, after which it will stop polling. Report via stats and system log if
this occurs.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Add support for SW timestamping
Matthew Vick [Thu, 13 Dec 2012 07:20:33 +0000 (07:20 +0000)]
igb: Add support for SW timestamping

Enable SW timestamping for situations where the user may prefer it over HW
timestamping or there may not be HW timestamping.

Cc: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: Matthew Vick <matthew.vick@intel.com>
Acked-by: Jacob Keller <Jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Enable hwmon data output for thermal sensors via I2C.
Carolyn Wyborny [Fri, 7 Dec 2012 03:01:42 +0000 (03:01 +0000)]
igb: Enable hwmon data output for thermal sensors via I2C.

Some of our adapters have internal sensors that report thermal data.  This
patch enables reporting of that data via sysfs.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
11 years agoigb: Add support functions to access thermal data.
Carolyn Wyborny [Fri, 7 Dec 2012 03:01:16 +0000 (03:01 +0000)]
igb: Add support functions to access thermal data.

Some of our devices have internal sensors for reporting thermal data.
This patch creates the interface to the sensors for exporting via sysfs.
Subsequent patch will actually export the data.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>