Commit graph

429716 commits

Author SHA1 Message Date
Eric W. Biederman 26faa9d777 ibmveth: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in ibmveth_start_xmit
that can be called in hard irq and other contexts.

In this code path the packet can have either been transmitted
or dropped, dev_consume_skb_any was choosen because that preserves
the existing semantics of the code, and a transmitted packet is
more likely.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:03 -07:00
Eric W. Biederman cfbe406307 ehea: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in functions that can
be called in hard irq and other contexts.

None of the locations was a packet drop so dev_kfree_skb_any is
inappropriate.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:03 -07:00
Eric W. Biederman 374e29da7c i825xx: Call dev_kfree_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in i596_start_xmit that
can be called in hard irq and other contexts, when the skb is dropped.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:02 -07:00
Eric W. Biederman 361457415a ucc_geth: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in ucc_geth_tx that can
be called in hard irq and other contexts, when processing the
tx completion event.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:02 -07:00
Eric W. Biederman 8e7e687452 fec: Call dev_kfree_skb_any instead of kfree_skb.
Replace kfree_skb with dev_kfree_skb_any in fec_enet_start_xmit that
can be called in hard irq and other contexts, when the packet is
dropped.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:01 -07:00
Eric W. Biederman 36fc210904 sundance: Call dev_kfree_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in start_tx that can
be called in hard irq and other contexts, when the skb is dropped.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:01 -07:00
Eric W. Biederman 290a79dbf7 uli526x: Call dev_kfree/consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in uli562x_start_xmit
that can be called in hard irq and other contexts, when the packet is
dropped.

Replace dev_kfree_skb with dev_consume_skb_any in uli562x_start_xmit
that can be called in hard irq and other contexts, when the packet is
transmitted.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:00 -07:00
Eric W. Biederman 086dfb7fad dmfe: Call dev_kfree/consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in dmfe_start_xmit that
can be called in hard irq and other contexts, when the packet is
dropped.

Replace dev_kfree_skb with dev_consume_skb_any in dmfe_start_xmit that
can be called in hard irq and other contexts, when the packet is
transmitted.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:19:00 -07:00
Eric W. Biederman 2c3d0bc027 dm9000: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in dm9000_start_xmit
that can be called in hard irq and other contexts, on the path
that successfully transmits the packet.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:59 -07:00
Eric W. Biederman 98d8a65d10 enic: Call dev_kfree_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in enic_hard_start_xmit
that can be called in hard irq and other contexts.

enic_hard_start_xmit only frees the skb when dropping it.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:59 -07:00
Eric W. Biederman d6bea829ca cs89x0: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in net_send_packet that
can be called in hard irq and other contexts.

net_send_packet consumes (not drops) the skb of interest.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:58 -07:00
Eric W. Biederman 42ffda5fe7 cxfb4vf: Call dev_kfree/consume_skb_any instead of [dev_]kfree_skb.
Replace kfree_skb with dev_consume_skb_any in free_tx_desc that can be
called in hard irq and other contexts. dev_consume_skb_any is used
as this function consumes successfully transmitted skbs.

Replace dev_kfree_skb with dev_kfree_skb_any in t4vf_eth_xmit that can
be called in hard irq and other contexts, on paths that drop the skb.

Replace dev_kfree_skb with dev_consume_skb_any in t4vf_eth_xmit that can
be called in hard irq and other contexts, on paths that successfully
transmit the skb.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:58 -07:00
Eric W. Biederman a7525198a8 cxgb4: Call dev_kfree/consume_skb_any instead of [dev_]kfree_skb.
Replace kfree_skb with dev_consume_skb_any in free_tx_desc that can be
called in hard irq and other contexts. dev_consume_skb_any is used
as this function consumes successfully transmitted skbs.

Replace dev_kfree_skb with dev_kfree_skb_any in t4_eth_xmit that can
be called in hard irq and other contexts, on paths that drop the skb.

Replace dev_kfree_skb with dev_consume_skb_any in t4_eth_xmit that can
be called in hard irq and other contexts, on paths that successfully
transmit the skb.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:57 -07:00
Eric W. Biederman f9ec8131bb cxgb3: Call dev_kfree/consume_skb_any instead of [dev_]kfree_skb.
Replace kfree_skb with dev_consume_skb_any in free_tx_desc, and
write_tx_pkt_wr that can be called in hard irq and other contexts.

Replace dev_kfree_skb with dev_kfree_skb_any in t3_eth_xmit that can
be called in hard irq and other contexts.

dev_kfree_skb is replaced with dev_kfree_skb_any in t3_eth_xmit as
that location is a packet drop, while kfree_skb in free_tx_desc,
and in write_tx_pkt_wr are places where packets are consumed
in a healthy manner.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:57 -07:00
Eric W. Biederman f5cf76ba62 xgmac: Call dev_kfree/consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in xgmac_tx_complete
that can be called in hard irq and other contexts.

Replace dev_kfree_skb with dev_kfree_skb_any in xgmac_xmit that can
be called in hard irq and other contexts.

dev_consume_skb_any is used in xgamc_tx_complete as skbs that reach
there have been successfully transmitted, dev_kfree_skby_any is used
in xgmac_xmit as skbs that are freed there are being dropped.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:56 -07:00
Eric W. Biederman c88b5b6a68 macb: Call dev_kfree_skb_any instead of kfree_skb.
Replace kfree_skb with dev_kfree_skb_any in macb_start_xmit that can
be called in hard irq and other contexts.

macb_start_xmit only frees skbs when dropping them so
dev_kfree_skb_any is used.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:55 -07:00
Eric W. Biederman 27400df8e9 bnad: Call dev_kfree_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in bnad_start_xmit that
can be called in hard irq and other contexts.

dev_kfree_skb_any is used as bnad_start_xmit only frees skbs when to
drop them, normally transmitted packets are handled elsewhere.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:55 -07:00
Eric W. Biederman 07641c8fa4 atl1c: Call dev_kfree/consume_skb_any instead of dev_kfree_skb.
The call path: atl1c_xmit_frame, atlc_tx_rollback, atl1c_clean_buffer
can not be tell at compile time if it will be invoked from hard irq
or other context, as atl1c_xmit_frame does not know.  So remove
the logic that  passes the compile time knowledge into al1c_clean_buffer
and figure out it out at runtime with dev_consume_skb_any.

Replace dev_kfree_skb with dev_kfree_skb_any in atl1c_xmit_frame that
can be called in hard irq and other contexts.

Replace dev_kfree_skb and dev_kfree_skb_irq with dev_consume_skb_any
in atl1c_clean_buffer that can be called in hard irq and other
contexts.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:54 -07:00
Eric W. Biederman 548ff1ed7d alx: Call dev_kfree_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in alx_start_xmit that
can be called in hard irq and other contexts.

dev_kfree_skb_any is used as alx_start_xmit only frees skbs
when dropping them.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:54 -07:00
Eric W. Biederman af9ba92cb2 pcnet32: Call dev_kfree_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_kfree_skb_any in pcnet32_start_xmit
that can be called in hard irq and other contexts.

dev_kfree_skb_any is used as pcnet32_start_xmit only frees an
skb when it drops a packet during transmit.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:53 -07:00
Eric W. Biederman 37392c7b84 lance: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in lance_start_xmit
that can be called in hard irq and other contexts.

dev_consume_skb_any is used as lance_start_xmit always immediately
consumes the skb.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:53 -07:00
Eric W. Biederman e21106b412 am79c961a: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in am79c961 that can
be called in hard irq and other contexts.

dev_consume_skb_any is used as am79c961_sendpacket always
immediately consumes the skb.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:18:40 -07:00
Eric W. Biederman c99abc8b39 sun4i-emac: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in emacs_start_xmit
which can be called in hard irq and other contexts.

emac_start_xmit always transmits the packet making dev_consume_skb
the appropriate function to call.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 21:15:53 -07:00
Linus Torvalds b098d6726b Linux 3.14-rc8 2014-03-24 19:31:17 -07:00
Linus Torvalds 822316461b Merge branch 'parisc-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc updates from Helge Deller:
 - revert parts of the latest patch regarding font selection with STICON
   console
 - wire up the utimes() syscall for parisc
 - remove the unused parisc tmpalias code and unnecessary arch*relax
   defines

* 'parisc-3.14' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
  parisc: locks: remove redundant arch_*_relax operations
  parisc: wire up sys_utimes
  parisc: Remove unused CONFIG_PARISC_TMPALIAS code
  partly revert commit 8a10bc9: parisc/sti_console: prefer Linux fonts over built-in ROM fonts
2014-03-24 17:36:58 -07:00
Linus Torvalds 56f1f4b24e Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc fixes from David Miller:

 1) Do serial locking in a way that makes things clear that these are
    IRQ spinlocks.

 2) Conversion to generic idle loop broke first generation Niagara
    machines, need to have %pil interrupts enabled during cpu yield
    hypervisor call.

 3) Do not use magic constants for iterations over tsb tables, from Doug
    Wilson.

 4) Fix erroneous truncation of 64-bit system call return values to
    32-bit.  From Dave Kleikamp.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc64: Make sure %pil interrupts are enabled during hypervisor yield.
  sparc64:tsb.c:use array size macro rather than number
  sparc64: don't treat 64-bit syscall return codes as 32-bit
  sparc: serial: Clean up the locking for -rt
2014-03-24 17:30:44 -07:00
Linus Torvalds 8a1094462c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller:

 1) OpenVswitch's lookup_datapath() returns error pointers, so don't
    check against NULL.  From Jiri Pirko.

 2) pfkey_compile_policy() code path tries to do a GFP_KERNEL allocation
    under RCU locks, fix by using GFP_ATOMIC when necessary.  From
    Nikolay Aleksandrov.

 3) phy_suspend() indirectly passes uninitialized data into the ethtool
    get wake-on-land implementations.  Fix from Sebastian Hesselbarth.

 4) CPSW driver unregisters CPTS twice, fix from Benedikt Spranger.

 5) If SKB allocation of reply packet fails, vxlan's arp_reduce() defers
    a NULL pointer.  Fix from David Stevens.

 6) IPV6 neigh handling in vxlan doesn't validate the destination
    address properly, and it builds a packet with the src and dst
    reversed.  Fix also from David Stevens.

 7) Fix spinlock recursion during subscription failures in TIPC stack,
    from Erik Hugne.

 8) Revert buggy conversion of davinci_emac to devm_request_irq, from
    Chrstian Riesch.

 9) Wrong flags passed into forwarding database netlink notifications,
    from Nicolas Dichtel.

10) The netpoll neighbour soliciation handler checks wrong ethertype,
    needs to be ETH_P_IPV6 rather than ETH_P_ARP.  Fix from Li RongQing.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (34 commits)
  tipc: fix spinlock recursion bug for failed subscriptions
  vxlan: fix nonfunctional neigh_reduce()
  net: davinci_emac: Fix rollback of emac_dev_open()
  net: davinci_emac: Replace devm_request_irq with request_irq
  netpoll: fix the skb check in pkt_is_ns
  net: micrel : ks8851-ml: add vdd-supply support
  ip6mr: fix mfc notification flags
  ipmr: fix mfc notification flags
  rtnetlink: fix fdb notification flags
  tcp: syncookies: do not use getnstimeofday()
  netlink: fix setsockopt in mmap examples in documentation
  openvswitch: Correctly report flow used times for first 5 minutes after boot.
  via-rhine: Disable device in error path
  ATHEROS-ATL1E: Convert iounmap to pci_iounmap
  vxlan: fix potential NULL dereference in arp_reduce()
  cnic: Update version to 2.5.20 and copyright year.
  cnic,bnx2i,bnx2fc: Fix inconsistent use of page size
  cnic: Use proper ulp_ops for per device operations.
  net: cdc_ncm: fix control message ordering
  ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly
  ...
2014-03-24 17:07:24 -07:00
Eric W. Biederman 21534d20fe bfin_mac: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in _tx_reclaim_skb that
can be called in hard irq and other contexts.

dev_consume_skb is used as _tx_reclaim_skb is called after a packet
has been successfully transmitted.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 15:25:30 -07:00
Eric W. Biederman e05b310198 8390: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in __ei_start_xmit that
can be called in hard irq and other contexts.

dev_consume_skb is used as in this simple driver the skb is always
immediately consumed, there are no drops.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 15:22:02 -07:00
Eric W. Biederman e5ddf351b1 3c59x: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in vortex_start_xmit
as it can be called in hard irq and other contexts.

dev_consume_skb_any is used when vortext_start_xmit directly consumes
the packet instead of dmaing it to the device.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 15:17:22 -07:00
Eric W. Biederman 8fa9524d6b 3c509: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in el3_start_xmit
as it can be called in hard irq and other contexts.

dev_consume_skb_any is used as on this simple hardware the
skb is consumed directly by the start_xmit function.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 15:14:59 -07:00
Eric W. Biederman fabfb91d50 uml/net_kern: Call dev_consume_skb_any instead of dev_kfree_skb.
Replace dev_kfree_skb with dev_consume_skb_any in uml_net_start_xmit
as it can be called in hard irq and other contexts.

dev_consume_skb_any is used as uml_net_start_xmit typically
consumes (not drops) packets.

Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
2014-03-24 15:13:35 -07:00
Erik Hugne a5d0e7c037 tipc: fix spinlock recursion bug for failed subscriptions
If a topology event subscription fails for any reason, such as out
of memory, max number reached or because we received an invalid
request the correct behavior is to terminate the subscribers
connection to the topology server. This is currently broken and
produces the following oops:

[27.953662] tipc: Subscription rejected, illegal request
[27.955329] BUG: spinlock recursion on CPU#1, kworker/u4:0/6
[27.957066]  lock: 0xffff88003c67f408, .magic: dead4ead, .owner: kworker/u4:0/6, .owner_cpu: 1
[27.958054] CPU: 1 PID: 6 Comm: kworker/u4:0 Not tainted 3.14.0-rc6+ #5
[27.960230] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[27.960874] Workqueue: tipc_rcv tipc_recv_work [tipc]
[27.961430]  ffff88003c67f408 ffff88003de27c18 ffffffff815c0207 ffff88003de1c050
[27.962292]  ffff88003de27c38 ffffffff815beec5 ffff88003c67f408 ffffffff817f0a8a
[27.963152]  ffff88003de27c58 ffffffff815beeeb ffff88003c67f408 ffffffffa0013520
[27.964023] Call Trace:
[27.964292]  [<ffffffff815c0207>] dump_stack+0x45/0x56
[27.964874]  [<ffffffff815beec5>] spin_dump+0x8c/0x91
[27.965420]  [<ffffffff815beeeb>] spin_bug+0x21/0x26
[27.965995]  [<ffffffff81083df6>] do_raw_spin_lock+0x116/0x140
[27.966631]  [<ffffffff815c6215>] _raw_spin_lock_bh+0x15/0x20
[27.967256]  [<ffffffffa0008540>] subscr_conn_shutdown_event+0x20/0xa0 [tipc]
[27.968051]  [<ffffffffa000fde4>] tipc_close_conn+0xa4/0xb0 [tipc]
[27.968722]  [<ffffffffa00101ba>] tipc_conn_terminate+0x1a/0x30 [tipc]
[27.969436]  [<ffffffffa00089a2>] subscr_conn_msg_event+0x1f2/0x2f0 [tipc]
[27.970209]  [<ffffffffa0010000>] tipc_receive_from_sock+0x90/0xf0 [tipc]
[27.970972]  [<ffffffffa000fa79>] tipc_recv_work+0x29/0x50 [tipc]
[27.971633]  [<ffffffff8105dbf5>] process_one_work+0x165/0x3e0
[27.972267]  [<ffffffff8105e869>] worker_thread+0x119/0x3a0
[27.972896]  [<ffffffff8105e750>] ? manage_workers.isra.25+0x2a0/0x2a0
[27.973622]  [<ffffffff810648af>] kthread+0xdf/0x100
[27.974168]  [<ffffffff810647d0>] ? kthread_create_on_node+0x1a0/0x1a0
[27.974893]  [<ffffffff815ce13c>] ret_from_fork+0x7c/0xb0
[27.975466]  [<ffffffff810647d0>] ? kthread_create_on_node+0x1a0/0x1a0

The recursion occurs when subscr_terminate tries to grab the
subscriber lock, which is already taken by subscr_conn_msg_event.
We fix this by checking if the request to establish a new
subscription was successful, and if not we initiate termination of
the subscriber after we have released the subscriber lock.

Signed-off-by: Erik Hugne <erik.hugne@ericsson.com>
Reviewed-by: Jon Maloy <jon.maloy@ericsson.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:36:56 -04:00
David Stevens 4b29dba9c0 vxlan: fix nonfunctional neigh_reduce()
The VXLAN neigh_reduce() code is completely non-functional since
check-in. Specific errors:

1) The original code drops all packets with a multicast destination address,
	even though neighbor solicitations are sent to the solicited-node
	address, a multicast address. The code after this check was never run.
2) The neighbor table lookup used the IPv6 header destination, which is the
	solicited node address, rather than the target address from the
	neighbor solicitation. So neighbor lookups would always fail if it
	got this far. Also for L3MISSes.
3) The code calls ndisc_send_na(), which does a send on the tunnel device.
	The context for neigh_reduce() is the transmit path, vxlan_xmit(),
	where the host or a bridge-attached neighbor is trying to transmit
	a neighbor solicitation. To respond to it, the tunnel endpoint needs
	to do a *receive* of the appropriate neighbor advertisement. Doing a
	send, would only try to send the advertisement, encapsulated, to the
	remote destinations in the fdb -- hosts that definitely did not do the
	corresponding solicitation.
4) The code uses the tunnel endpoint IPv6 forwarding flag to determine the
	isrouter flag in the advertisement. This has nothing to do with whether
	or not the target is a router, and generally won't be set since the
	tunnel endpoint is bridging, not routing, traffic.

	The patch below creates a proxy neighbor advertisement to respond to
neighbor solicitions as intended, providing proper IPv6 support for neighbor
reduction.

Signed-off-by: David L Stevens <dlstevens@us.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:35:10 -04:00
David S. Miller 866b7cdf5f Merge branch 'davinci_emac'
Christian Riesch says:

====================
net: davinci_emac: Fix interrupt requests and error handling

since commit 6892b41d97 (Linux 3.11) the
davinci_emac driver is broken. After doing ifconfig down, ifconfig up,
requesting the interrupts for the driver fails. The interface remains dead
until the board is rebooted.

The first patch in this patchset reverts commit
6892b41d97 partially and makes the driver
useable again.

During the work on the first patch, a number of bugs in the error handling
of the driver's ndo_open code were found. The second patch fixes these bugs.

I believe the first patch meets the rules for stable kernels, I therefore added
the stable tag to this patch. The second patch is just cleanup, the code
that is fixed by this patch is only executed in case of an error.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:32:34 -04:00
Christian Riesch cd11cf5053 net: davinci_emac: Fix rollback of emac_dev_open()
If an error occurs during the initialization in emac_dev_open() (the
driver's ndo_open function), interrupts, DMA descriptors etc. must be freed.
The current rollback code is buggy in several ways.

  1) Freeing the interrupts. The current code will not free all interrupts
     that were requested by the driver. Furthermore,  the code tries to do a
     platform_get_resource(priv->pdev, IORESOURCE_IRQ, -1) in its last
     iteration.

     This patch fixes these bugs.

  2) Wrong order of err: and rollback: labels. If the setup of the PHY in
     the code fails, the interrupts that have been requested before are
     not freed:

        request irq
                if requesting irqs fails, goto rollback
        setup phy
                if phy setup fails, goto err
        return 0

     rollback:
        free irqs
     err:

     This patch brings the code into the correct order.

  3) The code calls napi_enable() and emac_int_enable(), but does not
     undo both in case of an error.

     This patch adds calls of emac_int_disable() and napi_disable() to the
     rollback code.

  4) RX DMA descriptors are not freed in case of an error: Right before
     requesting the irqs, the function creates DMA descriptors for the
     RX channel. These RX descriptors are never freed when we jump to either
     rollback or err.

     This patch adds code for freeing the DMA descriptors in the case of
     an initialization error. This required a modification of
     cpdma_ctrl_stop() in davinci_cpdma.c: We must be able to call this
     function to free the DMA descriptors while the DMA channels are
     in IDLE state (before cpdma_ctlr_start() was called).

Tested on a custom board with the Texas Instruments AM1808.

Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:32:03 -04:00
Christian Riesch 33b7107f59 net: davinci_emac: Replace devm_request_irq with request_irq
In commit 6892b41d97

Author: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Date:   Tue Jun 25 21:24:51 2013 +0530
net: davinci: emac: Convert to devm_* api

the call of request_irq is replaced by devm_request_irq and the call
of free_irq is removed. But since interrupts are requested in
emac_dev_open, doing ifconfig up/down on the board requests the
interrupts again each time, causing devm_request_irq to fail. The
interface is dead until the device is rebooted.

This patch reverts said commit partially: It changes the driver back
to use request_irq instead of devm_request_irq, puts free_irq back in
place, but keeps the remaining changes of the original patch.

Reported-by: Jon Ringle <jon@ringle.org>
Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
Cc: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:32:03 -04:00
Li RongQing c27f0872a3 netpoll: fix the skb check in pkt_is_ns
Neighbor Solicitation is ipv6 protocol, so we should check
skb->protocol with ETH_P_IPV6

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Cc: WANG Cong <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 15:08:40 -04:00
David S. Miller cb3042d609 sparc64: Make sure %pil interrupts are enabled during hypervisor yield.
In arch_cpu_idle() we must enable %pil based interrupts before
potentially invoking the hypervisor cpu yield call.

As per the Hypervisor API documentation for cpu_yield:

	Interrupts which are blocked by some mechanism other that
	pstate.ie (for example %pil) are not guaranteed to cause
	a return from this service.

It seems that only first generation Niagara chips are hit by this
bug.  My best guess is that later chips implement this in hardware
and wake up anyways from %pil events, whereas in first generation
chips the yield is implemented completely in hypervisor code and
requires %pil to be enabled in order to wake properly from this
call.

Fixes: 87fa05aeb3 ("sparc: Use generic idle loop")
Reported-by: Fabio M. Di Nitto <fabbione@fabbione.net>
Reported-by: Jan Engelhardt <jengelh@inai.de>
Tested-by: Jan Engelhardt <jengelh@inai.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 14:45:12 -04:00
David S. Miller 35d499ee3a Merge 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 igb, ixgbe, ixgbevf, i40e and i40evf.

Anjali provides a i40e/i40evf patch to add Energy Efficient Ethernet
Low Power Idle stats and a fix for i40e to change the string
"Side Band" to "Sideband" for consistency.

Mitch provides 2 patches for i40evf to fix if the driver encounters
an error while communicating with the PF driver, do not shut down the
admin queue unconditionally.  Add an error message when the admin
queue message never completes and fix formatting on another message
that was unnecessarily wrapped.

Mark provides a ixgbe patch and five ixgbevf patches.  Fix a possible
infinite recursion when an adapter is removed and registers all read
as all one's in ixgbe_clear_vmdq_generic() and ixgbe_clear_rar_generic().
Converts macros to static inline functions to align kernel coding standard
and prepare for adding Live Error Recovery (LER) to ixgbevf.  Change the
ethtool register test to use the normal register accessor functions and
eliminate macors used for calling register test functions to make error
exits more clear.  Checks all register reads for adapter removal by checking
the status register after any register read that returns all F's since the
status register will never return 0xFFFFFFFF unless the adapter is removed.

Jacob implements SIOCGHWTSTAMP ioctl for igb which enables user processes
to read the current hardware stamp config settings non-destructively.

Todd adds the initial register read and write for surprise removal (LER)
for igb.

Christian Engelmayer fixes an igb memory leak in the igb_get_module_eeprom()
error handling path.

Ken Ichikawa provides a fix for igb, specifically for 82575 hardware to
specify -1 to the phc_index for ethtool's get_ts_info, otherwise a wrong
value will be set to the phc_index.

Christopher Paasch fixes a null pointer dereference in igb and makes sure
to unset the HAS_MSIX flag when the driver falls back to MSI only.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 12:45:16 -04:00
Li RongQing 0b8c7f6f2a ipv4: remove ip_rt_dump from route.c
ip_rt_dump do nothing after IPv4 route caches removal, so we can remove it.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 12:45:01 -04:00
wangweidong dffe278f0a atheros/atlx: use SET_ETHTOOL_OPS directly
As commit a6e28b34205b("staging/et131x: use SET_ETHTOOL_OPS
directly"), using a wrapper around SET_ETHTOOL_OPS macro is
not actually required, remove and use SET_ETHTOOL_OPS directly.

Signed-off-by: Wang Weidong <wangweidong1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 12:45:01 -04:00
Vince Bridgers 80175f93f3 Altera TSE: Correct two typos in original submission
This patch addresses two typos in the original driver submission. One derived
from a cut & paste error, and another is a misspelling.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 12:45:00 -04:00
Vince Bridgers a804ad0e3b Altera TSE: Correct typecast issue detected by kbuild test robot
This patch addresses a portable pointer arithmetic issue in the
original submission found by the kbuild test robot.

config: make ARCH=i386 allyesconfig

   altera_sgdma.c: In function 'sgdma_txphysaddr':
>> altera_sgdma.c:393:33: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
     dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
                                    ^
>> altera_sgdma.c:394:5: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
        (dma_addr_t)priv->tx_dma_desc);
        ^
   altera_sgdma.c: In function 'sgdma_rxphysaddr':
>> altera_sgdma.c:403:33: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
     dma_addr_t offs = (dma_addr_t)((dma_addr_t)desc -
                                    ^
>> altera_sgdma.c:404:5: warning: cast from
>> pointer to integer of different size [-Wpointer-to-int-cast]
        (dma_addr_t)priv->rx_dma_desc);
        ^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 12:45:00 -04:00
Vince Bridgers 8adfc3ae45 Altera TSE: Set version number by driver's get regs
Set the version number returned by the driver's get regs routine
invoked by ethtool so formatting can be dependent on the version
number returned, and any interesting formatted output can check
the version number for specific types of register data returned.

Signed-off-by: Vince Bridgers <vbridgers2013@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 12:45:00 -04:00
David S. Miller 70abc79877 Merge branch 'qlcnic-next'
Shahed Shaikh says:

====================
This patch series containes following changes -

* TSO over IPv4 and IPv6, Tx checksum offload for VXLAN
* Rx checksum offload for VXLAN and support for .ndo_{add|del}_vxlan_port
  netdev ops.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 00:44:34 -04:00
Shahed Shaikh 8af7b7f81c qlcnic: Update version to 5.3.57
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 00:44:24 -04:00
Shahed Shaikh 2b3d7b758c qlcnic: Add VXLAN Rx offload support
This patch adds Rx checksum offload support for VXLAN.
Implements .ndo_{add|del}_vxlan_port netdev ops.
Adapter supports only one VXLAN port, so program adapter with
very first UDP port which VXLAN driver is listening to.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 00:44:23 -04:00
Shahed Shaikh 381709de15 qlcnic: Add VXLAN Tx offload support
This patch adds LSO, LSO6 and Tx checksum offload support for VXLAN
encapsulated packets on 83xx/84xx series adapters.

Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 00:44:23 -04:00
Claudiu Manoil c65d753372 gianfar: Fix P1010 config regression (SQ polling)
The P1010 device tree restricts the number of
supported interrupt groups to 1, although the eth
controller can support 2 interrupt groups and the
driver assumes the Multi-Group mode ("fsl,etsec2" model).

So, in this case the assumption that the Multi-Group
mode (MQ_MG_MODE) devices always support 2 interrupt
groups is false.  To fix this, a check for the actual
number of interrupt groups enabled in the board's
device tree has been added in gfar_probe for the
"fsl,etsec2" devices.

Without this fix, P1010 based boards claim support for
2 Tx queues to the net stack but only one is actually
allocated, leading to NULL access in xmit.  This issue
was introduced by enabling Single-Queue polling for
the P1010 devices.
(71ff9e3 gianfar: Use Single-Queue polling for
"fsl,etsec2")

Fixes: 71ff9e3df7
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2014-03-24 00:40:44 -04:00