]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/log
mirror_ubuntu-artful-kernel.git
10 years agonetpoll: Respect NETIF_F_LLTX
Eric W. Biederman [Thu, 27 Mar 2014 22:42:20 +0000 (15:42 -0700)]
netpoll: Respect NETIF_F_LLTX

Stop taking the transmit lock when a network device has specified
NETIF_F_LLTX.

If no locks needed to trasnmit a packet this is the ideal scenario for
netpoll as all packets can be trasnmitted immediately.

Even if some locks are needed in ndo_start_xmit skipping any unnecessary
serialization is desirable for netpoll as it makes it more likely a
debugging packet may be trasnmitted immediately instead of being
deferred until later.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonetpoll: Remove strong unnecessary assumptions about skbs
Eric W. Biederman [Thu, 27 Mar 2014 22:41:04 +0000 (15:41 -0700)]
netpoll: Remove strong unnecessary assumptions about skbs

Remove the assumption that the skbs that make it to
netpoll_send_skb_on_dev are allocated with find_skb, such that
skb->users == 1 and nothing is attached that would prevent the skbs from
being freed from hard irq context.

Remove this assumption by replacing __kfree_skb on error paths with
dev_kfree_skb_irq (in hard irq context) and kfree_skb (in process
context).

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonetpoll: Rename netpoll_rx_enable/disable to netpoll_poll_disable/enable
Eric W. Biederman [Thu, 27 Mar 2014 22:39:03 +0000 (15:39 -0700)]
netpoll: Rename netpoll_rx_enable/disable to netpoll_poll_disable/enable

The netpoll_rx_enable and netpoll_rx_disable functions have always
controlled polling the network drivers transmit and receive queues.

Rename them to netpoll_poll_enable and netpoll_poll_disable to make
their functionality clear.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonetpoll: Move rx enable/disable into __dev_close_many
Eric W. Biederman [Thu, 27 Mar 2014 22:38:17 +0000 (15:38 -0700)]
netpoll: Move rx enable/disable into __dev_close_many

Today netpoll_rx_enable and netpoll_rx_disable are called from
dev_close and and __dev_close, and not from dev_close_many.

Move the calls into __dev_close_many so that we have a single call
site to maintain, and so that dev_close_many gains this protection as
well.  Which importantly makes batched network device deletes safe.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonetpoll: Only call ndo_start_xmit from a single place
Eric W. Biederman [Thu, 27 Mar 2014 22:37:28 +0000 (15:37 -0700)]
netpoll: Only call ndo_start_xmit from a single place

Factor out the code that needs to surround ndo_start_xmit
from netpoll_send_skb_on_dev into netpoll_start_xmit.

It is an unfortunate fact that as the netpoll code has been maintained
the primary call site ndo_start_xmit learned how to handle vlans
and timestamps but the second call of ndo_start_xmit in queue_process
did not.

With the introduction of netpoll_start_xmit this associated logic now
happens at both call sites of ndo_start_xmit and should make it easy
for that to continue into the future.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonetpoll: Remove gfp parameter from __netpoll_setup
Eric W. Biederman [Thu, 27 Mar 2014 22:36:38 +0000 (15:36 -0700)]
netpoll: Remove gfp parameter from __netpoll_setup

The gfp parameter was added in:
commit 47be03a28cc6c80e3aa2b3e8ed6d960ff0c5c0af
Author: Amerigo Wang <amwang@redhat.com>
Date:   Fri Aug 10 01:24:37 2012 +0000

    netpoll: use GFP_ATOMIC in slave_enable_netpoll() and __netpoll_setup()

    slave_enable_netpoll() and __netpoll_setup() may be called
    with read_lock() held, so should use GFP_ATOMIC to allocate
    memory. Eric suggested to pass gfp flags to __netpoll_setup().

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
The reason for the gfp parameter was removed in:
commit c4cdef9b7183159c23c7302aaf270d64c549f557
Author: dingtianhong <dingtianhong@huawei.com>
Date:   Tue Jul 23 15:25:27 2013 +0800

    bonding: don't call slave_xxx_netpoll under spinlocks

    The slave_xxx_netpoll will call synchronize_rcu_bh(),
    so the function may schedule and sleep, it should't be
    called under spinlocks.

    bond_netpoll_setup() and bond_netpoll_cleanup() are always
    protected by rtnl lock, it is no need to take the read lock,
    as the slave list couldn't be changed outside rtnl lock.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Nothing else that calls __netpoll_setup or ndo_netpoll_setup
requires a gfp paramter, so remove the gfp parameter from both
of these functions making the code clearer.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'skb_cow_head'
David S. Miller [Sat, 29 Mar 2014 21:50:14 +0000 (17:50 -0400)]
Merge branch 'skb_cow_head'

Francois Romieu says:

====================
remove open-coded skb_cow_head.

As per http://marc.info/?l=linux-netdev&m=139440579104701.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agowimax/i2400m: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:30 +0000 (12:26 +0100)]
wimax/i2400m: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotg3: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:29 +0000 (12:26 +0100)]
tg3: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Nithin Nayak Sujir <nsujir@broadcom.com>
Cc: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobna: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:28 +0000 (12:26 +0100)]
bna: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Rasesh Mody <rmody@brocade.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoqlge: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:27 +0000 (12:26 +0100)]
qlge: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jitendra Kalsaria <jitendra.kalsaria@qlogic.com>
Cc: Shahed Shaikh <shahed.shaikh@qlogic.com>
Cc: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agojme: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:26 +0000 (12:26 +0100)]
jme: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoatl1e: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:16 +0000 (12:26 +0100)]
atl1e: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Chris Snook <chris.snook@gmail.com>
Cc: Jay Cliburn <jcliburn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoatl1c: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:15 +0000 (12:26 +0100)]
atl1c: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Jay Cliburn <jcliburn@gmail.com>
Cc: Chris Snook <chris.snook@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoatl1: remove open-coded skb_cow_head.
françois romieu [Sat, 29 Mar 2014 11:26:14 +0000 (12:26 +0100)]
atl1: remove open-coded skb_cow_head.

Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Cc: Chris Snook <chris.snook@gmail.com>
Cc: Jay Cliburn <jcliburn@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: mvneta: use devm_ioremap_resource() instead of of_iomap()
Thomas Petazzoni [Thu, 27 Mar 2014 10:39:29 +0000 (11:39 +0100)]
net: mvneta: use devm_ioremap_resource() instead of of_iomap()

The mvneta driver currently uses of_iomap(), which has two drawbacks:
it doesn't request the resource, and it isn't devm-style so some error
handling is needed.

This commit switches to use devm_ioremap_resource() instead, which
automatically requests the resource (so the I/O registers region shows
up properly in /proc/iomem), and also is devm-style, which allows to
get rid of some error handling to unmap the I/O registers region.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: net: add a core netdev->tx_dropped counter
Eric Dumazet [Thu, 27 Mar 2014 15:45:56 +0000 (08:45 -0700)]
net: net: add a core netdev->tx_dropped counter

Dropping packets in __dev_queue_xmit() when transmit queue
is stopped (NIC TX ring buffer full or BQL limit reached) currently
outputs a syslog message.

It would be better to get a precise count of such events available in
netdevice stats so that monitoring tools can have a clue.

This extends the work done in caf586e5f23ce
("net: add a core netdev->rx_dropped counter")

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agopacket: respect devices with LLTX flag in direct xmit
Daniel Borkmann [Thu, 27 Mar 2014 15:38:30 +0000 (16:38 +0100)]
packet: respect devices with LLTX flag in direct xmit

Quite often it can be useful to test with dummy or similar
devices as a blackhole sink for skbs. Such devices are only
equipped with a single txq, but marked as NETIF_F_LLTX as
they do not require locking their internal queues on xmit
(or implement locking themselves). Therefore, rather use
HARD_TX_{UN,}LOCK API, so that NETIF_F_LLTX will be respected.

trafgen mmap/TX_RING example against dummy device with config
foo: { fill(0xff, 64) } results in the following performance
improvements for such scenarios on an ordinary Core i7/2.80GHz:

Before:

 Performance counter stats for 'trafgen -i foo -o du0 -n100000000' (10 runs):

   160,975,944,159 instructions:k            #    0.55  insns per cycle          ( +-  0.09% )
   293,319,390,278 cycles:k                  #    0.000 GHz                      ( +-  0.35% )
       192,501,104 branch-misses:k                                               ( +-  1.63% )
               831 context-switches:k                                            ( +-  9.18% )
                 7 cpu-migrations:k                                              ( +-  7.40% )
            69,382 cache-misses:k            #    0.010 % of all cache refs      ( +-  2.18% )
       671,552,021 cache-references:k                                            ( +-  1.29% )

      22.856401569 seconds time elapsed                                          ( +-  0.33% )

After:

 Performance counter stats for 'trafgen -i foo -o du0 -n100000000' (10 runs):

   133,788,739,692 instructions:k            #    0.92  insns per cycle          ( +-  0.06% )
   145,853,213,256 cycles:k                  #    0.000 GHz                      ( +-  0.17% )
        59,867,100 branch-misses:k                                               ( +-  4.72% )
               384 context-switches:k                                            ( +-  3.76% )
                 6 cpu-migrations:k                                              ( +-  6.28% )
            70,304 cache-misses:k            #    0.077 % of all cache refs      ( +-  1.73% )
        90,879,408 cache-references:k                                            ( +-  1.35% )

      11.719372413 seconds time elapsed                                          ( +-  0.24% )

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: nlmon: flag nlmon devs with LLTX/SG
Daniel Borkmann [Thu, 27 Mar 2014 15:34:59 +0000 (16:34 +0100)]
net: nlmon: flag nlmon devs with LLTX/SG

As in xmit path we merely update statistics and free the skb, we
can mark the device with LLTX feature, so that upper layers can
avoid taking the single txq lock on xmit. While at it, also add
missing NETIF_F_SG.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agocxgb4vf: Adds device Id for few more Chelsio adapters
Hariprasad Shenai [Thu, 27 Mar 2014 12:47:10 +0000 (18:17 +0530)]
cxgb4vf: Adds device Id for few more Chelsio adapters

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agocxgb4: Adds device ID for few more Chelsio Adapters
Hariprasad Shenai [Thu, 27 Mar 2014 12:47:09 +0000 (18:17 +0530)]
cxgb4: Adds device ID for few more Chelsio Adapters

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'mlx4_vxlan'
David S. Miller [Fri, 28 Mar 2014 20:30:05 +0000 (16:30 -0400)]
Merge branch 'mlx4_vxlan'

Or Gerlitz says:

====================
Implement vxlan ndo calls

This short series adds support for the vxlan ndo calls, the udp
port is programmed to the firmware using a new command we introduce
here which is called "config device".
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4: Implement vxlan ndo calls
Or Gerlitz [Thu, 27 Mar 2014 12:02:04 +0000 (14:02 +0200)]
net/mlx4: Implement vxlan ndo calls

Add implementation for the add/del vxlan port ndo calls, using the
CONFIG_DEV firmware command.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agomlx4: Add support for CONFIG_DEV command
Or Gerlitz [Thu, 27 Mar 2014 12:02:03 +0000 (14:02 +0200)]
mlx4: Add support for CONFIG_DEV command

Introduce the CONFIG_DEV firmware command which we will use to
configure the UDP port assumed by the firmware for the VXLAN offloads.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4: USe one wrapper that returns -EPERM
Or Gerlitz [Thu, 27 Mar 2014 12:02:02 +0000 (14:02 +0200)]
net/mlx4: USe one wrapper that returns -EPERM

When a VF issues a firmware command which is disallowed for them, the PF
rerturns -EPERM from that command wrapper. Move to use one such wrapper
instance, instead of repeating the same code on such commands.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: Fix possible memory leak on iov error flow
Yuval Mintz [Thu, 27 Mar 2014 11:46:37 +0000 (13:46 +0200)]
bnx2x: Fix possible memory leak on iov error flow

Commit 2dc33bbc4 "bnx2x: Remove the sriov VFOP mechanism" introduced a possible
memory leak on the error flow during multicast filters configuration.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosh_eth: ensure pm_runtime cannot suspend the device during init
Ben Dooks [Fri, 21 Mar 2014 11:09:14 +0000 (12:09 +0100)]
sh_eth: ensure pm_runtime cannot suspend the device during init

The pm_rumtime work queue is causing the device to be suspended during
initialisation, thus the initialisation may not be able to access registers
properly. As the code is called from a work queue, it is possible that this
is not seen from certain configurations/builds due to the asynchronos
nature of the code.

Another issue has also been found where the network device registration
calls back into the driver thus causing further pm_runtime calls that
also caused issues with the MDIO bus code. This has now been checked
and is the only place the MDIO can be called without the device open.

Use pm_runtime_get_sync() and pm_runtime_put() to ensure that the
pm system does not suspend it during the probe() call and remove the
now unnecessary pm_runtime_resume() call. Also add a call in the error
path to call pm_runtime_disable().

This fixes the external abort that can cause /sbin/init or other such
init processed to die.

Signed-off-by: Ben Dooks <ben.dooks@codethink.co.uk>
Tested-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: stmmac: Add SOCFPGA glue driver
Dinh Nguyen [Thu, 27 Mar 2014 03:45:10 +0000 (22:45 -0500)]
net: stmmac: Add SOCFPGA glue driver

Like the STi and sunxi series SOCs, Altera's SOCFPGA also needs a glue layer
on top of the Synopsys gmac IP.

This patch adds the platform driver for the glue layer which configures the IP
before the generic STMMAC driver takes over.

Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoRDMA/cxgb4: set error code on kmalloc() failure
Yann Droneaud [Fri, 28 Mar 2014 18:55:21 +0000 (14:55 -0400)]
RDMA/cxgb4: set error code on kmalloc() failure

If kmalloc() fails in c4iw_alloc_ucontext(), the function
leaves but does not set an error code in ret variable:
it will return 0 to the caller.

This patch set ret to -ENOMEM in such case.

Cc: Steve Wise <swise@opengridcomputing.com>
Cc: Steve Wise <swise@chelsio.com>
Signed-off-by: Yann Droneaud <ydroneaud@opteya.com>
Acked-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'tipc-next'
David S. Miller [Fri, 28 Mar 2014 18:46:34 +0000 (14:46 -0400)]
Merge branch 'tipc-next'

Erik Hugne says:

====================
tipc: fix handling of NETDEV_CHANGEADDR event

Aside from manual reconfiguration of the netdevice hwaddr, this can also
be changed automatically for an interface bond in active-backup mode
if fail_over_mac is enabled. This patchset fixes the handling of this
event in TIPC by properly updating the l2 media address for the bearer,
followed by a reinitialization of the node discovery mechanism.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: make discovery domain a bearer attribute
Erik Hugne [Fri, 28 Mar 2014 09:32:09 +0000 (10:32 +0100)]
tipc: make discovery domain a bearer attribute

The node discovery domain is assigned when a bearer is enabled.
In the previous commit we reflect this attribute directly in the
bearer structure since it's needed to reinitialize the node
discovery mechanism after a hardware address change.

There's no need to replicate this attribute anywhere else, so we
remove it from the tipc_link_req structure.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: fix neighbor detection problem after hw address change
Erik Hugne [Fri, 28 Mar 2014 09:32:08 +0000 (10:32 +0100)]
tipc: fix neighbor detection problem after hw address change

If the hardware address of a underlying netdevice is changed, it is
not enough to simply reset the bearer/links over this device. We
also need to reflect this change in the TIPC bearer and node
discovery structures aswell.

This patch adds the necessary reinitialization of the node disovery
mechanism following a hardware address change so that the correct
originating media address is advertised in the discovery messages.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reported-by: Dong Liu <dliu.cn@gmail.com>
Reviewed-by: Ying Xue <ying.xue@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Fri, 28 Mar 2014 18:44:06 +0000 (14:44 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates

This series contains updates to e1000e, igb, i40e and i40evf

Anjali provides i40e fix to remove the ATR filter on RST as well as FIN
packets.  Cleans up add_del_fdir() because it was used and implemented
only for the add, so change the name and drop a parameter.  Adds the
ability to drop a flow if we wanted to and adds a flow director
message level to be used for flow director specific messages.

Mitch fixes an issue on i40evf where the Tx watchdog handler was causing
an oops when sending an admin queue message to request a reset because
the admin queue functions use spinlocks.

Greg provides a change to i40e to make the alloc and free queue vector
calls orthogonal.

Shannon fixes i40e to verify the eeprom checksum and firmware CRC status
bits, and shutdown the driver if they fail.  This change stops the
processing of traffic, but does not kill the PF netdev so that the
NVMUpdate process still has a chance at fixing the image.  Also provides
a fix to make sure the VSI has a netdev before trying to use it in
the debugfs netdev_ops commands.

Jakub Kicinski provides patches for e1000e and igb to fix a number issues
found in the PTP code.

v2:
- drop patch 11 "i40e: Add a fallback debug flow for the driver" from the
  series based on feedback from David Miller
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: fix potential null dereference
Byungho An [Fri, 28 Mar 2014 17:57:44 +0000 (10:57 -0700)]
net: sxgbe: fix potential null dereference

This fixes following:

drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c:1828 sxgbe_hw_init()
error: potential null dereference 'priv->hw'.  (kmalloc returns null)

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: fix sparse warnings about static declaration
Byungho An [Fri, 28 Mar 2014 17:57:36 +0000 (10:57 -0700)]
net: sxgbe: fix sparse warnings about static declaration

This fixes followings:

sparse warnings: (new ones prefixed by >>)

>> drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:197:5:
sparse: symbol 'sxgbe_platform_freeze' was not declared. Should it be static?
>> drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:204:5:
sparse: symbol 'sxgbe_platform_restore' was not declared. Should it be static?
>> drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c:228:24:
sparse: symbol 'sxgbe_platform_driver' was not declared. Should it be static?

>> drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c:1795:6:
sparse: symbol 'sxgbe_get_ops' was not declared. Should it be static?

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'be2net-next'
David S. Miller [Fri, 28 Mar 2014 18:25:02 +0000 (14:25 -0400)]
Merge branch 'be2net-next'

Sathya Perla says:

====================
be2net: add vxlan offload support

The first patch adds the FW cmds needed to configure the Skyhawk-R
chip for supporting VxLAN offloads. The second patch implements the
ndo_add/del_vxlan_port() methods and the plumbing for supporting
RX/TX csum, TSO and RSS steering offloads for VxLAN traffic.

v2 changes:
NETIF_F_SG need not be set for hw_enc_features by the driver as it is
done by the stack.

v3 changes:
* Defer FW cmds needed for VxLAN offloads to a workqueue
* Reset FW to VxLAN offloads disabled state in the unload path

v4 changes:
* Revert the usage of workqueue (introduced in v3) to implement
ndo_add/del_vxlan_port() as it is currently not needed (none of the
FW cmd calls sleep.) Suggested by David M.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobe2net: csum, tso and rss steering offload support for VxLAN
Sathya Perla [Thu, 27 Mar 2014 05:16:19 +0000 (10:46 +0530)]
be2net: csum, tso and rss steering offload support for VxLAN

This patch mainly implements the add/del_vxlan_port() methods by invoking
the needed FW cmds for supporting VxLAN offloads for Skyhawk-R.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobe2net: add FW cmds needed for VxLAN offloads
Sathya Perla [Thu, 27 Mar 2014 05:16:18 +0000 (10:46 +0530)]
be2net: add FW cmds needed for VxLAN offloads

This patch adds support for the FW cmds needed for VxLAN offloads
on Skyhawk-R:
1) The VxLAN UDP port needs to be configured via the port-desc of
   SET_PROFILE_CONFIG_v1 cmd.
   This patch re-factors the be_set_profile_config() code (used so far
   only for setting VF QoS) to be used to set any type of descriptor.
2) The MANAGE_IFACE_FILTERS cmds is needed to convert a normal interface
   into a tunnel interface. This allows for RSS to work even on the inner
   TCP/UDP headers of VxLAN traffic.

Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoigb: fix race conditions on queuing skb for HW time stamp
Jakub Kicinski [Sat, 15 Mar 2014 14:55:32 +0000 (14:55 +0000)]
igb: fix race conditions on queuing skb for HW time stamp

igb has a single set of TX time stamping resources per NIC.
Use a simple bit lock to avoid race conditions and leaking skbs
when multiple TX rings try to claim time stamping.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoigb: never generate both software and hardware timestamps
Jakub Kicinski [Sat, 15 Mar 2014 14:55:26 +0000 (14:55 +0000)]
igb: never generate both software and hardware timestamps

skb_tx_timestamp() does not report software time stamp
if SKBTX_IN_PROGRESS is set. According to timestamping.txt
software time stamps are a fallback and should not be
generated if hardware time stamp is provided.

Move call to skb_tx_timestamp() after setting
SKBTX_IN_PROGRESS.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoe1000e: remove redundant if clause from PTP work
Jakub Kicinski [Sat, 15 Mar 2014 14:55:05 +0000 (14:55 +0000)]
e1000e: remove redundant if clause from PTP work

tx_hwtstamp_skb is always set before work is scheduled,
work is cancelled before tx_hwtstamp_skb is set to NULL.
PTP work cannot ever see tx_hwtstamp_skb set to NULL.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoe1000e: add timeout for TX HW time stamping work
Jakub Kicinski [Sat, 15 Mar 2014 14:55:00 +0000 (14:55 +0000)]
e1000e: add timeout for TX HW time stamping work

Hardware may fail to report time stamp e.g.:
 - when hardware time stamping is not enabled
 - when time stamp is requested shortly after ifup

Timeout time stamp reading work to prevent it from
scheduling itself indefinitely. Report timeout events
via system log and device stats.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Use DEBUG_FD message level for an FD message
Anjali Singhai Jain [Thu, 6 Mar 2014 09:00:04 +0000 (09:00 +0000)]
i40e: Use DEBUG_FD message level for an FD message

We don't need to print this info unless at FD message level.

Change-ID: I329efdd8e754a0ea0669ec04d12e03db02e6b76e
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e/i40evf: Add an FD message level
Anjali Singhai Jain [Thu, 6 Mar 2014 09:00:03 +0000 (09:00 +0000)]
i40e/i40evf: Add an FD message level

To use for Flow Director specific messages.

Change-ID: I69e39a410aa2661f8fd1ed6af0126fa4c335cb77
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: check for netdev before debugfs use
Shannon Nelson [Thu, 6 Mar 2014 09:00:02 +0000 (09:00 +0000)]
i40e: check for netdev before debugfs use

Make sure the VSI has a netdev before trying to use it
in the debugfs netdev_ops commands.

Change-ID: I2d744fc0c32b3226534ce2cde171d9675c5440a6
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40evf: remove double space after return
Jesse Brandeburg [Thu, 6 Mar 2014 09:00:01 +0000 (09:00 +0000)]
i40evf: remove double space after return

There were two spaces between return and the value, we only need one.

Change-ID: Iaa42c33f50d8d149cdf1a4c9c1902295bfd991c4
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Acked-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Kevin Scott <kevin.c.scott@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Add functionality for FD SB to drop packets
Anjali Singhai Jain [Thu, 6 Mar 2014 09:00:00 +0000 (09:00 +0000)]
i40e: Add functionality for FD SB to drop packets

With this change we can drop a flow if we wanted to.

Change-ID: I222b1ae960e61a31965bafe3159a95099e70c7d2
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Cleanup in FDIR SB ethtool code
Anjali Singhai Jain [Thu, 6 Mar 2014 08:59:59 +0000 (08:59 +0000)]
i40e: Cleanup in FDIR SB ethtool code

Function add_del_fdir was used and implemented only for add. So change the name
and drop a parameter.

Change-ID: Icf2c6c3bbd4fd00cf8d9613a3f6d8c08e0f8e288
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: eeprom integrity check on load and empr
Shannon Nelson [Thu, 6 Mar 2014 08:59:58 +0000 (08:59 +0000)]
i40e: eeprom integrity check on load and empr

The driver needs to verify the eeprom checksum and firmware crc status bits,
and shutdown the driver if they fail. This code stops the processing of traffic,
but doesn't kill the PF netdev so that the NVMUpdate process should still have a
chance at fixing the image. The eeprom is checked on driver load and after an
EMP reset, the latter of which should be generated after an NVMUpdate.

Change-ID: I34deef21d2e16bf5a43c603cf8af27e6a29dc9d2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Make the alloc and free queue vector calls orthogonal
Greg Rose [Thu, 6 Mar 2014 08:59:57 +0000 (08:59 +0000)]
i40e: Make the alloc and free queue vector calls orthogonal

It's annoying to search for a matching alloc and free set of function calls
when they don't use the same framework for the name of the functions.  Fix
that up in the case of alloc and free of vsi queue vectors.

i40e_vsi_free_q*
i40e_vsi_alloc_q*

Change-ID: I510eb863a0fbe405312bebea55c2846c76285e6d
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40evf: fix oops in watchdog handler
Mitch Williams [Thu, 6 Mar 2014 08:59:56 +0000 (08:59 +0000)]
i40evf: fix oops in watchdog handler

The Tx watchdog handler runs in interrupt context, so it would cause an
oops when sending an admin queue message to request a reset, because the
admin queue functions use spinlocks.

Instead, set a flag and let the reset task handle sending the request.

Change-ID: I65879470b72963d9c308edfb8f45ac4fbba2c14f
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Delete ATR filter on RST
Anjali Singhai Jain [Thu, 6 Mar 2014 08:59:54 +0000 (08:59 +0000)]
i40e: Delete ATR filter on RST

We currently delete ATR filter on FIN alone, delete on RST as well.

Change-ID: Ie7cae5d1046b9d1d4a0d6ef5bdbf41224c3dade6
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoMerge branch 'mdio_reset-next'
David S. Miller [Fri, 28 Mar 2014 05:38:10 +0000 (01:38 -0400)]
Merge branch 'mdio_reset-next'

Florian Fainelli says:

====================
net: remove empty MDIO bus reset functions

This patchset removes all empty MDIO bus reset functions that we have in the
tree (hopefully all of them). This function is optional for the MDIO bus code in
drivers/net/phy/mdio_bus.c::mdiobus_register, the documentation is updated to
reflect that.

Having less call sites to update will allow us to implement a generic BMCR_RESET
based PHY reset for MDIO buses that require to reset their PHYs before their
PHY detection succeeds (e.g: HiSilicon hip04 current submission) and provide it
as a helper.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoDocumentation: networking: phy.txt: MDIO bus reset is optional
Florian Fainelli [Thu, 27 Mar 2014 01:07:26 +0000 (18:07 -0700)]
Documentation: networking: phy.txt: MDIO bus reset is optional

Update the MDIO bus documentation to mention that the MDIO bus reset
function is completely optional. It became optional with commit
e13934563db0 ("[PATCH] PHY Layer fixup")

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobfin_mac: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:25 +0000 (18:07 -0700)]
bfin_mac: remove empty MDIO bus reset function

bfin_mdiobus_reset() does nothing useful and is optional for the MDIO
bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agor6040: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:24 +0000 (18:07 -0700)]
r6040: remove empty MDIO bus reset function

r6040_mdiobus_reset() does nothing useful and is optional for the MDIO
bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: ftgmac100: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:23 +0000 (18:07 -0700)]
net: ftgmac100: remove empty MDIO bus reset function

ftgmac100_mdiobus_reset() does nothing useful and is optional for the
MDIO bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sun4i: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:22 +0000 (18:07 -0700)]
net: sun4i: remove empty MDIO bus reset function

sun4i_mdio_reset() does nothing useful and is optional for the MDIO bus
code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: emaclite: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:21 +0000 (18:07 -0700)]
net: emaclite: remove empty MDIO bus reset function

xemaclite_mdio_reset() does nothing useful and is optional for the MDIO
bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: mvmdio: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:20 +0000 (18:07 -0700)]
net: mvmdio: remove empty MDIO bus reset function

orion_mdio_reset() does nothing useful and is optional for the MDIO bus
code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agofs_enet: remove empty MDIO bus function
Florian Fainelli [Thu, 27 Mar 2014 01:07:19 +0000 (18:07 -0700)]
fs_enet: remove empty MDIO bus function

fs_enet_fec_mii_reset() does nothing useful and is optional for the MDIO
bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agofec: remove empty MDIO bus function
Florian Fainelli [Thu, 27 Mar 2014 01:07:18 +0000 (18:07 -0700)]
fec: remove empty MDIO bus function

fec_enet_mdio_reset() does nothing useful and is optional for the MDIO
bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: ethoc: remove empty MDIO bus function
Florian Fainelli [Thu, 27 Mar 2014 01:07:17 +0000 (18:07 -0700)]
net: ethoc: remove empty MDIO bus function

ethoc_mdio_reset() does nothing useful and is optional for the MDIO bus
code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodnet: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:16 +0000 (18:07 -0700)]
dnet: remove empty MDIO bus reset function

dnet_mdio_reset() does nothing useful and is optional for the MDIO bus
code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agomacb: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:15 +0000 (18:07 -0700)]
macb: remove empty MDIO bus reset function

macb_mdio_reset() does nothing useful and is optional for the MDIO bus
code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotg3: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:14 +0000 (18:07 -0700)]
tg3: remove empty MDIO bus reset function

tg3_mdio_reset() does nothing useful and is optional for the MDIO bus
code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: greth: remove empty MDIO bus reset function
Florian Fainelli [Thu, 27 Mar 2014 01:07:13 +0000 (18:07 -0700)]
net: greth: remove empty MDIO bus reset function

greth_mdio_reset() does nothing useful and this function is optional for
the MDIO bus code, so let's just remove it.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: bcmgenet: set RBUF_SKIP_FCS based on UniMAC CRC forwarding
Florian Fainelli [Thu, 27 Mar 2014 04:18:39 +0000 (21:18 -0700)]
net: bcmgenet: set RBUF_SKIP_FCS based on UniMAC CRC forwarding

When the UniMAC block is configured to forward the CRC as part of the
Ethernet frame (priv->crc_fwd_en, set by default), enabling the hardware
RX checksum block unveiled that the dma_rxchk_bit was never set in the
per-packet status bits (dma_flag in bcmgenet_desc_rx). This would make
the chksum_ok variable to be never set to 1, and the networking stack
would have to compute the packet checksums, which takes a substantial
amount of time.

In order for the RXCHK block to properly compute the packet checksum in
hardware, we also need to set the RBUF_SKIP_FCS bit accordingly.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoyam: replace del_timer by del_timer_sync
Julia Lawall [Wed, 26 Mar 2014 21:33:45 +0000 (22:33 +0100)]
yam: replace del_timer by del_timer_sync

Use del_timer_sync to ensure that the timer is stopped on all CPUs before
the driver exists.

This change was suggested by Thomas Gleixner

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
declarer name module_exit;
identifier ex;
@@

module_exit(ex);

@@
identifier r.ex;
@@

ex(...) {
  <...
- del_timer
+ del_timer_sync
    (...)
  ...>
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agohsr: replace del_timer by del_timer_sync
Julia Lawall [Wed, 26 Mar 2014 21:33:44 +0000 (22:33 +0100)]
hsr: replace del_timer by del_timer_sync

Use del_timer_sync to ensure that the timer is stopped on all CPUs before
the driver exists.

This change was suggested by Thomas Gleixner.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
declarer name module_exit;
identifier ex;
@@

module_exit(ex);

@@
identifier r.ex;
@@

ex(...) {
  <...
- del_timer
+ del_timer_sync
    (...)
  ...>
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoatm: replace del_timer by del_timer_sync
Julia Lawall [Wed, 26 Mar 2014 21:33:40 +0000 (22:33 +0100)]
atm: replace del_timer by del_timer_sync

Use del_timer_sync to ensure that the timer is stopped on all CPUs before
the driver exists.

This change was suggested by Thomas Gleixner.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
declarer name module_exit;
identifier ex;
@@

module_exit(ex);

@@
identifier r.ex;
@@

ex(...) {
  <...
- del_timer
+ del_timer_sync
    (...)
  ...>
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoisdn: replace del_timer by del_timer_sync
Julia Lawall [Wed, 26 Mar 2014 21:33:39 +0000 (22:33 +0100)]
isdn: replace del_timer by del_timer_sync

Use del_timer_sync to ensure that the timer is stopped on all CPUs before
the driver exists.

This change was suggested by Thomas Gleixner.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
declarer name module_exit;
identifier ex;
@@

module_exit(ex);

@@
identifier r.ex;
@@

ex(...) {
  <...
- del_timer
+ del_timer_sync
    (...)
  ...>
}
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotcp: tcp_make_synack() minor changes
Eric Dumazet [Wed, 26 Mar 2014 16:57:19 +0000 (09:57 -0700)]
tcp: tcp_make_synack() minor changes

There is no need to allocate 15 bytes in excess for a SYNACK packet,
as it contains no data, only headers.

SYNACK are always generated in softirq context, and contain a single
segment, we can use TCP_INC_STATS_BH()

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: do not overwrite inetpeer metrics prematurely
Michal Kubeček [Thu, 27 Mar 2014 12:04:08 +0000 (13:04 +0100)]
ipv6: do not overwrite inetpeer metrics prematurely

If an IPv6 host route with metrics exists, an attempt to add a
new route for the same target with different metrics fails but
rewrites the metrics anyway:

12sp0:~ # ip route add fec0::1 dev eth0 rto_min 1000
12sp0:~ # ip -6 route show
fe80::/64 dev eth0  proto kernel  metric 256
fec0::1 dev eth0  metric 1024  rto_min lock 1s
12sp0:~ # ip route add fec0::1 dev eth0 rto_min 1500
RTNETLINK answers: File exists
12sp0:~ # ip -6 route show
fe80::/64 dev eth0  proto kernel  metric 256
fec0::1 dev eth0  metric 1024  rto_min lock 1.5s

This is caused by all IPv6 host routes using the metrics in
their inetpeer (or the shared default). This also holds for the
new route created in ip6_route_add() which shares the metrics
with the already existing route and thus ip6_route_add()
rewrites the metrics even if the new route ends up not being
used at all.

Another problem is that old metrics in inetpeer can reappear
unexpectedly for a new route, e.g.

12sp0:~ # ip route add fec0::1 dev eth0 rto_min 1000
12sp0:~ # ip route del fec0::1
12sp0:~ # ip route add fec0::1 dev eth0
12sp0:~ # ip route change fec0::1 dev eth0 hoplimit 10
12sp0:~ # ip -6 route show
fe80::/64 dev eth0  proto kernel  metric 256
fec0::1 dev eth0  metric 1024  hoplimit 10 rto_min lock 1s

Resolve the first problem by moving the setting of metrics down
into fib6_add_rt2node() to the point we are sure we are
inserting the new route into the tree. Second problem is
addressed by introducing new flag DST_METRICS_FORCE_OVERWRITE
which is set for a new host route in ip6_route_add() and makes
ipv6_cow_metrics() always overwrite the metrics in inetpeer
(even if they are not "new"); it is reset after that.

v5: use a flag in _metrics member rather than one in flags

v4: fix a typo making a condition always true (thanks to Hannes
Frederic Sowa)

v3: rewritten based on David Miller's idea to move setting the
metrics (and allocation in non-host case) down to the point we
already know the route is to be inserted. Also rebased to
net-next as it is quite late in the cycle.

Signed-off-by: Michal Kubecek <mkubecek@suse.cz>
Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoptp: Fix compiler warnings in the testptp utility
Christian Riesch [Wed, 26 Mar 2014 07:16:03 +0000 (08:16 +0100)]
ptp: Fix compiler warnings in the testptp utility

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Dong Zhu <bluezhudong@gmail.com>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoRevert "ptp: Fix compiler warnings in the testptp utility"
David S. Miller [Thu, 27 Mar 2014 18:51:26 +0000 (14:51 -0400)]
Revert "ptp: Fix compiler warnings in the testptp utility"

This reverts commit 203191c386e83b8c5d95bbbaef13baa629512726.

A better version of this fix is forthcoming.

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: Fix compilation when CONFIG_BNX2X_SRIOV is not set
Yuval Mintz [Wed, 26 Mar 2014 07:06:29 +0000 (09:06 +0200)]
bnx2x: Fix compilation when CONFIG_BNX2X_SRIOV is not set

Commit 370d4a26 "bnx2x: Create workqueue for IOV related tasks" breaks bnx2x
compilation when CONFIG_BNX2X_SRIOV is not set - "multiple definition of
`bnx2x_schedule_iov_task'".

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'tipc-next'
David S. Miller [Thu, 27 Mar 2014 17:08:45 +0000 (13:08 -0400)]
Merge branch 'tipc-next'

Ying Xue says:

====================
tipc: clean up bearer and node layer

This is another commit series which aims at facilitating future
changes to the locking policy around nodes, links and bearers.

Currently, the tipc routing hierarchy comprises the structures 'node',
'link' and 'bearer'. The whole hierarchy is protected by a big
read/write lock (tipc_net_lock), to ensure that nothing is added or
removed while any of these structures is being accessed. Obviously
the locking policy makes node, link and bearer components closely
bound together so that their relationship becomes extremely complex.
In the worst case, such locking policy not only has a negative
influence on performance, but also it's prone to lead to deadlock
occasionally.

In order to decouple the complex relationship between bearer and node
as well as link, the locking policy is adjusted as follows:

- Bearer level
  RTNL lock is used on update side, and RCU is used on read side.
  Meanwhile, all bearer instances including broadcast bearer are
  saved into bearer_list array.

- Node and link level
  All node instances are saved into two tipc_node_list and node_htable
  lists. The two lists are protected by node_list_lock on write side,
  and they are guarded with RCU lock on read side. All members in node
  structure including link instances are protected by node spin lock.

- The relationship between bearer and node
  When link accesses bearer, it first needs to find the bearer with
  its bearer identity from the bearer_list array. When bearer accesses
  node, it can iterate the node_htable hash list with the node address
  to find the corresponding node.

In the new locking policy, every component has its private locking
solution and the relationship between bearer and node is very simple,
that is, they can find each other with node address or bearer identity
from node_htable hash list or bearer_list array.

But, prior to these changes, we need to do some necessary cleanup and
code consolidation. This is what we do with this commit series. In a
later series we will replace net_lock with RTNL as well as RCU lock
to deploy the new locking policy.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: use node list lock to protect tipc_num_links variable
Ying Xue [Thu, 27 Mar 2014 04:54:39 +0000 (12:54 +0800)]
tipc: use node list lock to protect tipc_num_links variable

Without properly implicit or explicit read memory barrier, it's
unsafe to read an atomic variable with atomic_read() from another
thread which is different with the thread of changing the atomic
variable with atomic_inc() or atomic_dec(). So a stale tipc_num_links
may be got with atomic_read() in tipc_node_get_links(). If the
tipc_num_links variable type is converted from atomic to unsigned
integer and node list lock is used to protect it, the issue would
be avoided.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: use node_list_lock to protect tipc_num_nodes variable
Ying Xue [Thu, 27 Mar 2014 04:54:38 +0000 (12:54 +0800)]
tipc: use node_list_lock to protect tipc_num_nodes variable

As tipc_node_list is protected by rcu read lock on read side, it's
unnecessary to hold node_list_lock to protect tipc_node_list in
tipc_node_get_links(). Instead, node_list_lock should just protects
tipc_num_nodes in the function.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: tipc: convert node list and node hlist to RCU lists
Ying Xue [Thu, 27 Mar 2014 04:54:37 +0000 (12:54 +0800)]
tipc: tipc: convert node list and node hlist to RCU lists

Convert tipc_node_list list and node_htable hash list to RCU lists.
On read side, the two lists are protected with RCU read lock, and
on update side, node_list_lock is applied to them.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: rename node create lock to protect node list and hlist
Ying Xue [Thu, 27 Mar 2014 04:54:36 +0000 (12:54 +0800)]
tipc: rename node create lock to protect node list and hlist

When a node is created, tipc_net_lock read lock is first held and
then node_create_lock is grabbed in order to prevent the same node
from being created and inserted into both node list and hlist twice.
But when we query node from the two node lists, we only hold
tipc_net_lock read lock without grabbing node_create_lock. Obviously
this locking policy is unable to guarantee that the two node lists
are always synchronized especially when the operation of changing
and accessing them occurs in different contexts like currently doing.

Therefore, rename node_create_lock to node_list_lock to protect the
two node lists, that is, whenever node is inserted into them or node
is queried from them, the node_list_lock should be always held. As a
result, tipc_net_lock read lock becomes redundant and then can be
removed from the node query functions.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: make broadcast bearer store in bearer_list array
Ying Xue [Thu, 27 Mar 2014 04:54:35 +0000 (12:54 +0800)]
tipc: make broadcast bearer store in bearer_list array

Now unicast bearer is dynamically allocated and placed into its
identity specified slot of bearer_list array. When we search
bearer_list array with a bearer identity, the corresponding bearer
instance can be found. But broadcast bearer is statically allocated
and it is not located in the bearer_list array yet. So we decide to
enlarge bearer_list array into MAX_BEARERS + 1 slots, and its last
slot stores the broadcast bearer so that the broadcast bearer can
be found from bearer_list array with MAX_BEARERS as index. The
change will help us reduce the complex relationship between bearer
and link in the future.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: remove active flag from tipc_bearer structure
Ying Xue [Thu, 27 Mar 2014 04:54:34 +0000 (12:54 +0800)]
tipc: remove active flag from tipc_bearer structure

After the allocation of tipc_bearer structure instance is converted
from statical way to dynamical way, we identify whether a certain
tipc_bearer structure pointer is valid by checking whether the pointer
is NULL or not. So the active flag in tipc_bearer structure becomes
redundant.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: convert tipc_bearers array to pointer list
Ying Xue [Thu, 27 Mar 2014 04:54:33 +0000 (12:54 +0800)]
tipc: convert tipc_bearers array to pointer list

As part of the effort to introduce RCU protection for the bearer
list, we first need to change it to a list of pointers.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: acquire necessary locks in named_cluster_distribute routine
Ying Xue [Thu, 27 Mar 2014 04:54:32 +0000 (12:54 +0800)]
tipc: acquire necessary locks in named_cluster_distribute routine

The 'tipc_node_list' is guarded by tipc_net_lock and 'links' array
defined in 'tipc_node' structure is protected by node lock as well.
Without acquiring the two locks in named_cluster_distribute() a fatal
oops may happen in case that a destroyed link might be got and then
accessed. Therefore, above mentioned two locks must be held in
named_cluster_distribute() to prevent the issue from happening
accidentally.

As 'links' array in node struct must be protected by node lock,
we have to move the code of selecting an active link from
tipc_link_xmit() to named_cluster_distribute() and then call
__tipc_link_xmit() with the selected link to deliver name messages.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: obsolete the remote management feature
Ying Xue [Thu, 27 Mar 2014 04:54:31 +0000 (12:54 +0800)]
tipc: obsolete the remote management feature

Due to the lacking of any credential, it's allowed to accept commands
requested from remote nodes to query the local node status, which is
prone to involve potential security risks. Instead, if we login to
a remote node with ssh command, this approach is not only more safe
than the remote management feature, but also it can give us more
permissions like changing the remote node configuration. So it's
reasonable for us to obsolete the remote management feature now.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotipc: remove unnecessary checking for node object
Ying Xue [Thu, 27 Mar 2014 04:54:30 +0000 (12:54 +0800)]
tipc: remove unnecessary checking for node object

tipc_node_create routine doesn't need to check whether a node
object specified with a node address exists or not because its
caller(ie, tipc_disc_recv_msg routine) has checked this before
calling it.

Signed-off-by: Ying Xue <ying.xue@windriver.com>
Reviewed-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'sxgbe'
David S. Miller [Thu, 27 Mar 2014 17:07:45 +0000 (13:07 -0400)]
Merge branch 'sxgbe'

Byungho An says:

====================
This is 14th posting for SAMSUNG SXGBE driver.

Changes since v1:
- changed name of driver to SXGbE as per Ben's comment
- squashed Joe's neatening for many stuff in original patches

Changes since v2:
- updated and split binding document as per Mark's comment
- clean up codes as per Joe's comment
- removed unused fields and clean up codes as per Francois's comment
- removed module parameters as per Dave's comment
- moved driver directory to samsung/sxgbe/

Changes since v3:
- fixed Missing a blank line after declarations as per Dave's comment
- clean up codes as per Joe's comment
- removed reference of net_device.{irq, base_addr} as per Francois's comment

Changes since v4:
- updated binding document and DT related function as per Mark's comment

Changes since v5:
- updated binding document and DT related function as per Florian's comment
- fixed typo and shortened code as per Joe's comment

Changes since v6:
- updated TSO related functions as per Rayagond's comment
- updated binding document as per Mark's comment
- removed WoL patch from this patch set

Changes since v7:
- updated TSO related functions as per Rayagond's comment

Changes since v8:
- removed select and depends statement from vendor sub-section as per
  Dave's comment

Changes since v9:
- removed adv-add-map, force-sf-dma-modei and force-thresh-dma-mode from
  binding documnet as per Mark's comment

Changes since v10:
- clean up codes as per Francois's comment

Changes since v11:
- clean up mdio_read/write codes as per Francois's comment
- changed irq acquisition error path as per Francois's comment
- updated mdio and platform related codes as per Tomasz'comment
- clean up dma related codes as per Vince's comment

Changes since v12:
- fixed typo

Changes since v13:
- clean up error path codes for irqs as per Francois's comment
- removed unsupported functions for ehttoolirq as per Ben's comment
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/core: Use RCU_INIT_POINTER(x, NULL) in netpoll.c
Monam Agarwal [Sun, 23 Mar 2014 19:12:46 +0000 (00:42 +0530)]
net/core: Use RCU_INIT_POINTER(x, NULL) in netpoll.c

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/bridge: Use RCU_INIT_POINTER(x, NULL) in br_vlan.c
Monam Agarwal [Sun, 23 Mar 2014 19:11:13 +0000 (00:41 +0530)]
net/bridge: Use RCU_INIT_POINTER(x, NULL) in br_vlan.c

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c
Monam Agarwal [Sun, 23 Mar 2014 18:32:32 +0000 (00:02 +0530)]
drivers/net: Use RCU_INIT_POINTER(x, NULL) in tun.c

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers/net: Use RCU_INIT_POINTER(x, NULL) in bonding/bond_options.c
Monam Agarwal [Sun, 23 Mar 2014 18:30:17 +0000 (00:00 +0530)]
drivers/net: Use RCU_INIT_POINTER(x, NULL) in bonding/bond_options.c

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMAINTAINERS: add maintainer for Samsung sxgbe driver
Byungho An [Tue, 25 Mar 2014 19:11:07 +0000 (12:11 -0700)]
MAINTAINERS: add maintainer for Samsung sxgbe driver

Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: add ethtool related functions support Samsung sxgbe
Vipul Pandya [Tue, 25 Mar 2014 19:11:02 +0000 (12:11 -0700)]
net: sxgbe: add ethtool related functions support Samsung sxgbe

This patch adds ethtool related functions.

Signed-off-by: Vipul Pandya <vipul.pandya@samsung.com>
Neatening-by: Joe Perches <joe@perches.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: add Checksum offload support for Samsung sxgbe
Vipul Pandya [Tue, 25 Mar 2014 19:11:02 +0000 (12:11 -0700)]
net: sxgbe: add Checksum offload support for Samsung sxgbe

This patch adds TX and RX checksum offload support.

Signed-off-by: Vipul Pandya <vipul.pandya@samsung.com>
Neatening-by: Joe Perches <joe@perches.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: add TSO support for Samsung sxgbe
Vipul Pandya [Tue, 25 Mar 2014 19:10:57 +0000 (12:10 -0700)]
net: sxgbe: add TSO support for Samsung sxgbe

Enable TSO during initialization for each DMA channels

Signed-off-by: Vipul Pandya <vipul.pandya@samsung.com>
Neatening-by: Joe Perches <joe@perches.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: add EEE(Energy Efficient Ethernet) for Samsung sxgbe
Girish K S [Tue, 25 Mar 2014 19:10:57 +0000 (12:10 -0700)]
net: sxgbe: add EEE(Energy Efficient Ethernet) for Samsung sxgbe

Added support for the EEE(Energy Efficient Ethernet) in 10G ethernet driver.

Signed-off-by: Girish K S <ks.giri@samsung.com>
Neatening-by: Joe Perches <joe@perches.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sxgbe: add basic framework for Samsung 10Gb ethernet driver
Siva Reddy [Tue, 25 Mar 2014 19:10:54 +0000 (12:10 -0700)]
net: sxgbe: add basic framework for Samsung 10Gb ethernet driver

This patch adds support for Samsung 10Gb ethernet driver(sxgbe).

- sxgbe core initialization
- Tx and Rx support
- MDIO support
- ISRs for Tx and Rx
- ifconfig support to driver

Signed-off-by: Siva Reddy Kallam <siva.kallam@samsung.com>
Signed-off-by: Vipul Pandya <vipul.pandya@samsung.com>
Signed-off-by: Girish K S <ks.giri@samsung.com>
Neatening-by: Joe Perches <joe@perches.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosxgbe: Add device-tree binding support document
Siva Reddy [Tue, 25 Mar 2014 19:10:51 +0000 (12:10 -0700)]
sxgbe: Add device-tree binding support document

This patch adds binding document for SXGBE ethernet driver via device-tree.

Signed-off-by: Siva Reddy Kallam <siva.kallam@samsung.com>
Signed-off-by: Byungho An <bh74.an@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>