Commit Graph

618824 Commits

Author SHA1 Message Date
Arend Van Spriel
bc98164136 brcmfmac: fix memory leak in brcmf_flowring_add_tdls_peer()
In the error paths in brcmf_flowring_add_tdls_peer() the allocated
resource should be freed.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 20:35:53 +03:00
Arend Van Spriel
704d1c6b56 brcmfmac: rework pointer trickery in brcmf_proto_bcdc_query_dcmd()
The variable info is assigned to point to bcdc->msg[1], which is the
same as pointing to bcdc->buf. As that is what we want to access
make it clear by fixing the assignment. This also avoid out-of-bounds
errors from static analyzers are bcdc->msg[1] is not in the structure
definition.

Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 20:35:52 +03:00
Hante Meuleman
b3589dfe02 brcmfmac: ignore 11d configuration errors
802.11d is not always supported by firmware anymore. Currently the
AP configuration of 11d will cause an abort if the ioctl set is
failing. This behavior is not correct and the error should be
ignored.

Reviewed-by: Arend Van Spriel <arend.vanspriel@broadcom.com>
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
Signed-off-by: Hante Meuleman <hante.meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 20:35:51 +03:00
Ganapathi Bhat
89951db2be mwifiex: cfg80211 set_default_mgmt_key handler
Previously device used to start using IGTK key as Tx key as soon as it
gets downloaded in add_key(). This patch implements set_default_mgmt_key
handler. We will update Tx key ID in set_default_mgmt_key().

Signed-off-by: Ganapathi Bhat <gbhat@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 18:19:42 +03:00
Tony Lindgren
33e40d025e wlcore: wl18xx: Use chip specific configuration firmware
Use the wl18xx specific config firmware we now have available.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 18:13:45 +03:00
Tony Lindgren
3e1ac93268 wlcore: Fix config firmware loading issues
Booting multiple wl12xx and wl18xx devices using the same rootfs is
a pain. You currently have to symlink the right nvs file depending
on the wl12xx type.

For example, with wl1271-nvs.bin being a symlink to wl127x-nvs.bin
by default and trying to bring up a wl128x based device:

wlcore: ERROR nvs size is not as expected: 1113 != 912
wlcore: ERROR NVS file is needed during boot
wlcore: ERROR NVS file is needed during boot
wlcore: ERROR firmware boot failed despite 3 retries

Note that wl18xx uses a separate config firmware wl18xx-conf.bin
that can be generated with tools using the following two git repos:

git.ti.com/wilink8-wlan/18xx-ti-utils
git.ti.com/wilink8-wlan/wl18xx_fw

So let's not configure the nvs file for wl18xx as it's not needed
AFAIK. If it turns out that we also need the nvs file for wl18xx,
we can just add it to the config firmware data for wl18xx.

Let's fix the issue by using the chip specific config firmware
data, and make sure we produce understandable warnings if something
is missing.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 18:13:45 +03:00
Tony Lindgren
c815fdebef wlcore: spi: Populate config firmware data
Configure the config firmware names and make it available
in platform data.

Let's also fix the order of the struct wilink_family_data
while at it.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 18:13:44 +03:00
Tony Lindgren
d776fc86b8 wlcore: sdio: Populate config firmware data
Configure the config firmware names and make it available
in platform data.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 18:13:43 +03:00
Tony Lindgren
a762bb8ecb wlcore: Prepare family to fix nvs file handling
Move struct wilink_family_data to be available for all TI WLAN
variants. And fix familiy typo, it should be just family.

Looks like wl12xx use two different nvs.bin files and wl18xx
uses a different conf.bin file.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-26 18:13:43 +03:00
Kalle Valo
9c95fd662a * added support for MU-MIMO sniffer
* added support for RRM by scan
 * added support for packet injection
 * migrate to devm memory allocation handling
 * some fixes, mostly in DQA and new HW support
 * other generic cleanups
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX36ObAAoJEKFHnKIaPMX6LhkP+wfLwbFRxPjjgDw3lmCKkNVG
 00TwrKNjZUeVR0CPkwnBb4QZHVMAvDP/EoOGbdBNCKI0RJL6PC/Qs68TegYiVCL6
 9xzYEVD/vkABXugIrhAU3U8xAZPYbqHmMw/swbZkp+9pi+8GddpRcmkQnB9WElQ2
 /dsWOFF12AdONCO/u8j7w/pfSd0p3iN9dcZHHQc19+KlFYEUaryLFoL1PTzz5DV1
 WbtCWBinE1dUbmnZHBgoXfTL2A1sopLwMr6RJ8yqlMAGIG7sndNJ0OzEFy8IdTvm
 irEmkwcYlAH5ZjJ7MKlCrsUNErescNnTqcLCRK850VCBxLIwnGvJtIMBJjR/cY0X
 SvejNom5xEy48WUhx6yFbutsRih5bq0yglsL298pAuwQLpLXBetplozrtlGXK6hV
 1x+R1kBkFleBoHTWamImBLzP5fJHIHxHEHoZqTAzvXDsQp/4ZLpugi6Y91Z4BtRv
 yHg3CN0ebPmGTM2yMgXlRynY2xrvM5MlCPq+n9zLEy4bQ6BDa+IsX9BgMK0cdBXC
 eSk5T3pq+csGSAZ/1EBCKNaEQ7qDGKtf9YWpd/d5hsxVsGEMcCj0jjGV7km/ikQJ
 2yQmAiKB2Rn0KI9ABUQGDDGPdxoFVT8Jdd/qBy0RC9ERNl1B1rLiqdpST8KVkTkr
 4tHK6tvJUELZsZqzyJgn
 =42wP
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2016-09-19-2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* added support for MU-MIMO sniffer
* added support for RRM by scan
* added support for packet injection
* migrate to devm memory allocation handling
* some fixes, mostly in DQA and new HW support
* other generic cleanups
2016-09-26 14:10:31 +03:00
Johannes Berg
0979a913f8 iwlwifi: pcie: use LIST_HEAD() macro
There's no need to declare a list and then init it manually,
just use the LIST_HEAD() macro.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:35 +03:00
Johannes Berg
8098203f26 iwlwifi: mvm: use LIST_HEAD() macro
There's no need to declare a list and then init it manually,
just use the LIST_HEAD() macro.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:34 +03:00
Sara Sharon
176aa60bf1 iwlwifi: mvm: set HCMD_NAME for PHY_DB as well
Currently it is logged as UNKNOWN.
Also, 0x6c seems to be the permanent ID for this command, remove
incorrect comment and uncomment the command from the commands
list.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:33 +03:00
Ido Yariv
2b55f43f8e iwlwifi: mvm: Add mem debugfs entry
In order to access cached/paged memory, there are a couple of firmware
commands (one for UMAC and one for LMAC) that let the host access memory
and registers indirectly. Since this is done by the firmware on behalf
of the host, even if memory is paged out or cached, the host will
retrieve the memory as the firmware sees it (paged out memory will get
paged in).

Export this mechanism via a debugfs entry for both read and write
access.

WARNING: This mechanism has no protections at all. Invalid addresses may
crash or hang the firmware. Writing to arbitrary memory also comes with
no guarantees.

Signed-off-by: Ido Yariv <idox.yariv@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:33 +03:00
Johannes Berg
186cd49a4d iwlwifi: mvm: move AP-specific code to right function
There's no need for the common MAC context function to have an
if on AP mode, the values can be overridden in the AP-specific
function later. Clean that up by adding the full command as a
new parameter to the AP-specific function, and doing it there.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:32 +03:00
Oren Givon
8b6607cc6c iwlwifi: add new 8265 series PCI ID
Add a new PCI ID for the 8265 series.

Signed-off-by: Oren Givon <oren.givon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:31 +03:00
Roee Zamir
b3bee580b1 iwlwifi: mvm: Add debugfs function for clocks diff
New function, reveals the diff between gp2 and host time.

Signed-off-by: Roee Zamir <roee.zamir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 11:29:28 +03:00
Sharon Dvir
5a41a86c52 iwlwifi: migrate to devm_* API
Change PCIE and trans resource allocations to managed resources.

Signed-off-by: Sharon Dvir <sharon.dvir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:42 +03:00
Sara Sharon
341d7eb822 iwlwifi: mvm: disable P2P queue on mac context release
AP queue is properly released, but P2P queue isn't.

Fixes: commit 4c965139a3 ("iwlwifi: mvm: support p2p device frames tx on dqa queue #2")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:41 +03:00
Emmanuel Grumbach
de9466499b iwlwifi: don't export trace points that are used in iwlwifi only
This can save a few bytes

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:41 +03:00
Johannes Berg
8ec8ed4379 iwlwifi: mvm: document passing unexpected Block Ack Request frames
When we get an unexpected Block Ack Request frame, the BAID from
the hardware will be invalid, and we'll pass it to mac80211 for
further handling (sending a delBA action frame.)

Add a comment explaining that, in case anyone looks in the future.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:40 +03:00
Sara Sharon
5b88792cd8 iwlwifi: move to wide ID for all commands
Due to firmware design considerations, move to wide ID for
all commands.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:39 +03:00
Johannes Berg
607876f1da iwlwifi: mvm: make iwl_mvm_update_sta() an inline
There's no point in making this an out-of-line function
since it just calls a single other function with a few
changed parameters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:38 +03:00
Sara Sharon
35177c9931 iwlwifi: pcie: log full command sequence
Log group as well. Remove 0x prefix to match TX logging.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:37 +03:00
Arik Nemtsov
671bed3fbe iwlwifi: move BIOS MCC retrieval to common code
This will be used by more than MVM, so move it to iwlwifi

While at it, rename WRD_METHOD to the more appropriate
WRDD_METHOD and add some documentation.

Signed-off-by: Arik Nemtsov <arikx.nemtsov@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:37 +03:00
Sara Sharon
4857d6cbf7 iwlwifi: mvm: support packet injection
For automatic testing packet injection can be useful.
Support injection through debugfs.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:36 +03:00
Avrahams Stern
aacf8f189b iwlwifi: mvm: Add support for RRM by scan
Implement support for RRM by adding an option to configure the scan
dwell time and reporting scan start time and BSS detection time, and
Advertise support for these features.

Signed-off-by: David Spinadel <david.spinadel@intel.com>
Signed-off-by: Avraham Stern <avraham.stern@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:35 +03:00
Sara Sharon
9a73a7d24d iwlwifi: mvm: support BAR in reorder buffer
On default queue we will not receive frame release notification,
but the BAR itself.
Upon receiving the BAR driver should look at the NSSN and adjust
window accordingly.

Fixes: b915c10174 ("iwlwifi: mvm: add reorder buffer per queue")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:34 +03:00
Sara Sharon
3ee0f0e23e iwlwifi: mvm: fix DQA AP mode station assumption
There was recently a Full AP mode feature added where hostap adds
the station at auth stage, and not assoc.
However, when running with legacy hostapd, we get the auth response
before station was added, and tx_skb_non_sta fails to allocate
a queue, resulting in a complete failure of association.
Take care of this situation as well.
Add a warning when no valid queue is returned at all and make mvm
drop the packet instead of passing it on.
Refactor the function a bit while at it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:33 +03:00
Haim Dreyfuss
a6c934b364 iwlwifi: check for valid ethernet address provided by OEM
In 9000 family products we added an option to let the OEM fuse the
mac address via registers. If these registers are zeroed we use the OTP
address instead. Make sure that the address provided by the OEM is valid
and, if not, fall back to the OTP address as well.

Fixes: commit 17c867bfe8 ("iwlwifi: add support for getting HW address from CSR")
Signed-off-by: Haim Dreyfuss <haim.dreyfuss@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 10:09:27 +03:00
Aviya Erenfeld
91b08c2da4 iwlwifi: mvm: add support for MU-MIMO air sniffer
enable MU-MIMO air sniffer if it's supported by the NIC

Signed-off-by: Aviya Erenfeld <aviya.erenfeld@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 09:16:44 +03:00
Johannes Berg
61b0f5d7c4 iwlwifi: mvm: compare full command ID
When comparing command IDs, the group should be taken
into account so the same command/notification from a
different group doesn't trigger anything unexpected.
Fix this by comparing to the wide ID.

Fixes: commit 1738d60b31 ("iwlwifi: mvm: handle RX MPDUs separately")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 09:14:11 +03:00
Sara Sharon
5a710b8606 iwlwifi: mvm: cleanup skb queue functions use
Use skb_queue_empty() and not skb_peek_tail() to check for
empty list.
Avoid a redundant check as well - loop will take care of it.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 09:09:19 +03:00
Sara Sharon
8352e62ac2 iwlwifi: pcie: fix typo in struct name for a000 devices
commit 3cd1980b0c ("iwlwifi: pcie: introduce new tfd and tb formats")
Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 09:06:30 +03:00
Liad Kaufman
d55092b481 iwlwifi: mvm: remove variable shadowing
Variable "ac" defined twice. Fix that.

Fixes: commit 93f436e2c7 ("iwlwifi: mvm: set sta_id in SCD_QUEUE_CONFIG cmd")
Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2016-09-19 09:04:53 +03:00
Colin Ian King
80ba4f1d36 mwifiex: fix null pointer deference when adapter is null
If adapter is null the error exit path in mwifiex_shutdown_sw is
to down the semaphore sem and print some debug via mwifiex_dbg.
However, passing a NULL adapter to mwifiex_dbg causes a null
pointer deference when accessing adapter->dev.  This fix checks
for a null adapter at the start of the function and to exit
without the need to up the semaphore and we also skip the debug
to avoid the null pointer dereference.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-17 18:26:32 +03:00
Bob Copeland
92ca4f92ec mwifiex: fix error handling in mwifiex_create_custom_regdomain
smatch reports:

sta_cmdresp.c:1053 mwifiex_create_custom_regdomain() warn: possible memory leak of 'regd'

Indeed, mwifiex_create_custom_regdomain() returns NULL in the
case that channel is missing in the TLV without freeing regd.

Moreover, some other error paths in this function return ERR_PTR
values which are assigned without checking to the regd field in
the mwifiex_adapter struct.  The latter is only null-checked where
used.

Fix by freeing regd in the error path, and only update
priv->adapter->regd if the returned pointer is valid.

Cc: Amitkumar Karwar <akarwar@marvell.com>
Cc: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-17 18:25:57 +03:00
Jes Sorensen
f1785fbf7c rtl8xxxu: Implement 8192e specific power down sequence
This powers down the 8192e correctly, or at least to the point where
the firmware will load again, when reloading the driver module.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-09-17 18:16:19 +03:00
Kalle Valo
6833d0700d * work for new hardware support continues
* dynamic queue allocation stabilization
 * improvements in the MSIx code
 * multiqueue support work continues
 * new firmware version support
 * general cleanups and improvements
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJX25qoAAoJEKFHnKIaPMX6WKgP/2DFTFQ4rBGBsOlUyrIGZKWJ
 k/TTaVNPlgsDEFahloAtcWnLeAvB1IbJLMWj6C7AKTMWM0gs+aTDh1VyMoUfOvYg
 pwmSKFen/yC1YOSEqPPXVXO9CN0TOh6qJq/5OOPiLw7Ao8nhtfa9xbW7SDe22f/M
 JkX5c4vcyxpMdv5Z2GPhnVbDZmlBBpwQWPqTq9S9WM87Bh9NOQYkr/DZ648Dh61N
 KLrOpzXXKiaGbs9WzdzWhBMeSpDUeLjBy6Fn3uixGkQ6pfiqBFbHVf6ljR0ntJNY
 uGFljhTxyTg1lGr9EseS0wZtwdtAnxlvIaXmV/ZagyMiz4hzqoEZ0EeY+uU2dvuA
 GbGtckcB9nxCemFPcFFfoMuvWM6qfw+2HirxjBgg2uGufXzLSMJYk+aX92HvPSJ0
 GyeW0+cw9kJSxR0OdhFaz6uPWBHvsCJ2ZrVkXcJ5RsA5Ss5KVhwUr4ztyDfN1dtt
 bJndVZu6loHt85qtlY+Z5t0mw8Oz8aBsNYhrjpaPfiw9pSThsvXh186wXEixXz58
 m1jxO5HqbMvHWODwB4yo8HWVifmiCPN6nGjpESQfnCYvqig1shjzOPpHixdW0CeE
 Xq69/KhBI1q40Laa2g07wGgulB+txSZ0JLWLyW3AjNPdbdmoiqmxwoWsY4Dvcn7q
 8uHZDaRPGfAZKrhhj2/G
 =SrvZ
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2016-09-15-2' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* work for new hardware support continues
* dynamic queue allocation stabilization
* improvements in the MSIx code
* multiqueue support work continues
* new firmware version support
* general cleanups and improvements
2016-09-17 18:10:33 +03:00
David S. Miller
fd9527f404 Merge branch 'ip_tunnel-collect_md'
Alexei Starovoitov says:

====================
ip_tunnel: add collect_md mode to IPv4/IPv6 tunnels

Similar to geneve, vxlan, gre tunnels implement 'collect metadata' mode
in ipip, ipip6, ip6ip6 tunnels.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:13:16 -04:00
Alexei Starovoitov
173ca26e9b samples/bpf: add comprehensive ipip, ipip6, ip6ip6 test
the test creates 3 namespaces with veth connected via bridge.
First two namespaces simulate two different hosts with the same
IPv4 and IPv6 addresses configured on the tunnel interface and they
communicate with outside world via standard tunnels.
Third namespace creates collect_md tunnel that is driven by BPF
program which selects different remote host (either first or
second namespace) based on tcp dest port number while tcp dst
ip is the same.
This scenario is rough approximation of load balancer use case.
The tests check both traditional tunnel configuration and collect_md mode.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:13:07 -04:00
Alexei Starovoitov
a1c82704d1 samples/bpf: extend test_tunnel_bpf.sh with IPIP test
extend existing tests for vxlan, geneve, gre to include IPIP tunnel.
It tests both traditional tunnel configuration and
dynamic via bpf helpers.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:13:07 -04:00
Alexei Starovoitov
8d79266bc4 ip6_tunnel: add collect_md mode to IPv6 tunnels
Similar to gre, vxlan, geneve tunnels allow IPIP6 and IP6IP6 tunnels
to operate in 'collect metadata' mode.
Unlike ipv4 code here it's possible to reuse ip6_tnl_xmit() function
for both collect_md and traditional tunnels.
bpf_skb_[gs]et_tunnel_key() helpers and ovs (in the future) are the users.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:13:07 -04:00
Alexei Starovoitov
cfc7381b30 ip_tunnel: add collect_md mode to IPIP tunnel
Similar to gre, vxlan, geneve tunnels allow IPIP tunnels to
operate in 'collect metadata' mode.
bpf_skb_[gs]et_tunnel_key() helpers can make use of it right away.
ovs can use it as well in the future (once appropriate ovs-vport
abstractions and user apis are added).
Note that just like in other tunnels we cannot cache the dst,
since tunnel_info metadata can be different for every packet.

Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Thomas Graf <tgraf@suug.ch>
Acked-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:13:07 -04:00
Julia Lawall
eb94737d71 l2tp: constify net_device_ops structures
Check for net_device_ops structures that are only stored in the netdev_ops
field of a net_device structure.  This field is declared const, so
net_device_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct net_device_ops i@p = { ... };

@ok@
identifier r.i;
struct net_device e;
position p;
@@
e.netdev_ops = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct net_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct net_device_ops i = { ... };
// </smpl>

The result of size on this file before the change is:
   text	      data     bss     dec         hex	  filename
   3401        931      44    4376        1118	net/l2tp/l2tp_eth.o

and after the change it is:
   text	     data        bss	    dec	    hex	filename
   3993       347         44       4384    1120	net/l2tp/l2tp_eth.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:07:23 -04:00
Julia Lawall
373075049c dwc_eth_qos: constify net_device_ops structures
Check for net_device_ops structures that are only stored in the netdev_ops
field of a net_device structure.  This field is declared const, so
net_device_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct net_device_ops i@p = { ... };

@ok@
identifier r.i;
struct net_device e;
position p;
@@
e.netdev_ops = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct net_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct net_device_ops i = { ... };
// </smpl>

The result of size on this file before the change is:
   text	      data     bss     dec         hex	  filename
  21623       1316      40   22979        59c3
   drivers/net/ethernet/synopsys/dwc_eth_qos.o

and after the change it is:
   text	     data        bss	    dec	    hex	filename
  22199       724         40      22963    59b3
   drivers/net/ethernet/synopsys/dwc_eth_qos.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:07:23 -04:00
Julia Lawall
66f58ec486 hisilicon: constify net_device_ops structures
Check for net_device_ops structures that are only stored in the netdev_ops
field of a net_device structure.  This field is declared const, so
net_device_ops structures that have this property can be declared as const
also.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r disable optional_qualifier@
identifier i;
position p;
@@
static struct net_device_ops i@p = { ... };

@ok@
identifier r.i;
struct net_device e;
position p;
@@
e.netdev_ops = &i@p;

@bad@
position p != {r.p,ok.p};
identifier r.i;
struct net_device_ops e;
@@
e@i@p

@depends on !bad disable optional_qualifier@
identifier r.i;
@@
static
+const
 struct net_device_ops i = { ... };
// </smpl>

The result of size on this file before the change is:

   text	      data     bss     dec         hex	  filename
   7995	       848       8    8851        2293
   drivers/net/ethernet/hisilicon/hip04_eth.o

and after the change it is:

   text	     data        bss	    dec	    hex	filename
   8571	      256          8       8835    2283
   drivers/net/ethernet/hisilicon/hip04_eth.o

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:07:23 -04:00
Alan Cox
5ff904d55d llc: switch type to bool as the timeout is only tested versus 0
(As asked by Dave in Februrary)

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:05:05 -04:00
David Ahern
19664c6a00 net: l3mdev: Remove netif_index_is_l3_master
No longer used after e0d56fdd73 ("net: l3mdev: remove redundant calls")

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:05:05 -04:00
David Ahern
e1fb9d0389 net: vrf: Remove RT_FL_TOS
No longer used after d66f6c0a8f ("net: ipv4: Remove l3mdev_get_saddr")

Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2016-09-17 10:05:05 -04:00