Daniel Borkmann [Thu, 29 May 2014 08:22:48 +0000 (10:22 +0200)]
net: filter: add slot overlapping test with fully filled M[]
Also add a test for the scratch memory store that first fills
all slots and then sucessively reads all of them back adding
up to A, and eventually returning A. This and the previous
M[] test with alternating fill/spill will detect possible JIT
errors on M[].
Suggested-by: Alexei Starovoitov <ast@plumgrid.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>
wangweidong [Thu, 29 May 2014 02:15:30 +0000 (10:15 +0800)]
bridge: fix the unbalanced promiscuous count when add_if failed
As commit 2796d0c648c94 ("bridge: Automatically manage port
promiscuous mode."), make the add_if use dev_set_allmulti
instead of dev_set_promiscuous, so when add_if failed, we
should do dev_set_allmulti(dev, -1).
Signed-off-by: Wang Weidong <wangweidong1@huawei.com> Reviewed-by: Amos Kong <akong@redhat.com> Acked-by: Vlad Yasevich <vyasevic@redhat.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Boyd [Wed, 28 May 2014 20:11:12 +0000 (13:11 -0700)]
net: ks8851: Don't use regulator_get_optional()
We shouldn't be using regulator_get_optional() here. These
regulators are always present as part of the physical design and
there isn't any way to use an internal regulator or change the
source of the reference voltage via software. Given that the only
users of this driver in the kernel are DT based, this change
should be transparent to them even if they don't specify any
supplies because the regulator framework will insert dummy
supplies as needed.
Cc: Nishanth Menon <nm@ti.com> Cc: Mark Brown <broonie@kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Reviewed-by: Mark Brown <broonie@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Mon, 2 Jun 2014 02:17:18 +0000 (19:17 -0700)]
Merge branch 'mlx4-next'
Amir Vadai says:
====================
cpumask,net: Affinity hint helper function
This patchset will set affinity hint to influence IRQs to be allocated on the
same NUMA node as the one where the card resides. As discussed in
http://www.spinics.net/lists/netdev/msg271497.html
If the number of IRQs allocated is greater than the number of local NUMA cores, all
local cores will be used first, and the rest of the IRQs will be on a remote
NUMA node.
If no NUMA support - IRQ's and cores will be mapped 1:1
Since the utility function to calculate the mapping could be useful in other mq
drivers in the kernel, it was added to cpumask.[ch]
This patchset was tested and applied on top of net-next since the first
consumer is a network device (mlx4_en). Over commit 506724c: "tg3: Override
clock, link aware and link idle mode during NVRAM dump"
I couldn't find a maintainer for cpumask.c, so only added the kernel mailing
list
Amir
Changes from V5:
- Moved the utility function from kernel/irq/manage.c to lib/cpumask.c, and
renamed it's name accordingly to cpumask_set_cpu_local_first()
- Added some comments as Thomas Gleixner suggested
- Changed -EINVAL to -EAGAIN, that describes the error situtation better.
Changes from V4:
- Patch 1/2: irq: Utility function to get affinity_hint by policy
Thank you Ben for the great review:
- Moved the function it kernel/irq/manage.c since it could be useful for
block mq devices
- Fixed Typo's
- Use cpumask_t * instead of cpumask_var_t in function header
- Restructured the function to remove NULL assignment in a cpumask_var_t
- Fix for offline local CPU's
Changes from V3:
- Patch 2/2: net/mlx4_en: Use affinity hint
- somehow patch file was corrupted
Changes from V2:
- Patch 1/2: net: Utility function to get affinity_hint by policy
- Fixed style issues
Changes from V1:
- Patch 1/2: net: Utility function to get affinity_hint by policy
- Fixed error flow to return -EINVAL on error (thanks govind)
- Patch 2/2: net/mlx4_en: Use affinity hint
- Set ring->affinity_hint to NULL on error
Changes from V0:
- Fixed small style issues
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Yuval Atias [Sun, 25 May 2014 14:47:27 +0000 (17:47 +0300)]
net/mlx4_en: Use affinity hint
The “affinity hint” mechanism is used by the user space
daemon, irqbalancer, to indicate a preferred CPU mask for irqs.
Irqbalancer can use this hint to balance the irqs between the
cpus indicated by the mask.
We wish the HCA to preferentially map the IRQs it uses to numa cores
close to it. To accomplish this, we use cpumask_set_cpu_local_first(), that
sets the affinity hint according the following policy:
First it maps IRQs to “close” numa cores. If these are exhausted, the
remaining IRQs are mapped to “far” numa cores.
Signed-off-by: Yuval Atias <yuvala@mellanox.com> Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Amir Vadai [Sun, 25 May 2014 14:47:26 +0000 (17:47 +0300)]
cpumask: Utility function to set n'th cpu - local cpu first
This function sets the n'th cpu - local cpu's first.
For example: in a 16 cores server with even cpu's local, will get the
following values:
cpumask_set_cpu_local_first(0, numa, cpumask) => cpu 0 is set
cpumask_set_cpu_local_first(1, numa, cpumask) => cpu 2 is set
...
cpumask_set_cpu_local_first(7, numa, cpumask) => cpu 14 is set
cpumask_set_cpu_local_first(8, numa, cpumask) => cpu 1 is set
cpumask_set_cpu_local_first(9, numa, cpumask) => cpu 3 is set
...
cpumask_set_cpu_local_first(15, numa, cpumask) => cpu 15 is set
Curently this function will be used by multi queue networking devices to
calculate the irq affinity mask, such that as many local cpu's as
possible will be utilized to handle the mq device irq's.
Signed-off-by: Amir Vadai <amirv@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
====================
Netfilter/IPVS updates for net-next
This small patchset contains three accumulated Netfilter/IPVS updates,
they are:
1) Refactorize common NAT code by encapsulating it into a helper
function, similarly to what we do in other conntrack extensions,
from Florian Westphal.
2) A minor format string mismatch fix for IPVS, from Masanari Iida.
3) Add quota support to the netfilter accounting infrastructure, now
you can add quotas to accounting objects via the nfnetlink interface
and use them from iptables. You can also listen to quota
notifications from userspace. This enhancement from Mathieu Poirier.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 31 May 2014 00:51:27 +0000 (17:51 -0700)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates
This series contains updates to i40e and i40evf.
Kevin updates the i40e and i40evf driver i40e_check_asq_alive() to ensure
the length register offset is non-zero which indicates that the software
has initialized the admin queue. Also removes PCTYPE definitions which are
now reserved.
Mitch enables descriptor prefetch for rings belonging to the virtual function.
Also configures the VF minimum transmit rate to 50 Mbps rather than 0 which was
be interpreted as no limit at all. Mitch found in order for the VF to achieve
its programmed transmit rate, we need to set the max credit value to 4.
Lastly fixes a Tx hang and firmware crash that happens after setting the MTU
on a VF by not using the RESETTING state during reinit, this is because
the RESETTING state means that a catastrophic hardware bad thing is happening
and the driver needs to tiptoe around and not use the admin queue or registers.
A reinit is no big deal and we can use the admin queue (and we should) so
do not set the state to RESETTING during reinit to resolve the bug.
Akeem changes the declaration of the transmit and receive rings inside
several loops to eliminate declaring the same ring every time for the
duration of the loop and declares them just once before the loop. Also fixes
the driver to clear the recovery pending bit if pf_reset fails instead of
falling through the setup process.
Anjali makes a change based on feedback from Ben Hutchings that cmd->data
needs to be reported in ETHTOOL_GRXCLSRLCNT and use a helper function to
calculate the total filter count.
Jesse removes storm control since the storm control features are not apart
of the hardware and were mistakenly left in the code.
Greg changes tx_lpi_status and rx_lpi_status from bool to u32 to avoid
sparse errors.
Shannon adds the clear_pxe AdminQ API call to tell the firmware that the
driver is taking over from PXE. In addition, relaxes the firmware API
check to allow more flexibility in handling newer NICs and NVMs in the field.
Vasu ensures that FCoE is disabled for MFP modes since it is not supported
by overriding the hardware FCoE capability.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Fri, 30 May 2014 15:48:12 +0000 (21:18 +0530)]
af_key: Replace comma with semicolon
This patch replaces a comma between expression statements by a semicolon.
A simplified version of the semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Fri, 30 May 2014 15:47:13 +0000 (21:17 +0530)]
rds/tcp_listen: Replace comma with semicolon
This patch replaces a comma between expression statements by a semicolon.
A simplified version of the semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Fri, 30 May 2014 15:46:05 +0000 (21:16 +0530)]
RDS/RDMA: Replace comma with semicolon
This patch replaces a comma between expression statements by a semicolon.
A simplified version of the semantic patch that performs this
transformation is as follows:
// <smpl>
@r@
expression e1,e2,e;
type T;
identifier i;
@@
e1
-,
+;
e2;
// </smpl>
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Wed, 28 May 2014 08:22:31 +0000 (10:22 +0200)]
s390/net: fix format string mismatches
cppcheck blamed some issues in drivers/s390/net/...
They are fixed here.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Reported-by: Toralf Foerster <toralf.foerster@gmx.de> Signed-off-by: David S. Miller <davem@davemloft.net>
There is otherwise a risk of a possible null pointer dereference.
Was largely found by using a static code analysis program called cppcheck.
Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Ursula Braun [Wed, 28 May 2014 08:22:29 +0000 (10:22 +0200)]
af_iucv: correct cleanup if listen backlog is full
In case of transport HIPER a sock struct is allocated for an incoming
connect request. If the backlog queue is full this socket is not
needed, but is left in the list of af_iucv sockets. Final socket
release posts console message "Attempt to release alive iucv socket".
This patch makes sure the new created socket is cleaned up correctly
if the backlog queue is full.
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Reported-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
If a socket is bound to an address using before calling connect
it is usual to leave it to the network system to choose an appropriate
outgoing application name respective port address.
af_iucv on VM uses a counter and uses simple numbers as unique identifiers.
This behaviour was missing when af_iucv is used with HiperSockets.
This patch contains a simple approach to harmonize af_iucv's behaviour.
Signed-off-by: Philipp Hachtmann <phacht@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <blaschka@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Sat, 31 May 2014 00:27:39 +0000 (17:27 -0700)]
Merge branch 'be2net-next'
Sathya Perla says:
====================
be2net: patch set
Patch 1 is a minor optimization for issuing multicast promisc FW cmd
only when the interface is not already in that mode.
Patch 2 provides support for VF TX-rate setting on Skyhawk-R.
Patch 3 provides support for flashing new FW flash regions.
Patches 4, 5, 6 cleanup the MCC processing (for FW cmds) code in be_cmds.c.
The MCC error reporting and event handling code are areas that needed
cleanup.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 30 May 2014 13:36:28 +0000 (19:06 +0530)]
be2net: cleanup MCC async event processing code
The MCC async event processing code has 2 issues:
a) because of long struct names the code indentation is badly broken
b) description and definitions of how an MCC completion is interpreted as
an async event are confusing (for e.g. the last word of an MCC event is
named "code", while "code" is just a sub-field of the last word.)
This patch fixes the structure definitions, comments and re-factors code
as needed.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sathya Perla [Fri, 30 May 2014 13:36:27 +0000 (19:06 +0530)]
be2net: move async cmd processing to a separate routine
For some FW cmds, the caller just issues the cmd and doesn't wait for a
response. The response handling is done in the MCCQ compl processing context
only. Move this code into a separate routine to make be_mcc_compl_process()
more manageable.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 30 May 2014 13:36:26 +0000 (19:06 +0530)]
be2net: re-factor MCCQ error status handling code
This patch improves MCCQ error status handling in the following ways:
a) A MCC cmd completion returns a base-status and an addl-status.
So far, the routine be_mcc_compl_process() returned only the "status" value.
Now, embedd both statuses in the return value and let the caller routine access
the value of interest using base_status() and addl_status() macros.
b) Rename variables accordingly (base/addl) to avoid confusion while error
checking.
b) Some of the errors returned by FW are harmless and so an error msg is not
logged for such errors. Capture this logic in a separate routine to make the
code more readable.
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>
Vasundhara Volam [Fri, 30 May 2014 13:36:25 +0000 (19:06 +0530)]
be2net: support flashing new regions on Skyhawk-R
Certain new flash regions have been added to Skyhawk-R FW image. The newer
FW images specify op_types for each region. A region is flashed only
when it's CRC doesn't match that of the region on the HW flash. While
upgrading to a new FW image the driver is expected to tolerate certain
errors.
This patch re-factors code under be_flash() to support the above scheme. Signed-off-by: Vasundhara Volam <vasundhara.volam@emulex.com> Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Skyhawk-R FW supports TX-rate setting only as a % value of the link
speed, set via the SET_PROFILE_CONFIG cmd.
This patch makes the necessary changes to the FW cmd descriptors to support
the above change and also introduces checks in be_set_vf_tx_rate() to allow
only discrete values (that map to % of the link-speed).
Signed-off-by: Sathya Perla <sathya.perla@emulex.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Kalesh AP [Fri, 30 May 2014 13:36:23 +0000 (19:06 +0530)]
be2net: skip multicast promiscuos setting in already set
Set mc-promisc (multicast promiscuous) mode on an interface, only if it is
*not already* in that mode.
Also removed logs that report interface being set to multicast
promiscous mode. In an earlier comment on the netdev list such log messages
were deemed unnecessary as this behaviour is common across most of the
ethernet drivers.
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>
David S. Miller [Sat, 31 May 2014 00:18:46 +0000 (17:18 -0700)]
Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says:
====================
Please pull this batch of updates intended for 3.16...
For the mac80211 bits, Johannes says:
"Here I just have Heikki's rfkill GPIO cleanups.
The ARM/tegra patch is OK with the maintainer (Stephen). Let me know of
any problems."
and;
"We have a whole bunch of work on CSA by Andrei, Luca and Michal, but
unfortunately it doesn't seem quite complete yet so it's still disabled.
There's some TDLS work from Arik, and the rest is mostly minor fixes and
cleanups."
For the NFC bits, Samuel says:
"This is the NFC pull request for 3.16. We have:
- STMicroeectronics st21nfca support. The st21nfca is an HCI chipset and
thus relies on the HCI stack. This submission provides support for tag
redaer/writer mode (including Type 5) and device tree bindings.
- PM runtime support and a bunch of bug fixes for TI's trf7970a.
- Device tree support for NXP's pn544. Legacy platform data support is
obviously kept intact.
- NFC Tag type 4B support to the NFC Digital stack.
- SOCK_RAW type support to the raw NFC socket, and allow NCI
sniffing from that. This can be extended to report HCI frames and also
proprietarry ones like e.g. the pn533 ones."
For the iwlwifi bits, Emmanuel says:
"Eran continues to work on new devices, Eyal is still digging in
the rate control stuff, and Johannes added new functionality to the
debug system we have in place now along with a few cleanups he made
on the way. That's pretty much it."
and;
"Avri continues to work on the power code and Eran is improving the
NVM handling as a preparations for new devices on which he works
with Liad. Luca cleans up a bit the code while working on CSA. I have
the regular BT Coex stuff and a small lockdep fix. Johannes has his
regular amount of clean ups and improvements, the main one is the
ability to leave 2 chains open to improve diversity and hence the
throughput in high attenuation scenarios."
and;
"The regular amount of housekeeping here. I merged iwlwifi-fixes.git to
be able to add the patch you didn't want in wireless.git at that stage
of the -rc cycle. Luca has a few preparations for CSA implementation
and also what seems to be a bugfix for P2P but hasn't caused issues
we could notice."
For the Atheros bits, Kalle says:
"For ath10k Michal did various small fixes on how we handle
hardware/firmware problems and he also fixed two memory leaks."
Also included are a couple of pulls from the wireless tree to
avoid/resolve merge issues...
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Paul Bolle [Tue, 27 May 2014 15:07:12 +0000 (17:07 +0200)]
atm: remove commented out check
This preprocessor check is commented out ever since this file was added
during the v2.3 development cycle. It is unclear what it purpose might
have been. Whatever it was, it can safely be removed now.
Signed-off-by: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: David S. Miller <davem@davemloft.net>
Ariel Elior [Tue, 27 May 2014 10:11:36 +0000 (13:11 +0300)]
bnx2x: update MAINTAINERS for bnx2x and e-mail addresses
The bnx2x development team has transferred from Broadcom to Qlogic.
This patch updates some obsolete email addresses to usable ones.
The bnx2x files contain headers with legal information from
Broadcom. Qlogic Legal depratment is taking their time coming up
with their own legal info. So this patch only updates contact
information. I will follow up with a patch for the headers once I
have the required info.
Signed-off-by: Ariel Elior <ariel.elior@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Nimrod Andy [Tue, 27 May 2014 07:51:08 +0000 (15:51 +0800)]
net: fec: use pinctrl PM helpers
when system suspend, need to set pins to low power state to
save IO power consumption, there are three states of pinctrl:
"default", "idle" and "sleep". Currently enet supports default
and sleep state.
Signed-off-by: Fugang Duan <B38611@freescale.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Mon, 26 May 2014 18:17:35 +0000 (20:17 +0200)]
net: filter: use block statements in tcpdump tests
This patch converts raw opcodes for tcpdump tests into
BPF_STMT()/BPF_JUMP() combinations, which brings it into
conformity with the rest of the patches and it also makes
life easier to grasp what's going on in these particular
test cases when they ever fail. Also arrange payload from
the jump+holes test in a way as we have with other packet
payloads in the test suite.
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 [Mon, 26 May 2014 18:17:34 +0000 (20:17 +0200)]
net: filter: test fill/spill of all M[] regs
This test for classic BPF probes stores and load combination
via X on all 16 registers of the scratch memory store. It
initially loads integer 100 and passes this value around
to each register while incrementing it every time, thus we
expect to have 116 as a result. Might be useful for JIT
testing.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Division of a 32 bit number by a 64 bit number causes the following link
error introduced by 7c2ce6e60f703 "enic: Add support for adaptive interrupt coalescing"
drivers/built-in.o: In function `enic_poll_msix':
enic_main.c:(.text+0x48710a): undefined reference to `__udivdi3'
make: *** [vmlinux] Error 1
Since numerator is 32 bit, convert denominator to 32 bit accordingly.
Fixes: 7c2ce6e60f703 ("enic: Add support for adaptive interrupt coalescing") Reported-by: Jim Davis <jim.epost@gmail.com> Cc: Christian Benvenuti <benve@cisco.com> Cc: Sujith Sankar <ssujith@cisco.com> Cc: Neel Patel <neepatel@cisco.com> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Sachin Kamat [Mon, 26 May 2014 09:22:46 +0000 (14:52 +0530)]
net: tso: Export symbols for modular build
Export the symbols to fix the below errors when built as modules:
ERROR: "tso_build_data" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_build_hdr" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_start" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_count_descs" [drivers/net/ethernet/marvell/mvneta.ko] undefined!
ERROR: "tso_build_data" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
ERROR: "tso_build_hdr" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
ERROR: "tso_start" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
ERROR: "tso_count_descs" [drivers/net/ethernet/marvell/mv643xx_eth.ko] undefined!
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Acked-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Himangi Saraogi [Wed, 28 May 2014 14:23:09 +0000 (19:53 +0530)]
ehea: Introduce the use of the managed version of kzalloc
This patch moves data allocated using kzalloc to managed data allocated
using devm_kzalloc and cleans now unnecessary kfrees in probe and remove
functions. Also, linux/device.h is added to make sure the devm_*()
routine declarations are unambiguously available.
The following Coccinelle semantic patch was used for making the change:
Signed-off-by: Himangi Saraogi <himangi774@gmail.com> Compile-Tested-by: Thadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Sat, 24 May 2014 07:34:27 +0000 (09:34 +0200)]
net: of_mdio: don't store the length of a property if we don't need to
of_get_property() can be called with NULL as 2nd argument if the caller
is not interested in the length of a property. Use that here so we can
get rid of a variable.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Sat, 24 May 2014 07:34:26 +0000 (09:34 +0200)]
net: of_mdio: add of_mdiobus_link_phydev()
Add a function to walk the list of subnodes of a mdio bus and look for
a node that matches the phy's address with its 'reg' property. If found,
set the of_node pointer for the phy. This allows auto-probed pyh
devices to be augmented by information passed in via DT.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Mack [Sat, 24 May 2014 07:34:25 +0000 (09:34 +0200)]
net: of_mdio: factor out code to parse a phy's 'reg' property
Factor out some logic into of_mdio_parse_addr() so it can be reused
later. While at it, use of_property_read_u32() rather than open-coding
the same logic again.
Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Shannon Nelson [Thu, 29 May 2014 06:55:59 +0000 (06:55 +0000)]
i40e: relax the firmware API version check
As long as the Firmware isn't reporting a higher API major version number
than what the driver knows about, the driver does not need to worry as
much about greater minor numbers. The API changes minor numbers when
things get added to the API, but no existing structs or calls are changed.
The driver has the option of warning that the minor numbers don't match.
This will allow a little more flexibility in handling newer NICs and NVMs
in the field.
Change-ID: I5302acd2d147a2992328991ee7223b2ff39c8741 Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Wed, 9 Apr 2014 05:59:07 +0000 (05:59 +0000)]
i40evf: don't use RESETTING state during reinit
The RESETTING state means that a Catastrophic Hardware Bad Thing is
happening and the driver need to tiptoe around and not use the admin
queue or registers or anything like that.
On the other hand, a reinit is no big deal and we can use the admin
queue, and we should. So don't set the state to RESETTING here.
This fixes a Tx hang and FW crash that happens after setting the MTU on
a VF.
Change-ID: I3e6191edbd6a93958a1f1bd1d41a5c2d17474d41 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Vasu Dev [Wed, 9 Apr 2014 05:59:06 +0000 (05:59 +0000)]
i40: disable FCoE for MFP modes
Currently FCoE is not supported with MFP modes, so this patch
makes sure it is disabled.
It is disabled by overriding HW FCoE capability, so that later
it can be re-enabled by just the SW upgrade.
Change-ID: I1c0bae5c099b209f56b88bda360031a8565e43e8 Signed-off-by: Vasu Dev <vasu.dev@intel.com> Tested-By: Jack Morgan <jack.morgan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
If pf_reset failed, it becomes necessary to clear recovery pending bit, instead
of falling through the setup process.
Change-ID: Ic1611e6a32741fe3a2782ec7be173cb65e7492ed Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Greg Rose [Wed, 9 Apr 2014 05:59:03 +0000 (05:59 +0000)]
i40e/i40evf: Change type to u32 to avoid sparse error
tx_lpi_status and rx_lpi_status are declared as bool but then used in sizeof
operations in the CORE driver code. Make them u32 to make sparse be quiet.
Change-ID: Iad6daeb1c7149e61ece242acd18c64b320c246a3 Signed-off-by: Greg Rose <gregory.v.rose@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
i40e: Report cmd->data in ETHTOOL_GRXCLSRLCNT instead of ETHTOOL_GRXCLSRULE
Based on review feedback from upstream cmd->data is not
defined in ETHTOOL_GRXCLSRULE but needs to be reported in
ETHTOOL_GRXCLSRLCNT. Also use a helper function to calculate the total
filter count.
Change-ID: Iaacbf729527b73290c4fdad837b379b44fd7dd20 Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Kevin Scott [Wed, 9 Apr 2014 05:58:59 +0000 (05:58 +0000)]
i40e/i40evf: Remove reserved PCTYPE defines
Patch to remove PCTYPE definitions which are now reserved.
Change-ID: I66c1c16a45a16f4894b2983101ab2a48ce03f1f4 Signed-off-by: Kevin Scott <kevin.c.scott@intel.com> Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Jim Young <jamesx.m.young@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This patch changes the declaration of Tx/Rx rings inside several loops. It
eliminates declaring the same rings every time for the duration of the loop,
instead declaring them once before the loop.
Change-ID: I59dea54276f18c47dca522f520c18f65fe42a15d Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Wed, 9 Apr 2014 05:58:57 +0000 (05:58 +0000)]
i40evf: tweak Tx rate params and de-magic-ify
In order for the VF to achieve its programmed Tx rate, we need to set
the max credits value to 4. While we're at it, get rid of some magic
numbers.
Change-ID: I4f17b4d3a90f1e069bdd134a543f0aa22feac3a9 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Wed, 9 Apr 2014 05:58:56 +0000 (05:58 +0000)]
i40evf: don't round Tx rate down to 0
Because the hardware configures VF Tx rates in increments of 50 Mbps,
values smaller than that would be rounded down to 0, which was
interpreted as no limit at all. Rather than do this, we round up to 50
Mbps and notify the user.
Change-ID: I5275848233fe7514cf93e11323661c68f4c38737 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Wed, 9 Apr 2014 05:58:55 +0000 (05:58 +0000)]
i40e: enable descriptor prefetch for VFs
As recommended by the hardware guys, enable descriptor prefetch for
rings belonging to VFs. This matches a change already made for ring
belonging to the PF.
Change-ID: Idcc4dc7064bc9144ea81f5701ad07b7ecd11ba49 Signed-off-by: Mitch Williams <mitch.a.williams@intel.com> Tested-by: Sibai Li <sibai.li@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Kevin Scott [Wed, 9 Apr 2014 05:58:54 +0000 (05:58 +0000)]
i40e/i40evf: Update check for AQ aliveness
Update the i40e_check_asq_alive check to ensure that the len register
offset is non-zero, indicating that SW has initialized the AQ.
Change-ID: I9c2e804788b4775bef9c7e80954ab004e6bdb306 Signed-off-by: Kevin Scott <kevin.c.scott@intel.com> Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David S. Miller [Wed, 28 May 2014 16:40:13 +0000 (12:40 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says:
====================
Intel Wired LAN Driver Updates
This series contains updates to e1000, e1000e, ixgbe and i40evf.
Emil provides a fix for ixgbe so that non-fiber devices with MNG FW enabled
are able to link at 100Mbps.
Jacob provides several changes for ixgbe, most of which are PTP related.
Renames ixgbe_ptp_enable() to ixgbe_ptp_feature_enable() to better reflect
the functions purpose. Extracts the hardware setup logic for the PTP
hardware bits from the ixgbe_ptp_set_ts_config() to enable future work for
the ixgbe_ptp_reset(). Maintain the hwstamp configuration through a reset
and extracts the creation of the PTP clock device from ptp_init() in order
to properly handle a suspend/resume cycle and only calls it if we don't
already have a ptp_clock pointer.
David provides a patch to expend the e1000e driver to turn on unicast
PROMISC when there is failure to write to a shared receive address register.
The fix update_phy_task() for 82579 is expanded to include newer PHYs as well
so that the dev_spec->eee_lp_ability has the correct value when going into
SX states.
Todd provides a e1000e fix an errata for 82574/82583 where it is possible
bad bits are read from SYSTIMH/L so check to see that the time is
incrementing at a reasonable rate and is a multiple of the time incremental
value. Removes a redundant igb PHY power down register write.
Andi Kleen out of lines two write functions for e1000e to save 30k text size.
Tobias Klauser converts the e1000 and i40evf drivers to use the
is_broadcast_ether_addr() and is_multicast_ether_addr().
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Todd Fujinaka [Thu, 8 May 2014 23:20:24 +0000 (23:20 +0000)]
igb: remove redundant PHY power down register write
One of the registers used to power down the PHY was found to be wrong
(should be bit 2 not bit 1) on further inspection it was also found to
be redundant.
Signed-off-by: Todd Fujinaka <todd.fujinaka@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David Ertman [Tue, 13 May 2014 00:06:26 +0000 (00:06 +0000)]
e1000e: Fix expand setting EEE link info to all affected parts
Previously, the update_phy_task was only calling e1000_set_eee_pchlan()
for phy.type 82579. This patch is to cause this function to be called
for 82579 and newer phy.types. This causes the dev_spec->eee_lp_ability
to have the correct value when going into SX states.
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David Ertman [Tue, 13 May 2014 00:02:12 +0000 (00:02 +0000)]
e1000e: Cleanup parenthesis around return value
Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David Ertman [Tue, 6 May 2014 03:50:17 +0000 (03:50 +0000)]
e1000e: Failure to write SHRA turns on PROMISC mode
Previously, the check to turn on promiscuous mode only took into account
the total number of SHared Receive Address (SHRA) registers and if the
request was for a register within that range. It is possible that the
Management Engine might have locked a number of SHRA and not allowed a
new address to be written to the requested register.
Add a function to determine the number of unlocked SHRA registers. Then
determine if the number of registers available is sufficient for our needs,
if not then return -ENOMEM so that UNICAST PROMISC mode is activated.
Since the method by which ME claims SHRA registers is non-deterministic,
also add a return value to the function attempting to write an address
to a SHRA, and return a -E1000_ERR_CONFIG if the write fails. The error
will be passed up the function chain and allow the driver to also set
UNICAST PROMISC when this happens.
Cc: Vlad Yasevich <vyasevic@redhat.com> Signed-off-by: Dave Ertman <davidx.m.ertman@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 16 May 2014 05:12:29 +0000 (05:12 +0000)]
ixgbe: avoid duplicate code in suspend and stop paths
Resume path calls .open but suspend path cannot call .stop because
fdirs should not be freed and control over hardware should not be
released until WoL is configured. To avoid having to duplicate all
changes made in .stop on suspend path split out part of .stop that
is relevant during suspend and call it from .stop and during suspend.
This fix also ensures that ixgbe_ptp_suspend is called during the
suspend path, and helps avoid similar errors. We can't call
ixgbe_ptp_stop, since it will free the PTP clock device, which we
shouldn't be doing during a suspend path.
Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 16 May 2014 05:12:28 +0000 (05:12 +0000)]
ixgbe: separate the PTP suspend and stop actions
Since we are adding proper support for suspend of PTP, extract out of
ixgbe_ptp_stop those things relevant to suspend. Then, have
ixgbe_ptp_stop call ixgbe_ptp_suspend. The next patch in the series will
have ixgbe_ptp_suspend called from the ixgbe_suspend path.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 16 May 2014 05:12:27 +0000 (05:12 +0000)]
ixgbe: extract PTP clock device from ptp_init
In order to properly handle a suspend/resume cycle, we cannot destroy
the PTP clock device. As part of this, we should only re-create the
device on first initialization. After a resume, when ixgbe_ptp_init is
called, we won't create a new clock, and we will use the old clock
device. To that end, this patch extracts the clock creation out of
ptp_init, and only calls it if we don't already have a ptp_clock
pointer.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 16 May 2014 05:12:26 +0000 (05:12 +0000)]
ixgbe: allow ixgbe_ptp_reset to maintain current hwtstamp config
Rather than clearing the hwtstamp configuration, we should use the known
configuration requested by the user and call the function which has now
been separated from the ioctl. This means that after a reset, the
timestamp mode will be maintained rather than lost. We still can't
maintain the clock value, however.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 16 May 2014 05:12:25 +0000 (05:12 +0000)]
ixgbe: extract the hardware setup from the ixgbe_ptp_set_ts_config
Currently all of the hardware setup logic for the PTP hardware bits is
buried inside of the ioctl which sets the timestamp configuration. This
makes it hard to use this logic in other places (primarily reset), and
this means we can't restore current timestamp mode upon a MAC reset.
Extracting this logic into a separate function will enable future work
for the ixgbe_ptp_reset function.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 16 May 2014 05:12:24 +0000 (05:12 +0000)]
ixgbe: rename ixgbe_ptp_enable to ixgbe_ptp_feature_enable
Since the name ixgbe_ptp_enable could be misconstrued as a function
which enables the whole PTP core, rename this function so that it is
clear the function is for enabling of the extra features such as PPS
signal.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Emil Tantilov [Tue, 13 May 2014 08:24:00 +0000 (08:24 +0000)]
ixgbe: fix linking at 100Mbps on copper devices with MNG FW enabled
Driver was calling setup_link to make sure that fiber interfaces with MNG FW
enabled will get link on probe because the laser was most likely turned off.
This prevented non-fiber devices with MNG FW from linking at 100Mbps.
This patch adds a check to only call setup_link for fiber devices.
Reported-and-by: Tony Luck <tony.luck@intel.com> Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Tony Luck <tony.luck@intel.com> Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Pablo Neira [Sun, 25 May 2014 12:48:33 +0000 (14:48 +0200)]
netfilter: bridge: fix Kconfig unmet dependencies
Before f5efc69 ("netfilter: nf_tables: Add meta expression key for
bridge interface name"), the entire net/bridge/netfilter/ directory
depended on BRIDGE_NF_EBTABLES, ie. on ebtables. However, that
directory already contained the nf_tables bridge extension that
we should allow to compile separately. In f5efc69, we tried to
generalize this by using CONFIG_BRIDGE_NETFILTER which was not a good
idea since this option already existed and it is dedicated to enable
the Netfilter bridge IP/ARP filtering.
Let's try to fix this mess by:
1) making net/bridge/netfilter/ dependent on the toplevel
CONFIG_NETFILTER option, just like we do with the net/netfilter and
net/ipv{4,6}/netfilter/ directories.
2) Changing 'selects' to 'depends on' NETFILTER_XTABLES for
BRIDGE_NF_EBTABLES. I believe this problem was already before f5efc69:
warning: (BRIDGE_NF_EBTABLES) selects NETFILTER_XTABLES which has
unmet direct dependencies (NET && INET && NETFILTER)
3) Fix ebtables/nf_tables bridge dependencies by making NF_TABLES_BRIDGE
and BRIDGE_NF_EBTABLES dependent on BRIDGE and NETFILTER:
warning: (NF_TABLES_BRIDGE && BRIDGE_NF_EBTABLES) selects
BRIDGE_NETFILTER which has unmet direct dependencies (NET && BRIDGE &&
NETFILTER && INET && NETFILTER_ADVANCED)
net/built-in.o: In function `br_parse_ip_options':
br_netfilter.c:(.text+0x4a5ba): undefined reference to `ip_options_compile'
br_netfilter.c:(.text+0x4a5ed): undefined reference to `ip_options_rcv_srr'
net/built-in.o: In function `br_nf_pre_routing_finish':
br_netfilter.c:(.text+0x4a8a4): undefined reference to `ip_route_input_noref'
br_netfilter.c:(.text+0x4a987): undefined reference to `ip_route_output_flow'
make: *** [vmlinux] Error 1
Reported-by: Jim Davis <jim.epost@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: David S. Miller <davem@davemloft.net>
of: mdio: fix compile warning in of_mdiobus_register_phy()
Commit de906af1 (net: phy: make of_set_phy_supported work with genphy driver)
removed the last user of variable 'max_speed' in function
of_mdiobus_register_phy(), leading to compile warning "unused variable
‘max_speed’ [-Wunused-variable]". Thus remove it.
Signed-off-by: Christian Engelmayer <cengelma@gmx.at> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
tg3: Override clock, link aware and link idle mode during NVRAM dump
When cable is not present the clock speed of some of the devices is
reduced based upon power saving mode setting in NVRAM. Due to this
NVRAM reads take long time to complete as a result CPU soft lockup
message is seen. Fix is to override clock, disable link aware and link
idle modes before NVRAM reads and restore them back after the reads
are complete. During this period also check if the thread needs to be
rescheduled and if there are any signals to handle.
Also decrease the NVRAM command execution timeout value to 1ms.
Signed-off-by: Prashant Sreedharan <prashant@broadcom.com> Signed-off-by: Michael Chan <mchan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Daniel Borkmann [Sat, 24 May 2014 19:47:46 +0000 (21:47 +0200)]
team: lb: use sizeof(*fprog) in __fprog_create
sock_fprog and sock_fprog_kern are of equal size, however
it's cleaner to just use sizeof(*fprog) instead to always
have correct type.
Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
As it may then take longer than what the user specified using
setsockopt(SO_RCVTIMEO).
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: Jon Maloy <jon.maloy@ericsson.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This set of patches properly documents the micrel ks8851 spi ethernet
controller, converts to devm_regulator_get_optional() to make error
paths slightly simpler, and finally adds supports for another
optional regulator and a reset gpio. This allows me to use the ks8851
on my MSM8960 CDP board.
Changes since v1:
* Dropped vendor prefix patch as that should go through DT tree
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Stephen Boyd [Fri, 23 May 2014 19:57:20 +0000 (12:57 -0700)]
net: ks8851: Add of match table
Users are currently just providing "ks8851" as the compatible for
this driver in device tree. Add a compatible string that provides
the vendor name along with the device name to be more explicit.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
The ks8851 SPI ethernet wasn't documented, but we documented the
optional regulator supply for it under the mll based ethernet
chip. Furthermore, that compatible string needed another 'l'. Fix
all of this and document the optional vdd-io and reset-gpios
properties.
Cc: Nishanth Menon <nm@ti.com> Cc: Rob Herring <robh+dt@kernel.org> Cc: Pawel Moll <pawel.moll@arm.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk> Cc: Kumar Gala <galak@codeaurora.org> Cc: <devicetree@vger.kernel.org> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Pull networking fixes from David Miller:
"It looks like a sizeble collection but this is nearly 3 weeks of bug
fixing while you were away.
1) Fix crashes over IPSEC tunnels with NAT, the latter can reroute
the packet through a non-IPSEC protected path and the code has to
be able to handle SKBs attached to routes lacking an attached xfrm
state. From Steffen Klassert.
2) Fix OOPSs in ipv4 and ipv6 ipsec layers for unsupported
sub-protocols, also from Steffen Klassert.
3) Set local_df on fragmented netfilter skbs otherwise we won't be
able to forward successfully, from Florian Westphal.
4) cdc_mbim ipv6 neighbour code does __vlan_find_dev_deep without
holding RCU lock, from Bjorn Mork.
5) local_df test in ip_may_fragment is inverted, from Florian
Westphal.
6) jme driver doesn't check for DMA mapping failures, from Neil
Horman.
7) qlogic driver doesn't calculate number of TX queues properly, from
Shahed Shaikh.
8) fib_info_cnt can drift irreversibly positive if we fail to
allocate the fi->fib_metrics array, from Sergey Popovich.
9) Fix use after free in ip6_route_me_harder(), also from Sergey
Popovich.
10) When SYSCTL is disabled, we don't handle local_port_range and
ping_group_range defaults properly at all, from Cong Wang.
11) Unaccelerated VLAN tagged frames improperly handled by cdc_mbim
driver, fix from Bjorn Mork.
12) cassini driver needs nested lock annotations for TX locking, from
Emil Goode.
13) On init error ipv6 VTI driver can unregister pernet ops twice,
oops. Fix from Mahtias Krause.
14) If macvlan device is down, don't propagate IFF_ALLMULTI changes,
from Peter Christensen.
15) Missing NULL pointer check while parsing netlink config options in
ip6_tnl_validate(). From Susant Sahani.
16) Fix handling of neighbour entries during ipv6 router reachability
probing, from Duan Jiong.
17) x86 and s390 JIT address randomization has some address
calculation bugs leading to crashes, from Alexei Starovoitov and
Heiko Carstens.
18) Clear up those uglies with nop patching and net_get_random_once(),
from Hannes Frederic Sowa.
19) Option length miscalculated in ip6_append_data(), fix also from
Hannes Frederic Sowa.
20) A while ago we fixed a race during device unregistry when a
namespace went down, turns out there is a second place that needs
similar protection. From Cong Wang.
21) In the new Altera TSE driver multicast filtering isn't working,
disable it and just use promisc mode until the cause is found.
From Vince Bridgers.
22) When we disable router enabling in ipv6 we have to flush the
cached routes explicitly, from Duan Jiong.
23) NBMA tunnels should not cache routes on the tunnel object because
the key is variable, from Timo Teräs.
24) With stacked devices GRO information in skb->cb[] can be not setup
properly, make sure it is in all code paths. From Eric Dumazet.
25) Really fix stacked vlan locking, multiple levels of nesting with
intervening non-vlan devices are possible. From Vlad Yasevich.
26) Fallback ipip tunnel device's mtu is not setup properly, from
Steffen Klassert.
27) The packet scheduler's tcindex filter can crash because we
structure copy objects with list_head's inside, oops. From Cong
Wang.
28) Fix CHECKSUM_COMPLETE handling for ipv6 GRE tunnels, from Eric
Dumazet.
29) In some configurations 'itag' in __mkroute_input() can end up
being used uninitialized because of how fib_validate_source()
works. Fix it by explitly initializing itag to zero like all the
other fib_validate_source() callers do, from Li RongQing"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (116 commits)
batman: fix a bogus warning from batadv_is_on_batman_iface()
ipv4: initialise the itag variable in __mkroute_input
bonding: Send ALB learning packets using the right source
bonding: Don't assume 802.1Q when sending alb learning packets.
net: doc: Update references to skb->rxhash
stmmac: Remove unbalanced clk_disable call
ipv6: gro: fix CHECKSUM_COMPLETE support
net_sched: fix an oops in tcindex filter
can: peak_pci: prevent use after free at netdev removal
ip_tunnel: Initialize the fallback device properly
vlan: Fix build error wth vlan_get_encap_level()
can: c_can: remove obsolete STRICT_FRAME_ORDERING Kconfig option
MAINTAINERS: Pravin Shelar is Open vSwitch maintainer.
bnx2x: Convert return 0 to return rc
bonding: Fix alb mode to only use first level vlans.
bonding: Fix stacked device detection in arp monitoring
macvlan: Fix lockdep warnings with stacked macvlan devices
vlan: Fix lockdep warning with stacked vlan devices.
net: Allow for more then a single subclass for netif_addr_lock
net: Find the nesting level of a given device by type.
...
Daniel Borkmann [Fri, 23 May 2014 16:44:01 +0000 (18:44 +0200)]
net: filter: add test case for jump with holes and ret x variants
This patch adds three more test cases:
1) long jumps with holes of unreachable code
2) ret x
3) ldx + ret x
All three tests are for classical BPF and to make sure that
any changes will not break some exotic behaviour that exists
probably since decades. The last two tests are expected to
fail by the BPF checker already, as in classic BPF only K
or A are allowed to be returned. Thus, there are now 52 test
cases for BPF.
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 [Fri, 23 May 2014 16:44:00 +0000 (18:44 +0200)]
net: filter: improve test case framework
This patch simplifies and refactors the test case code a
bit and also adds a summary of all test that passed or
failed in the kernel log, so that it's easier to spot if
something has failed.
Future work could further extend the test framework to also
support different input 'stimuli' i.e. related structures
to seccomp.
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 [Fri, 23 May 2014 16:43:59 +0000 (18:43 +0200)]
net: filter: doc: add section for BPF test suite
Mention the recently added test suite in the documentation file.
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 [Fri, 23 May 2014 16:43:58 +0000 (18:43 +0200)]
net: filter: let unattached filters use sock_fprog_kern
The sk_unattached_filter_create() API is used by BPF filters that
are not directly attached or related to sockets, and are used in
team, ptp, xt_bpf, cls_bpf, etc. As such all users do their own
internal managment of obtaining filter blocks and thus already
have them in kernel memory and set up before calling into
sk_unattached_filter_create(). As a result, due to __user annotation
in sock_fprog, sparse triggers false positives (incorrect type in
assignment [different address space]) when filters are set up before
passing them to sk_unattached_filter_create(). Therefore, let
sk_unattached_filter_create() API use sock_fprog_kern to overcome
this issue.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>