sfrench/cifs-2.6.git
9 years agoi40e/i40evf: Bump build version
Catherine Sullivan [Sat, 10 May 2014 04:49:15 +0000 (04:49 +0000)]
i40e/i40evf: Bump build version

Bump i40e to 0.4.5 and i40evf to 0.9.29.

Change-ID: I9faca5544446518c5425612e733499cf16ef20a1
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: remove deprecated device IDs
Jesse Brandeburg [Sat, 10 May 2014 04:49:14 +0000 (04:49 +0000)]
i40e/i40evf: remove deprecated device IDs

Remove two device IDs 1582 and 1573, because they will not be shipped.

Change-ID: Ica2e550b5b21a69e3f353eba2fe5e1c532a548c4
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: fix poll weight
Jesse Brandeburg [Sat, 10 May 2014 04:49:13 +0000 (04:49 +0000)]
i40e/i40evf: fix poll weight

Fix a coding error where during the registration for NAPI
the driver requested 256 budget.  The max recommended
value for this is NAPI_POLL_WEIGHT or 64.

Change-ID: I03ea1e2934a84ff1b5d572988b18315d6d91c5c6
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: fix TSO accounting
Jesse Brandeburg [Sat, 10 May 2014 04:49:12 +0000 (04:49 +0000)]
i40e/i40evf: fix TSO accounting

The TSO logic in the transmit path had some assumptions that
have been broken now that the kernel can send as much as 32kB
in a single skb->frag[.] entry, even on a system with 4kB pages.

This fixes the assumptions and allows the kernel to operate
as efficiently as possible with both SENDFILE and SEND.

In addition, the hardware limit of data contained in a descriptor is
changed to the next power of two below where it currently is in
order to align to a power of two value, preventing a single byte
of data in a descriptor.

Change-ID: I6af1f0b87c1458e10644dbd47541591075a52651
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: remove chatty reset messages
Mitch Williams [Sat, 10 May 2014 04:49:11 +0000 (04:49 +0000)]
i40e/i40evf: remove chatty reset messages

Both the PF side and the VF side of the VF reset process are too noisy.
We already warn the user that a reset is happening, and that is
sufficient.

Because some of these message are inside if statements, we have to
rejigger the brackets at the same time to keep our coding style
consistent.

Change-ID: Id175562fb0ec7c396d9de156b4890e136f52d5f4
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: not all VSIs have rings
Mitch Williams [Sat, 10 May 2014 04:49:10 +0000 (04:49 +0000)]
i40e: not all VSIs have rings

Once more, with feeling: not all VSIs have rings. To assume so is to
invite null pointers to your party.

Change-ID: I576858824468d9712d119fa1015a1f28c27712c4
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: clear pxe after adminq is rebuilt
Shannon Nelson [Sat, 10 May 2014 04:49:09 +0000 (04:49 +0000)]
i40e: clear pxe after adminq is rebuilt

Be sure to clear PXE mode bit on each reset after AdminQ has been rebuilt.

Change-ID: I992d8c79594f8ca0660c50844ace675ecb9c9bf2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Fix incorrect feature configuration status
Akeem G Abodunrin [Sat, 10 May 2014 04:49:08 +0000 (04:49 +0000)]
i40e: Fix incorrect feature configuration status

This patch fixes an issue where FD SB/ATR and NTUPLE configurations status are
reported erroneously. Without this patch, driver reports FDir without further
information.

Change-ID: I5bdd2871b7f2db1e5f5e76c741ae6a0dc603b453
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: use correct format for printing MAC addresses
Mitch Williams [Sat, 10 May 2014 04:49:07 +0000 (04:49 +0000)]
i40evf: use correct format for printing MAC addresses

The correct format is %pM, not %pMAC.

Change-ID: Idb335723a966fe56db3a72b9c07c08ca66f9db3c
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>
9 years agoi40evf: clean up log message formatting
Mitch Williams [Sat, 10 May 2014 04:49:06 +0000 (04:49 +0000)]
i40evf: clean up log message formatting

Clean up inconsistent log messages, mostly related to punctuation. Based
on the dogma that "kernel messages are not sentences", remove all
trailing periods. Reword a few of the messages to make them less
sentence-like.

Change-ID: Ibd849aa7623a77549b0709988c66ab05d1311472
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>
9 years agoi40evf: remove bogus comment
Mitch Williams [Sat, 10 May 2014 04:49:05 +0000 (04:49 +0000)]
i40evf: remove bogus comment

This comment is just plain false. VF drivers require MSI-X or they won't
get interrupts at all.

Change-ID: Iaea5e30b6926948aa834a3c506d9a9223d9e3e29
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>
9 years agoi40evf: remove unnecessary log messages
Mitch Williams [Sat, 10 May 2014 04:49:04 +0000 (04:49 +0000)]
i40evf: remove unnecessary log messages

We don't need to print log messages when we encounter an out-of-memory
condition, as the allocator will do this for us. Also, remove a Tx hang
message that duplicates the one emitted by the netdev layer, and a
duplicate message in the watchdog.

Change-ID: If2056e6135fe248f66ea939778f9895660f4d189
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>
9 years agoi40e/i40evf: Clean up a few things
Akeem G Abodunrin [Sat, 10 May 2014 04:49:03 +0000 (04:49 +0000)]
i40e/i40evf: Clean up a few things

1. There is no ixgbe_watchdog_task function in the driver, so change
   the comment to the correct function name, i40e_watchdog_subtask.
2. Remove num_msix_entries from interrupt set_up routine
   because it is never used.
3. Remove some TBD comments that are not needed.

Change-ID: I37697a04007074b797f85fd83d626672e4df1ad1
Signed-off-by: Akeem G Abodunrin <akeem.g.abodunrin@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: Fix code to accommodate i40e_register.h changes
Anjali Singhai Jain [Sat, 10 May 2014 04:49:02 +0000 (04:49 +0000)]
i40e/i40evf: Fix code to accommodate i40e_register.h changes

Remove use of registers no longer supported.

Change-ID: I9d27399091cea78a926489d94f958edd762f5a20
Signed-off-by: Anjali Singhai Jain <anjali.singhai@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: fix rx descriptor status
Jesse Brandeburg [Sat, 10 May 2014 04:49:01 +0000 (04:49 +0000)]
i40e/i40evf: fix rx descriptor status

As reported by Eric Dumazet, the driver is not masking the right
bits in the receive descriptor before it starts checking them.

This patch extends the mask to allow for the right bits to be
checked, and fixes the issue permanently via a define.

CC: Eric Dumazet <eric.dumazet@gmail.com>
Change-ID: I3274f7619057a950f468143e6d7e11b129f54655
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agomac802154: llsec: add forgotten list_del_rcu in key removal
Phoebe Buckheister [Fri, 6 Jun 2014 12:27:52 +0000 (14:27 +0200)]
mac802154: llsec: add forgotten list_del_rcu in key removal

During key removal, the key object is freed, but not taken out of the
llsec key list properly. Fix that.

Signed-off-by: Phoebe Buckheister <phoebe.buckheister@itwm.fraunhofer.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: use ethtool_cmd_speed_set helper to set ethtool speed value
Jiri Pirko [Fri, 6 Jun 2014 12:17:01 +0000 (14:17 +0200)]
net: use ethtool_cmd_speed_set helper to set ethtool speed value

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate
Jiri Pirko [Fri, 6 Jun 2014 12:17:00 +0000 (14:17 +0200)]
net: use SPEED_UNKNOWN and DUPLEX_UNKNOWN when appropriate

Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoamd-xgbe: Remove unnecessary include
Tom Lendacky [Fri, 6 Jun 2014 13:52:19 +0000 (08:52 -0500)]
amd-xgbe: Remove unnecessary include

The include of asm/cputype.h breaks the powerpc build. This
include was accidentally left in from driver debugging and
can be removed.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>,
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Fri, 6 Jun 2014 19:55:37 +0000 (12:55 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2014-06-06

This series contains updates to i40e and i40evf.

Shannon sets the lan_veb index when the Virtual Ethernet Bridge (VEB) is
created for the basic LAN device and its Virtual Switch Interfaces (VSIs).
Also adds the VEB/VSI statistics in the ethtool stats output.  Increases the
reset wait time because the original time was too optimistic and resets
were failing after EMPR.  This won't delay the actual wait, just allows
us to poll more times as needed.  He fixes the attempted removal of the
HMC space and unhook IRQs when a reset recovery fails because the HMC space
never got setup and IRQs are already unhooked in the first place, so the
removal is not necessary.

Jesse adds a log message for pre-production hardware so that the user is
notified that there may be issues with the hardware, yet does not prevent
the user from using the hardware.  Add the printing of link messages
in the i40e driver like all the other Intel Ethernet drivers.

Mitch makes log message changes to i40evf to prevent confusion by making
the most common messages less scary by lowering them to a less terrifying
log level.  This is due to the fact that depending on the timing of what
the PF driver is doing, it may take a few tries before the VF driver is able
to communicate with the PF driver on init or reset recovery.

Kamil provides a change to prevent the driver from getting into a endless
loop while trying to send GetVersion AQ command, since BO silicon blocks
AQ registers when in Blank Flash mode.  So introduce a simple check for a
correct value in one of the AQ registers to be sure that AQ was configured
correctly.

Matt adds a function which indicates our intention to enable or disable a
particular transmit queue.  Also adds a function to notify the device's
transmit unit that we are about to enable or disable a transmit queue.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoi40e/i40evf: Bump build version
Catherine Sullivan [Wed, 23 Apr 2014 04:50:17 +0000 (04:50 +0000)]
i40e/i40evf: Bump build version

Bump i40e to 0.4.3 and i40evf to 0.9.27.

Change-ID: I4141e9f8615bdcfa3b1b5ecbc2ac62603a03b7ad
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: remove irqs only when they are set up
Shannon Nelson [Wed, 23 Apr 2014 04:50:16 +0000 (04:50 +0000)]
i40e: remove irqs only when they are set up

Use an extra state variable to keep track of when the IRQs are fully
set up.  This keeps us from trying to unhook IRQs that already were
left unhooked in a failed reset recovery, e.g. when firmware is broken.

Change-ID: I073eb081e4ef8aedcbdf1ee0717c0ed64fa172f2
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: don't remove HMC that doesn't exist
Shannon Nelson [Wed, 23 Apr 2014 04:50:13 +0000 (04:50 +0000)]
i40e: don't remove HMC that doesn't exist

If a reset recovery failed (e.g. firmware is broken), the HMC space won't
get set up.  We don't need to try to delete it if it didn't get set up.
This stops some needless error messages when we already know we need to
just tear things down.

Change-ID: Iac600481765e20b136052b43a544e55d7870268b
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: print full link message
Jesse Brandeburg [Wed, 23 Apr 2014 04:50:12 +0000 (04:50 +0000)]
i40e: print full link message

The i40e driver should print link messages like all the
other Intel Ethernet drivers.

Change-ID: Ia88bdb96794e17a3962fcea94db176de01f921f7
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: add xcast stats for port
Shannon Nelson [Wed, 23 Apr 2014 04:50:09 +0000 (04:50 +0000)]
i40e: add xcast stats for port

Add the missing unicast, multicast, and broadcast stats for the port.

Change-ID: Ifc366d7b7745f70eaac9d00eeb0694eb9ec076a9
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: add vsi x-cast stats
Shannon Nelson [Wed, 23 Apr 2014 04:50:07 +0000 (04:50 +0000)]
i40e: add vsi x-cast stats

Add VSI HW stats for unicast, multicast, and broadcast for Rx and Tx.
Stop printing the netdev multicast value because it doesn't include Tx
and would be confusing.

Change-ID: I08278b6657e7c838fd29a4a1f305f78fe1b150be
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: increase reset wait time
Shannon Nelson [Wed, 23 Apr 2014 04:50:06 +0000 (04:50 +0000)]
i40e: increase reset wait time

The wait time was originally too optimistic and the resets were failing
after EMPR.  This increases the loop count to wait considerably longer.
This won't delay the actual wait longer than really needed, just allows
us to poll more times as needed.

Change-ID: If7b96f55cc25b8d06cbbe8665259d250188c53d7
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: add Tx pre queue disable function
Matt Jared [Wed, 23 Apr 2014 04:50:03 +0000 (04:50 +0000)]
i40e/i40evf: add Tx pre queue disable function

Add a function which indicates our intention to enable or disable a particular
Tx queue. Also add a function to notify the device's Tx unit that we're about
to enable or disable a Tx queue.

Change-ID: I6adf3cbb5bb3e3c984d1ec969e06577c19ef296d
Signed-off-by: Matt Jared <matthew.a.jared@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>
9 years agoi40e/i40evf: check AQ register for valid data
Kamil Krawczyk [Wed, 23 Apr 2014 04:50:02 +0000 (04:50 +0000)]
i40e/i40evf: check AQ register for valid data

B0 Si blocks AQ registers when in Blank Flash mode - write is dropped,
read gives 0xDEADBEEF. Introduce a simple check for a correct value in one
of the AQ registers to be sure that AQ was configured correctly.
Without this check we get into an endless loop while trying to send
GetVersion AQ cmd.

Change-ID: I00102b8c5fa6c16d14289be677aafadf87f10f0d
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: make messages less dire
Mitch Williams [Wed, 23 Apr 2014 04:50:00 +0000 (04:50 +0000)]
i40evf: make messages less dire

Depending on the timing of what the PF driver is doing, it make take a
few tries before the VF driver is able to communicate with the PF driver
on init or reset recovery. In order to prevent confusion, make the most
common messages less scary by lowering them to a less terrifying log
level and indicate that the driver will retry.

Change-ID: I1ec22aa59a68f4469aabe14775a1bfc1ab4b7f2f
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>
9 years agoi40e: print message for pre-production hardware
Jesse Brandeburg [Wed, 23 Apr 2014 04:49:57 +0000 (04:49 +0000)]
i40e: print message for pre-production hardware

The driver and hardware are not expected to work correctly
with revision_id 0 hardware.  Don't prevent the user from
using it, but be sure to print a warning.

Change-ID: I3712d34752bfad458078a5f35dfd0aa0ae9fd20e
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: add VEB stats to ethtool
Shannon Nelson [Wed, 23 Apr 2014 04:49:55 +0000 (04:49 +0000)]
i40e: add VEB stats to ethtool

Print the VEB statistics in the ethtool stats output.

Change-ID: Ic93d4c3922345c43e4cfd7f7e7a906844dd2f49f
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: set lan_veb index
Shannon Nelson [Wed, 23 Apr 2014 04:49:54 +0000 (04:49 +0000)]
i40e: set lan_veb index

When the VEB is created for the basic LAN device and its VSIs, we need to
set the tracking lan_veb index for later use.

Change-ID: I66bb74993bbda3621ca557437cb4b3517f9b315b
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoipv6: Shrink udp_v6_mcast_next() to one socket variable
Sven Wegener [Thu, 29 May 2014 20:27:06 +0000 (20:27 +0000)]
ipv6: Shrink udp_v6_mcast_next() to one socket variable

To avoid the confusion of having two variables, shrink the function to
only use the parameter variable for looping.

Cc: Eric Dumazet <edumazet@google.com>
Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
David S. Miller [Thu, 5 Jun 2014 23:22:02 +0000 (16:22 -0700)]
Merge git://git./linux/kernel/git/davem/net

Conflicts:
drivers/net/xen-netback/netback.c
net/core/filter.c

A filter bug fix overlapped some cleanups and a conversion
over to some new insn generation macros.

A xen-netback bug fix overlapped the addition of multi-queue
support.

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: filter: fix SKF_AD_PKTTYPE extension on big-endian
Alexei Starovoitov [Thu, 5 Jun 2014 21:39:36 +0000 (14:39 -0700)]
net: filter: fix SKF_AD_PKTTYPE extension on big-endian

BPF classic->internal converter broke SKF_AD_PKTTYPE extension, since
pkt_type_offset() was failing to find skb->pkt_type field which is defined as:
__u8 pkt_type:3,
     fclone:2,
     ipvs_property:1,
     peeked:1,
     nf_trace:1;

Fix it by searching for 3 most significant bits and shift them by 5 at run-time

Fixes: bd4cf0ed331a ("net: filter: rework/optimize internal BPF interpreter's instruction set")
Signed-off-by: Alexei Starovoitov <ast@plumgrid.com>
Acked-by: Daniel Borkmann <dborkman@redhat.com>
Tested-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: phy: fix sparse warning in fixed.c
Konrad Zapalowicz [Thu, 5 Jun 2014 18:27:42 +0000 (20:27 +0200)]
net: phy: fix sparse warning in fixed.c

This commit fixes the following sparse warning:

drivers/net/phy/fixed.c:207
    - warning: symbol 'fixed_phy_del' was not declared.
      Should it be static?

by adding symbol definition to the phy_fixed.h API file. It is ok to do
because the function in question is an exported symbol.

Signed-off-by: Konrad Zapalowicz <bergo.torino@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'systemport-next'
David S. Miller [Thu, 5 Jun 2014 22:37:00 +0000 (15:37 -0700)]
Merge branch 'systemport-next'

Florian Fainelli says:

====================
net: systemport: misc fixes

This patch series contains some misc fixes for the SYSTEMPORT driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: systemport: start with carrier off
Florian Fainelli [Thu, 5 Jun 2014 17:22:18 +0000 (10:22 -0700)]
net: systemport: start with carrier off

The SYSTEMPORT driver uses libphy to determine the carrier state, so
make sure we start with a carrier off until libphy has completed the
link training process.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: systemport: fix comment about HW prepending 2bytes
Florian Fainelli [Thu, 5 Jun 2014 17:22:17 +0000 (10:22 -0700)]
net: systemport: fix comment about HW prepending 2bytes

The comment about how the hardware prepends 2bytes to align the IP
header on a 4-byte boundary was not correct, fix that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: systemport: correctly check for RX_STATUS_OVFLOW flag
Florian Fainelli [Thu, 5 Jun 2014 17:22:16 +0000 (10:22 -0700)]
net: systemport: correctly check for RX_STATUS_OVFLOW flag

We were missing an and comparison with status to check whether
RX_STATUS_OVFLOW is asserted or not in the per-packet status word, fix
that.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: systemport: fix transmit locking scheme
Florian Fainelli [Thu, 5 Jun 2014 17:22:15 +0000 (10:22 -0700)]
net: systemport: fix transmit locking scheme

Our transmit locking scheme did not account for the TX ring full
interrupt. If a TX ring full interrupt fires while we are attempting to
transmit, we will cause a deadlock to occur. Fix this by making sure
that we properly disable interrupts while acquiring the spinlock.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/pablo/nf-next
David S. Miller [Thu, 5 Jun 2014 22:35:04 +0000 (15:35 -0700)]
Merge git://git./linux/kernel/git/pablo/nf-next

Pablo Neira Ayuso says:

====================
Netfilter/nf_tables fixes for net-next

This patchset contains fixes for recent updates available in your
net-next, they are:

1) Fix double memory allocation for accounting objects that results
   in a leak, this slipped through with the new quota extension,
   patch from Mathieu Poirier.

2) Fix broken ordering when adding set element transactions.

3) Make sure that objects are released in reverse order in the abort
   path, to avoid possible use-after-free when accessing dependencies.

4) Allow to delete several objects (as long as dependencies are
   fulfilled) by using one batch. This includes changes in the use
   counter semantics of the nf_tables objects.

5) Fix illegal sleeping allocation from rcu callback.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'amd-xgbe'
David S. Miller [Thu, 5 Jun 2014 22:26:58 +0000 (15:26 -0700)]
Merge branch 'amd-xgbe'

Tom Lendacky says:

====================
amd-xgbe: AMD 10Gb Ethernet driver

The following series implements support for the new AMD 10Gb Ethernet
driver (amd-xgbe).  It includes the 10Gb Ethernet driver as well as
a 10Gb Ethernet PHY driver.

This patch series is based on net-next.

Changes in V3:
  - Add OF dependency to the phylib driver configuration
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoamd-xgbe: Maintainer information
Lendacky, Thomas [Thu, 5 Jun 2014 14:15:24 +0000 (09:15 -0500)]
amd-xgbe: Maintainer information

This patch adds the maintainer information for the AMD 10GbE
platform driver.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoamd-xgbe: Configuration and build support
Lendacky, Thomas [Thu, 5 Jun 2014 14:15:18 +0000 (09:15 -0500)]
amd-xgbe: Configuration and build support

This patch provides the Kconfig and Makefile changes needed
to configure and build the AMD 10GbE platform driver and the
AMD 10GbE phylib driver.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoamd-xgbe: Initial AMD 10GbE phylib driver
Lendacky, Thomas [Thu, 5 Jun 2014 14:15:12 +0000 (09:15 -0500)]
amd-xgbe: Initial AMD 10GbE phylib driver

This patch provides the initial phylib driver in support
of the AMD 10GbE device.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoamd-xgbe: Initial AMD 10GbE platform driver
Lendacky, Thomas [Thu, 5 Jun 2014 14:15:06 +0000 (09:15 -0500)]
amd-xgbe: Initial AMD 10GbE platform driver

This patch provides the initial platform driver for the AMD
10GbE device.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoamd-xgbe: AMD 10GbE device bindings documentation
Lendacky, Thomas [Thu, 5 Jun 2014 14:15:00 +0000 (09:15 -0500)]
amd-xgbe: AMD 10GbE device bindings documentation

This patch provides the documentation of the device bindings
for the AMD 10GbE platform driver.

Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobridge: Fix incorrect judgment of promisc
Toshiaki Makita [Thu, 5 Jun 2014 11:53:32 +0000 (20:53 +0900)]
bridge: Fix incorrect judgment of promisc

br_manage_promisc() incorrectly expects br_auto_port() to return only 0
or 1, while it actually returns flags, i.e., a subset of BR_AUTO_MASK.

Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agohplance: fix ram size in comment
Amos Kong [Thu, 5 Jun 2014 03:01:22 +0000 (11:01 +0800)]
hplance: fix ram size in comment

drivers/net/ethernet/amd/hplance.h:
 #define HPLANCE_MEMOFF 0x8000   /* struct lance_init_block */
 #define HPLANCE_NVRAMOFF 0xC008 /* etheraddress as one *nibble* per byte */

The offset of RAM start is 0x8000, the offset of RAM end is 0xC008,
so the RAM size is 16392 bytes.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agomvme147: fix ram size in comment
Amos Kong [Thu, 5 Jun 2014 03:01:21 +0000 (11:01 +0800)]
mvme147: fix ram size in comment

The order of ram pages is 3, so the ram size is 2^3 * 4K = 32K.

Signed-off-by: Amos Kong <akong@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'dm9000-next'
David S. Miller [Thu, 5 Jun 2014 22:12:16 +0000 (15:12 -0700)]
Merge branch 'dm9000-next'

Andrew Ruder says:

====================
miscellaneous dm9000 driver fixes

This is a collection of changes discovered while bringing a PXA270 based board
(Arcom ZEUS) with a Davicom DM9000A/B up to a more recent kernel (from 2.6.xx).
This addresses all of my earlier issues (August 2013) listed here:

http://marc.info/?l=linux-netdev&m=137598605603324&w=2
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodm9000: avoid sleeping in dm9000_timeout callback
Andrew Ruder [Wed, 4 Jun 2014 22:28:49 +0000 (17:28 -0500)]
dm9000: avoid sleeping in dm9000_timeout callback

On the DM9000B, dm9000_msleep() is called during the dm9000_timeout()
routine.  Since dm9000_timeout() holds the main spinlock through the
entire routine, mdelay() needs to be used rather than msleep().
Furthermore, the mutex_lock()/mutex_unlock() should be avoided so as to
not sleep with spinlocks held.

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodm9000: handle initial link status
Andrew Ruder [Wed, 4 Jun 2014 22:28:48 +0000 (17:28 -0500)]
dm9000: handle initial link status

On the DM9000A/DM9000B force the initial check of the link status.  The
DM9000A/B has a link status changed event and this interrupt bit isn't
always set out of reset when a cable is plugged in.  This results in the
driver not seeing the cable attached link status until the cable is
removed and plugged in again.

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodm9000: remove redundant ISR status clear
Andrew Ruder [Wed, 4 Jun 2014 22:28:47 +0000 (17:28 -0500)]
dm9000: remove redundant ISR status clear

Since dm9000_interrupt() is already reading/clearing every set bit in
DM9000_ISR, this additional clear in dm9000_rx() (which is only called
by dm9000_interrupt()) is unnecessary and can be removed.

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodm9000: clean up edge-triggered irq compatibility
Andrew Ruder [Wed, 4 Jun 2014 22:28:46 +0000 (17:28 -0500)]
dm9000: clean up edge-triggered irq compatibility

DM9000 uses level-triggered interrupts.  Some systems (PXA270) only
support edge-triggered interrupts on GPIOs.  Some changes are necessary
to ensure that interrupts are not triggered while the GPIO interrupt is
masked or we will miss the interrupt forever.

* Make some helper functions called dm9000_mask_interrupts() and
  dm9000_unmask_interrupts() for readability.

* dm9000_init_dm9000(): ensure that this function always leaves interrupts
  masked regardless of the state when it entered the function.  This is
  primarily to support the situation in dm9000_open where the logic used
  to go:

    dm9000_open()
        dm9000_init_dm9000()
            unmask interrupts
        request_irq()

  If an interrupt occurred between unmasking the interrupt and
  requesting the irq, it would be missed forever as the edge event would
  never be seen by the GPIO hardware in the PXA270.  This allows us to
  change the logic to:

    dm9000_open()
        dm9000_init_dm9000()
            dm9000_mask_interrupts()
        request_irq()
        dm9000_unmask_interrupts()

* dm9000_timeout(), dm9000_drv_resume(): Add the missing
  dm9000_unmask_interrupts() now required by the change above.

* dm9000_shutdown(): Use mask helper function

* dm9000_interrupt(): Use mask/unmask helper functions

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodm9000: clean up reset code
Andrew Ruder [Wed, 4 Jun 2014 22:28:45 +0000 (17:28 -0500)]
dm9000: clean up reset code

* Change a hard-coded 0x3 to NCR_RST | NCR_MAC_LBK in dm9000_reset

* Every single place where dm9000_init_dm9000 was ran, a dm9000_reset
  was called immediately before-hand.  Bring dm9000_reset into
  dm9000_init_dm9000.

* The following commit updated the dm9000_probe reset routine to use NCR_RST
  | NCR_MAC_LBK:

    6741f40 DM9000B: driver initialization upgrade

  and a later commit added a bug-fix to always reset the chip twice:

    09ee9f8 dm9000: Implement full reset of DM9000 network device

  Unfortunately, since the changes in 6741f40 were made by replacing the
  dm9000_probe dm9000_reset with the adjusted iow(), the changes in
  09ee9f8 were not incorporated into the dm9000_probe reset.
  Furthermore, it bypassed the requisite reset-delay causing some boards
  to get at least one "read wrong id ..." dev_err message during
  dm9000_probe.

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agodm9000: acquire irq flags from device tree
Andrew Ruder [Wed, 4 Jun 2014 22:28:44 +0000 (17:28 -0500)]
dm9000: acquire irq flags from device tree

The DM9000 supports both active high interrupts and active low interrupts.
This is configured via the attached EEPROM.  In the device-tree case, make sure
that the DM9000 driver passes the correct flags to request_irq.

Signed-off-by: Andrew Ruder <andrew.ruder@elecsyscorp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoxen-netback: Fix handling of skbs requiring too many slots
Zoltan Kiss [Wed, 4 Jun 2014 18:58:51 +0000 (19:58 +0100)]
xen-netback: Fix handling of skbs requiring too many slots

A recent commit (a02eb4 "xen-netback: worse-case estimate in xenvif_rx_action is
underestimating") capped the slot estimation to MAX_SKB_FRAGS, but that triggers
the next BUG_ON a few lines down, as the packet consumes more slots than
estimated.
This patch introduces full_coalesce on the skb callback buffer, which is used in
start_new_rx_buffer() to decide whether netback needs coalescing more
aggresively. By doing that, no packet should need more than
(XEN_NETIF_MAX_TX_SIZE + 1) / PAGE_SIZE data slots (excluding the optional GSO
slot, it doesn't carry data, therefore irrelevant in this case), as the provided
buffers are fully utilized.

Signed-off-by: Zoltan Kiss <zoltan.kiss@citrix.com>
Cc: Paul Durrant <paul.durrant@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: David Vrabel <david.vrabel@citrix.com>
Reviewed-by: Paul Durrant <paul.durrant@gmail.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoqlcnic: Initialize mailbox cmd structure to zero
Rajesh Borundia [Wed, 4 Jun 2014 07:40:54 +0000 (03:40 -0400)]
qlcnic: Initialize mailbox cmd structure to zero

o Uninitialzed fields in mailbox command structure
  caused commands to time out randomly due to garbage
  values so initialize it to zero.

Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMPLS: Use mpls_features to activate software MPLS GSO segmentation
Simon Horman [Tue, 3 Jun 2014 23:53:17 +0000 (08:53 +0900)]
MPLS: Use mpls_features to activate software MPLS GSO segmentation

If an MPLS packet requires segmentation then use mpls_features
to determine if the software implementation should be used.

As no driver advertises MPLS GSO segmentation this will always be
the case.

I had not noticed that this was necessary before as software MPLS GSO
segmentation was already being used in my test environment. I believe that
the reason for that is the skbs in question always had fragments and the
driver I used does not advertise NETIF_F_FRAGLIST (which seems to be the
case for most drivers). Thus software segmentation was activated by
skb_gso_ok().

This introduces the overhead of an extra call to skb_network_protocol()
in the case where where CONFIG_NET_MPLS_GSO is set and
skb->ip_summed == CHECKSUM_NONE.

Thanks to Jesse Gross for prompting me to investigate this.

Signed-off-by: Simon Horman <horms@verge.net.au>
Acked-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Acked-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agogianfar: Call netif_carrier_off() prior to registration
Fabio Estevam [Tue, 3 Jun 2014 22:55:38 +0000 (19:55 -0300)]
gianfar: Call netif_carrier_off() prior to registration

Quoting David Miller:
"At the moment you call register_netdev() the device is visible, notifications
are sent to userspace, and userland tools can try to bring the interface up
and see the incorrect link state, before you do the netif_carrier_off().

Said another way, between the register_netdev() and netif_carrier_off() call,
userspace can see the device in an inconsistent state."

So call netif_carrier_off() prior to register_netdev().

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net...
David S. Miller [Thu, 5 Jun 2014 20:04:31 +0000 (13:04 -0700)]
Merge branch 'master' of git://git./linux/kernel/git/jkirsher/net-next

Jeff Kirsher says:

====================
Intel Wired LAN Driver Updates 2014-06-05

This series contains updates to i40e and i40evf.

Jesse fixes an issue reported by Dave Jones where a couple of FD checks
ended up using bitwise OR where it should have been bitwise AND.

Neerav removes unused defines and macros for receive LRO.  Fix the driver
from allowing the user to set a larger MTU size that the hardware was
being configured to support.  Refactors send version which moves code in
two places into a small helper function.

Kamil modifies register diagnostics since register ranges can vary among
the different NVMs to avoid false test results.  So now we try to identify
the full range and use it for a register test and if we fail to define the
proper register range, we will only test the first register from that
group.  Then removes the check for large buffer since this was added in the
case this structure changed in the future, since the AQ definition is now
mature enough that this check is no longer necessary.

Mitch fixes i40evf driver to allocate descriptors in groups of 32 since the
hardware requires it.  Also fixes a crash when the ring size changed because
it would change the count before deallocating resources, causing the driver
to either free nonexistent buffers or leak leftover buffers.  Fixed the
driver to notify the VF for all types of resets so the VF can attempt a
graceful reinit.

Shannon refactors stats collection to create a unifying stats update routine
to call the various stat collection routines.  Removes rx_errors and
rx_missed stats since they were removed from the chip design.  Added
missing VSI statistics that the hardware offers but are not apart of the
standard netdev stats.

v2: dropped patch "i40e: Allow disabling of DCB via debugfs" from Neerav
    based on feedback from David Miller.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoi40e: add missing VSI statistics
Shannon Nelson [Wed, 23 Apr 2014 04:50:20 +0000 (04:50 +0000)]
i40e: add missing VSI statistics

Add a couple more statistics that the hardware offers but aren't part
of the standard netdev stats.

Change-ID: I201db2898f2c284aee3d9631470bc5edd349e9a5
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: remove rx_errors and rx_missed
Shannon Nelson [Wed, 23 Apr 2014 04:50:19 +0000 (04:50 +0000)]
i40e/i40evf: remove rx_errors and rx_missed

The rx_errors (GLV_REPC) and rx_missed (GLV_RMPC) were removed
from the chip design.

Change-ID: Ifdeb69c90feac64ec95c36d3d32c75e3a06de3b7
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: refactor stats collection
Shannon Nelson [Wed, 23 Apr 2014 04:50:18 +0000 (04:50 +0000)]
i40e: refactor stats collection

Pull the PF stat collection out of the VSI collection routine, and
add a unifying stats update routine to call the various stat collection
routines.

Change-ID: I224192455bb3a6e5dc0a426935e67dffc123e306
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: refactor send version
Jesse Brandeburg [Wed, 23 Apr 2014 04:50:15 +0000 (04:50 +0000)]
i40e: refactor send version

This change moves some common code in two places into a
small helper function, and corrects a bug in one of the
two places in the process.

Change-ID: If3bba7152b240f13a7881eb0e8a781655fa66ce7
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: VEB structure added, GTIME macro update
Kamil Krawczyk [Wed, 23 Apr 2014 04:50:14 +0000 (04:50 +0000)]
i40e/i40evf: VEB structure added, GTIME macro update

Structure for VEB context added. Update macro for
transition from ms to GTIME (us) time units.

Change-ID: Ib3a19587b4cf355348655df8f60c6f37bb1497a3
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: notify VF of all types of resets
Mitch Williams [Wed, 23 Apr 2014 04:50:11 +0000 (04:50 +0000)]
i40e: notify VF of all types of resets

Currently, the PF driver only notifies the VFs for PF reset events.
Instead, notify the VFs for all types of resets, so they can attempt a
graceful reinit.

Change-ID: I03eb7afde25727198ef620f8b4e78bb667a11370
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: fix crash when changing ring sizes
Mitch Williams [Thu, 24 Apr 2014 06:41:37 +0000 (06:41 +0000)]
i40evf: fix crash when changing ring sizes

i40evf_set_ringparam was broken in several ways. First, it only changed
the size of the first ring, and second, changing the ring size would
often result in a panic because it would change the count before
deallocating resources, causing the driver to either free nonexistent
buffers, or leak leftover buffers.

Fix this by storing the descriptor count in the adapter structure, and
updating the count for each ring each time we allocate them. This
ensures that we always free the right size ring, and always end up with
the requested count when the device is (re)opened.

Change-ID: I298396cd3d452ba8509d9f2d33a93f25868a9a55
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40evf: set descriptor multiple to 32
Mitch Williams [Wed, 23 Apr 2014 04:50:08 +0000 (04:50 +0000)]
i40evf: set descriptor multiple to 32

Hardware requires descriptors to be allocated in groups of 32.

Change-ID: I752ccc96769d1bd8d3018c004b8aeff464045bf2
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>
9 years agoi40e: clamp jumbo frame size
Jesse Brandeburg [Wed, 23 Apr 2014 04:50:05 +0000 (04:50 +0000)]
i40e: clamp jumbo frame size

The driver was allowing the user to set larger size MTU
than the hardware was being configured to support.

The driver was already using VLAN_HLEN when setting the
hardware max receivable frame size, so just add it to the
netdev MTU set entry point as well.

Change-ID: Ie20e2a35d04f8c411253e255bea79ca69aaeaea3
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e/i40evf: remove unused RX_LRO define
Jesse Brandeburg [Wed, 23 Apr 2014 04:50:04 +0000 (04:50 +0000)]
i40e/i40evf: remove unused RX_LRO define

Remove unused defines and macros for RX_LRO.

Change-ID: I8ca6715edfa62b56837417a1c4ff68c2345dab6e
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: remove check for large buffer
Kamil Krawczyk [Wed, 23 Apr 2014 04:49:58 +0000 (04:49 +0000)]
i40e: remove check for large buffer

We introduced this check in case this structure changed in the future,
the AQ definition is now mature enough that this check is no longer necessary.

Change-ID: Ic66321d0a08557dc9d8cb84029185352cb534330
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Tested-by: Jim Young <jamesx.m.young@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: Rework register diagnostic
Kamil Krawczyk [Wed, 23 Apr 2014 04:49:56 +0000 (04:49 +0000)]
i40e: Rework register diagnostic

Register range, being subject to register diagnostic, can vary among
different NVMs. We will try to identify the full range and use it for
a register test. This is needed to avoid false test results. If we fail
to define the proper register range we will test only the first register
from that group.

Change-ID: Ieee7173c719733b61d3733177a94dc557eb7b3fd
Signed-off-by: Kamil Krawczyk <kamil.krawczyk@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoi40e: don't use OR to check a value
Jesse Brandeburg [Wed, 16 Apr 2014 01:21:40 +0000 (01:21 +0000)]
i40e: don't use OR to check a value

A couple of FD checks ended up using bitwise OR to check
a value, which ends up always being evaluated to true.

This should fix the issue.  Thanks to DaveJ for noticing
and reporting the issue!

CC: Dave Jones <davej@redhat.com>
Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
9 years agoipv4: use skb frags api in udp4_hwcsum()
WANG Cong [Mon, 2 Jun 2014 23:12:02 +0000 (16:12 -0700)]
ipv4: use skb frags api in udp4_hwcsum()

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>
9 years agonet: use the new API kvfree()
WANG Cong [Mon, 2 Jun 2014 22:55:22 +0000 (15:55 -0700)]
net: use the new API kvfree()

It is available since v3.15-rc5.

Cc: Pablo Neira Ayuso <pablo@netfilter.org>
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>
9 years agodns_resolver: Do not accept domain names longer than 255 chars
Manuel Schölling [Sat, 31 May 2014 21:37:40 +0000 (23:37 +0200)]
dns_resolver: Do not accept domain names longer than 255 chars

According to RFC1035 "[...] the total length of a domain name (i.e.,
label octets and label length octets) is restricted to 255 octets or
less."

Signed-off-by: Manuel Schölling <manuel.schoelling@gmx.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'isdn-capi'
David S. Miller [Thu, 5 Jun 2014 06:13:49 +0000 (23:13 -0700)]
Merge branch 'isdn-capi'

Tilman Schmidt says:

====================
ISDN patches for net-next (v2)

Here's v2 of the series of patches for the ISDN CAPI subsystem
prepared by Paul Bolle and reviewed by yours truly. It reflects
GregKH's review, resulting in a substantial simplification.
Please merge via net-next.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoisdn/capi: fix (middleware) device nodes
Paul Bolle [Sun, 1 Jun 2014 21:47:24 +0000 (23:47 +0200)]
isdn/capi: fix (middleware) device nodes

Since v2.4 the capi driver used the following device nodes if
"middleware" support was enabled:
    /dev/capi20
    /dev/capi/0
    /dev/capi/1
    [...]

/dev/capi20 is a character device node. /dev/capi/0 (and up) are tty
device nodes (with a different major).

This device node (naming) scheme is not documented anywhere, as far as I
know. It was originally provided by the capifs pseudo filesystem (before
udev became available). It is required for example by the pppd
capiplugin. It was supported until a few years ago. But a number of
developments broke it:
- v2.6.6 (May 2004) renamed /dev/capi20 to /dev/capi and removed the
  "/" from the name of capi's tty driver. The explanation of the patch
  that did this included two examples of udev rules "to restore the old
  namespace";
- either udev 154 (May 2010) or udev 179 (January 2012) stopped
  allowing to rename device nodes, and thus the ability to have
  /dev/capi20 appear instead of /dev/capi and /dev/capi/0 (and up)
  instead of /dev/capi0 (and up);
- v3.0 (July 2011) also removed capifs. That disabled another method to
  create the /dev/capi/0 (and up) device nodes.

So now users need to manually tweak their setup (eg, create /dev/capi/
and fill that with symlinks) to get things working. This is all rather
hacky and only discoverable by searching the web. Fix all this by
renaming /dev/capi back to /dev/capi20, and by setting the name of the
"capi_nc" tty driver to "capi!" so the tty device nodes appear as
/dev/capi/0 (and up).

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoisdn/capi: Make verbose reporting depend on capidrv
Paul Bolle [Sun, 1 Jun 2014 21:47:24 +0000 (23:47 +0200)]
isdn/capi: Make verbose reporting depend on capidrv

The Kconfig symbol ISDN_DRV_AVMB1_VERBOSE_REASON is only used for
capi_info2str(). That function is only used in capidrv.c. So setting it
without setting ISDN_CAPI_CAPIDRV is pointless. Make it depend on
ISDN_CAPI_CAPIDRV, rename it to ISDN_CAPI_CAPIDRV_VERBOSE and put its
entry after ISDN_CAPI_CAPIDRV's entry.

Since this symbol seems to be primarily used for debugging, keep it off
by default. By now the last users of capidrv hopefully know all they
need to know about the reasons for disconnecting.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoisdn/capi: move capi_info2str to capidrv.c
Paul Bolle [Sun, 1 Jun 2014 21:47:24 +0000 (23:47 +0200)]
isdn/capi: move capi_info2str to capidrv.c

capi_info2str() is apparently meant to be of general utility. It is
actually only used in capidrv.c. So move it from capiutil.c to
capidrv.c and (obviously) stop exporting it.

And, since we're touching this, merge the two versions of this
function.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'inet_csums'
David S. Miller [Thu, 5 Jun 2014 05:52:31 +0000 (22:52 -0700)]
Merge branch 'inet_csums'

Tom Herbert says:

====================
net: Support checksum in UDP

This patch series adds support for using checksums in UDP tunnels. With
this it is possible that two or more checksums may be set within the
same packet and we would like to do that efficiently.

This series also creates some new helper functions to be used by various
tunnel protocol implementations.

v2: Fixed indentation in tcp_v6_send_check arguments.
v3: Move udp_set_csum and udp6_set_csum to be not inlined
    Also have this functions call with a nocheck boolean argument
    instead of passing a sock structure.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agovxlan: Add support for UDP checksums (v4 sending, v6 zero csums)
Tom Herbert [Thu, 5 Jun 2014 00:20:29 +0000 (17:20 -0700)]
vxlan: Add support for UDP checksums (v4 sending, v6 zero csums)

Added VXLAN link configuration for sending UDP checksums, and allowing
TX and RX of UDP6 checksums.

Also, call common iptunnel_handle_offloads and added GSO support for
checksums.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agogre: Call gso_make_checksum
Tom Herbert [Thu, 5 Jun 2014 00:20:23 +0000 (17:20 -0700)]
gre: Call gso_make_checksum

Call gso_make_checksum. This should have the benefit of using a
checksum that may have been previously computed for the packet.

This also adds NETIF_F_GSO_GRE_CSUM to differentiate devices that
offload GRE GSO with and without the GRE checksum offloaed.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Add GSO support for UDP tunnels with checksum
Tom Herbert [Thu, 5 Jun 2014 00:20:16 +0000 (17:20 -0700)]
net: Add GSO support for UDP tunnels with checksum

Added a new netif feature for GSO_UDP_TUNNEL_CSUM. This indicates
that a device is capable of computing the UDP checksum in the
encapsulating header of a UDP tunnel.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotcp: Call gso_make_checksum
Tom Herbert [Thu, 5 Jun 2014 00:20:09 +0000 (17:20 -0700)]
tcp: Call gso_make_checksum

Call common gso_make_checksum when calculating checksum for a
TCP GSO segment.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Support for multiple checksums with gso
Tom Herbert [Thu, 5 Jun 2014 00:20:02 +0000 (17:20 -0700)]
net: Support for multiple checksums with gso

When creating a GSO packet segment we may need to set more than
one checksum in the packet (for instance a TCP checksum and
UDP checksum for VXLAN encapsulation). To be efficient, we want
to do checksum calculation for any part of the packet at most once.

This patch adds csum_start offset to skb_gso_cb. This tracks the
starting offset for skb->csum which is initially set in skb_segment.
When a protocol needs to compute a transport checksum it calls
gso_make_checksum which computes the checksum value from the start
of transport header to csum_start and then adds in skb->csum to get
the full checksum. skb->csum and csum_start are then updated to reflect
the checksum of the resultant packet starting from the transport header.

This patch also adds a flag to skbuff, encap_hdr_csum, which is set
in *gso_segment fucntions to indicate that a tunnel protocol needs
checksum calculation

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agol2tp: call udp{6}_set_csum
Tom Herbert [Thu, 5 Jun 2014 00:19:56 +0000 (17:19 -0700)]
l2tp: call udp{6}_set_csum

Call common functions to set checksum for UDP tunnel.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoudp: Generic functions to set checksum
Tom Herbert [Thu, 5 Jun 2014 00:19:48 +0000 (17:19 -0700)]
udp: Generic functions to set checksum

Added udp_set_csum and udp6_set_csum functions to set UDP checksums
in packets. These are for simple UDP packets such as those that might
be created in UDP tunnels.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoipv6: Fix regression caused by efe4208 in udp_v6_mcast_next()
Sven Wegener [Thu, 29 May 2014 20:27:05 +0000 (20:27 +0000)]
ipv6: Fix regression caused by efe4208 in udp_v6_mcast_next()

Commit efe4208 ("ipv6: make lookups simpler and faster") introduced a
regression in udp_v6_mcast_next(), resulting in multicast packets not
reaching the destination sockets under certain conditions.

The packet's IPv6 addresses are wrongly compared to the IPv6 addresses
from the function's socket argument, which indicates the starting point
for looping, instead of the loop variable. If the addresses from the
first socket do not match the packet's addresses, no socket in the list
will match.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agoMerge branch 'bonding-macvlan'
David S. Miller [Wed, 4 Jun 2014 22:14:17 +0000 (15:14 -0700)]
Merge branch 'bonding-macvlan'

Vlad Yasevich says:

====================
Fix support for macvlan devices on top bonding

Currently, macvlan devices do not work well over bond interfaces.
Everything works well, untill a failover is triggered in the bond
device and then macvlan becomes unreachble untill arp entries
are flushed.   This series adds needed functionality to
handle correct notifications and update switches with mac addresses
assigned to macvlans.

The first patch simply addes IFF_UNICAST_FLT flag to bonds since they
already correctly manage the unicast filter list of the slaves, so
we might as well prevent the bond from needlessly going into promiscuous
mode.

The second patch adds notifier handler to macvlan to trigger correct
ARP notifications.

The third patch adds handling for TLB and RLB modes that use special
ETH_P_LOOPBACK type packets to teach switch about mac addresses.
It also allow ARPs for the macvlan mac addresses to be handled by
RLB mode.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobonding: Support macvlans on top of tlb/rlb mode bonds
Vlad Yasevich [Wed, 4 Jun 2014 20:23:38 +0000 (16:23 -0400)]
bonding: Support macvlans on top of tlb/rlb mode bonds

To make TLB mode work, the patch allows learning packets
to be sent using mac addresses assigned to macvlan devices,
also taking into an account vlans that may be between the
bond and macvlan device.

To make RLB work, all we have to do is accept ARP packets
for addresses added to the bond dev->uc list.  Since RLB
mode will take care to update the peers directly with
correct mac addresses, learning packets for these addresses
do not have be send to switch.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agomacvlan: Support bonding events
Vlad Yasevich [Wed, 4 Jun 2014 20:23:37 +0000 (16:23 -0400)]
macvlan: Support bonding events

Bonding and team drivers generate specific events during failover
that trigger switch updates.  When a macvlan device is configured
on top of bonding, we want switches to learn about the macvlan
devices as well.   This patch adds a handler to macvlan driver to
propagate these events to all macvlan devices.  We let the generic
inetdev event handler do the work.

This allows macvlan to operated correctly over active-backup
mode bond.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agobonding: Turn on IFF_UNICAST_FLT on bond devices
Vlad Yasevich [Wed, 4 Jun 2014 20:23:36 +0000 (16:23 -0400)]
bonding: Turn on IFF_UNICAST_FLT on bond devices

Bonding devices manage the unicast filters of the underlying
interfaces, but do not turn on IFF_UNICAST_FLT flag.  Thus
anytime a unicast address is added to the bond, the bond is
places in promiscuous mode.

Turn on IFF_UNICAST_FLT on the bond device so that the bond does
not go into promiscuous mode needlesly.  If an underlying device
does not support unicast filtering, that device will automaticall
enter promiscuous mode already.

Signed-off-by: Vlad Yasevich <vyasevic@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agonet: Revert "fib_trie: use seq_file_net rather than seq->private"
Sasha Levin [Wed, 4 Jun 2014 22:02:32 +0000 (18:02 -0400)]
net: Revert "fib_trie: use seq_file_net rather than seq->private"

This reverts commit 30f38d2fdd79f13fc929489f7e6e517b4a4bfe63.

fib_triestat is surrounded by a big lie: while it claims that it's a
seq_file (fib_triestat_seq_open, fib_triestat_seq_show), it isn't:

static const struct file_operations fib_triestat_fops = {
        .owner  = THIS_MODULE,
        .open   = fib_triestat_seq_open,
        .read   = seq_read,
        .llseek = seq_lseek,
        .release = single_release_net,
};

Yes, fib_triestat is just a regular file.

A small detail (assuming CONFIG_NET_NS=y) is that while for seq_files
you could do seq_file_net() to get the net ptr, doing so for a regular
file would be wrong and would dereference an invalid pointer.

The fib_triestat lie claimed a victim, and trying to show the file would
be bad for the kernel. This patch just reverts the issue and fixes
fib_triestat, which still needs a rewrite to either be a seq_file or
stop claiming it is.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agotrivial: drivers/net/ethernet/nvidia/forcedeth.c: fix typo s/SUBSTRACT1/SUBTRACT1/
Antonio Ospite [Wed, 4 Jun 2014 12:03:47 +0000 (14:03 +0200)]
trivial: drivers/net/ethernet/nvidia/forcedeth.c: fix typo s/SUBSTRACT1/SUBTRACT1/

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Alexander Gordeev <agordeev@redhat.com>
Cc: netdev@vger.kernel.org
Signed-off-by: David S. Miller <davem@davemloft.net>
9 years agogianfar: Fix the section mismatch warnings.
Xiubo Li [Wed, 4 Jun 2014 08:49:16 +0000 (16:49 +0800)]
gianfar: Fix the section mismatch warnings.

Building with CONFIG_DEBUG_SECTION_MISMATCH enabled, the following
WARNING is occured:

  LD      drivers/net/built-in.o
WARNING: drivers/net/built-in.o(.text+0xcd4c): Section mismatch in
reference from the function gfar_probe() to the function
.init.text:gfar_init_addr_hash_table()
The function gfar_probe() references
the function __init gfar_init_addr_hash_table().
This is often because gfar_probe lacks a __init
annotation or the annotation of gfar_init_addr_hash_table is wrong.

Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>