wangweidong [Thu, 8 May 2014 12:55:01 +0000 (20:55 +0800)]
Revert "sctp: optimize the sctp_sysctl_net_register"
This revert commit efb842c45("sctp: optimize the sctp_sysctl_net_register"),
Since it doesn't kmemdup a sysctl_table for init_net, so the
init_net->sctp.sysctl_header->ctl_table_arg points to sctp_net_table
which is a static array pointer. So when doing sctp_sysctl_net_unregister,
it will free sctp_net_table, then we will get a NULL pointer dereference
like that:
Arnd Bergmann [Thu, 8 May 2014 14:46:52 +0000 (16:46 +0200)]
mdio_bus: fix devm_mdiobus_alloc_size export
commit 6d48f44b7b2 "mdio_bus: implement devm_mdiobus_alloc/devm_mdiobus_free"
introduced a new function devm_mdiobus_alloc_size() but added an export
for a different function devm_mdiobus_alloc(), which was obviously
a simple mistake that leads to build error whenever this function is
used from a loadable module:
bonding: make a generic sysfs option store and fix comments
Introduce a generic option store function for sysfs and remove the
specific ones. The attribute name is used to match against the option
which is to be set.
Also adjust the "name" of tlb_dynamic_lb option to match the sysfs
entry and fix the comments and comment style in bond_sysfs.c
The comments which showed obvious behaviour (i.e. behaviour that's seen
in the option's entry) are removed, the ones that explained important
points about the setting function have been moved above the respective
set function in bond_options.c
There's only 1 exception: num_unsol_na/num_grat_arp since it has 2 names
CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Veaceslav Falico <vfalico@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> CC: David S. Miller <davem@davemloft.net> Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 May 2014 17:13:44 +0000 (13:13 -0400)]
Merge branch 'be2net-next'
Sathya Perla says:
====================
be2net: patch set
This patch set contains the following modificatons:
* three patches (1/7 to 3/7) that fix indentation style issues
* convert the u8 vlan[] array to a bit-map to reduce memory usage
* use MCCQ instead of MBOX in be_cmd_rss_config() as the MCCQ is already
created by that time
* include rx-comp-error counter in ethtool stats
* remove the unused promiscuous setting from be_cmd_vlan_config()
Pls apply to net-next tree. Thanks!
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 9 May 2014 07:59:19 +0000 (13:29 +0530)]
be2net: use MCCQ instead of MBOX in be_cmd_rss_config()
be_cmd_rss_config() is called after the MCCQ is created; so this cmd is
now modified to use the MCCQ instead of MBOX. Also fixed some indentation
problem in this routine.
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 9 May 2014 07:59:18 +0000 (13:29 +0530)]
be2net: include rx-compl error counter in ethtool stats
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 9 May 2014 07:59:17 +0000 (13:29 +0530)]
be2net: remove unused code in be_cmd_vlan_config()
For putting interface into vlan promiscuous mode, we use be_cmd_rx_filter()
and not be_cmd_vlan_config(). So remove the "promiscuous" argument from
be_cmd_vlan_config().
Signed-off-by: Kalesh AP <kalesh.purayil@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This patch converts the vlan u8[] used to track vlan-id
membership to a bit-map as it reduces memory usage.
Signed-off-by: Ravikumar Nelavelli <ravikumar.nelavelli@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 9 May 2014 07:59:15 +0000 (13:29 +0530)]
be2net: fix line wrap and function call indentation in be_ethtool.c
When a funtion definition or a function call spans more than one
line, ensure that the first argument on the subsequent lines is
aligned to the first column after the opening paranthesis of the
function call.
Also removes unnecessary line wrap.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 9 May 2014 07:59:14 +0000 (13:29 +0530)]
be2net: fix function call indentation in be_cmds.c
When a funtion definition or a function call spans more than one
line, ensure that the first argument on the subsequent lines is
aligned to the first column after the opening paranthesis of the
function call.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 9 May 2014 07:59:13 +0000 (13:29 +0530)]
be2net: fix line wrap and function call indentation in be_main.c
When a funtion definition or a function call spans more than one
line, ensure that the first argument on the subsequent lines is
aligned to the first column after the opening paranthesis of the
function call.
Also remove unnecessary line wrap.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 May 2014 17:10:12 +0000 (13:10 -0400)]
Merge branch 'qlcnic-next'
Rajesh Borundia says:
====================
qlcnic: SR-IOV and FW-dump enhancements
This patch series contain following enhancements.
* SR-IOV enhancements:
- Allow SR-IOV VF's to probe in hypervisor. SR-IOV VF can be
uplinked to bridge/macvtap device with this change.
- Commands from VF are processed in process context
as it may sleep during PF-VF communication. Earlier
we use to process qlcnic_sriov_vf_set_multi function in
process context but now we process individual commands.
- As SR-IOV VF's can be uplinked to bridge/macvtap device
support mac-learning to allow communication through
embedded switch.
* FW-dump enhancement:
- Support to collect RDMEM section of firmware dump using
PEX DMA method for 82xx series adapter.
* Changes in v2:
- Removed unnecessary cast from void pointer to something
else and verified this issue in entire patch series as
per David Miller's suggestion.
Please apply this series to net-next.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Shahed Shaikh [Fri, 9 May 2014 06:51:32 +0000 (02:51 -0400)]
qlcnic: Collect firmware dump using DMA on 82xx adapters
o Add support to collect RDMEM section of firmware dump
using PEX DMA method.
o This patch uses most of the code used for PEX DMA support
on 83xx series adapters and some refactoring.
Signed-off-by: Shahed Shaikh <shahed.shaikh@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Rajesh Borundia [Fri, 9 May 2014 06:51:31 +0000 (02:51 -0400)]
qlcnic: Add mac learning support to SR-IOV VF.
o SR-IOV VF can be uplinked to bridge/macvtap device.
Enable mac learning to support communication through
embedded switch.
o Learn vlan filters based on QLCNIC_VLAN_FILTERING flag.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Rajesh Borundia [Fri, 9 May 2014 06:51:30 +0000 (02:51 -0400)]
qlcnic: Add support to process commands in atomic context
o Commands from VF may sleep during PF-VF communication.
Earlier we use to process qlcnic_sriov_vf_set_multi
function in process context. Now individual commands
that are called in atomic context are processed in
process context without waiting for completion of
command.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Rajesh Borundia [Fri, 9 May 2014 06:51:29 +0000 (02:51 -0400)]
qlcnic: Allow SR-IOV VF probe in hypervisor.
o Add support for SR-IOV VF probe in hypervisor to enable
assignment of VFs within hypervisor.
o SR-IOV VF can be uplinked to bridge/macvtap device with this change.
o Refactor SR-IOV enable/disable code. We cannot take rtnl lock
while enabling/disabling SR-IOV as VF probe will take an rtnl
lock.
o Disable spoofchk by default.
Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
We currently have two problems with the node flags field:
- The naming of the individual action flags is unclear and confusing
- The flags are often not cleared individually, making it hard to follow
where this happens.
So the series aims to solve above two problems.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Thu, 8 May 2014 00:54:40 +0000 (08:54 +0800)]
tipc: don't directly overwrite node action_flags
Each node action flag should be set or cleared separately, instead
we now set the whole flags variable in one shot, and it's turned
out to be hard to see which other flags are affected. Therefore,
for instance, we explicitly clear TIPC_WAIT_OWN_LINKS_DOWN bit in
node_lost_contact().
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 9 May 2014 03:48:01 +0000 (23:48 -0400)]
Merge branch 'inet_csums_part2'
Tom Herbert says:
====================
net: Checksum offload changes - Part II
I am working on overhauling RX checksum offload. Goals of this effort
are:
- Specify what exactly it means when driver returns CHECKSUM_UNNECESSARY
- Preserve CHECKSUM_COMPLETE through encapsulation layers
- Don't do skb_checksum more than once per packet
- Unify GRO and non-GRO csum verification as much as possible
- Unify the checksum functions (checksum_init)
- Simply code
What is in this second patch set:
- Call common inet checksum validation functions in ICMP{4,6},
GRE{4,6}, and IGMP.
- In UDP, verify checksum before handing off to encap_rcv.
- Remove custom UDP checksum validation code in L2TP.
Please review carefully and test if possible, mucking with basic
checksum functions is always a little precarious :-)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Wed, 7 May 2014 23:52:48 +0000 (16:52 -0700)]
l2tp: Remove UDP checksum verification
Validating the UDP checksum is now done in UDP before handing
packets to the encapsulation layer. Note that this also eliminates
the "feature" where L2TP can ignore a non-zero UDP checksum (doing
this was contrary to RFC 1122).
Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Joe Perches [Wed, 7 May 2014 19:52:57 +0000 (12:52 -0700)]
mellanox: Logging message cleanups
Use a more current logging style.
o Coalesce formats
o Add missing spaces for coalesced formats
o Align arguments for modified formats
o Add missing newlines for some logging messages
o Use DRV_NAME as part of format instead of %s, DRV_NAME to
reduce overall text.
o Use ..., ##__VA_ARGS__ instead of args... in macros
o Correct a few format typos
o Use a single line message where appropriate
Signed-off-by: Joe Perches <joe@perches.com> Acked-By: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
dingtianhong [Wed, 7 May 2014 14:10:21 +0000 (22:10 +0800)]
bonding: remove the unused macro
Cc: Jay Vosburgh <j.vosburgh@gmail.com> Cc: Veaceslav Falico <vfalico@gmail.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
dingtianhong [Wed, 7 May 2014 14:10:20 +0000 (22:10 +0800)]
bonding: simplify the slave_do_arp_validate_only()
The argument slave is not used for slave_do_arp_validate_only(), so no need
to keep it, make the function more simple.
Cc: Jay Vosburgh <j.vosburgh@gmail.com> Cc: Veaceslav Falico <vfalico@gmail.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
dingtianhong [Wed, 7 May 2014 14:10:19 +0000 (22:10 +0800)]
bonding: remove the unnecessary struct bond_net
Move the structure bond_net forward, and remove the unnecessary structure declaration.
Cc: Jay Vosburgh <j.vosburgh@gmail.com> Cc: Veaceslav Falico <vfalico@gmail.com> Cc: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Harish Patil [Wed, 7 May 2014 06:06:15 +0000 (02:06 -0400)]
qlcnic: Fix Kconfig dependency on HWMON
Commit 1f0f467b670e "qlcnic: Add hwmon interface to export board
temperature" introduced a randconfig build error in the case
when the hwmon framework is built as a module and the qlcnic
driver itself is built-in:
drivers/built-in.o: In function `qlcnic_register_hwmon_dev':
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c:1301:
undefined reference to `hwmon_device_register_with_groups'
drivers/built-in.o: In function `qlcnic_unregister_hwmon_dev':
drivers/net/ethernet/qlogic/qlcnic/qlcnic_sysfs.c:1309:
undefined reference to `hwmon_device_unregister'.
This changes the Kconfig logic to enforce that the qlcnic hwmon
support can only be enabled if it is possible to successfully
build it.
Signed-off-by: Harish Patil <harish.patil@qlogic.com> Reported-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Wed, 7 May 2014 20:51:22 +0000 (16:51 -0400)]
Merge branch 'micrel_ksz9031'
Hubert Chaumette says:
====================
net/phy: micrel: Add DT configuration support and documentation for KSZ9031
- Adds DT configuration support for ksz9031
- Renames micrel-ksz9021.txt to micrel-ksz90x1.txt and adds ksz9031 binding
documentation
Changes since v3:
- Rebased on net-next
Changes since v2:
- Merged together ksz9031_load_{clk,data,ctrl}_skew_values()
- Added field length and number of fields prameter to account for registers
specificities
- Added binding documentation
Changes since v1:
- Removed ksz9021 and ksz9031 fixup deletions from arch/arm/mach-imx/mach-imx6q.c
Hubert Chaumette (2):
Update Micrel KSZ90x1 binding documentation
ARM: i.MX6: Add OF configuration support for ksz9031
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
ARM: i.MX6: Add OF configuration support for ksz9031
Adds support for ksz9031 PAD skew configuration over devicetree.
Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Renames micrel-ksz9021.txt to micrel-ksz90x1.txt and adds documentation for
the KSZ9031 binding from patch 1. Also adds step increment information, and
note about phy fixups.
Signed-off-by: Hubert Chaumette <hchaumette@adeneo-embedded.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
WANG Cong [Mon, 5 May 2014 22:55:55 +0000 (15:55 -0700)]
net: clean up snmp stats code
commit 8f0ea0fe3a036a47767f9c80e (snmp: reduce percpu needs by 50%)
reduced snmp array size to 1, so technically it doesn't have to be
an array any more. What's more, after the following commit:
We simply say that regular this_cpu use must be safe regardless of
preemption and interrupt state. That has no material change for x86
and s390 implementations of this_cpu operations. However, arches that
do not provide their own implementation for this_cpu operations will
now get code generated that disables interrupts instead of preemption.
probably no arch wants to have SNMP_ARRAY_SZ == 2. At least after
almost 3 years, no one complains.
So, just convert the array to a single pointer and remove snmp_mib_init()
and snmp_mib_free() as well.
Cc: Christoph Lameter <cl@linux.com> 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: David S. Miller <davem@davemloft.net>
Paul Bolle [Sun, 4 May 2014 11:03:12 +0000 (13:03 +0200)]
w83977af_ir: remove two faux Kconfig macros
Ever since v2.3.5 the driver for "Winbond W83977AF (IR)" contains two
unneeded preprocessor macros.
CONFIG_NETWINDER_TX_DMA_PROBLEMS is never defined and can safely be
removed. And CONFIG_NETWINDER_RX_DMA_PROBLEMS is just an alias for
CONFIG_ARCH_NETWINDER, so that (valid) Kconfig macro can be used
instead.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Mon, 5 May 2014 23:43:58 +0000 (16:43 -0700)]
ipv6: Need to sock_put on csum error
Commit 4068579e1e098fa81d48db9ba4432ab664c58561 ("net: Implmement
RFC 6936 (zero RX csums for UDP/IPv6)") introduced zero checksums
being allowed for IPv6, but in the case that a socket disallows a
zero checksum on RX we need to sock_put.
Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 5 May 2014 21:26:54 +0000 (17:26 -0400)]
Merge branch 'tipc-next'
Ying Xue says:
====================
tipc: purge signal handler infrastructure
When we delay some actions to be executed in asynchronous contexts,
these usually add unnecessary code complexities, and make their
behaviours unpredictable and indeterministic. Moreover, as the signal
handler infrastructure is first stopped when tipc module is removed,
this may cause some potential risks for us. For instance, although
signal handler is already stopped, some tipc components still submit
signal requests to signal handler infrastructure, which may lead to
some resources not to be released or freed correctly.
So the series aims to convert all actions being performed in tasklet
context asynchronously with interface provided by signal handler
infrastructure to be executed synchronously, thereby deleting the
whole infrastructure of signal handler.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:18 +0000 (08:56 +0800)]
tipc: purge signal handler infrastructure
In the previous commits of this series, we removed all asynchronous
actions which were based on the tasklet handler - "tipc_k_signal()".
So the moment has now come when we can completely remove the tasklet
handler infrastructure. That is done with this commit.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:17 +0000 (08:56 +0800)]
tipc: avoid to asynchronously reset all links
Postpone the actions of resetting all links until after bclink
lock is released, avoiding to asynchronously reset all links.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:16 +0000 (08:56 +0800)]
tipc: convert allocations of global variables associated with bclink
Convert allocations of global variables associated with bclink from
static way to dynamical way for the convenience of bclink instance
initialisation. Meanwhile, this also helps TIPC support name space
in the future easily.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:15 +0000 (08:56 +0800)]
tipc: define new functions to operate bc_lock
As we are going to do more jobs when bc_lock is released, the two
operations of holding/releasing the lock should be encapsulated with
functions. In addition, we move bc_lock spin lock into tipc_bclink
structure avoiding to define the global variable.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:14 +0000 (08:56 +0800)]
tipc: avoid to asynchronously deliver name tables to peer node
Postpone the actions of delivering name tables until after node
lock is released, avoiding to do it under asynchronous context.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:13 +0000 (08:56 +0800)]
tipc: remove TIPC_NAMES_GONE node flag
Since previously what all publications pertaining to the lost node
were removed from name table was finished in tasklet context
asynchronously, we need to TIPC_NAMES_GONE flag indicating whether
the node cleanup work is finished or not. But now as the cleanup work
has been finished when node lock is released, the flag becomes
meaningless for us.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:12 +0000 (08:56 +0800)]
tipc: avoid to asynchronously notify subscriptions
Postpone the actions of notifying subscriptions until after node lock
is released, avoiding to asynchronously execute registered handlers
when node is lost.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:11 +0000 (08:56 +0800)]
tipc: rename setup_blocked variable of node struct to flags
Rename setup_blocked variable of node struct to a more common
name called "flags", which will be used to represent kinds of
node states.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:10 +0000 (08:56 +0800)]
tipc: adjust order of variables in tipc_node structure
Move more frequently used variables up to the head of tipc_node
structure, hopefully improving a bit performance.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ying Xue [Mon, 5 May 2014 00:56:09 +0000 (08:56 +0800)]
tipc: always use tipc_node_lock() to hold node lock
Although we obtain node lock with tipc_node_lock() in most time, there
are still places where we directly use native spin lock interface
to grab node lock. But as we will do more jobs in the future when node
lock is released, we should ensure that tipc_node_lock() is always
called when node lock is taken.
Signed-off-by: Ying Xue <ying.xue@windriver.com> Reviewed-by: Erik Hugne <erik.hugne@ericsson.com> Reviewed-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Alexey Charkov [Sat, 3 May 2014 12:40:53 +0000 (16:40 +0400)]
net: via-rhine: Convert #ifdef USE_MMIO to a runtime flag
This introduces another flag in 'quirks' to replace the preprocessor
define (USE_MMIO) used to indicate whether the device needs a
separate enable routine to operate in MMIO mode.
All of the currently known platform Rhine cores operate in MMIO
mode by default, and on PCI it is preferred over PIO for performance
reasons. However, a comment in code suggests that some (?) early
Rhine cores only work in PIO mode, so they should not be switched
to MMIO.
Enabling MMIO on PCI is still triggered by the same Kconfig option
to avoid breaking user configs needlessly, but this can be changed
going forward towards automatic runtime detection in case a list of
PIO-only Rhine revisions can be compiled.
This also fixes a couple of compiler warnings detected by Fengguang
Wu's test bot (!USE_MMIO case):
drivers/net/ethernet/via/via-rhine.c: In function 'rhine_init_one_pci':
drivers/net/ethernet/via/via-rhine.c:1108:1: warning: label 'err_out_unmap' defined but not used [-Wunused-label]
err_out_unmap:
^
drivers/net/ethernet/via/via-rhine.c:1022:6: warning: unused variable 'i' [-Wunused-variable]
int i, rc;
^
drivers/net/ethernet/via/via-rhine.c:916:22: warning: 'quirks' may be used uninitialized in this function [-Wmaybe-uninitialized]
phy_id = rp->quirks & rqIntPHY ? 1 : 0;
^
drivers/net/ethernet/via/via-rhine.c:1026:6: note: 'quirks' was declared here
u32 quirks;
^
Signed-off-by: Alexey Charkov <alchark@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
WANG Cong [Sat, 3 May 2014 00:21:01 +0000 (17:21 -0700)]
ipv6: remove unused function ipv6_inherit_linklocal()
It is no longer used after commit e837735ec406a347756e
(ip6_tunnel: ensure to always have a link local address).
Cc: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com> Acked-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
I am working on overhauling RX checksum offload. Goals of this effort
are:
- Specify what exactly it means when driver returns CHECKSUM_UNNECESSARY
- Preserve CHECKSUM_COMPLETE through encapsulation layers
- Don't do skb_checksum more than once per packet
- Unify GRO and non-GRO csum verification as much as possible
- Unify the checksum functions (checksum_init)
- Simply code
What is in this first patch set:
- Create a common "checksum_init" function which is called from
TCPv{4,6} and UDPv{4,6}
- Add some for RFC6936, UDP/IPv6 zero checksums
- Add architecture support for csum_add and provide implementations
for x86_64 and Sparc 32 and 64 bit (please test the latter)
Please review carefully and test if possible, mucking with basic
checksum functions is always a little precarious :-)
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Fri, 2 May 2014 23:29:58 +0000 (16:29 -0700)]
net: Implmement RFC 6936 (zero RX csums for UDP/IPv6)
RFC 6936 relaxes the requirement of RFC 2460 that UDP/IPv6 packets which
are received with a zero UDP checksum value must be dropped. RFC 6936
allows zero checksums to support tunnels over UDP.
When sk_no_check is set we allow on a socket we allow a zero IPv6
UDP checksum. This is for both sending zero checksum and accepting
a zero checksum on receive.
Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Fri, 2 May 2014 23:29:18 +0000 (16:29 -0700)]
net: Generalize checksum_init functions
Create a general __skb_checksum_validate function (actually a
macro) to subsume the various checksum_init functions. This
function can either init the checksum, or do the full validation
(logically checksum_init+skb_check_complete)-- a flag specifies
if full vaidation is performed. Also, there is a flag to the function
to indicate that zero checksums are allowed (to support optional
UDP checksums).
Added several stub functions for calling __skb_checksum_validate.
Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Tom Herbert [Fri, 2 May 2014 23:28:03 +0000 (16:28 -0700)]
net: Allow csum_add to be provided in arch
csum_add is really nothing more then add-with-carry which
can be implemented efficiently in some architectures.
Allow architecture to define this protected by HAVE_ARCH_CSUM_ADD.
Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Please pull this batch of updates intended for the 3.16 stream...
For the mac80211 bits, Johannes says:
"In this round we have a large number of small features and
improvements from people too numerous to list here. The only really
bit thing is Michał and Luca's CSA work (including changing how
interface combination verification is done)."
For the Bluetooth bits, Gustavo says:
"Here goes some patches for the -next release. There is nothing
really special for this pull request, just a bunch of refactors,
fixes and clean ups."
For the ath10k/ath6kl bits, Kalle says:
"For ath6kl Kalle fixed a bunch of checkpatch warnings.
In ath10k we had more changes, major ones being:
* fix memory allocation failures after a firmware crash (Michal)
* some rework of DFS configuration to enable it correctly in all cases
(Michal)
* add a new firmware crash option to make it possible to crash 10.1
firmware for testing purposes (Marek P)
* fix RTS/CTS protection in certain cases (Marek K)
* fix wrong RSSI and rate reporting in some cases (Janusz)
* fix firmware stats reporting (Chun, Ben & Bartosz)"
For the iwlwifi bits, Emmanuel says:
"I have here a bunch of unrelated things. I disabled support for
-7.ucode which means that I can removed a lot of code. Eliad has
a brand new feature: we reduce the Tx power when the link allows -
this reduces our power consumption. The regular changes in power and
scan area. One interesting thing though is the patches from Johannes,
we have now GRO which allows to increase our throughput in TCP Rx. The
main advantage is that it reduces the number of TCP Acks - these TCP
Acks are completely useless when we are using A-MPDU since the first
packet of the A-MPDU generates a TCP Ack which is made obsolete by
the next packets."
Along with that, there are a variety of updates to b43, mwifiex,
rtl8180 and wil6210 drivers and a handful of other updates here
and there.
Please let me know if there are problems!
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 5 May 2014 17:19:00 +0000 (13:19 -0400)]
Merge branch 'am437x'
George Cherian says:
====================
The series adds CPTS support for AM4372.
Patch 1 - DT changes w.r.t clock changes for AM33xx.
Patch 2 - CPTS clock name harcoding in the driver is removed.
Easier to pass the clock name from dt rather than hardcoding in driver.
Also in prepration for DRA7x CPTS support.
Patch 3 - Enable the CPTS support for both DRA7x and AM4372 in the driver.
Patch 4 - Enable the Annexe F for L2 PTP for AM437x and DRA7x.
Patch 5 - Change the default clocksource to dpll_core_m5
Patch 6 - DT changes for AM4372.
v1 -> v2
Patch 1 and 2 Re-ordering.
Seperate TS_BITS define for Hw version V2 and V3
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Roopa Prabhu [Thu, 1 May 2014 18:40:30 +0000 (11:40 -0700)]
unregister_netdevice : move RTM_DELLINK to until after ndo_uninit
This patch fixes ordering of rtnl notifications during unregister_netdevice
by moving RTM_DELLINK notification to until after ndo_uninit.
The problem was seen with unregistering bond netdevices.
bond ndo_uninit callback generates a few RTM_NEWLINK notifications for
NETDEV_CHANGEADDR and NETDEV_FEAT_CHANGE. This is seen mostly when the
bond is deleted with slaves still enslaved to the bond.
During unregister netdevice (rollback_registered_many to be specific)
bond ndo_uninit is called after RTM_DELLINK notification goes out.
This results in userspace seeing RTM_DELLINK followed by a couple of
RTM_NEWLINK's.
In userspace problem was seen with libnl. libnl cache deletes the bond
when it sees RTM_DELLINK and re-adds the bond with the following
RTM_NEWLINK. Resulting in a stale bond entry in libnl cache when the kernel
has already deleted the bond.
This patch has been tested for bond, bridges and vlan devices.
Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sun, 4 May 2014 23:46:59 +0000 (19:46 -0400)]
Merge branch 'filter-cleanups'
Daniel Borkmann says:
====================
BPF cleanups
v3->v4:
- Sorry, noticed and fixed a typo in patch 3, rest as is
v2->v3:
- Included Dave's feedback for unsigned long type in patch 3
- Patch 1 and patch 2 unchanged since v1, dropped other
two for now
v1->v2:
- Only changed patch 5 as to suggestion from Alexei
- Rest is the same
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Thu, 1 May 2014 16:34:20 +0000 (18:34 +0200)]
net: filter: misc/various cleanups
This contains only some minor misc cleanpus. We can spare us the
extra variable declaration in __skb_get_pay_offset(), the cast in
__get_random_u32() is rather unnecessary and in __sk_migrate_realloc()
we can remove the memcpy() and do a direct assignment of the structs.
Latter was suggested by Fengguang Wu found with coccinelle. Also,
remaining pointer casts of long should be unsigned long instead.
Suggested-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Thu, 1 May 2014 16:34:19 +0000 (18:34 +0200)]
net: filter: make register naming more comprehensible
The current code is a bit hard to parse on which registers can be used,
how they are mapped and all play together. It makes much more sense to
define this a bit more clearly so that the code is a bit more intuitive.
This patch cleans this up, and makes naming a bit more consistent among
the code. This also allows for moving some of the defines into the header
file. Clearing of A and X registers in __sk_run_filter() do not get a
particular register name assigned as they have not an 'official' function,
but rather just result from the concrete initial mapping of old BPF
programs. Since for BPF helper functions for BPF_CALL we already use
small letters, so be consistent here as well. No functional changes.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Thu, 1 May 2014 16:34:18 +0000 (18:34 +0200)]
net: filter: simplify label names from jump-table
This patch simplifies label naming for the BPF jump-table.
When we define labels via DL(), we just concatenate/textify
the combination of instruction opcode which consists of the
class, subclass, word size, target register and so on. Each
time we leave BPF_ prefix intact, so that e.g. the preprocessor
generates a label BPF_ALU_BPF_ADD_BPF_X for DL(BPF_ALU, BPF_ADD,
BPF_X) whereas a label name of ALU_ADD_X is much more easy
to grasp. Pure cleanup only.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
net: filter: doc: expand and improve BPF documentation
In particular, this patch tries to clarify internal BPF calling
convention and adds internal BPF examples, JIT guide, use cases.
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Sat, 3 May 2014 04:18:05 +0000 (21:18 -0700)]
tcp: remove in_flight parameter from cong_avoid() methods
Commit e114a710aa505 ("tcp: fix cwnd limited checking to improve
congestion control") obsoleted in_flight parameter from
tcp_is_cwnd_limited() and its callers.
This patch does the removal as promised.
Signed-off-by: Eric Dumazet <edumazet@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Eric Dumazet [Wed, 30 Apr 2014 18:58:13 +0000 (11:58 -0700)]
tcp: fix cwnd limited checking to improve congestion control
Yuchung discovered tcp_is_cwnd_limited() was returning false in
slow start phase even if the application filled the socket write queue.
All congestion modules take into account tcp_is_cwnd_limited()
before increasing cwnd, so this behavior limits slow start from
probing the bandwidth at full speed.
The problem is that even if write queue is full (aka we are _not_
application limited), cwnd can be under utilized if TSO should auto
defer or TCP Small queues decided to hold packets.
So the in_flight can be kept to smaller value, and we can get to the
point tcp_is_cwnd_limited() returns false.
With TCP Small Queues and FQ/pacing, this issue is more visible.
We fix this by having tcp_cwnd_validate(), which is supposed to track
such things, take into account unsent_segs, the number of segs that we
are not sending at the moment due to TSO or TSQ, but intend to send
real soon. Then when we are cwnd-limited, remember this fact while we
are processing the window of ACKs that comes back.
For example, suppose we have a brand new connection with cwnd=10; we
are in slow start, and we send a flight of 9 packets. By the time we
have received ACKs for all 9 packets we want our cwnd to be 18.
We implement this by setting tp->lsnd_pending to 9, and
considering ourselves to be cwnd-limited while cwnd is less than
twice tp->lsnd_pending (2*9 -> 18).
This makes tcp_is_cwnd_limited() more understandable, by removing
the GSO/TSO kludge, that tried to work around the issue.
Note the in_flight parameter can be removed in a followup cleanup
patch.
Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This switches a few remaining capable(CAP_NET_ADMIN) to ns_capable so
that root in a user namespace may set tc rules inside that namespace.
Signed-off-by: Stéphane Graber <stgraber@ubuntu.com> Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com> Cc: "Eric W. Biederman" <ebiederm@xmission.com> Cc: Jamal Hadi Salim <jhs@mojatatu.com> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Fri, 2 May 2014 20:17:18 +0000 (16:17 -0400)]
Merge branch 'davinci_mdio'
Grygorii Strashko says:
====================
introduce devm_mdiobus_alloc/free and clean up davinci mdio
Introduce a resource managed devm_mdiobus_alloc[_size]()/devm_mdiobus_free()
to automatically clean up MDIO bus alocations made by MDIO drivers,
thus leading to simplified MDIO drivers code.
Clean up Davinci MDIO driver and use new devm API.
Changes in v3:
- added devm_mdiobus_alloc_size() and
devm_mdiobus_alloc() converted to be just a simple wrapper now.
Changes in v2:
- minor comments taken into account
- additional patches added for cleaning up Davinci MDIO driver
====================
Acked-by: Santosh Shilimkar<santosh.shilimkar@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Simplify IO memory mapping by using devm_ioremap_resource()
which will do all errors handling and reporting for us.
Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
net: davinci_mdio: drop pinctrl_pm_select_default_state from probe
The "default" pinctrl state is set by Drivers core now before
calling the driver's probe.
Hence, it's safe to drop pinctrl_pm_select_default_state() call
from Davinci mdio driver probe.
Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Linus Walleij <linus.walleij@linaro.org> Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Add a resource managed devm_mdiobus_alloc[_size]()/devm_mdiobus_free()
to automatically clean up MDIO bus alocations made by MDIO drivers,
thus leading to simplified MDIO drivers code.
Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
net: via-rhine: Drop revision property, use quirks instead
This adds two new flags to quirks and thus removes the need to carry
revision in rhine_private. As a result, the init logic is simplified
a bit.
This also fixes a compiler warning in OF code on 64bit due to pointer
casting:
drivers/net/ethernet/via/via-rhine.c: In function ‘rhine_init_one_platform’:
drivers/net/ethernet/via/via-rhine.c:1132:13: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
revision = (u32)match->data;
^
KY Srinivasan [Wed, 30 Apr 2014 17:14:31 +0000 (10:14 -0700)]
hyperv: Enable sendbuf mechanism on the send path
We send packets using a copy-free mechanism (this is the Guest to Host transport
via VMBUS). While this is obviously optimal for large packets,
it may not be optimal for small packets. Hyper-V host supports
a second mechanism for sending packets that is "copy based". We implement that
mechanism in this patch.
In this version of the patch I have addressed a comment from David Miller.
With this patch (and all of the other offload and VRSS patches), we are now able
to almost saturate a 10G interface between Linux VMs on Hyper-V
on different hosts - close to 9 Gbps as measured via iperf.
Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
mii_irq[] array is never initialized anywhere in the driver, thus mii_irq[]
will always equate to zero. So, for the case where the PHY does not have an
irq, we should use PHY_POLL for that situation.
Signed-off-by: Dinh Nguyen <dinguyen@altera.com> Tested-by: Vince Bridgers <vbridger@altera.com> Signed-off-by: David S. Miller <davem@davemloft.net>
virtio-net: Set needed_headroom for virtio-net when VIRTIO_F_ANY_LAYOUT is true
This is a small supplement for commit e7428e95a06fb516fac1308bd0e176e27c0b9287
("virtio-net: put virtio-net header inline with data"). TCP packages have
enough room to put virtio-net header in, but UDP packages do not. By
setting dev->needed_headroom for virtio-net device, UDP packages could have
enough room.
For UDP packages, sk_buff is alloced in fun __ip_append_data. The size is
"alloclen + hh_len + 15", and "hh_len = LL_RESERVED_SPACE(rt-dst.dev);".
The Macro is defined as follows:
#define LL_RESERVED_SPACE(dev) \
((((dev)->hard_header_len+(dev)->needed_headroom)\
&~(HH_DATA_MOD - 1)) + HH_DATA_MOD)
By default, for UDP packages, after skb is allocated, only 16 bytes
reserved. And 2 bytes remained after mac header is set. That is not enough
to put virtio-net header in. If we set dev->needed_headroom to 12 or 10
(according to mergeable_rx_bufs is on or off ), more room can be reserved.
Then there is enough room for UDP packages to put the header in.
Signed-off-by: Zhang Jie <zhangjie14@huawei.com> Acked-by: Rusty Russell <rusty@rustcorp.com.au> Acked-by: Jason Wang <jasowang@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Commit 1bb8dce57f4d15233688c68990852a10eb1cd79f ("tipc: fix memory
leak during module removal") introduced a memory leak issue: when
name table is stopped, it's forgotten that publication instances are
freed properly. Additionally the useless "continue" statement in
tipc_nametbl_stop() is removed as well.
Reported-by: Jason <huzhijiang@gmail.com> Signed-off-by: Ying Xue <ying.xue@windriver.com> Acked-by: Erik Hugne <erik.hugne@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
DSA drivers have a trick which consists in allocating "priv_size" more
bytes to account for the DSA driver private context. Add a helper
function to access that private context instead of open-coding it in
drivers with (void *)(ds + 1).
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>