GitHub/LineageOS/android_kernel_motorola_exynos9610.git
8 years agoMerge tag 'rxrpc-rewrite-20160823-1' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Wed, 24 Aug 2016 00:19:59 +0000 (17:19 -0700)]
Merge tag 'rxrpc-rewrite-20160823-1' of git://git./linux/kernel/git/dhowells/linux-fs

David Howells says:

====================
rxrpc: Cleanups

Here are some cleanups for the AF_RXRPC rewrite:

 (1) Remove some unused bits.

 (2) Call releasing on socket closure is now done in the order in which
     calls progress through the phases so that we don't miss a call
     actively moving list.

 (3) The rxrpc_call struct's channel number field is redundant and replaced
     with accesses to the masked off cid field instead.

 (4) Use a tracepoint for socket buffer accounting rather than printks.

     Unfortunately, since this would require currently non-existend
     arch-specific help to divine the current instruction location, the
     accounting functions are moved out of line so that
     __builtin_return_address() can be used.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: hns: remove redundant dev_err call in hns_dsaf_get_cfg()
Wei Yongjun [Tue, 23 Aug 2016 15:11:03 +0000 (15:11 +0000)]
net: hns: remove redundant dev_err call in hns_dsaf_get_cfg()

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: Remove unused including <linux/version.h>
Wei Yongjun [Tue, 23 Aug 2016 15:09:49 +0000 (15:09 +0000)]
cxgb4: Remove unused including <linux/version.h>

Remove including <linux/version.h> that don't need it.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: phy: xgmiitorgmii: Fix non static symbol warning
Wei Yongjun [Tue, 23 Aug 2016 15:06:05 +0000 (15:06 +0000)]
net: phy: xgmiitorgmii: Fix non static symbol warning

Fixes the following sparse warning:

drivers/net/phy/xilinx_gmii2rgmii.c:61:5: warning:
 symbol 'xgmiitorgmii_probe' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqede: Add support for Tx/Rx-only queues.
Sudarsana Reddy Kalluru [Tue, 23 Aug 2016 14:56:55 +0000 (10:56 -0400)]
qede: Add support for Tx/Rx-only queues.

Add provision for configuring the fastpath queues with Tx (or Rx) only
functionality.

Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: rtnetlink: Don't export empty RTAX_FEATURES
Phil Sutter [Tue, 23 Aug 2016 11:14:31 +0000 (13:14 +0200)]
net: rtnetlink: Don't export empty RTAX_FEATURES

Since the features bit field has bits for internal only use as well, it
may happen that the kernel exports RTAX_FEATURES attribute with zero
value which is pointless.

Fix this by making sure the attribute is added only if the exported
value is non-zero.

Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: Fix issue while re-registering VF mgmt netdev
Hariprasad Shenai [Tue, 23 Aug 2016 06:05:32 +0000 (11:35 +0530)]
cxgb4: Fix issue while re-registering VF mgmt netdev

When we disable SRIOV, we used to unregister the netdev but wasn't
freed. But next time when the same netdev is registered, since the state
was in 'NETREG_UNREGISTERED', we used to hit BUG_ON in register_netdevice,
where it expects the state to be 'NETREG_UNINITIALIZED'.

Alloc netdev and register them while configuring SRIOV, and free them
when SRIOV is disabled. Also added a new function to setup ethernet
properties instead of using ether_setup. Set carrier off by default,
since we don't have to do any transmit on the interface.

Fixes: 7829451c695e ("cxgb4: Add control net_device for configuring PCIe VF")

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet-tcp: retire TFO_SERVER_WO_SOCKOPT2 config
Yuchung Cheng [Tue, 23 Aug 2016 00:17:54 +0000 (17:17 -0700)]
net-tcp: retire TFO_SERVER_WO_SOCKOPT2 config

TFO_SERVER_WO_SOCKOPT2 was intended for debugging purposes during
Fast Open development. Remove this config option and also
update/clean-up the documentation of the Fast Open sysctl.

Reported-by: Piotr Jurkiewicz <piotr.jerzy.jurkiewicz@gmail.com>
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoxen-netback: using kfree_rcu() to simplify the code
Wei Yongjun [Mon, 22 Aug 2016 23:01:29 +0000 (23:01 +0000)]
xen-netback: using kfree_rcu() to simplify the code

The callback function of call_rcu() just calls a kfree(), so we
can use kfree_rcu() instead of call_rcu() + callback function.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoliquidio: declare liquidio_set_rxcsum_command static
Nicholas Mc Guire [Mon, 22 Aug 2016 15:52:00 +0000 (17:52 +0200)]
liquidio: declare liquidio_set_rxcsum_command static

liquidio_set_rxcsum_command is a local function only, no need to expose
it outside of lio_main.c so declare it static and make sparse happy.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agol2tp: Refactor the codes with existing macros instead of literal number
Gao Feng [Mon, 22 Aug 2016 14:50:02 +0000 (22:50 +0800)]
l2tp: Refactor the codes with existing macros instead of literal number

Use PPP_ALLSTATIONS, PPP_UI, and SEND_SHUTDOWN instead of 0xff,
0x03, and 2 separately.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Acked-by: Guillaume Nault <g.nault@alphalink.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'strp-kcm-fixes'
David S. Miller [Tue, 23 Aug 2016 23:23:13 +0000 (16:23 -0700)]
Merge branch 'strp-kcm-fixes'

Tom Herbert says:

====================
strp: Minor fixes to strparser and kcm

Fix locking issue in kcm and losing events when paused.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agokcm: Fix locking issue
Tom Herbert [Tue, 23 Aug 2016 18:55:31 +0000 (11:55 -0700)]
kcm: Fix locking issue

Lock the lower socket in kcm_unattach. Release during call to strp_done
since that function cancels the RX timers and work queue with sync.

Also added some status information in psock reporting.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agostrparser: Queue work when being unpaused
Tom Herbert [Tue, 23 Aug 2016 18:55:30 +0000 (11:55 -0700)]
strparser: Queue work when being unpaused

When the upper layer unpauses a stream parser connection we need to
queue rx_work to make sure no events are missed.

Signed-off-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'hv_netvsc-cleanups'
David S. Miller [Tue, 23 Aug 2016 19:05:38 +0000 (12:05 -0700)]
Merge branch 'hv_netvsc-cleanups'

Stephen Hemminger says:

====================
Hyper-V network driver cleanups.

The only new functionality is minor extensions to ethtool.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: add ethtool statistics for tx packet issues
Stephen Hemminger [Tue, 23 Aug 2016 19:17:57 +0000 (12:17 -0700)]
hv_netvsc: add ethtool statistics for tx packet issues

Printing console messages is not helpful when system is out of memory;
and can be disastrous with netconsole. Instead keep statistics
of these anomalous conditions.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: report vmbus name in ethtool
Stephen Hemminger [Tue, 23 Aug 2016 19:17:56 +0000 (12:17 -0700)]
hv_netvsc: report vmbus name in ethtool

Make netvsc on vmbus behave more like PCI.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: make variable local
Stephen Hemminger [Tue, 23 Aug 2016 19:17:55 +0000 (12:17 -0700)]
hv_netvsc: make variable local

The variable m_ret is only used in one basic block.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: make netvsc_destroy_buf void
Stephen Hemminger [Tue, 23 Aug 2016 19:17:54 +0000 (12:17 -0700)]
hv_netvsc: make netvsc_destroy_buf void

No caller checks the return value.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: refactor completion function
Stephen Hemminger [Tue, 23 Aug 2016 19:17:53 +0000 (12:17 -0700)]
hv_netvsc: refactor completion function

Break the different cases, code is cleaner if broken up

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: rearrange start_xmit
Stephen Hemminger [Tue, 23 Aug 2016 19:17:52 +0000 (12:17 -0700)]
hv_netvsc: rearrange start_xmit

Rearrange the transmit routine to eliminate goto's and unnecessary
boolean variables. Use standard functions to test for vlan tag.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: init completion during alloc
Stephen Hemminger [Tue, 23 Aug 2016 19:17:51 +0000 (12:17 -0700)]
hv_netvsc: init completion during alloc

Move initialization to allocate where other fields are initialized.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: make device_remove void
Stephen Hemminger [Tue, 23 Aug 2016 19:17:50 +0000 (12:17 -0700)]
hv_netvsc: make device_remove void

Always returns 0 and no callers check.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: use ARRAY_SIZE() for NDIS versions
Stephen Hemminger [Tue, 23 Aug 2016 19:17:49 +0000 (12:17 -0700)]
hv_netvsc: use ARRAY_SIZE() for NDIS versions

Don't hard code size of array of NDIS versions.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: make inline functions static
Stephen Hemminger [Tue, 23 Aug 2016 19:17:48 +0000 (12:17 -0700)]
hv_netvsc: make inline functions static

Several new functions were introduced into hyperv.h but only used in one file.
Move them and let compiler decide on inline.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: style cleanups
Stephen Hemminger [Tue, 23 Aug 2016 19:17:47 +0000 (12:17 -0700)]
hv_netvsc: style cleanups

Fix most of the complaints about the style of the code.
Things like extra blank lines and return statements.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: use kcalloc
Stephen Hemminger [Tue, 23 Aug 2016 19:17:46 +0000 (12:17 -0700)]
hv_netvsc: use kcalloc

Better to use kcalloc rather than kzalloc and multiply for an array.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: make RSS hash key static
Stephen Hemminger [Tue, 23 Aug 2016 19:17:45 +0000 (12:17 -0700)]
hv_netvsc: make RSS hash key static

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: fix rtnl locking in callback
Stephen Hemminger [Tue, 23 Aug 2016 19:17:44 +0000 (12:17 -0700)]
hv_netvsc: fix rtnl locking in callback

The function get_netvsc_net_device had conditional locking. This was
unnecessary, incorrect, but harmless. It was unnecessary since the
code is only called from netlink netdev event callback where RTNL
is always acquired before the callbacks are run. It was incorrect
because of use of trylock and then continuing.
Fix by replacing with proper assertion.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge tag 'shared-for-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/leon...
David S. Miller [Tue, 23 Aug 2016 18:08:23 +0000 (11:08 -0700)]
Merge tag 'shared-for-4.9-1' of git://git./linux/kernel/git/leon/linux-rdma

Saeed Mahameed says:

====================
Mellanox mlx5 core driver updates 2016-08-20

This series contains several low level and API updates for mlx5 core
commands interface and mlx5_ifc.h to be shared as base code for net-next and
rdma mlx5 4.9 submissions.

From Saeed, ten patches that refactors old layouts of firmware commands which
were manually generated before we introduced the mlx5_ifc, now all of the firmware
commands inbox/outbox layouts moved to use mlx5_ifc and we remove the old
manually generated structures.  Plus to those ten patches, we add two patches
that unifies mlx5 commands execution interface and improve the driver log messages
in that area.

From Hadar and Ilya, added the needed hardware bits and infrastructure for
minimum inline headers setting and encap/decap commands and capabilities,
needed for E-Switch offloads.

This series applies on top latest net-next and rdma/master, and smoothly merges with
the latest "Mellanox 100G mlx5 fixes 2016-08-16" series already applied into net branch.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agorxrpc: Use a tracepoint for skb accounting debugging
David Howells [Tue, 23 Aug 2016 14:27:24 +0000 (15:27 +0100)]
rxrpc: Use a tracepoint for skb accounting debugging

Use a tracepoint to log various skb accounting points to help in debugging
refcounting errors.

Signed-off-by: David Howells <dhowells@redhat.com>
8 years agorxrpc: Drop channel number field from rxrpc_call struct
David Howells [Tue, 23 Aug 2016 14:27:24 +0000 (15:27 +0100)]
rxrpc: Drop channel number field from rxrpc_call struct

Drop the channel number (channel) field from the rxrpc_call struct to
reduce the size of the call struct.  The field is redundant: if the call is
attached to a connection, the channel can be obtained from there by AND'ing
with RXRPC_CHANNELMASK.

Signed-off-by: David Howells <dhowells@redhat.com>
8 years agorxrpc: When clearing a socket, clear the call sets in the right order
David Howells [Tue, 23 Aug 2016 14:27:24 +0000 (15:27 +0100)]
rxrpc: When clearing a socket, clear the call sets in the right order

When clearing a socket, we should clear the securing-in-progress list
first, then the accept queue and last the main call tree because that's the
order in which a call progresses.  Not that a call should move from the
accept queue to the main tree whilst we're shutting down a socket, but it a
call could possibly move from sequreq to acceptq whilst we're clearing up.

Signed-off-by: David Howells <dhowells@redhat.com>
8 years agorxrpc: Tidy up the rxrpc_call struct a bit
David Howells [Tue, 23 Aug 2016 14:27:24 +0000 (15:27 +0100)]
rxrpc: Tidy up the rxrpc_call struct a bit

Do a little tidying of the rxrpc_call struct:

 (1) in_clientflag is no longer compared against the value that's in the
     packet, so keeping it in this form isn't necessary.  Use a flag in
     flags instead and provide a pair of wrapper functions.

 (2) We don't read the epoch value, so that can go.

 (3) Move what remains of the data that were used for hashing up in the
     struct to be with the channel number.

 (4) Get rid of the local pointer.  We can get at this via the socket
     struct and we only use this in the procfs viewer.

Signed-off-by: David Howells <dhowells@redhat.com>
8 years agorxrpc: Remove RXRPC_CALL_PROC_BUSY
David Howells [Tue, 23 Aug 2016 14:27:23 +0000 (15:27 +0100)]
rxrpc: Remove RXRPC_CALL_PROC_BUSY

Remove RXRPC_CALL_PROC_BUSY as work queue items are now 100% non-reentrant.

Signed-off-by: David Howells <dhowells@redhat.com>
8 years agoMerge branch 'cpsw-mq'
David S. Miller [Tue, 23 Aug 2016 07:13:11 +0000 (00:13 -0700)]
Merge branch 'cpsw-mq'

Ivan Khoronzhuk says:

====================
net: ethernet: ti: cpsw: add cpdma multi-queue support

This series is intended to allow cpsw driver to use cpdma ability of
h/w shaper to send/receive data with up to 8 tx and 8 rx queues. This
series doesn't contain interface to configure h/w shaper itself, it
contains only multi-queue support part and ability to configure number
of tx/rx queues with ethtool, it also doesn't contain mapping of input
traffic to rx queues, as it can depend on usage and requires separate
interface for setup.

Default shaper mode - priority mode. The h/w shaper configuration will
be added with separate patch series. This series doesn't affect on net
throughput.

Tested on:
am572x-idk, 1Gbps link
am335-boneblack, 100Mbps link.

A simple example for splitting traffic on queues:

$ ethtool -l eth0

$ ethtool -L eth0 rx 8 tx 8

$ tc qdisc add dev eth0 root handle 1: multiq

$ tc filter add dev eth0 parent 1: protocol ip prio 1 u32 \
    match ip dst 172.22.39.12 \
    action skbedit queue_mapping 5

Based on: net-next/master
V3: https://lkml.org/lkml/2016/8/15/788

Since v3:
-changed arg to priv in fill_rx_channels in
  net: ethernet: ti: davinci_cpdma: split descs num between all channels
- added more comments to cpsw_set_channels

Since v2:
- added new patch to avoid warn while ctrl stop

  net: ethernet: ti: cpsw: add ethtool channels support
- enable ctrl in case at least one interface is running

Since v1:
- removed cpdam_check_free_desc function
- remove pm_runtime calls as they are used in begin/complete ethtool calls now
- removed change of driver version. it can be done later
- corrected setup of channels for dual_emac mode with ethtool
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: ti: cpsw: add ethtool channels support
Ivan Khoronzhuk [Mon, 22 Aug 2016 18:18:28 +0000 (21:18 +0300)]
net: ethernet: ti: cpsw: add ethtool channels support

These ops allow to control number of channels driver is allowed to
work with at cpdma level. The maximum number of channels is 8 for
rx and 8 for tx. In dual_emac mode the h/w channels are shared
between two interfaces and changing number on one interface changes
number of channels on another.

How many channels are supported and enabled:
$ ethtool -l ethX

Change number of channels (up to 8)
$ ethtool -L ethX rx 6 tx 6

Per-channel statistic:
$ ethtool -S ethX

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: ti: davinci_cpdma: move cpdma channel struct macroses to internals
Ivan Khoronzhuk [Mon, 22 Aug 2016 18:18:27 +0000 (21:18 +0300)]
net: ethernet: ti: davinci_cpdma: move cpdma channel struct macroses to internals

Keep the driver internals in C file. Currently it's not required for
drivers to know rx or tx a channel is, except create function.
So correct "channel create" function, and use all channel struct
macroses only for internal use.

Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: ti: cpsw: add multi queue support
Ivan Khoronzhuk [Mon, 22 Aug 2016 18:18:26 +0000 (21:18 +0300)]
net: ethernet: ti: cpsw: add multi queue support

The cpsw h/w supports up to 8 tx and 8 rx channels. This patch adds
multi-queue support to the driver only, shaper configuration will
be added with separate patch series. Default shaper mode, as
before, priority mode, but with corrected priority order, 0 - is
highest priority, 7 - lowest.

The poll function handles all unprocessed channels, till all of
them are free, beginning from hi priority channel.

In dual_emac mode the channels are shared between two network devices,
as it's with single-queue default mode.

The statistic for every channel can be read with:
$ ethtool -S ethX

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: ti: davinci_cpdma: fix locking while ctrl_stop
Ivan Khoronzhuk [Mon, 22 Aug 2016 18:18:25 +0000 (21:18 +0300)]
net: ethernet: ti: davinci_cpdma: fix locking while ctrl_stop

The interrupts shouldn't be disabled while receiving skb, but while
ctrl_stop, the channels are stopped and all remaining packets are
handled with netif_receive_skb(), it can cause WARN_ONCE when ctrl
is stopping while not all packets were handled with NAPIs:

lock_irq_save
    cpdma_ctlr_stop
       cpdma_chan_top
           __cpdma_chan_free
               cpsw_rx_handler
                   netif_receive_skb

So, split locking while ctrl stop thus interrupts are still
enabled while skbs handling. It can cause WARN_ONCE in rare
cases when ctrl is stopping while not all packets were handled
with NAPIs.

Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: ti: davinci_cpdma: split descs num between all channels
Ivan Khoronzhuk [Mon, 22 Aug 2016 18:18:24 +0000 (21:18 +0300)]
net: ethernet: ti: davinci_cpdma: split descs num between all channels

Tx channels share same pool of descriptors. Thus one channel can
block another if pool is emptied by one. But, the shaper should
decide which channel is allowed to send packets. To avoid such
impact of one channel on another, let every channel to have its
own piece of pool.

Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@linaro.org>
Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: strparser: fix strparser sk_user_data check
Dave Watson [Mon, 22 Aug 2016 19:27:04 +0000 (12:27 -0700)]
net: strparser: fix strparser sk_user_data check

sk_user_data mismatch between what kcm expects (psock) and what strparser expects (strparser).

Queued rx_work, for example calling strp_check_rcv after socket buffer changes, will never complete.

sk_user_data is unused in strparser, so just remove the check.

Signed-off-by: Dave Watson <davejwatson@fb.com>
Acked-by: Tom Herbert <tom@herbertland.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed: Fix address macros
Yuval Mintz [Tue, 23 Aug 2016 04:19:50 +0000 (07:19 +0300)]
qed: Fix address macros

Last FW submission reverted various macros into an older form,
where they generate compilation warnings on some architectures.

Bring back the newer macros instead.

Fixes: 05fafbfb3d77 ("qed: utilize FW 8.10.10.0")
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'dsa-fix-MV88E6131-tagging'
David S. Miller [Tue, 23 Aug 2016 04:08:09 +0000 (21:08 -0700)]
Merge branch 'dsa-fix-MV88E6131-tagging'

Andrew Lunn says:

====================
Fix MV88E6131 tagging

Marvell has two different tagging protocols for frames passed to a
swicth. There is the older DSA and the newer EDSA. Somewhere along the
way, we broke support for switches which only support DSA, by trying
to configure them to use EDSA. These patches add back support for
switches which only support DSA, by allowing the drivers to
dynamically indicate the tagging protocol they support to the DSA
core. This needs to be dynamic since the mv88e6xxx has to support two
protocols.

Thanks go to Jamie Lentin for reporting the problem, helping debug it,
providing some of the fix, and testing.
====================

Tested-By: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: mv88e6xxx: Enable PORT_CONTROL_FORWARD_UNKNOWN for DSA-tagged CPU ports
Jamie Lentin [Mon, 22 Aug 2016 14:01:04 +0000 (16:01 +0200)]
net: mv88e6xxx: Enable PORT_CONTROL_FORWARD_UNKNOWN for DSA-tagged CPU ports

Without it, a mv88e6131 switch will not forward incoming unicast
packets to the CPU port.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agodsa: mv88e6xxx: Delete ppu timer when removing module
Andrew Lunn [Mon, 22 Aug 2016 14:01:03 +0000 (16:01 +0200)]
dsa: mv88e6xxx: Delete ppu timer when removing module

The PPU method of accessing PHYs makes use of a timer. Make sure this
timer is deleted before unloading the driver.

Reported-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: dsa: mv88e6xxx: Fix support for DSA tagging for older switches.
Andrew Lunn [Mon, 22 Aug 2016 14:01:02 +0000 (16:01 +0200)]
net: dsa: mv88e6xxx: Fix support for DSA tagging for older switches.

Older chips only support DSA tagging on the CPU port. New devices
support both DSA and EDSA. The driver needs to tell the core the tag
protocol to use, and configure the switch for what is available.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: dsa: Allow the DSA driver to indicate the tag protocol
Andrew Lunn [Mon, 22 Aug 2016 14:01:01 +0000 (16:01 +0200)]
net: dsa: Allow the DSA driver to indicate the tag protocol

DSA drivers may drive different families of switches which need
different tag protocol. Rather than hard code the tag protocol in the
driver structure, have a callback for the DSA core to call.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout
Geert Uytterhoeven [Mon, 22 Aug 2016 13:01:03 +0000 (15:01 +0200)]
net: ipconfig: Fix NULL pointer dereference on RARP/BOOTP/DHCP timeout

If no RARP, BOOTP, or DHCP response is received, ic_dev is never set,
causing a NULL pointer dereference in ic_close_devs():

    Sending DHCP requests ...... timed out!
    Unable to handle kernel NULL pointer dereference at virtual address 00000004

To fix this, add a check to avoid dereferencing ic_dev if it is still
NULL.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Fixes: 2647cffb2bc6fbed ("net: ipconfig: Support using "delayed" DHCP replies")
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge tag 'batadv-next-for-davem-20160822' of git://git.open-mesh.org/linux-merge
David S. Miller [Tue, 23 Aug 2016 03:38:25 +0000 (20:38 -0700)]
Merge tag 'batadv-next-for-davem-20160822' of git://git.open-mesh.org/linux-merge

Simon Wunderlich says:

====================
This feature patchset includes the following changes:

 - place kref_get near usage of referenced objects, separate patches
   for various used objects to improve readability and maintainability
   by Sven Eckelmann (18 patches)

 - Keep batadv net device when all hard interfaces disappear, to
   improve situations where tools currently use work arounds, by
   Sven Eckelmann

 - Add an option to disable debugfs support to minimize footprint when
   userspace uses netlink only, by Sven Eckelmann
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'cxgb4-tx-rate-limiting'
David S. Miller [Tue, 23 Aug 2016 01:29:14 +0000 (18:29 -0700)]
Merge branch 'cxgb4-tx-rate-limiting'

Rahul Lakkireddy says:

====================
TX max rate limiting for Chelsio T4/T5 adapters

This series of patches implement tx max rate limiting per queue on
Chelsio T4/T5 hardware.  This is achieved by first creating a tx
scheduling class with the specified max rate.  The queue is then
bound to the newly created class.  If a scheduling class with similar
max rate already exists, then the queue is bound to the matching class.

Patch 1 adds support for setting tx scheduling classes.
Patch 2 adds support to bind/unbind queues to/from the scheduling classes.
Patch 3 implements the set_tx_maxrate NDO.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: add support for tx max rate limiting
Rahul Lakkireddy [Mon, 22 Aug 2016 10:59:08 +0000 (16:29 +0530)]
cxgb4: add support for tx max rate limiting

Implement set_tx_maxrate NDO to perform per queue tx rate limiting.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: add support for per queue tx scheduling
Rahul Lakkireddy [Mon, 22 Aug 2016 10:59:07 +0000 (16:29 +0530)]
cxgb4: add support for per queue tx scheduling

Add support to bind/unbind specified tx queues to/from scheduling
classes.  If a queue is already bound to a scheduling class, it is
unbound first and then bound to a new specified class.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: add support for tx traffic scheduling classes
Rahul Lakkireddy [Mon, 22 Aug 2016 10:59:06 +0000 (16:29 +0530)]
cxgb4: add support for tx traffic scheduling classes

Add support to create tx traffic scheduling classes with specified
scheduling parameters.  Return an existing class if a match is found
with same scheduling parameters.

Signed-off-by: Rahul Lakkireddy <rahul.lakkireddy@chelsio.com>
Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'qed-sriov-legacy'
David S. Miller [Tue, 23 Aug 2016 01:24:52 +0000 (18:24 -0700)]
Merge branch 'qed-sriov-legacy'

Yuval Mintz says:

====================
qed*: IOV patch series

Recent FW [8.10.10.0] enabled us to support sriov interaction
with legacy VF/PF. This patch series adds the necessary driver changes
to utilize this additional compatibility.
In addition, utilize the new FW ability to prevent pause floods by VFs,
and fix a bug that is [mostly] exposed by the added legacy support.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed: Change locking scheme for VF channel
Yuval Mintz [Mon, 22 Aug 2016 10:25:12 +0000 (13:25 +0300)]
qed: Change locking scheme for VF channel

Each VF employees a lock that's supposed to serialize its usage of the
HW channel for communication with its PF, but the critical section is
ill-defined:

  - VFs currently release the lock whenever the PF response arrives,
    prior to actually processing the reply buffer [which was also supposed
    to have been protected by same lock].

  - The lock would be released on first response, ignoring the possibilty
    the sw flow isn't over [as might be the case of the acquisition flow].
    As a result, the flow would run unprotected and would cause a double
    mutex release [as the additional message completion would release it
    while its actually already free].

Change the flow to have a dedicated function to be called at end of each
flow and release the lock.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed*: Add support for VFs over legacy PFs
Yuval Mintz [Mon, 22 Aug 2016 10:25:11 +0000 (13:25 +0300)]
qed*: Add support for VFs over legacy PFs

Modern VFs can't run on old non-compatible as the fastpath HSI is
slightly changed - but as the HSI is actually very close [basically,
a single bit whose meaning flipped] this can be supported with small
modifications.

The major differences would be in:
  - Recognizing that VF is running on top of a legacy PF.
  - Returning some slowpath configurations that are no longer needed
    on top of modern PFs, but would be required when working over
    the legacy ones.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed: Prevent VFs from pause flooding
Yuval Mintz [Mon, 22 Aug 2016 10:25:10 +0000 (13:25 +0300)]
qed: Prevent VFs from pause flooding

Firmware would silently drop any control frame sent by VF to prevent
a malicious VF from generating pause flood in the network.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed: Add support for legacy VFs
Yuval Mintz [Mon, 22 Aug 2016 10:25:09 +0000 (13:25 +0300)]
qed: Add support for legacy VFs

The 8.10.x FW added support for forward compatability as well as
'future' backward compatibility, but only to those VFs that were
using HSI which was 8.10.x based or newer.

The latest firmware now supports backward compatibility for the
older VFs based on 8.7.x and 8.8.x firmware as well.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: phy: Add missing of_node_put() in xgmiitorgmii_probe()
Wei Yongjun [Sun, 21 Aug 2016 22:46:15 +0000 (22:46 +0000)]
net: phy: Add missing of_node_put() in xgmiitorgmii_probe()

This node pointer is returned by of_parse_phandle() with
refcount incremented in this function. of_node_put() on it
before exitting this function.

This is detected by Coccinelle semantic patch.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Reviewed-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agomlx5/core: Use memdup_user() rather than duplicating its implementation
Markus Elfring [Sat, 20 Aug 2016 05:50:09 +0000 (07:50 +0200)]
mlx5/core: Use memdup_user() rather than duplicating its implementation

* Reuse existing functionality from memdup_user() instead of keeping
  duplicate source code.

  This issue was detected by using the Coccinelle software.

* Return directly if this copy operation failed.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet_sched: properly handle failure case of tcf_exts_init()
WANG Cong [Fri, 19 Aug 2016 19:36:54 +0000 (12:36 -0700)]
net_sched: properly handle failure case of tcf_exts_init()

After commit 22dc13c837c3 ("net_sched: convert tcf_exts from list to pointer array")
we do dynamic allocation in tcf_exts_init(), therefore we need
to handle the ENOMEM case properly.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoRevert "l2tp: Refactor the codes with existing macros instead of literal number"
David S. Miller [Sun, 21 Aug 2016 22:50:11 +0000 (15:50 -0700)]
Revert "l2tp: Refactor the codes with existing macros instead of literal number"

This reverts commit 5ab1fe72d5490978104fc493615ea29dd7238766.

This change still has problems.

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agocxgb4: Simplify the return expression
Wei Yongjun [Sat, 20 Aug 2016 15:32:41 +0000 (15:32 +0000)]
cxgb4: Simplify the return expression

Simplify the return expression.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agol2tp: Refactor the codes with existing macros instead of literal number
Gao Feng [Sat, 20 Aug 2016 15:52:27 +0000 (23:52 +0800)]
l2tp: Refactor the codes with existing macros instead of literal number

Use PPP_ALLSTATIONS, PPP_UI, and SEND_SHUTDOWN instead of 0xff,
0x03, and 2 separately.

Signed-off-by: Gao Feng <fgao@ikuai8.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: renesas: ravb: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Fri, 19 Aug 2016 22:52:19 +0000 (00:52 +0200)]
net: ethernet: renesas: ravb: use new api ethtool_{get|set}_link_ksettings

The ethtool api {get|set}_settings is deprecated.
We move this driver to new api {get|set}_link_ksettings.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: ethernet: renesas: ravb: use phydev from struct net_device
Philippe Reynes [Fri, 19 Aug 2016 22:52:18 +0000 (00:52 +0200)]
net: ethernet: renesas: ravb: use phydev from struct net_device

The private structure contain a pointer to phydev, but the structure
net_device already contain such pointer. So we can remove the pointer
phy_dev in the private structure, and update the driver to use the
one contained in struct net_device.

Signed-off-by: Philippe Reynes <tremyfr@gmail.com>
Acked-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Sun, 21 Aug 2016 04:58:49 +0000 (21:58 -0700)]
Merge branch '10GbE' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
10GbE Intel Wired LAN Driver Updates 2016-08-20

This series contains updates to ixgbe and ixgbevf.

Veola fixes how the backplane reports the media in ethtool, as KR, KX or
KX4 based on the backplane interface present.

Emil fixes ixgbevf since an incorrect size parameter for
ixgbevf_write_msg_read_ack() ended up only giving the PF the first 4
bytes of the MAC address, so correct the size by calculating it on the
fly for all instances where we call ixgbevf_write_msg_read_ack().  Added
geneve receive offload support for x550em_a.

Don fixes the LED interface for x557 since it uses a different interface.
Added support for the new x557 copper device.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoixgbe: Add support for new X557 device
Don Skidmore [Thu, 18 Aug 2016 00:34:40 +0000 (20:34 -0400)]
ixgbe: Add support for new X557 device

This patch adds support for the new copper device X557.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: add device to MDIO speed setting
Don Skidmore [Wed, 17 Aug 2016 21:34:07 +0000 (17:34 -0400)]
ixgbe: add device to MDIO speed setting

This shouldn't matter as nothing should be attached still to be
consisted control MDIO speed for these devices as well.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: Fix led interface for X557 devices
Don Skidmore [Wed, 17 Aug 2016 18:11:57 +0000 (14:11 -0400)]
ixgbe: Fix led interface for X557 devices

The X557 devices use a different interface to the LED for the port.
This patch reflect that change.

Signed-off-by: Don Skidmore <donald.c.skidmore@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: add support for geneve Rx offload
Emil Tantilov [Wed, 10 Aug 2016 18:19:23 +0000 (11:19 -0700)]
ixgbe: add support for geneve Rx offload

Add geneve Rx offload support for x550em_a.

The implementation follows the vxlan code with the lower 16 bits of
the VXLANCTRL register holding the UDP port for VXLAN and the upper
for Geneve.

Disabled NFS filters in the RFCTL register which allows us to simplify
the check for VXLAN and Geneve packets in ixgbe_rx_checksum().

Removed vxlan from the name of the callback functions and replaced it
with udp_tunnel which is more in line with the new API.

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbevf: fix incorrect MAC address on load
Emil Tantilov [Wed, 27 Jul 2016 17:55:08 +0000 (10:55 -0700)]
ixgbevf: fix incorrect MAC address on load

The PF driver was only receiving the first 4 bytes of the MAC due
to an incorrect size parameter for ixgbevf_write_msg_read_ack()
in ixgbevf_set_rar_vf().

Correct the size by calculating it on a fly for all instances where
we call ixgbevf_write_msg_read_ack()

Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoixgbe: report correct media type for KR, KX and KX4 interfaces
Veola Nazareth [Sun, 21 Aug 2016 02:35:37 +0000 (19:35 -0700)]
ixgbe: report correct media type for KR, KX and KX4 interfaces

ethtool reports backplane type interfaces as 1000/10000baseT link modes.
This has been corrected to report the media as KR, KX or KX4 based on the backplane interface present.

Signed-off-by: Veola Nazareth <veola.nazareth@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoMerge branch 'tun-cleanups'
David S. Miller [Sun, 21 Aug 2016 02:11:34 +0000 (19:11 -0700)]
Merge branch 'tun-cleanups'

Markus Elfring says:

====================
tun: Fine-tuning for update_filter()

A few update suggestions were taken into account
from static source code analysis.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agotun: Rename a jump label in update_filter()
Markus Elfring [Sat, 20 Aug 2016 07:00:34 +0000 (09:00 +0200)]
tun: Rename a jump label in update_filter()

Adjust a jump target according to the Linux coding style convention.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agotun: Use memdup_user() rather than duplicating its implementation
Markus Elfring [Sat, 20 Aug 2016 06:54:15 +0000 (08:54 +0200)]
tun: Use memdup_user() rather than duplicating its implementation

Reuse existing functionality from memdup_user() instead of keeping
duplicate source code.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Reviewed-by: Shmulik Ladkani <shmulik.ladkani@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Sun, 21 Aug 2016 01:56:30 +0000 (18:56 -0700)]
Merge branch '40GbE' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
40GbE Intel Wired LAN Driver Updates 2016-08-19

This series contains updates to i40e and i40evf only.

Jake provides several patches, first just moves a function to co-locate
the two functions related to configuring RSS via the admin queue, which
should help in spotting bugs when comparing the two functions.  Fixed
an issue where commit e69ff813af35 ("i40e: rework the functions to
configure RSS with similar parameters") missed checking whether the seed
is NULL before using it and did not use the passed in *lut parameter.
Fixed an issue where a previous refactor missed i40e_vsi_config_rss()
and the values were being ignored, so checked for the fields and used
them instead of default values.  Lastly replaced calls to
create_singlethread_workqueue() with alloc_workqueue() to provide more
control over workqueue creation and allows explicit setting of the
desired mode of operation.

Mitch adds link speed to log messages and reports speed through ethtool.

Carolyn refactors tail bump check and fixes byte ordering problems found
when enabling this feature support.  Adds support for HMC resources and
profile commands for x722 firmware.

Heinrich Schuchardt fixes format identifiers from %u to %d since the
variable is defined as an integer.

Catherine fixes an issue where there was a race condition between the
completion of the client open and calls to the client ops, so ensured
that client ops are not called until we are sure client is open.

Harshitha makes sure that i40e_client_release() does not try to use
an adapter pointer which may not be initialized, so make sure it is.

Joe Perches fixes the use of the local macro XSTRINGIFY() to use
__stringify() instead.

Avinash corrects the mutex usage in client_subtask().  Fixed the RDMA
client to open again after reset since it is closed during a PF reset.

Jeff (me) clean up whitespace issues, where indentation was done
inconsistently and with spaces versus tabs.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agosamples/bpf: Add tunnel set/get tests.
William Tu [Fri, 19 Aug 2016 18:55:44 +0000 (11:55 -0700)]
samples/bpf: Add tunnel set/get tests.

The patch creates sample code exercising bpf_skb_{set,get}_tunnel_key,
and bpf_skb_{set,get}_tunnel_opt for GRE, VXLAN, and GENEVE.  A native
tunnel device is created in a namespace to interact with a lwtunnel
device out of the namespace, with metadata enabled.  The bpf_skb_set_*
program is attached to tc egress and bpf_skb_get_* is attached to egress
qdisc.  A ping between two tunnels is used to verify correctness and
the result of bpf_skb_get_* printed by bpf_trace_printk.

Signed-off-by: William Tu <u9012063@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agohv_netvsc: Implement batching of receive completions
Haiyang Zhang [Fri, 19 Aug 2016 21:47:09 +0000 (14:47 -0700)]
hv_netvsc: Implement batching of receive completions

The existing code uses busy retry when unable to send out receive
completions due to full ring buffer. It also gives up retrying after limit
is reached, and causes receive buffer slots not being recycled.
This patch implements batching of receive completions. It also prevents
dropping receive completions due to full ring buffer.

Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com>
Reviewed-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoi40evf: Open RDMA Client after reset
Avinash Dayanand [Wed, 17 Aug 2016 23:04:08 +0000 (16:04 -0700)]
i40evf: Open RDMA Client after reset

RDMA client is closed during the PF reset and needs to be opened again.
Setting the flag so that RDMA client is opened in watchdog() function.

Change-ID: I507b1e4cbd05528cdff68fd360ef3dcac8901263
Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e/i40evf: Fix indentation
Jeff Kirsher [Sat, 20 Aug 2016 04:47:41 +0000 (21:47 -0700)]
i40e/i40evf: Fix indentation

Several defines and code comments were indented with spaces instead
of tabs, correct the issue to make indentation consistent.

Change-ID: I0dc6bbb990ec4a9e856acc9ec526d876181f092c
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
8 years agoi40e: Correcting mutex usage in client code
Avinash Dayanand [Wed, 17 Aug 2016 23:04:06 +0000 (16:04 -0700)]
i40e: Correcting mutex usage in client code

Correcting the mutex usage, in client_subtask(), mutex_unlock has
to be called just before client_del_instance() since this function opens
and later closes the same mutex again.
Similarly in client_is_registered removing the mutex since it closes
the mutex twice.

This is a patch suggested by RDMA team.

Change-ID: Icce519c266e4221b8a2a72a15ba5bf01750e5852
Signed-off-by: Avinash Dayanand <avinash.dayanand@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Remove XSTRINGIFY macro definitions and uses
Joe Perches [Wed, 17 Aug 2016 10:37:31 +0000 (03:37 -0700)]
i40e: Remove XSTRINGIFY macro definitions and uses

Use __stringify instead.

Signed-off-by: Joe Perches <joe@perches.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Initialize pointer in client_release function
Harshitha Ramamurthy [Mon, 15 Aug 2016 21:17:19 +0000 (14:17 -0700)]
i40e: Initialize pointer in client_release function

The function i40e_client_release has a print statement that uses an
adapter pointer which is not initialized if a previous if statement
is not true. Hence, intialize it in the right place.

Change-ID: I1afdaa2c46771ac42be56edcc41bb56b455b06c8
Signed-off-by: Harshitha Ramamurthy <harshitha.ramamurthy@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Check client is open before calling client ops
Catherine Sullivan [Mon, 15 Aug 2016 21:17:18 +0000 (14:17 -0700)]
i40e: Check client is open before calling client ops

We were having a race between the completion of the client open and
calls to the client ops so don't call a client op unless we are sure the
client is open.

Testing Hints: Load IWARP driver and make sure it works as expected.

Change-Id: I741f4f2aa4fcbfdad3e40dabbbb1b005856c396b
Signed-off-by: Catherine Sullivan <catherine.sullivan@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: use matching format identifiers
Heinrich Schuchardt [Wed, 10 Aug 2016 23:07:22 +0000 (01:07 +0200)]
i40e: use matching format identifiers

i is defined as int but output as %u several times.
Adjust the format identifiers.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Add support for HMC resource and profile for X722
Carolyn Wyborny [Thu, 4 Aug 2016 18:37:05 +0000 (11:37 -0700)]
i40e: Add support for HMC resource and profile for X722

This patch adds support for HMC resource and profile cmds for X722
firmware.

Change-ID: Icc332101f38ab15d1bfa167823100eb4f6822f7e
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: Fix byte ordering in ARP NS code for X722
Carolyn Wyborny [Thu, 4 Aug 2016 18:37:04 +0000 (11:37 -0700)]
i40e: Fix byte ordering in ARP NS code for X722

This patch fixes byte ordering problems found when enabling this feature
support. Without this patch, the feature will not work correctly. This
patch fixes the definitions to have the correct byte order.

Change-ID: Ic7489fbcbe2195df7be62ff5e359201b827cefe6
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: refactor tail_bump check
Carolyn Wyborny [Thu, 4 Aug 2016 18:37:03 +0000 (11:37 -0700)]
i40e: refactor tail_bump check

This patch refactors tail bump check.

Change-ID: Ide0e19171d67d90cb2b06b8dcd4fa791ae120160
Signed-off-by: Carolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40evf: report link speed
Mitch Williams [Thu, 4 Aug 2016 18:37:02 +0000 (11:37 -0700)]
i40evf: report link speed

The PF driver tells us the link speed, so do something with that
information. Add link speed to log messages, and report speed through
ethtool.

Change-Id: I279dc9540cc5203376406050a3e8d67e128d5882
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: use alloc_workqueue instead of create_singlethread_workqueue
Jacob Keller [Thu, 4 Aug 2016 18:37:01 +0000 (11:37 -0700)]
i40e: use alloc_workqueue instead of create_singlethread_workqueue

Replace calls to create_singlethread_workqueue instead with alloc_workqueue
as is style with other Intel drivers. This provides more control over
workqueue creation, and allows explicit setting of the desired mode of
operation. It also makes it more obvious that driver name constant is
passed to a format "%s".

Change-ID: I6192b44caf5140336cd54c5b350d51c73b541fdb
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: use configured RSS key and lookup table in i40e_vsi_config_rss
Jacob Keller [Tue, 19 Jul 2016 23:23:31 +0000 (16:23 -0700)]
i40e: use configured RSS key and lookup table in i40e_vsi_config_rss

A previous refactor added support to store user configuration for VSIs,
so that extra VSIs such as for VMDq can use this information when
configuring. Unfortunately the i40e_vsi_config_rss function was missed
in this refactor, and the values were being ignored. Fix this by
checking for the fields and using those instead of always using the
default values.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: fix broken i40e_config_rss_aq function
Jacob Keller [Tue, 19 Jul 2016 23:23:30 +0000 (16:23 -0700)]
i40e: fix broken i40e_config_rss_aq function

X722 hardware requires using the admin queue to configure RSS. This
function was previously re-written in commit e69ff813af35 ("i40e: rework
the functions to configure RSS with similar parameters").
However, the previous refactor did not work correctly for a few reasons

(a) it does not check whether seed is NULL before using it, resulting in
a NULL pointer dereference

[  402.954721] BUG: unable to handle kernel NULL pointer dereference at           (null)
[  402.955568] IP: [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e]
[  402.956402] PGD ad610067 PUD accc0067 PMD 0
[  402.957235] Oops: 0000 [#1] SMP
[  402.958064] Modules linked in: ip6t_rpfilter ip6t_REJECT nf_reject_ipv6 xt_conntrack ip_set nfnetlink ebtable_filter ebtable_
broute bridge stp llc ebtable_nat ebtables ip6table_mangle ip6table_raw ip6table_nat nf_conntrack_ipv6 nf_defrag_ipv6 nf_nat_ipv
6 ip6table_security ip6table_filter ip6_tables iptable_mangle iptable_raw iptable_nat nf_conntrack_ipv4_ nf_defrag_ipv4_ nf_nat_ip
v4_ nf_nat nf_conntrack iptable_security intel_rapl i86_kg_temp_thermal coretemp kvm_intel kvm irqbypass crct10dif_clMl crc32_
pclMl ghash_clMlni_intel iTCO_wdt iTCO_vendor_support shpchp sb_edac dcdbas pcspkr joydev ipmi_devintf wmi edac_core ipmi_ssif
 acpi_ad acpi_ower_meter ipmi_si ipmi_msghandler mei_me nfsd lpc_ich mei ioatdma tpm_tis auth_rpcgss tpm nfs_acl lockd grace s
unrpc ifs nngag200 i2c_algo_bit drm_kms_helper ttm drm iigbe bnx2x i40e dca mdio ptp pps_core libcrc32c fjes crc32c_intel
[  402.965563] CPU: 22 PID: 2461 Conm: ethtool Not tainted 4.6.0-rc7_1.2-ABNidQ+ #20
[  402.966719] Hardware name: Dell Inc. PowerEdge R720/0C4Y3R, BIOS 2.5.2 01/28/2015
[  402.967862] task: ffff880219b51dc0 ti: ffff8800b3408000 task.ti: ffff8800b3408000
[  402.969046] RIP: 0010:[<ffffffffa0090ccf>]  [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e]
[  402.970339] RSP: 0018:ffff8800b340ba90  EFLAGS: 00010246
[  402.971616] RAX: 0000000000000000 RBX: ffff88042ec14000 RCX: 0000000000000200
[  402.972961] RDX: ffff880428eb9200 RSI: 0000000000000000 RDI: ffff88042ec14000
[  402.974312] RBP: ffff8800b340baf8 R08: ffff880237ada8f0 R09: ffff880428eb9200
[  402.975709] R10: ffff880428eb9200 R11: 0000000000000000 R12: ffff88042ec2e000
[  402.977104] R13: ffff88042ec2e000 R14: ffff88042ec14000 R15: ffff88022ea00800
[  402.978541] FS:  00007f84fd054700(0000) GS:ffff880237ac0000(0000) knlGS:0000000000000000
[  402.980003] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  402.981508] CR2: 0000000000000000 CR3: 000000003289e000 CR4: 00000000000406e0
[  402.983028] Stack:
[  402.984578]  0000000002000200 0000000000000000 ffff88023ffeda68 ffff88023ffef000
[  402.986187]  0000000000000268 ffff8800b340bbf8 ffff88023ffedd80 0000000088ce4f1d
[  402.987844]  ffff88042ec14000 ffff88022ea00800 ffff88042ec2e000 ffff88042ec14000
[  402.989509] Call Trace:
[  402.991200]  [<ffffffffa009636f>] i40e_config_rss+0x11f/0x1c0 [i40e]
[  402.992924]  [<ffffffffa00a1ae0>] i40e_set_rifh+0ic0/0x130 [i40e]
[  402.994684]  [<ffffffff816d54b7>] ethtool_set_rifh+0x1f7/0x300
[  402.996446]  [<ffffffff8136d02b>] ? cred_has_capability+0io6b/0x100
[  402.998203]  [<ffffffff8136d102>] ? selinux_capable+0x12/0x20
[  402.999968]  [<ffffffff8136277b>] ? security_capable+0x4b/0x70
[  403.001707]  [<ffffffff816d6da3>] dev_ethtool+0x1423/0x2290
[  403.003461]  [<ffffffff816eab41>] dev_ioctl+0x191/0io630
[  403.005186]  [<ffffffff811cf80a>] ? lru_cache_add+0x3a/0i80
[  403.006942]  [<ffffffff817f2a8e>] ? _raw_spin_unlock+0ie/0x20
[  403.008691]  [<ffffffff816adb95>] sock_do_ioctl+0x45/0i50
[  403.010421]  [<ffffffff816ae229>] sock_ioctl+0x209/0x2d0
[  403.012173]  [<ffffffff81262194>] do_vfs_ioctl+0u4/0io6c0
[  403.013911]  [<ffffffff81262829>] SyS_ioctl+0x79/0x90
[  403.015710]  [<ffffffff817f2e72>] entry_SYSCALL_64_fastpath+0x1a/0u4
[  403.017500] Code: 90 55 48 89 e5 41 57 41 56 41 55 41 54 53 48 89 fb 48 83 ec 40 4c 8b a7 e0 05 00 00 65 48 8b 04 25 28 00 00 00 48 89 45 d0 31 c0 <48> 8b 06 41 0f b7 bc 24 f2 0f 00 00 48 89 45 9c 48 8b 46 08 48
[  403.021454] RIP  [<ffffffffa0090ccf>] i40e_config_rss_aq.constprop.65+0x2f/0x1c0 [i40e]
[  403.023395]  RSP <ffff8800b340ba90>
[  403.025271] CR2: 0000000000000000
[  403.027169] ---[ end trace 64561b528cf61cf0 ]---

(b) it does not even bother to use the passed in *lut parameter which
defines the requested lookup table. Instead it uses its own round robin
table.

Fix these issues by re-writing it to be similar to i40e_config_rss_reg
and i40e_get_rss_aq.

Fixes: e69ff813af35 ("i40e: rework the functions to configure RSS with similar parameters", 2015-10-21)
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agoi40e: move i40e_vsi_config_rss below i40e_get_rss_aq
Jacob Keller [Tue, 19 Jul 2016 23:23:29 +0000 (16:23 -0700)]
i40e: move i40e_vsi_config_rss below i40e_get_rss_aq

Move this function below the two functions related to configuring RSS
via the admin queue. This helps co-locate the two functions, and made it
easier to spot a bug in the first i40e_config_rss_aq function as
compared to the i40e_get_rss_aq function.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
8 years agonet/irda: remove pointless assignment/check
Vegard Nossum [Fri, 19 Aug 2016 16:08:57 +0000 (18:08 +0200)]
net/irda: remove pointless assignment/check

We've already set sk to sock->sk and dereferenced it, so if it's NULL
we would have crashed already. Moreover, if it was NULL we would have
crashed anyway when jumping to 'out' and trying to unlock the sock.
Furthermore, if we had assigned a different value to 'sk' we would
have been calling lock_sock() and release_sock() on different sockets.

My conclusion is that these two lines are complete nonsense and only
serve to confuse the reader.

Signed-off-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoqed: utilize FW 8.10.10.0
Yuval Mintz [Fri, 19 Aug 2016 06:33:31 +0000 (09:33 +0300)]
qed: utilize FW 8.10.10.0

This new firmware for the qed* adpaters fixes several issues:
 - Better blocking of malicious VFs.
 - After FLR, Tx-switching [internal routing] of packets might
   be incorrect.
 - Deletion of unicast MAC filters would sometime have side-effect
   of corrupting the MAC filters configred for a device.
It also contains fixes for future qed* drivers that *hopefully* would be
sent for review in the near future.

In addition, it would allow driver some new functionality, including:
 - Allowing PF/VF driver compaitibility with old drivers [running
   pre-8.10.5.0 firmware].
 - Better debug facilities.

This would also bump the qed* driver versions to 8.10.9.20.

Signed-off-by: Yuval Mintz <Yuval.Mintz@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next...
David S. Miller [Sat, 20 Aug 2016 00:19:20 +0000 (17:19 -0700)]
Merge branch '10GbE' of git://git./linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
10GbE Intel Wired LAN Driver Updates 2016-08-18

This series contains updates to ixgbe and ixgbevf.

Emil cleans up confusing amongst the users by making an error message
into a debug message, since the TXDCTL.ENABLE (and comparable
VFTXDCTL.ENABLE for ixgbevf) bit is set only when the
transmit queue is actually enabled, which may not happen during the
configure phase eve if we waited for it.  Converts to using netdev_dbg()
macro instead of our home brewed macro for ixgbevf.  Converted the
service task to use atomic bitwise operations when setting and checking
reset requests to reduce the possibility of race conditions.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agoMerge branch 'bcm_sf2-platform-dev'
David S. Miller [Sat, 20 Aug 2016 00:15:37 +0000 (17:15 -0700)]
Merge branch 'bcm_sf2-platform-dev'

Florian Fainelli says:

====================
net: dsa: bcm_sf2: Platform conversion

This patch series converts the bcm_sf2 driver from a traditional DSA driver
into a platform_device driver and makes it use the new DSA binding that Andrew
introduced in the latest merge window.

Prior attempts used to coerce the code in net/dsa/dsa2.c to accept the old
binding, while really there is only one broken single user out there: bcm_sf2,
so instead, just assume the new DT binding is deployed and use it accordingly.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
8 years agonet: dsa: bcm_sf2: Remove probing through old DSA binding
Florian Fainelli [Thu, 18 Aug 2016 22:30:16 +0000 (15:30 -0700)]
net: dsa: bcm_sf2: Remove probing through old DSA binding

Remove our dsa_switch_driver::drv_probe callback to prevent probing
through the old DSA binding, not that this could happen anymore now that
we have moved the matching compatible string from net/dsa/dsa.c to
drivers/net/dsa/bcm_sf2.c, so this is essentially dead code.

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