Jes Sorensen [Thu, 31 Mar 2016 21:08:34 +0000 (17:08 -0400)]
rtl8xxxu: Rename TX descriptor bits to map them to 32/40 byte descriptors
With the size based naming of TX descriptors. Change the bit
definition namings to indicate which descriptor format they match,
rather than having a device name in the bit name.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jes Sorensen [Thu, 31 Mar 2016 21:08:33 +0000 (17:08 -0400)]
rtl8xxxu: Change name of struct tx_desc to be more decriptive
There are two major types of TX descriptor formats for the RTL parts,
the old 32 byte descriptor, and the newer 40 byte descriptor used by
the 8723bu, 8192eu, and 88xx series.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Wei-Ning Huang [Wed, 30 Mar 2016 10:14:55 +0000 (18:14 +0800)]
mwifiex: fix NULL pointer dereference error
In mwifiex_enable_hs, we need to check if
priv->wdev.wiphy->wowlan_config is NULL before accessing its member.
This sometimes cause kernel panic when suspend/resume.
Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Julian Calaby [Fri, 18 Mar 2016 02:29:11 +0000 (13:29 +1100)]
iwl4965: Fix more memory leaks in __il4965_up()
In some of the non-success return paths, the memory allocated by
iwl4965_sta_alloc_lq() in iwl4965_alloc_bcast_station() is not freed.
In particular:
- if the card isn't ready after il4965_prepare_card_hw()
- if the card is hardware-rfkilled
In the hardware rfkilled path, the driver enables the rfkill
interrupt. When the card is unrfkilled and this interrupt is raised
we end up calling il4965_bg_restart() which calls __il4965_up() which
calls iwl4965_alloc_bcast_station() again.
Suggested-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Markus Elfring [Fri, 18 Mar 2016 02:25:33 +0000 (13:25 +1100)]
rsi: Delete unnecessary variable initialisation
In rsi_send_data_pkt(), the following variables are assigned to
before they're used:
* tmp_hdr - Assigned on line 47, first used on line 48
* bss - Assigned on line 41, first used on line 44
* extnd_size - Assigned on line 50, first used on line 52
* seq_num - Assigned on line 48, first used on line 96
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Rewrote commit message] Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Markus Elfring [Fri, 18 Mar 2016 02:25:13 +0000 (13:25 +1100)]
rsi: Delete unnecessary variable initialisation
In rsi_send_mgmt_pkt(), the following variables are assigned to
before they're used:
* wh - Assigned on line 161, first used on line 180
* bss - Assigned on line 160, first used on line 196
* msg - Assigned on line 168, first used on line 175
* extnd_size - Assigned on line 139, first used on line 142
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
[Rewrote commit message] Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jia-Ju Bai [Fri, 18 Mar 2016 02:24:51 +0000 (13:24 +1100)]
rtl818x_pci: Disable pci device in error handling code
When pci_request_regions in rtl8180_probe fails, pci_disable_device is not
called to disable the device which is enabled by pci_enbale_device.
This patch fixes the problem by adding a new lable in error handling code.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Acked-by: Andrea Merello <andrea.merello@gmail.com> Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jia-Ju Bai [Fri, 18 Mar 2016 02:24:28 +0000 (13:24 +1100)]
b43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init
The memory allocated by kzalloc in b43_bus_dev_ssb_init and
b43_bus_dev_bcma_init is not freed.
This patch fixes the bug by adding kfree in b43_ssb_remove,
b43_bcma_remove and error handling code of b43_bcma_probe.
Thanks Michael for his suggestion.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Tested-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk> Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Jia-Ju Bai [Fri, 18 Mar 2016 02:24:06 +0000 (13:24 +1100)]
iwl4965: Fix a null pointer dereference in il_tx_queue_free and il_cmd_queue_free
If "txq->cmd = kzalloc(...)" in il_tx_queue_init fails,
"kfree(txq->cmd[i])" in il_tx_queue_free and il_cmd_queue_free
in iwl4965_hw_txq_ctx_free will causes a null pointer dereference,
because txq->cmd is NULL at that time.
This patch fixes this problem by adding a if-check before kfree.
To avoid double free in il_tx_queue_free and il_cmd_queue_free
caused by the fixing, txq->meta and txq->cmd in error handling code
of il_tx_queue_init are assigned null values.
Otherwise, a double free will occur.
This patch has been tested in real device, and it actually fixes the bug.
Thanks Stanislaw for his suggestion.
Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
In brcmf_sdio_download_firmware(), bcmerror is set by the call to
brcmf_sdio_download_code_file(), before it's checked in the following
line.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Acked-by: Arend van Spriel <arend@broadcom.com>
[Rewrote commit message] Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Ivan Safonov [Fri, 18 Mar 2016 02:16:26 +0000 (13:16 +1100)]
ath9k: Remove unnecessary ?: operator
"(thermometer < 0) ? 0 : (thermometer == X)" is equivalent to
"thermometer == X" for X >= 0.
Signed-off-by: Ivan Safonov <insafonov@gmail.com>
[Updated commit message] Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amitkumar Karwar [Tue, 22 Mar 2016 04:09:56 +0000 (12:09 +0800)]
mwifiex: advertise low priority scan feature
Low priority scan handling code which delays or aborts scan
operation based on Tx traffic is removed recently. The reason
is firmware already takes care of it in our new feature scan
channel gap. Hence we should advertise low priority scan
support to cfg80211.
This patch fixes a problem in which OBSS scan request from
wpa_supplicant was being rejected by cfg80211.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Wei-Ning Huang <wnhuang@chromium.org> Tested-by: Wei-Ning Huang <wnhuang@chromium.org> Acked-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
retry_limit has never been used during the life of this driver, so
we may as well remove it as it is redundant.
Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Vishal Thanki [Sat, 19 Mar 2016 10:41:01 +0000 (11:41 +0100)]
rt2x00usb: Use usb anchor to manage URB
With current driver, it is observed that a URB is not
completed while the USB disconnect is initiated. Due to
that, the URB completion handler is trying to access
the resource which was freed as a part of USB disconnect.
Managing the URBs with anchor will make sure that all
the URBs are handled gracefully before device gets
disconnected.
Signed-off-by: Vishal Thanki <vishalthanki@gmail.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Joe Perches [Fri, 18 Mar 2016 00:00:21 +0000 (17:00 -0700)]
rtlwifi: btcoexist: Convert BTC_PRINTK to btc_<foo>_dbg
Use a more common logging style.
Miscellanea:
o Add specific logging macros for ALGORITHM and INTERFACE types
o Output the messages at KERN_DEBUG
o Coalesce formats
o Align arguments
o Whitespace style adjustments for only these changes
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Thu, 17 Mar 2016 18:40:56 +0000 (13:40 -0500)]
rtlwifi: Fix Smatch warnings
Smatch reports the following:
CHECK drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/pci.c:366 rtl_pci_check_buddy_priv() error: we previously assumed 'tpriv' could be null (see line 368)
drivers/net/wireless/realtek/rtlwifi/pci.c:1216 _rtl_pci_init_struct() warn: inconsistent indenting
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Larry Finger [Wed, 16 Mar 2016 18:33:35 +0000 (13:33 -0500)]
rtlwifi: btcoexist: Implement antenna selection
The previous patch added an option to rtl8723be to manually select the
antenna for those cases when only a single antenna is present, and the
on-board EEPROM is incorrectly programmed. This patch implements the
necessary changes in the Bluetooth coexistence driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> [V4.0+] Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
A number of new laptops have been delivered with only a single antenna.
In principle, this is OK; however, a problem arises when the on-board
EEPROM is programmed to use the other antenna connection. The option
of opening the computer and moving the connector is not always possible
as it will void the warranty in some cases. In addition, this solution
breaks the Windows driver when the box dual boots Linux and Windows.
A fix involving a new module parameter has been developed. This commit
adds the new parameter and implements the changes needed for the driver.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> [V4.0+] Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Amitkumar Karwar [Wed, 16 Mar 2016 14:46:16 +0000 (07:46 -0700)]
mwifiex: fix Tx timeout issue during suspend test
Call netif_carrier_off/on while stoping/starting netdev queues.
This fixes netdev watchdog warning and ->ndo_tx_timeout() invocation
during suspend resume stress test.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Fixes: 54f008497b9f09f ('mwifiex: Empty Tx queue during suspend') Tested-by: Wei-Ning Huang <wnhuang@chromium.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Kalle Valo [Wed, 6 Apr 2016 18:16:01 +0000 (21:16 +0300)]
Merge tag 'iwlwifi-next-for-kalle-2016-03-30' of https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next
* Support for Link Quality measurement (Aviya)
* Improvements in thermal (Chaya Rachel)
* Various cleanups (many people)
* Improvements in firmware error dump (Golan)
* More work 9000 devices and MSIx (Haim)
* Continuation of the Dynamic Queue Allocation work (Liad)
* Scan timeout to cope with buggy firmware (Luca)
* D0i3 improvements (Luca)
* Make the paging less memory hungry (Matti)
* 9000 new Rx path (Sara)
When signaling that a GRO frame is ready to be processed, the network stack
correctly checks length and aborts processing when a frame is less than 14
bytes. However, such a condition is really indicative of a broken driver,
and should be loudly signaled, rather than silently dropped as the case is
today.
Convert the condition to use net_warn_ratelimited() to ensure the stack
loudly complains about such broken drivers.
Signed-off-by: Aaron Conole <aconole@bytheb.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Thomas Falcon [Fri, 1 Apr 2016 22:20:35 +0000 (17:20 -0500)]
ibmvnic: enable RX checksum offload
Enable RX Checksum offload feature in the ibmvnic driver.
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com> Cc: John Allen <jallen@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Thomas Falcon [Fri, 1 Apr 2016 22:20:34 +0000 (17:20 -0500)]
ibmvnic: map L2/L3/L4 header descriptors to firmware
Allow the VNIC driver to provide descriptors containing
L2/L3/L4 headers to firmware. This feature is needed
for greater hardware compatibility and enablement of checksum
and TCP offloading features.
A new function is included for the hypervisor call,
H_SEND_SUBCRQ_INDIRECT, allowing a DMA-mapped array of SCRQ
descriptor elements to be sent to the VNIC server.
These additions will help fully enable checksum offloading as
well as other features as they are included later.
Signed-off-by: Thomas Falcon <tlfalcon@linux.vnet.ibm.com> Cc: John Allen <jallen@linux.vnet.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Petri Gynther [Tue, 5 Apr 2016 21:00:01 +0000 (14:00 -0700)]
net: bcmgenet: cleanup for dmadesc_set()
dmadesc_set() is used for setting the Tx buffer DMA address, length,
and status bits on a Tx ring descriptor when a frame is being Tx'ed.
Always set the Tx buffer DMA address first, before updating the length
and status bits, i.e. giving the Tx descriptor to the hardware.
The reason this is a cleanup rather than a fix is that the hardware
won't transmit anything from a Tx ring until the TDMA producer index
has been incremented. As long as the dmadesc_set() writes complete
before the TDMA producer index write, life is good.
Signed-off-by: Petri Gynther <pgynther@google.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Petri Gynther [Tue, 5 Apr 2016 21:00:00 +0000 (14:00 -0700)]
net: bcmgenet: cleanup for bcmgenet_xmit_frag()
Add frag_size = skb_frag_size(frag) and use it when needed.
Signed-off-by: Petri Gynther <pgynther@google.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Petri Gynther [Tue, 5 Apr 2016 20:59:59 +0000 (13:59 -0700)]
net: bcmgenet: cleanup for bcmgenet_xmit()
1. Readability: Move nr_frags assignment a few lines down in order
to bundle index -> ring -> txq calculations together.
2. Readability: Add parentheses around nr_frags + 1.
3. Minor fix: Stop the Tx queue and throw the error message only if
the Tx queue hasn't already been stopped.
Signed-off-by: Petri Gynther <pgynther@google.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Apr 2016 20:29:38 +0000 (16:29 -0400)]
Merge branch 'udp-peek'
Willem de Bruijn says:
====================
udp: support SO_PEEK_OFF
Support peeking at a non-zero offset for UDP sockets. Match the
existing behavior on Unix datagram sockets.
1/3 makes the sk_peek_offset functions safe to use outside locks
2/3 removes udp headers before enqueue, to simplify offset arithmetic
3/3 introduces SO_PEEK_OFFSET support, with Unix socket peek semantics.
Changes
v1->v2
- squash patches 3 and 4
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Enable peeking at UDP datagrams at the offset specified with socket
option SOL_SOCKET/SO_PEEK_OFF. Peek at any datagram in the queue, up
to the end of the given datagram.
Implement the SO_PEEK_OFF semantics introduced in commit ef64a54f6e55
("sock: Introduce the SO_PEEK_OFF sock option"). Increase the offset
on peek, decrease it on regular reads.
When peeking, always checksum the packet immediately, to avoid
recomputation on subsequent peeks and final read.
The socket lock is not held for the duration of udp_recvmsg, so
peek and read operations can run concurrently. Only the last store
to sk_peek_off is preserved.
Signed-off-by: Sam Kumar <samanthakumar@google.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
udp: remove headers from UDP packets before queueing
Remove UDP transport headers before queueing packets for reception.
This change simplifies a follow-up patch to add MSG_PEEK support.
Signed-off-by: Sam Kumar <samanthakumar@google.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
sock: convert sk_peek_offset functions to WRITE_ONCE
Make the peek offset interface safe to use in lockless environments.
Use READ_ONCE and WRITE_ONCE to avoid race conditions between testing
and updating the peek offset.
Suggested-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Apr 2016 20:26:31 +0000 (16:26 -0400)]
Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says:
====================
40GbE Intel Wired LAN Driver Updates 2016-04-05
This series contains updates to i40e and i40evf only.
Stefan converts dev_close() to ndo_stop() for ethtool offline self test,
since dev_close() causes IFF_UP to be cleared which will remove the
interface routes and addresses.
Alex bumps up the size of the transmit data buffer to 12K rather than 8K,
which provides a gain in throughput and a reduction in overhead for
putting together the frame. Fixed an issue in the polling routines where
we were using bitwise operators to avoid the side effects of the
logical operators. Then added support for bulk transmit clean for skbs.
Jesse fixed a sparse issue in the type casting in the transmit code and
fixed i40e_aq_set_phy_debug() to use i40e_status as a return code.
Catherine cleans up duplicated code.
Shannon fixed the cleaning up of the interrupt handling to clean up the
IRQs only if we actually got them set up. Also fixed up the error
scenarios where we were trying to remove a non-existent timer or
worktask, which causes the kernel heartburn.
Mitch changes the notification of resets to the reset interrupt handler,
instead of the actual reset initiation code. This allows the VFs to get
properly notified for all resets, including resets initiated by different
PFs on the same physical device. Also moved the clearing of VFLR bit
after reset processing, instead of before which could lead to double
resets on VF init. Fixed code comment to match the actual function name.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Apr 2016 18:09:03 +0000 (14:09 -0400)]
bnxt_en: Improve ethtool .get_settings().
If autoneg is off, we should always report the speed and duplex settings
even if it is link down so the user knows the current settings. The
unknown speed and duplex should only be used for autoneg when link is
down.
Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Apr 2016 18:09:01 +0000 (14:09 -0400)]
bnxt_en: Add unsupported SFP+ module warnings.
Add the PORT_CONN_NOT_ALLOWED async event handling logic. The driver
will print an appropriate warning to reflect the SFP+ module enforcement
policy done in the firmware.
Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Apr 2016 18:09:00 +0000 (14:09 -0400)]
bnxt_en: Set async event bits when registering with the firmware.
Currently, the driver only sets bit 0 of the async_event_fwd fields.
To be compatible with the latest spec, we need to set the
appropriate event bits handled by the driver. We should be handling
link change and PF driver unload events, so these 2 bits should be
set.
Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Apr 2016 18:08:58 +0000 (14:08 -0400)]
bnxt_en: Add EEE setup code.
1. Add bnxt_hwrm_set_eee() function to setup EEE firmware parameters based
on the bp->eee settings.
2. The new function bnxt_eee_config_ok() will check if EEE parameters need
to be modified due to autoneg changes.
3. bnxt_hwrm_set_link() has added a new parameter to update EEE. If the
parameter is set, it will call bnxt_hwrm_set_eee().
Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Michael Chan [Tue, 5 Apr 2016 18:08:56 +0000 (14:08 -0400)]
bnxt_en: Improve flow control autoneg with Firmware 1.2.1 interface.
Make use of the new AUTONEG_PAUSE bit in the new interface to better
control autoneg flow control settings, independent of RX and TX
advertisement settings.
Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller [Tue, 5 Apr 2016 20:08:02 +0000 (16:08 -0400)]
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says:
====================
100GbE Intel Wired LAN Driver Updates 2016-04-05
This series contains updates to fm10k only.
Bruce provides nearly half of the patches in the series, most of which do
general cleanup of the driver. These include semantic cleanups,
checkpatch.pl fixes, update driver to use BIT() kernel macro, use
BUILD_BUG_ON() where appropriate and use ether_addr_copy() instead of
memcpy().
Jake provides the remaining patches in the series, starting with a fix
for a possible NULL pointer deference. Next delays initialization of the
service timer and service task until late in probe(). If we do not wait,
failures in probe do not properly cleanup the service timer or service
task items which result in a kernel panic. Added better reporting during
error conditions. Fixed another possible kernel panic where we were
clearing the interrupt scheme before we freed the mailbox IRQ. Added
helper functions for setting strings and data for ethtool stats. Fixed
comment mis-spelled words.
v2: Dropped patch 3 from the original submission, until a better solution
can be worked up based on feedback from Joe Perches and David Miller.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Jacob Keller [Wed, 17 Feb 2016 00:19:24 +0000 (16:19 -0800)]
fm10k: use ethtool_rxfh_indir_default for default redirection table
The fm10k driver used its own code for generating a default indirection
table on device load, which was not the same as the default generated by
ethtool when indir_size of 0 is passed to SRXFH. Take advantage of
ethtool_rxfh_indir_default() and simplify code to write the redirection
table to reduce some code duplication.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Wed, 10 Feb 2016 22:45:50 +0000 (14:45 -0800)]
fm10k: correctly clean up when init_queueing_scheme fails
Fix a kernel panic that occurs during surprise removal. Clear the
interface queue counts upon fm10k_init_msix_capability failure. This
prevents further code (fm10k_update_stats etc.) from attempting to
access unallocated queue vector or ring memory.
Bruce Allan [Wed, 10 Feb 2016 22:45:47 +0000 (14:45 -0800)]
fm10k: prevent possibly uninitialized variable
If 'attr_flag < (1 << (2 * FM10K_TEST_MSG_NESTED))' is ever false, err
will be used uninitialized.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Fri, 5 Feb 2016 18:43:08 +0000 (10:43 -0800)]
fm10k: add helper functions to set strings and data for ethtool stats
Reduce duplicate code and the amount of indentation by adding
fm10k_add_stat_strings and fm10k_add_ethtool_stats functions which help
add fm10k_stat structures to the ethtool stats callbacks. This helps
increase ease of use for future stat additions, and increases code
readability. Skip handling of the per-queue stats as these will be
reworked in a following patch.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Thu, 4 Feb 2016 18:47:58 +0000 (10:47 -0800)]
fm10k: free MBX IRQ before clearing interrupt scheme
During fm10k_io_error_detected we were clearing the interrupt scheme
before we freed the MBX IRQ. This causes a kernel panic because the MBX
IRQ are assigned after MSI-X initialization. Clearing the interrupt
scheme results in removing the MSI-X entry table. Fix this by freeing
the MBX IRQ before we clear the interrupt scheme, as we do elsewhere in
the driver.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Thu, 4 Feb 2016 18:47:57 +0000 (10:47 -0800)]
fm10k: print error message when stop_hw fails
fm10k_stop_hw_generic calls fm10k_disable_queues_generic, which may
return an error code indicating that the queues were not stopped within
the time limit. Notify the user by displaying a message in the kernel
message ring, in a similar way to how we notify the user when reset_hw
fails. There isn't much we can do to recover from this error, so
currently nothing else is done.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Thu, 4 Feb 2016 18:47:56 +0000 (10:47 -0800)]
fm10k: base queue scheme covered by RSS
In fm10k_set_num_queues, we previously assigned the base template. This
would always be overwritten by either fm10k_set_qos_queues or
fm10k_set_rss_queues. In either case, we don't need the base values, so
we can just remove them.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Jacob Keller [Thu, 4 Feb 2016 18:47:55 +0000 (10:47 -0800)]
fm10k: don't initialize service task until later in probe
Delay initialization of the service timer and service task until late
probe. If we don't wait, failures in probe do not properly cleanup the
service timer or service task items, which results in the kernel panic
below, potentially freezing the whole system. In addition, ensure that
the SERVICE_DISABLE bit is set before we request the MBX IRQ since the
MBX interrupt attempts to schedule the service task otherwise. This
prevents a similar trace from occurring after this change.
We didn't notice this issue before because probe almost always completes
successfully. I discovered it due to a mis-ordered mailbox handler
array, which resulted in the following failure when requesting mailbox
interrupt.
Jacob Keller [Thu, 4 Feb 2016 18:47:54 +0000 (10:47 -0800)]
fm10k: prevent null pointer dereference of msix_entries table
According to the C standard dereferencing a variable before it is
checked invokes undefined behavior, and thus compilers are free to
assume the check for NULL isn't necessary. Prevent this by re-ordering
the NULL check of msix_entries in fm10k_free_mbx_irq.
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Bruce Allan [Tue, 29 Dec 2015 02:00:30 +0000 (18:00 -0800)]
fm10k: use ether_addr_copy to copy MAC address
Cleanup the remaining instances of using memcpy() instead of the preferred
ether_addr_copy().
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Bruce Allan [Tue, 22 Dec 2015 22:55:20 +0000 (14:55 -0800)]
fm10k: demote BUG_ON() to WARN_ON() where appropriate
We don't need to crash the kernel in this instance so just warn about the
condition and play on.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Bruce Allan [Tue, 22 Dec 2015 21:43:49 +0000 (13:43 -0800)]
fm10k: cleanup remaining right-bit-shifted 1
Use BIT() macro instead.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Bruce Allan [Tue, 22 Dec 2015 21:43:44 +0000 (13:43 -0800)]
fm10k: Move constants to the right of binary operators
The semantic patch that makes this change is available
in scripts/coccinelle/misc/compare_const_fl.cocci.
More information about semantic patching is available at
http://coccinelle.lip6.fr/
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Tested-by: Krishneil Singh <Krishneil.k.singh@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 10 Mar 2016 22:59:50 +0000 (14:59 -0800)]
i40e: Change comment to reflect correct function name
Minor correction in the comment to reflect the correct function name
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>
Mitch Williams [Thu, 10 Mar 2016 22:59:49 +0000 (14:59 -0800)]
i40evf: Add additional check for reset
If the driver happens to read a register during the time in which the
device is undergoing reset, it will receive a value of 0xdeadbeef
instead of a valid value. Unfortunately, the driver may misinterpret
this as a valid value, especially if it's just looking for individual
bits.
Add an explicit check for this value when we are looking for admin queue
errors, and trigger reset recovery if we find it.
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>
Shannon Nelson [Thu, 10 Mar 2016 22:59:48 +0000 (14:59 -0800)]
i40e: Change unknown event error msg to ignore message
There's no real error in an unknown event from the Firmware, we're just
posting a useful FYI notice, so this patch simply removes the "Error" word.
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Mitch Williams [Thu, 10 Mar 2016 22:59:47 +0000 (14:59 -0800)]
i40e: Added code to prevent double resets
Clear the VFLR bit after reset processing, instead of before. This
prevents double resets on VF init.
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>
Mitch Williams [Thu, 10 Mar 2016 22:59:46 +0000 (14:59 -0800)]
i40e: Notify VFs of all resets
Notify VFs in the reset interrupt handler, instead of the actual
reset initiation code. This allows the VFs to get properly notified for
all resets, including resets initiated by different PFs on the same
physical device.
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>
Shannon Nelson [Thu, 10 Mar 2016 22:59:45 +0000 (14:59 -0800)]
i40e: Remove timer and task only if created
In some error scenarios, we may find ourselves trying to remove a
non-existent timer or worktask. This causes the kernel some bit
of consternation, so don't do it.
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
David S. Miller [Tue, 5 Apr 2016 19:07:55 +0000 (15:07 -0400)]
Merge branch 'mlxsw-next'
Jiri Pirko says:
====================
mlxsw: small driver update, including switchdev doc update
Ido Schimmel (3):
mlxsw: spectrum: Reduce number of supported 802.1D bridges
switchdev: Use switch ID in suggested udev rule
mlxsw: spectrum: Add support for physical port names
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
mlxsw: spectrum: Add support for physical port names
Export to userspace the front panel name of the port, so that udev can
rename the ports accordingly. The convention suggested by switchdev
documentation is used:
1) Non-split: pX
2) Split: pXsY
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>
Since there can be multiple switch ASICs on the same system we should
use the switch ID in order to differentiate between them and set the
switch name (e.g. swX) accordingly.
Also, replace the order of the "Switch ID" and "Port Netdev Naming"
sections following the above change.
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>
mlxsw: spectrum: Reduce number of supported 802.1D bridges
Resources allocated for these bridges at init time cannot be later used
for other purposes. While current number is supported by the device,
it's mostly theoretical with regards to any real use case, which leads
to poor utilization of device's resources. Solve that by reducing the
number.
The long term plan is to make this value (along with others) user
configurable via devlink and write it to NVRAM, so that it can be used
during the next init. Until then we must hardcode such values.
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>