openwrt/staging/blogic.git
10 years agosctp: fix missing include file
sfeldma@cumulusnetworks.com [Sat, 21 Dec 2013 02:51:10 +0000 (18:51 -0800)]
sctp: fix missing include file

Compile error reported by Jim Davis on netdev.

ip6_sk_accept_pmtu() needs net/ip6_route.h

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'b44'
David S. Miller [Sat, 21 Dec 2013 01:49:01 +0000 (20:49 -0500)]
Merge branch 'b44'

Hauke Mehrtens says:

====================
b44: add support for external PHY

This adds support for an external phy connected to the mac controlled
by b44. This is used on home routers of the BCM47xx line where this MAC
core was used and is contended to an external switch core through MII.
These patches are in OpenWrt for some time and are tested by different
users with different devices.

The publicly available Programmer's Reference Guide for some of these
chips help making this patch it would be nice to have such a
documentation for more Broadcom Chips like some SoCs.
https://www.broadcom.com/collateral/pg/440X-PG02-R.pdf
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
10 years agob44: use fixed PHY device if we do not find any
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:13 +0000 (02:16 +0100)]
b44: use fixed PHY device if we do not find any

The ADM6996L switch and some Broadcom switches with two MII interfaces
like the BCM5325F connected to two MACs on the SoC, used on some
routers do not return a valid value when reading the PHY id register
and Linux thinks there is no PHY at all, but that is wrong.
This patch registers a fixed phy in the arch code and then searches it
when there is no other phy in the Ethernet driver code.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: do not set PHY address to 30 for every ext PHY
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:12 +0000 (02:16 +0100)]
b44: do not set PHY address to 30 for every ext PHY

b44_phy_reset() will fail for an external PHY and only work with the
internal PHY, this was an old workaround when the detection of an
external switch based on the PHY address failed and it is not needed
any more.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: activate PHY when MAC is off
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:11 +0000 (02:16 +0100)]
b44: activate PHY when MAC is off

Without this patch we can not access the PHY when the MAC is switched
off. This PHY access is needed to configure the switch, which is done
through PHY registers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: add phylib support
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:10 +0000 (02:16 +0100)]
b44: add phylib support

Most of the older home routers based on the Broadcom BCM47XX SoC series
are using a MAC that is supported by b44. On most of these routers not
the internal PHY of this MAC core is used, but a switch sometimes on an
external chip or integrated into the same SoC as the Ethernet core.
For this switch a special PHY driver is needed which should not be
integrated into b44 as the same switches are also used by other
Broadcom home networking SoCs which are using different Ethernet MAC
drivers. This was tested with the b53 switch driver which is currently
on its way to mainline.

If the internal PHY is not used, b44 will now search on the MDIO bus
for a phy and use the Linux phylib subsystem to register a driver.
Support for the internal PHY must stay here, because there are some
device which are suing the internal phy.

With this patch we scan the mdio bus when the sprom or nvram says that
the PHY address is 30, if a PHY was found at this address b44 uses it.

This was tested with a BCM4704, BCM4712 and BCM5354.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: rename b44_mii_{read, write} to b44_mdio_{read, write}_mii
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:09 +0000 (02:16 +0100)]
b44: rename b44_mii_{read, write} to b44_mdio_{read, write}_mii

The next patch will add these functions for phylib, and we should
rename the old ones before. This now indicates that these functions are
used for the mdio registers and on the mii interface.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: abort when no PHY is available at all
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:08 +0000 (02:16 +0100)]
b44: abort when no PHY is available at all

When the phy address is 31, this means that there is no PHY connected
to this MAC at all, no internal and no external PHY. Reading these PHY
registers causes a system reset on some routers.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: rename B44_PHY_ADDR_NO_PHY to B44_PHY_ADDR_NO_LOCAL_PHY
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:07 +0000 (02:16 +0100)]
b44: rename B44_PHY_ADDR_NO_PHY to B44_PHY_ADDR_NO_LOCAL_PHY

The PHY address 30 means there is no local PHY, but there could be an
external PHY like a switch connected via MII. This is the case on most
embedded home routers where this driver is used.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agob44: check register instead of PHY address to detect external PHY
Hauke Mehrtens [Fri, 20 Dec 2013 01:16:06 +0000 (02:16 +0100)]
b44: check register instead of PHY address to detect external PHY

The Ethernet core supported by b44 supports an internal PHY integrated
into the mac core, which is supported by the b44 driver and an external
PHY to which the mac core is connected. This external PHY could be a
switch connected through MII, which is often the case when this core is
used on home routers. The usage of an external PHY was assumed when the
PHY address 30 was used and an internal PHY was assumed when the PHY
address was different. To verify that b44_phy_reset() was called and
checked if it worked, otherwise PHY address 30 was assumed, an external
PHY. It is better to check the register which says which PHY is
connected to the MAC instead of checking the PHY address.
The interface to an external PHY was only activated when this register
was set.

This also changes B44_FLAG_INTERNAL_PHY to B44_FLAG_EXTERNAL_PHY, it is
easier to check.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agotcp: autocork should not hold first packet in write queue
Eric Dumazet [Tue, 17 Dec 2013 17:58:30 +0000 (09:58 -0800)]
tcp: autocork should not hold first packet in write queue

Willem noticed a TCP_RR regression caused by TCP autocorking
on a Mellanox test bed. MLX4_EN_TX_COAL_TIME is 16 us, which can be
right above RTT between hosts.

We can receive a ACK for a packet still in NIC TX ring buffer or in a
softnet completion queue.

Fix this by always pushing the skb if it is at the head of write queue.

Also, as TX completion is lockless, it's safer to perform sk_wmem_alloc
test after setting TSQ_THROTTLED.

erd:~# MIB="MIN_LATENCY,MEAN_LATENCY,MAX_LATENCY,P99_LATENCY,STDDEV_LATENCY"
erd:~#  ./netperf -H remote -t TCP_RR -- -o $MIB | tail -n 1
(repeat 3 times)

Before patch :

18,1049.87,41004,39631,6295.47
17,239.52,40804,48,2912.79
18,348.40,40877,54,3573.39

After patch :

18,22.84,4606,38,16.39
17,21.56,2871,36,13.51
17,22.46,2705,37,11.83

Reported-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: f54b311142a9 ("tcp: auto corking")
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: fix regression in tc_action_ops
Eric Dumazet [Fri, 20 Dec 2013 20:32:32 +0000 (12:32 -0800)]
net_sched: fix regression in tc_action_ops

list_for_each_entry(a, &act_base, head) doesn't
exit with a = NULL if we reached the end of the list.

tcf_unregister_action(), tc_lookup_action_n() and tc_lookup_action()
need fixes.

Remove tc_lookup_action_id() as its unused and not worth 'fixing'

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 1f747c26c48b ("net_sched: convert tc_action_ops to use struct list_head")
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: fix a regression in tcf_proto_lookup_ops()
Eric Dumazet [Fri, 20 Dec 2013 18:04:18 +0000 (10:04 -0800)]
net_sched: fix a regression in tcf_proto_lookup_ops()

list_for_each_entry(t, &tcf_proto_base, head) doesn't
exit with t = NULL if we reached the end of the list.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Fixes: 3627287463b4 ("net_sched: convert tcf_proto_ops to use struct
list_head")
Cc: Cong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: fix a regression in tc actions
WANG Cong [Fri, 20 Dec 2013 08:08:51 +0000 (00:08 -0800)]
net_sched: fix a regression in tc actions

This patch fixes:
1) pass mask rather than size to tcf_hashinfo_init()
2) the cleanup should be in reversed order in mirred_cleanup_module()

Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
Fixes: 369ba56787d7469c0afd ("net_sched: init struct tcf_hashinfo at register time")
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'bridge_cleanups'
David S. Miller [Fri, 20 Dec 2013 00:27:34 +0000 (19:27 -0500)]
Merge branch 'bridge_cleanups'

Tan Xiaojun says:

====================
bridge: cleanup and fix checkpatch errors

Clean up and fix some checkpatch errors in bridge driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
10 years agobridge: change the position of '{' to the pre line
tanxiaojun [Thu, 19 Dec 2013 05:28:14 +0000 (13:28 +0800)]
bridge: change the position of '{' to the pre line

That open brace { should be on the previous line.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobridge: change "foo* bar" to "foo *bar"
tanxiaojun [Thu, 19 Dec 2013 05:28:13 +0000 (13:28 +0800)]
bridge: change "foo* bar" to "foo *bar"

"foo * bar" should be "foo *bar".

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobridge: add space before '(/{', after ',', etc.
tanxiaojun [Thu, 19 Dec 2013 05:28:12 +0000 (13:28 +0800)]
bridge: add space before '(/{', after ',', etc.

Spaces required before the open parenthesis '(', before the open
brace '{', after that ',' and around that '?/:'.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobridge: remove unnecessary parentheses
tanxiaojun [Thu, 19 Dec 2013 05:28:11 +0000 (13:28 +0800)]
bridge: remove unnecessary parentheses

Return is not a function, parentheses are not required.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobridge: remove unnecessary condition judgment
tanxiaojun [Thu, 19 Dec 2013 05:28:10 +0000 (13:28 +0800)]
bridge: remove unnecessary condition judgment

Because err is always negative, remove unnecessary condition
judgment.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobnx2x: cleanup skb_set_hash
Tom Herbert [Thu, 19 Dec 2013 16:59:08 +0000 (08:59 -0800)]
bnx2x: cleanup skb_set_hash

Save pkt_hash_types in tpa structure.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'sh_eth'
David S. Miller [Fri, 20 Dec 2013 00:10:14 +0000 (19:10 -0500)]
Merge branch 'sh_eth'

Sergei Shtylyov says:

====================
Add PHY IRQ support to the 'sh_eth' driver

   This patchset adds support for passing PHY's IRQ to the 'sh_eth' driver from
the platform code and removes now useless code that hinders the PHY IRQ handing
by philib.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosh_eth: do not reset PHY needlessly
Sergei Shtylyov [Thu, 19 Dec 2013 22:41:12 +0000 (01:41 +0300)]
sh_eth: do not reset PHY needlessly

There's no need anymore to call phy_init_hw() to reset/resume the PHY from the
driver, as the call chain in phylib already has reached it, and so reset/resumed
the PHY (even resuming it twice). This duplicate reset is not only  needless, it
e.g. clears the PHY's interrupt enables just setup by phylib and so prevents the
expected IRQs from the PHY.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosh_eth: add PHY IRQ to platform data
Sergei Shtylyov [Thu, 19 Dec 2013 22:39:52 +0000 (01:39 +0300)]
sh_eth: add PHY IRQ to platform data

Allow the platform code to pass PHY's IRQ to the driver.  Print this IRQ along
with the other PHY datails in sh_eth_phy_init().

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'mlx4'
David S. Miller [Fri, 20 Dec 2013 00:05:15 +0000 (19:05 -0500)]
Merge branch 'mlx4'

Amir Vadai says:

====================
net/mlx4: Mellanox driver update 08-12-2013

This patchset contains:
1. Support in ndo_get_phys_port_id added by Hadar.
2. Change the driver to use by default CQE/EQE size of 64 bytes done by Eyal.
   This doubles the packet-rate  of the NIC.
3. Configure the XPS queue mapping on driver load - added by Ido.
4. Fixes for some small bugs done by Jenny and Matan

Patchset was applied and tested against commit: "2372175 lib: hash: follow-up
fixups for arch hash"

Changes from V1:
- Removed Patch 10 "net/mlx4_en: Fix Supported/Advertised link mode reported by
  ethtool". This patch is needed to be rewritten from scratch and I wouldn't
  like it to block the rest of the patches in this set.
  Also, fix to Kconfig suggested by Ben will be sent in next patchset.

Changes from V0:
- Found some issues in "Reuse memory in RX flow" patch from V0.
  Removing this patch from the patchset till analyzed and fixed.
- Fix some coding style issues in patch 6 "Configure the XPS queue mapping on
  driver load"
- Changed patch 9 "Add NAPI support for transmit side" to use NAPI_POLL_WEIGHT
  instead of MLX4_EN_TX_BUDGET
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_core: Check port number for validity before accessing data
Matan Barak [Thu, 19 Dec 2013 19:20:18 +0000 (21:20 +0200)]
net/mlx4_core: Check port number for validity before accessing data

Need to validate port number at mlx4_promisc_qp() before use.
Since port number is extracted from gid, as a cooked or corrupted gid
could lead to a crash.

Signed-off-by: Matan Barak <matanb@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_en: Add NAPI support for transmit side
Eugenia Emantayev [Thu, 19 Dec 2013 19:20:17 +0000 (21:20 +0200)]
net/mlx4_en: Add NAPI support for transmit side

Add NAPI for TX side,
implement its support and provide NAPI callback.

Signed-off-by: Yevgeny Petrilin <yevgenyp@mellanox.com>
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_en: Ignore irrelevant hypervisor events
Eugenia Emantayev [Thu, 19 Dec 2013 19:20:16 +0000 (21:20 +0200)]
net/mlx4_en: Ignore irrelevant hypervisor events

MLX4_DEV_EVENT_SLAVE_INIT and MLX4_DEV_EVENT_SLAVE_SHUTDOWN
events used by Hypervisor to inform the PPF IB driver that
IB para-virtualization must be initialized/destroyed for a slave.
If this event is catched by ETH VF annoying but harmless error message
is printed into dmesg. Remove dmesg prints for these events.

Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_core: Set CQE/EQE size to 64B by default
Eyal Perry [Thu, 19 Dec 2013 19:20:15 +0000 (21:20 +0200)]
net/mlx4_core: Set CQE/EQE size to 64B by default

To achieve out of the box performance default is to use 64 byte CQE/EQE.
In tests that we conduct in our labs, we achieved a performance
improvement of twice the message rate. For older VF/libmlx4 support,
enable_64b_cqe_eqe must be set to 0 (disabled).

Signed-off-by: Eyal Perry <eyalpe@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_en: Configure the XPS queue mapping on driver load
Ido Shamay [Thu, 19 Dec 2013 19:20:14 +0000 (21:20 +0200)]
net/mlx4_en: Configure the XPS queue mapping on driver load

Only TX rings of User Piority 0 are mapped.
TX rings of other UP's are using UP 0 mapping.
XPS is not in use when num_tc is set.

Signed-off-by: Ido Shamay <idos@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_en: Implement ndo_get_phys_port_id
Hadar Hen Zion [Thu, 19 Dec 2013 19:20:13 +0000 (21:20 +0200)]
net/mlx4_en: Implement ndo_get_phys_port_id

Use the port GUID read from the firmware to identify the physical port.
This port identifier is available via ndo_get_phys_port_id for both PF
and VF net-devices.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_core: Expose physical port id as PF/VF capability
Hadar Hen Zion [Thu, 19 Dec 2013 19:20:12 +0000 (21:20 +0200)]
net/mlx4_core: Expose physical port id as PF/VF capability

Add the infrastructure needed to support ndo_get_phys_port_id which
allows users to identify to which physical port a net-device is connected
to by reading a unique port id.
This will work for VFs and PFs.
The driver uses a new device capability - phys_port_id, The PF driver
reads the port phys_port_id from Firmware and stores it. The VF driver
reads the port phys_port_id from the PF using QUERY_FUNC_CAP command.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_core: Introduce nic_info new flag in QUERY_FUNC_CAP
Hadar Hen Zion [Thu, 19 Dec 2013 19:20:11 +0000 (21:20 +0200)]
net/mlx4_core: Introduce nic_info new flag in QUERY_FUNC_CAP

Set nic_info field in QUERY_FUNC_CAP, which designates
supplementary NIC information is provided by the hypervisor.
When set, the following fields are valid: nic_num_rings,
nic_indirection_tbl_sz, cur_mac and phys_port_id.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_core: Rename QUERY_FUNC_CAP fields
Hadar Hen Zion [Thu, 19 Dec 2013 19:20:10 +0000 (21:20 +0200)]
net/mlx4_core: Rename QUERY_FUNC_CAP fields

Use correct names for QUERY_FUNC_CAP fields: flags0 and flags1.

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet/mlx4_core: Remove zeroed out of explicit QUERY_FUNC_CAP fields
Hadar Hen Zion [Thu, 19 Dec 2013 19:20:09 +0000 (21:20 +0200)]
net/mlx4_core: Remove zeroed out of explicit QUERY_FUNC_CAP fields

All mailboxes are already zeroed by commit:
571b8b9 net/mlx4_core: Initialize all mailbox buffers to zero before use
Remove explicit zero set for force mac and force vlan fields in
mlx4_QUERY_FUNC_CAP_wrapper

Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Signed-off-by: Amir Vadai <amirv@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agorps: NUMA flow limit allocations
Eric Dumazet [Wed, 18 Dec 2013 14:46:23 +0000 (06:46 -0800)]
rps: NUMA flow limit allocations

Given we allocate memory for each cpu, we can do this
using NUMA affinities, instead of using NUMA policies
of the process changing flow_limit_cpu_bitmap value.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Willem de Bruijn <willemb@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Mark functions as static in debug.c
Rashika Kheria [Thu, 19 Dec 2013 08:55:34 +0000 (14:25 +0530)]
drivers: net: Mark functions as static in debug.c

This patch marks the function il_clear_traffic_stats() in debug.c as
static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/debug.c:

drivers/net/wireless/iwlegacy/debug.c:35:1: warning: no previous prototype for â€˜il_clear_traffic_stats’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Mark functions as static in 4965-debug.c
Rashika Kheria [Thu, 19 Dec 2013 08:54:38 +0000 (14:24 +0530)]
drivers: net: Mark functions as static in 4965-debug.c

This patch marks the function il4965_ucode_rx_stats_read(),
il4965_ucode_tx_stats_read() and il4965_ucode_general_stats_read() in
4965-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/4965-debug.c:

drivers/net/wireless/iwlegacy/4965-debug.c:59:1: warning: no previous prototype for â€˜il4965_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:471:1: warning: no previous prototype for â€˜il4965_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/4965-debug.c:637:1: warning: no previous prototype for â€˜il4965_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Mark functions as static in 3945-debug.c
Rashika Kheria [Thu, 19 Dec 2013 08:53:49 +0000 (14:23 +0530)]
drivers: net: Mark functions as static in 3945-debug.c

This patch marks the function il3945_ucode_rx_stats_read(),
il3945_ucode_tx_stats_read() and il3945_ucode_general_stats_read() in
3945-debug.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
wireless/iwlegacy/3945-debug.c:

drivers/net/wireless/iwlegacy/3945-debug.c:52:1: warning: no previous prototype for â€˜il3945_ucode_rx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/3945-debug.c:317:1: warning: no previous prototype for â€˜il3945_ucode_tx_stats_read’ [-Wmissing-prototypes]
drivers/net/wireless/iwlegacy/3945-debug.c:407:1: warning: no previous prototype for â€˜il3945_ucode_general_stats_read’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Include new header file in sbni.c
Rashika Kheria [Thu, 19 Dec 2013 08:52:37 +0000 (14:22 +0530)]
drivers: net: Include new header file in sbni.c

Create a new header file include/net/Space.h which contains
prototype declaration of sbni_probe().

Include the new header file in drivers/net/Space.c and
drivers/net/wan/sbni.c because they use this function.

This eliminates the following warning in wan/sbni.c:
drivers/net/wan/sbni.c:224:12: warning: no previous prototype for â€˜sbni_probe’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Mark functions as static in stmmac_platform.c
Rashika Kheria [Thu, 19 Dec 2013 08:49:44 +0000 (14:19 +0530)]
drivers: net: Mark functions as static in stmmac_platform.c

This patch marks the function stmmac_pltfr_freeze() and
stmmac_pltfr_restore() in stmmac_platform.c as static because they are
not used outside this file.

Thus, it also removes the following warnings in
ethernet/stmicro/stmmac/stmmac_platform.c:

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:222:5: warning: no previous prototype for â€˜stmmac_pltfr_freeze’ [-Wmissing-prototypes]
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:236:5: warning: no previous prototype for â€˜stmmac_pltfr_restore’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Mark functions as static in qlcnic_83xx_hw.c
Rashika Kheria [Thu, 19 Dec 2013 08:48:11 +0000 (14:18 +0530)]
drivers: net: Mark functions as static in qlcnic_83xx_hw.c

This patch marks the function qlcnic_83xx_clear_legacy_intr_mask(),
qlcnic_83xx_set_legacy_intr_mask() and
qlcnic_83xx_enable_legacy_msix_mbx_intr() in qlcnic_83xx_hw.c as static
because they are not used outside this file.

Thus, it also removes the following warnings
in ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:

drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:318:13: warning: no previous prototype for â€˜qlcnic_83xx_clear_legacy_intr_mask’ [-Wmissing-prototypes]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:323:13: warning: no previous prototype for â€˜qlcnic_83xx_set_legacy_intr_mask’ [-Wmissing-prototypes]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c:343:13: warning: no previous prototype for â€˜qlcnic_83xx_enable_legacy_msix_mbx_intr’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agodrivers: net: Mark functions as static in qlcnic_io.c
Rashika Kheria [Thu, 19 Dec 2013 08:47:27 +0000 (14:17 +0530)]
drivers: net: Mark functions as static in qlcnic_io.c

This patch marks the function qlcnic_enable_tx_intr(),
qlcnic_83xx_enable_tx_intr() and qlcnic_83xx_disable_tx_intr() in
qlcnic_io.c as static because they are not used outside this file.

Thus, it also removes the following warnings in
ethernet/qlogic/qlcnic/qlcnic_io.c:

drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c:130:13: warning: no previous prototype for â€˜qlcnic_enable_tx_intr’ [-Wmissing-prototypes]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c:147:13: warning: no previous prototype for â€˜qlcnic_83xx_enable_tx_intr’ [-Wmissing-prototypes]
drivers/net/ethernet/qlogic/qlcnic/qlcnic_io.c:153:13: warning: no previous prototype for â€˜qlcnic_83xx_disable_tx_intr’ [-Wmissing-prototypes]

Signed-off-by: Rashika Kheria <rashika.kheria@gmail.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec...
David S. Miller [Thu, 19 Dec 2013 23:37:49 +0000 (18:37 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/klassert/ipsec-next

Steffen Klassert says:

====================
pull request (net-next): ipsec-next 2013-12-19

1) Use the user supplied policy index instead of a generated one
   if present. From Fan Du.

2) Make xfrm migration namespace aware. From Fan Du.

3) Make the xfrm state and policy locks namespace aware. From Fan Du.

4) Remove ancient sleeping when the SA is in acquire state,
   we now queue packets to the policy instead. This replaces the
   sleeping code.

5) Remove FLOWI_FLAG_CAN_SLEEP. This was used to notify xfrm about the
   posibility to sleep. The sleeping code is gone, so remove it.

6) Check user specified spi for IPComp. Thr spi for IPcomp is only
   16 bit wide, so check for a valid value. From Fan Du.

7) Export verify_userspi_info to check for valid user supplied spi ranges
   with pfkey and netlink. From Fan Du.

8) RFC3173 states that if the total size of a compressed payload and the IPComp
   header is not smaller than the size of the original payload, the IP datagram
   must be sent in the original non-compressed form. These packets are dropped
   by the inbound policy check because they are not transformed. Document the need
   to set 'level use' for IPcomp to receive such packets anyway. From Fan Du.

Please pull or let me know if there are problems.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'bonding_nl'
David S. Miller [Thu, 19 Dec 2013 23:32:47 +0000 (18:32 -0500)]
Merge branch 'bonding_nl'

Scott Feldman says:

====================
bonding: add even more netlink attributes

The following series implements five more bonding netlink attributes:

num_grat_arp|num_unsol_na
all_slaves_active
min_links
lp_interval
packets_per_slave

Tested with modified iproute2 to verify attributes can be set at bond creation
time or set later.  Verified sysfs interface to attributes continues to work.

I have one more set after this one for all of the 802.3ad attributes.  Whew.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobonding: add packets_per_slave attribute netlink support
sfeldma@cumulusnetworks.com [Wed, 18 Dec 2013 05:30:37 +0000 (21:30 -0800)]
bonding: add packets_per_slave attribute netlink support

Add IFLA_BOND_PACKETS_PER_SLAVE to allow get/set of bonding parameter
packets_per_slave via netlink.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobonding: add lp_interval attribute netlink support
sfeldma@cumulusnetworks.com [Wed, 18 Dec 2013 05:30:30 +0000 (21:30 -0800)]
bonding: add lp_interval attribute netlink support

Add IFLA_BOND_LP_INTERVAL to allow get/set of bonding parameter
lp_interval via netlink.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobonding: add min_links attribute netlink support
sfeldma@cumulusnetworks.com [Wed, 18 Dec 2013 05:30:23 +0000 (21:30 -0800)]
bonding: add min_links attribute netlink support

Add IFLA_BOND_MIN_LINKS to allow get/set of bonding parameter
min_links via netlink.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobonding: add all_slaves_active attribute netlink support
sfeldma@cumulusnetworks.com [Wed, 18 Dec 2013 05:30:16 +0000 (21:30 -0800)]
bonding: add all_slaves_active attribute netlink support

Add IFLA_BOND_ALL_SLAVES_ACTIVE to allow get/set of bonding parameter
all_slaves_active via netlink.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobonding: add num_grat_arp attribute netlink support
sfeldma@cumulusnetworks.com [Wed, 18 Dec 2013 05:30:09 +0000 (21:30 -0800)]
bonding: add num_grat_arp attribute netlink support

Add IFLA_BOND_NUM_PEER_NOTIF to allow get/set of bonding parameter
num_grat_arp via netlink.  Bonding parameter num_unsol_na is
synonymous with num_grat_arp, so add only one netlink attribute
to represent both bonding parameters.

Signed-off-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next
David S. Miller [Thu, 19 Dec 2013 20:13:14 +0000 (15:13 -0500)]
Merge branch 'for-davem' of git://gitorious.org/linux-can/linux-can-next

Marc Kleine-Budde says:

====================
this is a pull request of four patches for net-next/master.

There is one patch by Markus Pargmann, which speeds up the c_can
driver, a patch by John Whitmore which updates the in tree
documentation. A patch by Jeff Kirsher which replaces the FSF's address
by a link and a patch by Alexander Shiyan which converts the mcp251x
driver to make use of managed resources.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoxen-netback: add gso_segs calculation
Paul Durrant [Tue, 17 Dec 2013 11:44:35 +0000 (11:44 +0000)]
xen-netback: add gso_segs calculation

netback already has code which parses IPv4 and v6 headers to set up checksum
offsets and these are always applied to GSO packets being sent from
frontends. It's therefore suboptimal that GSOs are being marked
SKB_GSO_DODGY to defer the gso_segs calculation when netback already has all
necessary information to hand to do the calculation. This patch adds that
calculation.

Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosch_cbq: remove unnecessary null pointer check
Yang Yingliang [Tue, 17 Dec 2013 07:29:17 +0000 (15:29 +0800)]
sch_cbq: remove unnecessary null pointer check

It already has a NULL pointer check of rtab in qdisc_put_rtab().
Remove the check outside of qdisc_put_rtab().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoact_police: remove unnecessary null pointer check
Yang Yingliang [Tue, 17 Dec 2013 07:29:16 +0000 (15:29 +0800)]
act_police: remove unnecessary null pointer check

It already has a NULL pointer check of rtab in qdisc_put_rtab().
Remove the check outside of qdisc_put_rtab().

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agosfc: fix sparse non static symbol warning
Wei Yongjun [Tue, 17 Dec 2013 03:08:10 +0000 (11:08 +0800)]
sfc: fix sparse non static symbol warning

Fixes the following sparse warning:

drivers/net/ethernet/sfc/falcon.c:2601:6: warning:
 symbol 'falcon_pull_nic_stats' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: skbuff: improve comment on checksumming
Daniel Borkmann [Mon, 16 Dec 2013 22:27:09 +0000 (23:27 +0100)]
net: skbuff: improve comment on checksumming

It can be a bit confusing when looking for checksumming flags that
the actual comment for this resides elsewhere further below in the
header file.

Thus, bring the documentation where we define these flags, and
slightly improve the doc text to make it a bit more clear/readable.

Also, whitespace-align values of the define while at it.

Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc
Terry Lam [Sun, 15 Dec 2013 08:30:21 +0000 (00:30 -0800)]
net-qdisc-hhf: Heavy-Hitter Filter (HHF) qdisc

This patch implements the first size-based qdisc that attempts to
differentiate between small flows and heavy-hitters.  The goal is to
catch the heavy-hitters and move them to a separate queue with less
priority so that bulk traffic does not affect the latency of critical
traffic.  Currently "less priority" means less weight (2:1 in
particular) in a Weighted Deficit Round Robin (WDRR) scheduler.

In essence, this patch addresses the "delay-bloat" problem due to
bloated buffers. In some systems, large queues may be necessary for
obtaining CPU efficiency, or due to the presence of unresponsive
traffic like UDP, or just a large number of connections with each
having a small amount of outstanding traffic. In these circumstances,
HHF aims to reduce the HoL blocking for latency sensitive traffic,
while not impacting the queues built up by bulk traffic.  HHF can also
be used in conjunction with other AQM mechanisms such as CoDel.

To capture heavy-hitters, we implement the "multi-stage filter" design
in the following paper:
C. Estan and G. Varghese, "New Directions in Traffic Measurement and
Accounting", in ACM SIGCOMM, 2002.

Some configurable qdisc settings through 'tc':
- hhf_reset_timeout: period to reset counter values in the multi-stage
                     filter (default 40ms)
- hhf_admit_bytes:   threshold to classify heavy-hitters
                     (default 128KB)
- hhf_evict_timeout: threshold to evict idle heavy-hitters
                     (default 1s)
- hhf_non_hh_weight: Weighted Deficit Round Robin (WDRR) weight for
                     non-heavy-hitters (default 2)
- hh_flows_limit:    max number of heavy-hitter flow entries
                     (default 2048)

Note that the ratio between hhf_admit_bytes and hhf_reset_timeout
reflects the bandwidth of heavy-hitters that we attempt to capture
(25Mbps with the above default settings).

The false negative rate (heavy-hitter flows getting away unclassified)
is zero by the design of the multi-stage filter algorithm.
With 100 heavy-hitter flows, using four hashes and 4000 counters yields
a false positive rate (non-heavy-hitters mistakenly classified as
heavy-hitters) of less than 1e-4.

Signed-off-by: Terry Lam <vtlam@google.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years ago3c59x: Add software timestamping
Matthew Whitehead [Mon, 16 Dec 2013 15:20:26 +0000 (10:20 -0500)]
3c59x: Add software timestamping

Added software timestamping ability. Tested with linuxptp and synchronized
clocks to an average of less than 200 microseconds on 10 megabit ethernet.

Tested on both Vortex and Boomerang models.

Signed-off-by: Matthew Whitehead <tedheadster@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agolib: hash: follow-up fixups for arch hash
Francesco Fusco [Wed, 18 Dec 2013 15:05:48 +0000 (16:05 +0100)]
lib: hash: follow-up fixups for arch hash

This patch adds the include file to pull in __read_mostly on some
architectures e.g. ppc and also fixes up signatures in generic
asm.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Francesco Fusco <ffusco@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoisdn: use strlcpy() instead strcpy()
Dan Carpenter [Mon, 16 Dec 2013 13:56:23 +0000 (16:56 +0300)]
isdn: use strlcpy() instead strcpy()

I don't think the in-kernel drivers ever hit this strcpy() so this
doesn't change how the code works.  But strlcpy() is safer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agobridge: spelling fixes
tanxiaojun [Mon, 16 Dec 2013 13:32:46 +0000 (21:32 +0800)]
bridge: spelling fixes

Fix spelling errors in bridge driver.

Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv6: support IPV6_PMTU_INTERFACE on sockets
Hannes Frederic Sowa [Sun, 15 Dec 2013 02:41:14 +0000 (03:41 +0100)]
ipv6: support IPV6_PMTU_INTERFACE on sockets

IPV6_PMTU_INTERFACE is the same as IPV6_PMTU_PROBE for ipv6. Add it
nontheless for symmetry with IPv4 sockets. Also drop incoming MTU
information if this mode is enabled.

The additional bit in ipv6_pinfo just eats in the padding behind the
bitfield. There are no changes to the layout of the struct at all.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoipv4: new ip_no_pmtu_disc mode to always discard incoming frag needed msgs
Hannes Frederic Sowa [Sat, 14 Dec 2013 04:13:45 +0000 (05:13 +0100)]
ipv4: new ip_no_pmtu_disc mode to always discard incoming frag needed msgs

This new mode discards all incoming fragmentation-needed notifications
as I guess was originally intended with this knob. To not break backward
compatibility too much, I only added a special case for mode 2 in the
receiving path.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoinet: make no_pmtu_disc per namespace and kill ipv4_config
Hannes Frederic Sowa [Sat, 14 Dec 2013 04:13:38 +0000 (05:13 +0100)]
inet: make no_pmtu_disc per namespace and kill ipv4_config

The other field in ipv4_config, log_martians, was converted to a
per-interface setting, so we can just remove the whole structure.

Signed-off-by: Hannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Wed, 18 Dec 2013 21:42:06 +0000 (16:42 -0500)]
Merge git://git./linux/kernel/git/davem/net

Conflicts:
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/macvtap.c

Both minor merge hassles, simple overlapping changes.

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: vmxnet3 calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:32:08 +0000 (23:32 -0800)]
net: vmxnet3 calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sun-niu calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:32:00 +0000 (23:32 -0800)]
net: sun-niu calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sfc calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:31:50 +0000 (23:31 -0800)]
net: sfc calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: vxge calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:31:36 +0000 (23:31 -0800)]
net: vxge calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: mlx4 calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:31:23 +0000 (23:31 -0800)]
net: mlx4 calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: sky2 calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:28:13 +0000 (23:28 -0800)]
net: sky2 calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: emulex-benet calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:23:51 +0000 (23:23 -0800)]
net: emulex-benet calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: cisco-enic calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:23:42 +0000 (23:23 -0800)]
net: cisco-enic calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: cxgb4 calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:23:29 +0000 (23:23 -0800)]
net: cxgb4 calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: bnx2x calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:23:11 +0000 (23:23 -0800)]
net: bnx2x calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: bnx2 calls skb_set_hash
Tom Herbert [Wed, 18 Dec 2013 07:22:57 +0000 (23:22 -0800)]
net: bnx2 calls skb_set_hash

Drivers should call skb_set_hash to set the hash and its type
in an skbuff.

Signed-off-by: Tom Herbert <therbert@google.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 [Wed, 18 Dec 2013 19:58:41 +0000 (14:58 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

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

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

Don provides an ixgbevf patch to add DCB configuration into the queue
setup so that we won't have to allocate queues in a separate place when
enabling DCB.

Guenter Roeck provides 2 patches for ixgbe to simplify the code by
attaching hwmon sysfs attributes to hwmon device instead of PCI device.
Also fix an issues where the temperature sensor attribute index was
being started with the value 0 and not 1 as per the hwmon API.

Carolyn provides igb patches to fix queue allocation method to
accommodate changes during runtime.  This includes changing how the
driver initializes MSIx and checks for MSIx configuration to make it
easier to reconfigure the device when queue changes happen at runtime.

Neerav and Shannon fixes i40e debugfs commands that dump hex information
by using print_hex_dump().

Shannon provides several i40e fixes which include the prevention of
null pointer exception in the dump descriptor by checking that rings
were allocated before trying to reference them.  Fixed up a couple of
scanfs to accept various base numbers instead of silently requiring hex.

Anjali fixes up i40e where the incorrect defines were being used for
misc interrupts.

Alan Cox provides a fix for i40e where we assume that the resulting
buffer is zero terminated when we then re-use it.  The sscanf is limited
to 512 bytes but needs to be 511 to allow for a terminator.

Stephen Hemminger fixes i40e by making local functions static and removes
unused code (i40e_aq_add/remove_vlan() functions).
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: convert tcf_proto_ops to use struct list_head
WANG Cong [Mon, 16 Dec 2013 04:15:11 +0000 (20:15 -0800)]
net_sched: convert tcf_proto_ops to use struct list_head

We don't need to maintain our own singly linked list code.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: convert tc_action_ops to use struct list_head
WANG Cong [Mon, 16 Dec 2013 04:15:10 +0000 (20:15 -0800)]
net_sched: convert tc_action_ops to use struct list_head

We don't need to maintain our own singly linked list code.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: convert tcf_hashinfo to hlist and use spinlock
WANG Cong [Mon, 16 Dec 2013 04:15:09 +0000 (20:15 -0800)]
net_sched: convert tcf_hashinfo to hlist and use spinlock

So that we don't need to play with singly linked list,
and since the code is not on hot path, we can use spinlock
instead of rwlock.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: init struct tcf_hashinfo at register time
WANG Cong [Mon, 16 Dec 2013 04:15:08 +0000 (20:15 -0800)]
net_sched: init struct tcf_hashinfo at register time

It looks weird to store the lock out of the struct but
still points to a static variable. Just move them into the struct.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: cls: refactor out struct tcf_ext_map
WANG Cong [Mon, 16 Dec 2013 04:15:07 +0000 (20:15 -0800)]
net_sched: cls: refactor out struct tcf_ext_map

These information can be saved in tcf_exts, and this will
simplify the code.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: act: use standard struct list_head
WANG Cong [Mon, 16 Dec 2013 04:15:05 +0000 (20:15 -0800)]
net_sched: act: use standard struct list_head

Currently actions are chained by a singly linked list,
therefore it is a bit hard to add and remove a specific
entry. Convert it to struct list_head so that in the
latter patch we can remove an action without finding
its head.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet_sched: remove get_stats from tc_action_ops
WANG Cong [Mon, 16 Dec 2013 04:15:04 +0000 (20:15 -0800)]
net_sched: remove get_stats from tc_action_ops

It is not used.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David S. Miller <davem@davemloft.net>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agoigb: Change to use statically allocated array for MSIx entries
Carolyn Wyborny [Tue, 10 Dec 2013 07:58:34 +0000 (07:58 +0000)]
igb: Change to use statically allocated array for MSIx entries

This patch changes how the driver initializes MSIx and checks
for MSIx configuration.  This change makes it easier to reconfigure the
device when queue changes happen at runtime using ethtool's set_channels
feature.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoigb: Fix queue allocation method to accommodate changing during runtime
Carolyn Wyborny [Tue, 10 Dec 2013 07:58:29 +0000 (07:58 +0000)]
igb: Fix queue allocation method to accommodate changing during runtime

When changing number of queues using ethtool's set_channels during runtime,
a queue allocation could fail, which can leave the device in a down state.
In order to preserve the usability of the device in this scenario, this patch
changes the driver to allocate the  number of queues only if they have not
been allocated already. The first allocation is then done for the max number
of queues, which is the default queues for this driver.   With this change,
queue quantity changes are not subject to queue allocation failures.

Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoixgbe: Start temperature sensor attribute index with 1
Guenter Roeck [Tue, 26 Nov 2013 07:15:39 +0000 (07:15 +0000)]
ixgbe: Start temperature sensor attribute index with 1

Per hwmon ABI, temperature sensor attribute index starts with 1, not 0.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoixgbe: Convert to use devm_hwmon_device_register_with_groups
Guenter Roeck [Tue, 26 Nov 2013 07:15:28 +0000 (07:15 +0000)]
ixgbe: Convert to use devm_hwmon_device_register_with_groups

Simplify the code. Attach hwmon sysfs attributes to hwmon device
instead of pci device. Avoid race conditions caused by attributes
being created after hwmon device registration. Implicitly
(through hwmon API) add mandatory 'name' sysfs attribute.

Other cleanup:

Instead of allocating memory for hwmon attributes, move attributes
and all other hwmon related data into struct hwmon_buff and allocate
the entire structure using devm_kzalloc.

Check return value from calls to igb_add_hwmon_attr() one by one instead
of logically combining them all together.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoixgbevf: add DCB configuration into queue setup
Don Skidmore [Sat, 21 Sep 2013 01:40:49 +0000 (01:40 +0000)]
ixgbevf: add DCB configuration into queue setup

This patch takes the DCB config checks and adds them to the normal setting
up of the queues. This way we won't have to allocation queues in a separate
place for enabling DCB.

Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-By: Jack Morgan<jack.morgan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: make functions static and remove dead code
Stephen Hemminger [Fri, 13 Dec 2013 04:37:50 +0000 (04:37 +0000)]
i40e: make functions static and remove dead code

Make local functions static in the file they are used.

Remove functions i40e_aq_add_vlan and i40e_aq_remove_vlan since
they are not used anywhere by current code.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Fix off by one in i40e_dbg_command_write
Alan Cox [Thu, 12 Dec 2013 02:44:24 +0000 (02:44 +0000)]
i40e: Fix off by one in i40e_dbg_command_write

We assume that the resulting buffer is zero terminated when we then
re-use it. The sscanf is limited to 512 bytes but needs to be 511
to allow for a terminator.

One of a set of problems noted by Jackie Chang

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Shannon Nelson <Shannon.nelson@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Bump version number
Catherine Sullivan [Tue, 26 Nov 2013 10:49:33 +0000 (10:49 +0000)]
i40e: Bump version number

Version updated to 0.3.14-k

Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: Fix wrong mask bits being used in misc interrupt
Anjali Singhai Jain [Tue, 26 Nov 2013 10:49:32 +0000 (10:49 +0000)]
i40e: Fix wrong mask bits being used in misc interrupt

No functional change, but the wrong defines were being used.

Change-Id: Ica2afd2dfe18154ca0f1260a508f31e372319ba7
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: more print_hex_dump use
Shannon Nelson [Tue, 26 Nov 2013 10:49:31 +0000 (10:49 +0000)]
i40e: more print_hex_dump use

Take advantage of print_hex_dump() in another couple places to
clean up the code.

Change-Id: Ib618e75f928308c0afd0d8d74105da0c6577a024
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: fix up scanf decoders
Shannon Nelson [Tue, 26 Nov 2013 10:49:30 +0000 (10:49 +0000)]
i40e: fix up scanf decoders

Fix up a couple of scanfs to accept various base numbers instead of silently
requiring hex.

Change-Id: I1cc4dffbb1d011bf603cbf34a8db093da57fad7a
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: simplify error messages for dump descriptor
Shannon Nelson [Tue, 26 Nov 2013 10:49:29 +0000 (10:49 +0000)]
i40e: simplify error messages for dump descriptor

debugfs fixes: We don't really need to give usage messages for data errors,
only for invalid command errors.

Change-Id: If3f74ac49e43c3ced7fd388323fa738ac145e055
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoi40e: prevent null pointer exception in dump descriptor
Shannon Nelson [Tue, 26 Nov 2013 10:49:26 +0000 (10:49 +0000)]
i40e: prevent null pointer exception in dump descriptor

Check that rings were allocated before trying to reference them.

Change-Id: I33151e55ab7a7a305fecdb88ccb2709ac246b7c7
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
10 years agoMerge branch 'phy_checkpatch'
David S. Miller [Wed, 18 Dec 2013 05:49:35 +0000 (00:49 -0500)]
Merge branch 'phy_checkpatch'

Florian Fainelli says:

====================
net: phy: fix checkpatch errors

This patchset fixes trivial checkpatch errors, no functional change
introduced.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: phy: spi_ks8995: fix checkpatch errors
Florian Fainelli [Wed, 18 Dec 2013 05:38:13 +0000 (21:38 -0800)]
net: phy: spi_ks8995: fix checkpatch errors

checkpatch spotted two errors, fix them.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
10 years agonet: phy: fix checkpatch errors
Florian Fainelli [Wed, 18 Dec 2013 05:38:12 +0000 (21:38 -0800)]
net: phy: fix checkpatch errors

checkpatch spotted a few checkpatch errors such as whitespace damages
and switch/case labels not being on the same column, fix them.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>