cascardo/linux.git
7 years agoiwlwifi: add the new 8275 series
Oren Givon [Thu, 7 Jul 2016 06:11:56 +0000 (09:11 +0300)]
iwlwifi: add the new 8275 series

Add a new config struct for the new 8275 series and add
the first PCI ID for it.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: add the new 9560 series
Oren Givon [Thu, 7 Jul 2016 07:40:27 +0000 (10:40 +0300)]
iwlwifi: add the new 9560 series

Add a new config struct for the new 9560 series and add
the 4 new PCI IDs for it.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: Set affinity mask for rx interrupt vectors per cpu
Haim Dreyfuss [Sun, 13 Mar 2016 15:51:59 +0000 (17:51 +0200)]
iwlwifi: pcie: Set affinity mask for rx interrupt vectors per cpu

In order to utilize the host's CPUs in the most efficient way
we bind each rx interrupt vector to each CPU on the host.
Each rx interrupt is prioritized to execute only on the designated CPU
rather than any CPU.
Processor affinity takes advantage of the fact that some remnants of
a process that was run on a given processor may remain in that
processor's memory state for example, data in the CPU cache after
another process is run on that CPU. Scheduling that process to execute
on the same processor could result in an efficient use of process by
reducing performance-degrading situations such as cache misses
and parallel processing.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: free reserved queue on STA removal
Liad Kaufman [Thu, 7 Jul 2016 10:25:59 +0000 (13:25 +0300)]
iwlwifi: mvm: free reserved queue on STA removal

When a STA is removed in DQA mode, if no traffic went through
its reserved queue, the txq continues to be marked as
reserved and no STA can use it.

Make sure that in such a case the reserved queue is marked
as free when the STA is removed.

Fixes: commit 24afba7690e4 ("iwlwifi: mvm: support bss dynamic alloc/dealloc of queues")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: fix pending frames tracking on tx resp
Liad Kaufman [Thu, 7 Jul 2016 08:00:26 +0000 (11:00 +0300)]
iwlwifi: mvm: fix pending frames tracking on tx resp

In iwl_mvm_rx_tx_cmd_single(), when checking if a given TID is
aggregated, the driver doesn't check whether or not the queue
itself can be aggregated. For example, a management queue might
be marked as aggregated if TID 0 is aggregated on a (different)
data queue.

Make sure that mgmt frames are sent with TID IWL_TID_NON_QOS,
and in this way make sure no mixups of this sort happen.

Fixes: commit 24afba7690e4 ("iwlwifi: mvm: support bss dynamic alloc/dealloc of queues")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: Configure shared interrupt vector in MSIX mode
Haim Dreyfuss [Sun, 20 Mar 2016 15:57:22 +0000 (17:57 +0200)]
iwlwifi: pcie: Configure shared interrupt vector in MSIX mode

In case the OS provides fewer interrupts than requested, different
causes will share the same interrupt vector as follow:
1.One interrupt less: non rx causes shared with FBQ.
2.Two interrupts less: non rx causes shared with FBQ and RSS.
3.More than two interrupts: we will use fewer RSS queues.

Also make the request depend on the number of online CPUs
instead of possible CPUs.

Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: support new BA notification response
Sara Sharon [Sun, 17 Jul 2016 11:24:55 +0000 (14:24 +0300)]
iwlwifi: mvm: support new BA notification response

Support new format. TX response will not be sent anymore,
so all needed data is in the BA response.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: merge iwl_queue and iwl_txq
Sara Sharon [Thu, 7 Jul 2016 15:17:45 +0000 (18:17 +0300)]
iwlwifi: pcie: merge iwl_queue and iwl_txq

The original intent was to have the general iwl_queue shared
between RX and TX queues, but it is not the actual status.
Since it is not shared with any struct but iwl_txq, it adds
unnecessary complexity. Merge those structs.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: change byte count table for a000 devices
Sara Sharon [Mon, 4 Jul 2016 11:34:26 +0000 (14:34 +0300)]
iwlwifi: change byte count table for a000 devices

Since TFD was enlarged to 256 bytes, the fetch of the TFD
itself is very expensive.
To make DRAM to SRAM more efficient, bits 12-13 will indicate
the number of 64 byte chunks that should be transferred to
SRAM.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: assign and access a000 TFD & TBs
Sara Sharon [Sun, 26 Jun 2016 10:17:56 +0000 (13:17 +0300)]
iwlwifi: pcie: assign and access a000 TFD & TBs

Previous patch introduced the new formats. This patch
allocates the new structures and adjusts code accordingly.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: introduce trans API to get byte count table
Sara Sharon [Mon, 4 Jul 2016 12:40:11 +0000 (15:40 +0300)]
iwlwifi: introduce trans API to get byte count table

In future HW the byte count table address will be configured
by ucode per queue. Add API to expose the byte count table to
the opmode

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoMerge tag 'rxrpc-rewrite-20160913-2' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Fri, 16 Sep 2016 05:57:19 +0000 (01:57 -0400)]
Merge tag 'rxrpc-rewrite-20160913-2' of git://git./linux/kernel/git/dhowells/linux-fs

David Howells says:

====================
rxrpc: Support IPv6

Here is a set of patches that add IPv6 support.  They need to be applied on
top of the just-posted miscellaneous fix patches.  They are:

 (1) Make autobinding of an unconnected socket work when sendmsg() is
     called to initiate a client call.

 (2) Don't specify the protocol when creating the client socket, but rather
     take the default instead.

 (3) Use rxrpc_extract_addr_from_skb() in a couple of places that were
     doing the same thing manually.  This allows the IPv6 address
     extraction to be done in fewer places.

 (4) Add IPv6 support.  With this, calls can be made to IPv6 servers from
     userspace AF_RXRPC programs; AFS, however, can't use IPv6 yet as the
     RPC calls need to be upgradeable.
====================

Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge tag 'rxrpc-rewrite-20160913-1' of git://git.kernel.org/pub/scm/linux/kernel...
David S. Miller [Fri, 16 Sep 2016 05:52:20 +0000 (01:52 -0400)]
Merge tag 'rxrpc-rewrite-20160913-1' of git://git./linux/kernel/git/dhowells/linux-fs

David Howells says:

====================
rxrpc: Miscellaneous fixes

Here's a set of miscellaneous fix patches.  There are a couple of points of
note:

 (1) There is one non-fix patch that adjusts the call ref tracking
     tracepoint to make kernel API-held refs on calls more obvious.  This
     is a prerequisite for the patch that fixes prealloc refcounting.

 (2) The final patch alters how jumbo packets that partially exceed the
     receive window are handled.  Previously, space was being left in the
     Rx buffer for them, but this significantly hurts performance as the Rx
     window can't be increased to match the OpenAFS Tx window size.

     Instead, the excess subpackets are discarded and an EXCEEDS_WINDOW ACK
     is generated for the first.  To avoid the problem of someone trying to
     run the kernel out of space by feeding the kernel a series of
     overlapping maximal jumbo packets, we stop allowing jumbo packets on a
     call if we encounter more than three jumbo packets with duplicate or
     excessive subpackets.
====================

Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'libcxgb-next'
David S. Miller [Fri, 16 Sep 2016 00:49:30 +0000 (20:49 -0400)]
Merge branch 'libcxgb-next'

Varun Prakash says:

====================
iw_cxgb4,cxgbit: remove duplicate code

This patch series removes duplicate code from
iw_cxgb4 and cxgbit by adding common function
definitions in libcxgb.

Please review.
====================

Reviewed-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_mk_rx_data_ack()
Varun Prakash [Tue, 13 Sep 2016 15:54:06 +0000 (21:24 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_rx_data_ack()

Add cxgb_mk_rx_data_ack() to remove duplicate
code to form CPL_RX_DATA_ACK hardware command.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_mk_abort_rpl()
Varun Prakash [Tue, 13 Sep 2016 15:54:05 +0000 (21:24 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_abort_rpl()

Add cxgb_mk_abort_rpl() to remove duplicate
code to form CPL_ABORT_RPL hardware command.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_mk_abort_req()
Varun Prakash [Tue, 13 Sep 2016 15:54:04 +0000 (21:24 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_abort_req()

Add cxgb_mk_abort_req() to remove duplicate code
to form CPL_ABORT_REQ hardware command.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb, iw_cxgb4, cxgbit: add cxgb_mk_close_con_req()
Varun Prakash [Tue, 13 Sep 2016 15:54:03 +0000 (21:24 +0530)]
libcxgb, iw_cxgb4, cxgbit: add cxgb_mk_close_con_req()

Add cxgb_mk_close_con_req() to remove duplicate
code to form CPL_CLOSE_CON_REQ hardware command.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_mk_tid_release()
Varun Prakash [Tue, 13 Sep 2016 15:54:02 +0000 (21:24 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_mk_tid_release()

Add cxgb_mk_tid_release() to remove duplicate code
to form CPL_TID_RELEASE hardware command.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_compute_wscale()
Varun Prakash [Tue, 13 Sep 2016 15:54:01 +0000 (21:24 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_compute_wscale()

Add cxgb_compute_wscale() in libcxgb_cm.h to remove
it's duplicate definitions from cxgb4/cm.c and
cxgbit/cxgbit_cm.c.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_best_mtu()
Varun Prakash [Tue, 13 Sep 2016 15:54:00 +0000 (21:24 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_best_mtu()

Add cxgb_best_mtu() in libcxgb_cm.h to remove
it's duplicate definitions from cxgb4/cm.c and
cxgbit/cxgbit_cm.c

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_is_neg_adv()
Varun Prakash [Tue, 13 Sep 2016 15:53:59 +0000 (21:23 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_is_neg_adv()

Add cxgb_is_neg_adv() in libcxgb_cm.h to remove
it's duplicate definitions from cxgb4/cm.c and
cxgbit/cxgbit_cm.c.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_find_route6()
Varun Prakash [Tue, 13 Sep 2016 15:53:58 +0000 (21:23 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_find_route6()

Add cxgb_find_route6() in libcxgb_cm.c to remove
it's duplicate definitions from cxgb4/cm.c and
cxgbit/cxgbit_cm.c.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_find_route()
Varun Prakash [Tue, 13 Sep 2016 15:53:57 +0000 (21:23 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_find_route()

Add cxgb_find_route() in libcxgb_cm.c to remove
it's duplicate definitions from cxgb4/cm.c and
cxgbit/cxgbit_cm.c.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agolibcxgb,iw_cxgb4,cxgbit: add cxgb_get_4tuple()
Varun Prakash [Tue, 13 Sep 2016 15:53:56 +0000 (21:23 +0530)]
libcxgb,iw_cxgb4,cxgbit: add cxgb_get_4tuple()

Add cxgb_get_4tuple() in libcxgb_cm.c to remove
it's duplicate definitions from cxgb4/cm.c and
cxgbit/cxgbit_cm.c.

Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoopenvswitch: avoid deferred execution of recirc actions
Lance Richardson [Tue, 13 Sep 2016 14:08:54 +0000 (10:08 -0400)]
openvswitch: avoid deferred execution of recirc actions

The ovs kernel data path currently defers the execution of all
recirc actions until stack utilization is at a minimum.
This is too limiting for some packet forwarding scenarios due to
the small size of the deferred action FIFO (10 entries). For
example, broadcast traffic sent out more than 10 ports with
recirculation results in packet drops when the deferred action
FIFO becomes full, as reported here:

     http://openvswitch.org/pipermail/dev/2016-March/067672.html

Since the current recursion depth is available (it is already tracked
by the exec_actions_level pcpu variable), we can use it to determine
whether to execute recirculation actions immediately (safe when
recursion depth is low) or defer execution until more stack space is
available.

With this change, the deferred action fifo size becomes a non-issue
for currently failing scenarios because it is no longer used when
there are three or fewer recursions through ovs_execute_actions().

Suggested-by: Pravin Shelar <pshelar@ovn.org>
Signed-off-by: Lance Richardson <lrichard@redhat.com>
Acked-by: Pravin B Shelar <pshelar@ovn.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'cls_flower-port-masks'
David S. Miller [Fri, 16 Sep 2016 00:27:30 +0000 (20:27 -0400)]
Merge branch 'cls_flower-port-masks'

Or Gerlitz says:

====================
net/sched: cls_flower: Add ports masks

This series adds the ability to specify tcp/udp ports masks
for TC/flower filter matches.

I also removed an unused fields from the flower keys struct
and clarified the format of the recently added vlan attibutes.

v1--> v2 changes:

 * fixes typo in patch #2 title and change log (Sergei)
 * added acks provided by Jiri on v1

FWIW, by mistake the cover letter of V1 (but not the patches)
carried V2 tag, hope this doesn't create too much confusion.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet/sched: cls_flower: Specify vlan attributes format in the UAPI header
Or Gerlitz [Thu, 15 Sep 2016 12:28:24 +0000 (15:28 +0300)]
net/sched: cls_flower: Specify vlan attributes format in the UAPI header

Specify the format (size and endianess) for the vlan attributes.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet/sched: cls_flower: Remove an unused field from the filter key structure
Or Gerlitz [Thu, 15 Sep 2016 12:28:23 +0000 (15:28 +0300)]
net/sched: cls_flower: Remove an unused field from the filter key structure

Commit c3f8324188fa "net: Add full IPv6 addresses to flow_keys" added an
unused instance of struct flow_dissector_key_addrs into struct fl_flow_key,
remove it.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Reported-by: Hadar Hen Zion <hadarh@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet/sched: cls_flower: Support masking for matching on tcp/udp ports
Or Gerlitz [Thu, 15 Sep 2016 12:28:22 +0000 (15:28 +0300)]
net/sched: cls_flower: Support masking for matching on tcp/udp ports

Add the definitions for src/dst udp/tcp port masks and use
them when setting && dumping the relevant keys.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: Paul Blakey <paulb@mellanox.com>
Acked-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoalx: fix error handling in __alx_open
Tobias Regnery [Tue, 13 Sep 2016 10:06:57 +0000 (12:06 +0200)]
alx: fix error handling in __alx_open

In commit 9ee7b683ea63 we moved the enablement of msi interrupts earlier in
alx_init_intr. If there is an error in alx_alloc_rings, __alx_open returns
with an error but msi (or msi-x) interrupts stays enabled. Add a new error
label to disable msi (or msi-x) interrupts.

Fixes: 9ee7b683ea63 ("alx: refactor msi enablement and disablement")
Signed-off-by: Tobias Regnery <tobias.regnery@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agocxgb4vf: don't offload Rx checksums for IPv6 fragments
Hariprasad Shenai [Tue, 13 Sep 2016 08:09:24 +0000 (13:39 +0530)]
cxgb4vf: don't offload Rx checksums for IPv6 fragments

The checksum provided by the device doesn't include the L3 headers,
as IPv6 expects

Signed-off-by: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet_sched: Introduce skbmod action
Jamal Hadi Salim [Tue, 13 Sep 2016 00:13:09 +0000 (20:13 -0400)]
net_sched: Introduce skbmod action

This action is intended to be an upgrade from a usability perspective
from pedit (as well as operational debugability).
Compare this:

sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
u32 match ip protocol 1 0xff flowid 1:2 \
action pedit munge offset -14 u8 set 0x02 \
munge offset -13 u8 set 0x15 \
munge offset -12 u8 set 0x15 \
munge offset -11 u8 set 0x15 \
munge offset -10 u16 set 0x1515 \
pipe

to:

sudo tc filter add dev $ETH parent 1: protocol ip prio 10 \
u32 match ip protocol 1 0xff flowid 1:2 \
action skbmod dmac 02:15:15:15:15:15

Also try to do a MAC address swap with pedit or worse
try to debug a policy with destination mac, source mac and
etherype. Then make few rules out of those and you'll get my point.

In the future common use cases on pedit can be migrated to this action
(as an example different fields in ip v4/6, transports like tcp/udp/sctp
etc). For this first cut, this allows modifying basic ethernet header.

The most important ethernet use case at the moment is when redirecting or
mirroring packets to a remote machine. The dst mac address needs a re-write
so that it doesnt get dropped or confuse an interconnecting (learning) switch
or dropped by a target machine (which looks at the dst mac). And at times
when flipping back the packet a swap of the MAC addresses is needed.

Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoMerge branch 'bpf-next'
David S. Miller [Thu, 15 Sep 2016 23:29:53 +0000 (19:29 -0400)]
Merge branch 'bpf-next'

Daniel Borkmann says:

====================
Misc cls_bpf/act_bpf improvements

Two minor improvements to {cls,act}_bpf. For details please see
individual patches.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf: use skb_at_tc_ingress helper in tcf_bpf
Daniel Borkmann [Mon, 12 Sep 2016 21:38:43 +0000 (23:38 +0200)]
bpf: use skb_at_tc_ingress helper in tcf_bpf

We have a small skb_at_tc_ingress() helper for testing for ingress, so
make use of it. cls_bpf already uses it and so should act_bpf.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agobpf: drop unnecessary test in cls_bpf_classify and tcf_bpf
Daniel Borkmann [Mon, 12 Sep 2016 21:38:42 +0000 (23:38 +0200)]
bpf: drop unnecessary test in cls_bpf_classify and tcf_bpf

The skb_mac_header_was_set() test in cls_bpf's and act_bpf's fast-path is
actually unnecessary and can be removed altogether. This was added by
commit a166151cbe33 ("bpf: fix bpf helpers to use skb->mac_header relative
offsets"), which was later on improved by 3431205e0397 ("bpf: make programs
see skb->data == L2 for ingress and egress"). We're always guaranteed to
have valid mac header at the time we invoke cls_bpf_classify() or tcf_bpf().

Reason is that since 6d1ccff62780 ("net: reset mac header in dev_start_xmit()")
we do skb_reset_mac_header() in __dev_queue_xmit() before we could call
into sch_handle_egress() or any subsequent enqueue. sch_handle_ingress()
always sees a valid mac header as well (things like skb_reset_mac_len()
would badly fail otherwise). Thus, drop the unnecessary test in classifier
and action case.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet/sched: act_tunnel_key: Remove rcu_read_lock protection
Hadar Hen Zion [Mon, 12 Sep 2016 12:19:21 +0000 (15:19 +0300)]
net/sched: act_tunnel_key: Remove rcu_read_lock protection

Remove rcu_read_lock protection from tunnel_key_dump and use
rtnl_dereference, dump operation is protected by  rtnl lock.

Also, remove rcu_read_lock from tunnel_key_release and use
rcu_dereference_protected.

Both operations are running exclusively and a writer couldn't modify
t->params while those functions are executed.

Fixes: 54d94fd89d90 ('net/sched: Introduce act_tunnel_key')
Signed-off-by: Hadar Hen Zion <hadarh@mellanox.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Acked-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agotest_bpf: fix the dummy skb after dissector changes
Jakub Kicinski [Mon, 12 Sep 2016 12:04:57 +0000 (13:04 +0100)]
test_bpf: fix the dummy skb after dissector changes

Commit d5709f7ab776 ("flow_dissector: For stripped vlan, get vlan
info from skb->vlan_tci") made flow dissector look at vlan_proto
when vlan is present.  Since test_bpf sets skb->vlan_tci to ~0
(including VLAN_TAG_PRESENT) we have to populate skb->vlan_proto.

Fixes false negative on test #24:
test_bpf: #24 LD_PAYLOAD_OFF jited:0 175 ret 0 != 42 FAIL (1 times)

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dinan Gunawardena <dinan.gunawardena@netronome.com>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoatm: iphase: fix newline escape and minor tweak to source formatting
Colin Ian King [Mon, 12 Sep 2016 12:01:50 +0000 (13:01 +0100)]
atm: iphase: fix newline escape and minor tweak to source formatting

The newline escape is incorrect and needs fixing. Also adjust source
formatting / indentation and add { } to trailing else.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoiwlwifi: mvm: support new shared memory config API
Sara Sharon [Tue, 5 Jul 2016 14:37:58 +0000 (17:37 +0300)]
iwlwifi: mvm: support new shared memory config API

In a000 devices we have 15 fifos, so in the shared memory
config the number of tx fifos in the array was changed
accordingly.
As it is in the middle of the struct, the parsing code needs
to be duplicated.
To minimize the duplication, do not save variables we never
actually use.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: remove dump of locked registers
Sara Sharon [Wed, 13 Jul 2016 13:53:36 +0000 (16:53 +0300)]
iwlwifi: mvm: remove dump of locked registers

Firmware may lock those registers for access. This results
in 9000 devices with a bus stall and an endless loop of 0x5a5a5a.
Don't dump those registers.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: pcie: introduce new tfd and tb formats
Sara Sharon [Thu, 23 Jun 2016 13:31:40 +0000 (16:31 +0300)]
iwlwifi: pcie: introduce new tfd and tb formats

New hardware supports bigger TFDs and TBs.
Introduce the new formats and adjust defines and code
relying on old format.
Changing the actual TFD allocation is trickier and
deferred to the next patch.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: fix semicolon.cocci warnings
kbuild test robot [Sun, 10 Jul 2016 21:01:12 +0000 (05:01 +0800)]
iwlwifi: fix semicolon.cocci warnings

drivers/net/wireless/intel/iwlwifi/iwl-io.c:243:2-3: Unneeded semicolon

 Remove unneeded semicolon.

Generated by: scripts/coccinelle/misc/semicolon.cocci

CC: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: don't free queue after delba in dqa
Liad Kaufman [Sun, 26 Jun 2016 11:45:12 +0000 (14:45 +0300)]
iwlwifi: mvm: don't free queue after delba in dqa

In DQA mode, a delBA might free the queue although it
shouldn't. Fix that.

Fixes: cf941e174ee2 ("iwlwifi: mvm: support dqa-mode agg on non-shared queue")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agoiwlwifi: mvm: call a different txq_enable function
Sara Sharon [Thu, 30 Jun 2016 13:14:02 +0000 (16:14 +0300)]
iwlwifi: mvm: call a different txq_enable function

Since the SCD_QUEUE_CFG command was introduced the driver
calls iwl_trans_txq_enable_cfg() with a NULL for scd_cfg
parameter.
This makes the transport avoid writing to the SCD pointers,
since it can cause races with firmware, which is also accessing
the registers.
The transport only updates the write pointer in that case.
Fix a wrong call to iwl_trans_txq_enable() which caused a
scd_cfg parameter to be sent to transport, resulting with an
access to SCD registers.

Fixes: 58f2cc57dc6a ("iwlwifi: mvm: support dqa-mode scd queue redirection")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
7 years agomwifiex: firmware name correction for usb8997 chipset
Ganapathi Bhat [Mon, 12 Sep 2016 13:25:28 +0000 (18:55 +0530)]
mwifiex: firmware name correction for usb8997 chipset

Similar to pcie8997 chipset, first firmware submitted for usb8997
chipset will be usbusb8997_combo_v4.bin. This patch corrects the
name used in driver.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: Command 7 handling for USB chipsets
Ganapathi Bhat [Mon, 12 Sep 2016 13:25:27 +0000 (18:55 +0530)]
mwifiex: Command 7 handling for USB chipsets

Firmware image for newer USB chipsets starts with a command 7 block
(special command). It doesn't contain data length field. This patch adds
necessary handling.

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortlwifi: rtl818x: constify local structures
Julia Lawall [Sun, 11 Sep 2016 13:06:03 +0000 (15:06 +0200)]
rtlwifi: rtl818x: constify local structures

For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.

Done using Coccinelle.
Based on a suggestion by Joe Perches <joe@perches.com>.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoiwlegacy: constify local structures
Julia Lawall [Sun, 11 Sep 2016 13:05:50 +0000 (15:05 +0200)]
iwlegacy: constify local structures

For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.

Done using Coccinelle.
Based on a suggestion by Joe Perches <joe@perches.com>.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Acked-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoath: constify local structures
Julia Lawall [Sun, 11 Sep 2016 13:05:48 +0000 (15:05 +0200)]
ath: constify local structures

For structure types defined in the same file or local header files, find
top-level static structure declarations that have the following
properties:
1. Never reassigned.
2. Address never taken
3. Not passed to a top-level macro call
4. No pointer or array-typed field passed to a function or stored in a
variable.
Declare structures having all of these properties as const.

Done using Coccinelle.
Based on a suggestion by Joe Perches <joe@perches.com>.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortl8xxxu: fix spelling mistake "firmare" -> "firmware"
Colin Ian King [Fri, 9 Sep 2016 18:01:25 +0000 (14:01 -0400)]
rtl8xxxu: fix spelling mistake "firmare" -> "firmware"

Trivial fix to spelling mistakes in dev_dbg message.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agortl8xxxu: Reset device on module unload if still attached
Jes Sorensen [Fri, 9 Sep 2016 18:01:24 +0000 (14:01 -0400)]
rtl8xxxu: Reset device on module unload if still attached

If the USB dongle is still attached, reset it on module unload to
avoid scans failing when reloading the driver.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: correction in Rx STBC field of htcapinfo
Amitkumar Karwar [Fri, 9 Sep 2016 14:56:19 +0000 (20:26 +0530)]
mwifiex: correction in Rx STBC field of htcapinfo

Currently Rx STBC in assoc request frame is advertised as 3. It should
be 2, as our chipsets support two spatial streams.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agomwifiex: handle error if IRQ request fails in mwifiex_sdio_of()
Amitkumar Karwar [Fri, 9 Sep 2016 10:57:58 +0000 (16:27 +0530)]
mwifiex: handle error if IRQ request fails in mwifiex_sdio_of()

When this failure occurs, we will clear card->plt_wake_cfg so that
device would initialize without wake up on external interrupt feature.
This feature specific code in suspend and resume handlers will be
skipped.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
7 years agoMerge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
Kalle Valo [Wed, 14 Sep 2016 16:34:50 +0000 (19:34 +0300)]
Merge ath-next from git://git./linux/kernel/git/kvalo/ath.git

ath.git patches for 4.9. Major changes:

ath10k

* add nl80211 testmode support for 10.4 firmware
* hide kernel addresses from logs using %pK format specifier
* implement NAPI support
* enable peer stats by default

ath9k

* use ieee80211_tx_status_noskb where possible

wil6210

* extract firmware capabilities from the firmware file

ath6kl

* enable firmware crash dumps on the AR6004

ath-current is also merged to fix a conflict in ath10k.

7 years agorxrpc: Add IPv6 support
David Howells [Tue, 13 Sep 2016 07:49:05 +0000 (08:49 +0100)]
rxrpc: Add IPv6 support

Add IPv6 support to AF_RXRPC.  With this, AF_RXRPC sockets can be created:

service = socket(AF_RXRPC, SOCK_DGRAM, PF_INET6);

instead of:

service = socket(AF_RXRPC, SOCK_DGRAM, PF_INET);

The AFS filesystem doesn't support IPv6 at the moment, though, since that
requires upgrades to some of the RPC calls.

Note that a good portion of this patch is replacing "%pI4:%u" in print
statements with "%pISpc" which is able to handle both protocols and print
the port.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Use rxrpc_extract_addr_from_skb() rather than doing this manually
David Howells [Tue, 13 Sep 2016 07:49:05 +0000 (08:49 +0100)]
rxrpc: Use rxrpc_extract_addr_from_skb() rather than doing this manually

There are two places that want to transmit a packet in response to one just
received and manually pick the address to reply to out of the sk_buff.
Make them use rxrpc_extract_addr_from_skb() instead so that IPv6 is handled
automatically.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Don't specify protocol to when creating transport socket
David Howells [Tue, 13 Sep 2016 07:49:05 +0000 (08:49 +0100)]
rxrpc: Don't specify protocol to when creating transport socket

Pass 0 as the protocol argument when creating the transport socket rather
than IPPROTO_UDP.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Create an address for sendmsg() to bind unbound socket with
David Howells [Tue, 13 Sep 2016 07:49:05 +0000 (08:49 +0100)]
rxrpc: Create an address for sendmsg() to bind unbound socket with

Create an address for sendmsg() to bind unbound socket with rather than
using a completely blank address otherwise the transport socket creation
will fail because it will try to use address family 0.

We use the address family specified in the protocol argument when the
AF_RXRPC socket was created and SOCK_DGRAM as the default.  For anything
else, bind() must be used.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Correctly initialise, limit and transmit call->rx_winsize
David Howells [Tue, 13 Sep 2016 21:36:22 +0000 (22:36 +0100)]
rxrpc: Correctly initialise, limit and transmit call->rx_winsize

call->rx_winsize should be initialised to the sysctl setting and the sysctl
setting should be limited to the maximum we want to permit.  Further, we
need to place this in the ACK info instead of the sysctl setting.

Furthermore, discard the idea of accepting the subpackets of a jumbo packet
that lie beyond the receive window when the first packet of the jumbo is
within the window.  Just discard the excess subpackets instead.  This
allows the receive window to be opened up right to the buffer size less one
for the dead slot.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Fix prealloc refcounting
David Howells [Tue, 13 Sep 2016 08:05:14 +0000 (09:05 +0100)]
rxrpc: Fix prealloc refcounting

The preallocated call buffer holds a ref on the calls within that buffer.
The ref was being released in the wrong place - it worked okay for incoming
calls to the AFS cache manager service, but doesn't work right for incoming
calls to a userspace service.

Instead of releasing an extra ref service calls in rxrpc_release_call(),
the ref needs to be released during the acceptance/rejectance process.  To
this end:

 (1) The prealloc ref is now normally released during
     rxrpc_new_incoming_call().

 (2) For preallocated kernel API calls, the kernel API's ref needs to be
     released when the call is discarded on socket close.

 (3) We shouldn't take a second ref in rxrpc_accept_call().

 (4) rxrpc_recvmsg_new_call() needs to get a ref of its own when it adds
     the call to the to_be_accepted socket queue.

In doing (4) above, we would prefer not to put the call's refcount down to
0 as that entails doing cleanup in softirq context, but it's unlikely as
there are several refs held elsewhere, at least one of which must be put by
someone in process context calling rxrpc_release_call().  However, it's not
a problem if we do have to do that.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Adjust the call ref tracepoint to show kernel API refs
David Howells [Tue, 13 Sep 2016 08:12:34 +0000 (09:12 +0100)]
rxrpc: Adjust the call ref tracepoint to show kernel API refs

Adjust the call ref tracepoint to show references held on a call by the
kernel API separately as much as possible and add an additional trace to at
the allocation point from the preallocation buffer for an incoming call.

Note that this doesn't show the allocation of a client call for the kernel
separately at the moment.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Allow tx_winsize to grow in response to an ACK
David Howells [Tue, 13 Sep 2016 09:23:01 +0000 (10:23 +0100)]
rxrpc: Allow tx_winsize to grow in response to an ACK

Allow tx_winsize to grow when the ACK info packet shows a larger receive
window at the other end rather than only permitting it to shrink.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Use skb->len not skb->data_len
David Howells [Tue, 13 Sep 2016 21:36:22 +0000 (22:36 +0100)]
rxrpc: Use skb->len not skb->data_len

skb->len should be used rather than skb->data_len when referring to the
amount of data in a packet.  This will only cause a malfunction in the
following cases:

 (1) We receive a jumbo packet (validation and splitting both are wrong).

 (2) We see if there's extra ACK info in an ACK packet (we think it's not
     there and just ignore it).

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Add missing unlock in rxrpc_call_accept()
David Howells [Tue, 13 Sep 2016 21:36:22 +0000 (22:36 +0100)]
rxrpc: Add missing unlock in rxrpc_call_accept()

Add a missing unlock in rxrpc_call_accept() in the path taken if there's no
call to wake up.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Requeue call for recvmsg if more data
David Howells [Tue, 13 Sep 2016 21:36:21 +0000 (22:36 +0100)]
rxrpc: Requeue call for recvmsg if more data

rxrpc_recvmsg() needs to make sure that the call it has just been
processing gets requeued for further attention if the buffer has been
filled and there's more data to be consumed.  The softirq producer only
queues the call and wakes the socket if it fills the first slot in the
window, so userspace might end up sleeping forever otherwise, despite there
being data available.

This is not a problem provided the userspace buffer is big enough or it
empties the buffer completely before more data comes in.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: The IDLE ACK packet should use rxrpc_idle_ack_delay
David Howells [Tue, 13 Sep 2016 21:36:21 +0000 (22:36 +0100)]
rxrpc: The IDLE ACK packet should use rxrpc_idle_ack_delay

The IDLE ACK packet should use the rxrpc_idle_ack_delay setting when the
timer is set for it.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Add missing wakeup on Tx window rotation
David Howells [Tue, 13 Sep 2016 21:36:21 +0000 (22:36 +0100)]
rxrpc: Add missing wakeup on Tx window rotation

We need to wake up the sender when Tx window rotation due to an incoming
ACK makes space in the buffer otherwise the sender is liable to just hang
endlessly.

This problem isn't noticeable if the Tx phase transfers no more than will
fit in a single window or the Tx window rotates fast enough that it doesn't
get full.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agorxrpc: Make sure we initialise the peer hash key
David Howells [Tue, 13 Sep 2016 21:36:21 +0000 (22:36 +0100)]
rxrpc: Make sure we initialise the peer hash key

Peer records created for incoming connections weren't getting their hash
key set.  This meant that incoming calls wouldn't see more than one DATA
packet - which is not a problem for AFS CM calls with small request data
blobs.

Signed-off-by: David Howells <dhowells@redhat.com>
7 years agoMerge branch 'mlxsw-ethtool'
David S. Miller [Tue, 13 Sep 2016 16:16:44 +0000 (12:16 -0400)]
Merge branch 'mlxsw-ethtool'

Jiri Pirko says:

====================
mlxsw: ethtool enhancements

Ido says:

Patches 1-4 do some minor cleanup in current ethtool ops. Patch 5
replace legacy {get,set}_settings callbacks with
{get,set}_link_ksettings.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Add support for new ethtool API
Ido Schimmel [Mon, 12 Sep 2016 11:26:27 +0000 (13:26 +0200)]
mlxsw: spectrum: Add support for new ethtool API

Remove the deprecated {get,set}_settings callbacks and instead add
{get,set}_link_ksettings along with support for newly available speeds.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Indicate support of multiple port types
Ido Schimmel [Mon, 12 Sep 2016 11:26:26 +0000 (13:26 +0200)]
mlxsw: spectrum: Indicate support of multiple port types

The device can support multiple port types, so don't return on first
match.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Report port type according to operational speed
Ido Schimmel [Mon, 12 Sep 2016 11:26:25 +0000 (13:26 +0200)]
mlxsw: spectrum: Report port type according to operational speed

In case port isn't operational we shouldn't report the port type, but
instead return PORT_OTHER. This is consistent with most other drivers
that return PORT_OTHER when media type can't be determined.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Report link partner's advertised speeds
Ido Schimmel [Mon, 12 Sep 2016 11:26:24 +0000 (13:26 +0200)]
mlxsw: spectrum: Report link partner's advertised speeds

If autonegotiation was performed successfully, then we should report the
link partner's advertised speeds instead of the operational speed of the
port.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agomlxsw: spectrum: Correctly report autonegotiation
Ido Schimmel [Mon, 12 Sep 2016 11:26:23 +0000 (13:26 +0200)]
mlxsw: spectrum: Correctly report autonegotiation

Up until now the device always reported autonegotiation to be off
although it was on by default.

Allow the user to disable / enable autonegotiation and report its status
correctly.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: ethernet: apm: xgene: use new api ethtool_{get|set}_link_ksettings
Philippe Reynes [Sun, 11 Sep 2016 15:54:04 +0000 (17:54 +0200)]
net: ethernet: apm: xgene: 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: ethernet: apm: xgene: use phydev from struct net_device
Philippe Reynes [Sun, 11 Sep 2016 15:54:03 +0000 (17:54 +0200)]
net: ethernet: apm: xgene: 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>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: ethernet: dwmac: fix non static symbol warning
Wei Yongjun [Sat, 10 Sep 2016 12:31:30 +0000 (12:31 +0000)]
net: ethernet: dwmac: fix non static symbol warning

Fixes the following sparse warning:

drivers/net/ethernet/stmicro/stmmac/dwmac-stm32.c:172:1: warning:
 symbol 'stm32_dwmac_pm_ops' was not declared. Should it be static?

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: macb: fix missing unlock on error in macb_start_xmit()
Wei Yongjun [Sat, 10 Sep 2016 11:17:57 +0000 (11:17 +0000)]
net: macb: fix missing unlock on error in macb_start_xmit()

Fix missing unlock before return from function macb_start_xmit()
in the error handling case.

Fixes: 007e4ba3ee13 ("net: macb: initialize checksum when using
checksum offloading")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: Remove NO_IRQ from powerpc-only network drivers
Michael Ellerman [Sat, 10 Sep 2016 09:59:05 +0000 (19:59 +1000)]
net: Remove NO_IRQ from powerpc-only network drivers

We'd like to eventually remove NO_IRQ on powerpc, so remove usages of it
from powerpc-only drivers.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agotipc: fix possible memory leak in tipc_udp_enable()
Wei Yongjun [Sat, 10 Sep 2016 00:56:55 +0000 (00:56 +0000)]
tipc: fix possible memory leak in tipc_udp_enable()

'ub' is malloced in tipc_udp_enable() and should be freed before
leaving from the error handling cases, otherwise it will cause
memory leak.

Fixes: ba5aa84a2d22 ("tipc: split UDP nl address parsing")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: bridge: add helper to call /sbin/bridge-stp
Vivien Didelot [Thu, 8 Sep 2016 16:50:43 +0000 (12:50 -0400)]
net: bridge: add helper to call /sbin/bridge-stp

If /sbin/bridge-stp is available on the system, bridge tries to execute
it instead of the kernel implementation when starting/stopping STP.

If anything goes wrong with /sbin/bridge-stp, bridge silently falls back
to kernel STP, making hard to debug userspace STP.

This patch adds a br_stp_call_user helper to start/stop userspace STP
and debug errors from the program: abnormal exit status is stored in the
lower byte and normal exit status is stored in higher byte.

Below is a simple example on a kernel with dynamic debug enabled:

    # ln -s /bin/false /sbin/bridge-stp
    # brctl stp br0 on
    br0: failed to start userspace STP (256)
    # dmesg
    br0: /sbin/bridge-stp exited with code 1
    br0: failed to start userspace STP (256)
    br0: using kernel STP

Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoath10k: remove 4-addr padding related hw_param configuration
Vasanthakumar Thiagarajan [Fri, 9 Sep 2016 14:25:36 +0000 (17:25 +0300)]
ath10k: remove 4-addr padding related hw_param configuration

hw_4addr_pad was added to handle different types of padding
in 4-address rx frame. But this padding is not very specific
to 4-address, it can happen even with three address + ethernet
decap mode. Since the  padding information can be obtained
through Rx desc for QCA99X0 and newer chips, this hw_param
is not needed any more.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: properly remove padding from the start of rx payload
Vasanthakumar Thiagarajan [Fri, 9 Sep 2016 14:25:29 +0000 (17:25 +0300)]
ath10k: properly remove padding from the start of rx payload

In QCA99X0 (QCA99X0, QCA9984, QCA9888 and QCA4019) family chips,
hw adds padding at the begining of the rx payload to make L3
header 4-byte aligned. In the chips doing this type of padding,
the number of bytes padded will be indicated through msdu_end:info1.
Define a hw_rx_desc_ops wrapper to retrieve the number of padded
bytes and use this while doing undecap. This should fix padding
related issues with ethernt decap format with QCA99X0, QCA9984,
QCA9888 and QCA4019 hw.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
[Rename operations to hw_ops for other purposes]
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: add provision for Rx descriptor abstraction
Vasanthakumar Thiagarajan [Fri, 9 Sep 2016 14:25:22 +0000 (17:25 +0300)]
ath10k: add provision for Rx descriptor abstraction

There are slight differences in Rx hw descriptor information
among different chips. So far driver does not use those new
information for any functionalities, but there is one important
information which is available from QCA99X0 onwards to indicate
the number of bytes that hw padded at the begining of the rx
payload and this information is needed to undecap the rx
packet. Add an abstraction for Rx desc to make use of the
new desc information available. The callback that this patch
defines to retrieve the padding bytes will be used in follow-up
patch.

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
[Rename operations to hw_ops for other purposes]
Signed-off-by: Benjamin Berg <benjamin@sipsolutions.net>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: move ath10k_hw_params definition to hw.h
Vasanthakumar Thiagarajan [Fri, 9 Sep 2016 14:25:13 +0000 (17:25 +0300)]
ath10k: move ath10k_hw_params definition to hw.h

This is to prepare for rx descriptor abstraction where we'll
be dereferencing ath10k_hw_params member in hw.h. Moreover
hw.h looks more suitable to house ath10k_hw_params definition
than core.h

Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: improve logging message
Ben Greear [Fri, 19 Aug 2016 01:26:35 +0000 (18:26 -0700)]
ath10k: improve logging message

Helps to know the sta pointer.

Signed-off-by: Ben Greear <greearb@candelatech.com>
[kvalo@qca.qualcomm.com: add %pK and remove the colon]
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: enable peer stats by default
Thomas Pedersen [Tue, 6 Sep 2016 19:05:28 +0000 (12:05 -0700)]
ath10k: enable peer stats by default

IFTYPE_MESH_POINT need to rely on these for accurate path
selection metrics. Other modes will probably also find
them useful. Enabling peer stats has the side effect of
reducing max number of STAs from 128 to 118. There should
be negligible performance impact.

If users really need 128 STAs and don't mind losing out on
peer stats, they can still disable them:

echo 0 > debugfs/ieee80211/phyn/ath10k/peer_stats

Signed-off-by: Thomas Pedersen <twp@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: remove unused variable ar_pci
Chaehyun Lim [Mon, 5 Sep 2016 13:38:02 +0000 (22:38 +0900)]
ath10k: remove unused variable ar_pci

Trival fix to remove unused variable ar_pci in ath10k_pci_tx_pipe_cleanup
when building with W=1:
drivers/net/wireless/ath/ath10k/pci.c:1696:21: warning: variable
'ar_pci' set but not used [-Wunused-but-set-variable]

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoath10k: fix memory leak on caldata on error exit path
Colin Ian King [Sat, 3 Sep 2016 16:38:19 +0000 (17:38 +0100)]
ath10k: fix memory leak on caldata on error exit path

caldata is not being free'd on the error exit path, causing
a memory leak and data definitely should not be freed. Free
caldata instead of data.

Thanks to Kalle Valo for spotting that data should not be
free'd.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
7 years agoiwlegacy: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:46 +0000 (10:03 -0400)]
iwlegacy: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agohamradio: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:45 +0000 (10:03 -0400)]
hamradio: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agostmmac: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:44 +0000 (10:03 -0400)]
stmmac: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Reviewed-by: Alexandre TORGUE <alexandre.torgue@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosis900: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:43 +0000 (10:03 -0400)]
sis900: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Daniele Venzano <venza@brownhat.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agosfc: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:42 +0000 (10:03 -0400)]
sfc: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Bert Kenward <bkenward@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonatsemi: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:41 +0000 (10:03 -0400)]
natsemi: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet: mvneta: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:40 +0000 (10:03 -0400)]
net: mvneta: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoixgbe: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:39 +0000 (10:03 -0400)]
ixgbe: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agoi825xx: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:38 +0000 (10:03 -0400)]
i825xx: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
7 years agonet/fsl_pq_mdio: use IS_ENABLED() instead of checking for built-in or module
Javier Martinez Canillas [Mon, 12 Sep 2016 14:03:37 +0000 (10:03 -0400)]
net/fsl_pq_mdio: use IS_ENABLED() instead of checking for built-in or module

The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either
built-in or as a module, use that macro instead of open coding the same.

Using the macro makes the code more readable by helping abstract away some
of the Kconfig built-in and module enable details.

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>