aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/ibm/ibmvnic.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-03ibmvnic: Implement per-queue statistics reportingJohn Allen1-2/+84
Add counters to report number of packets, bytes, and dropped packets for each transmit queue and number of packets, bytes, and interrupts for each receive queue. Modify ethtool callbacks to report the new statistics. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-08-02ibmvnic: Initialize SCRQ's during login renegotiationThomas Falcon1-1/+14
SCRQ resources are freed during renegotiation, but they are not re-allocated afterwards due to some changes in the initialization process. Fix that by re-allocating the memory after renegotation. SCRQ's can also be freed if a server capabilities request fails. If this were encountered during a device reset for example, SCRQ's may not be re-allocated. This operation is not necessary anymore so remove it. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-07-24ibmvnic: Check for transport event on driver resumeJohn Allen1-4/+1
On resume, the ibmvnic driver will fail to resume normal operation. The main crq gets closed on suspend by the vnic server and doesn't get reopened again as the interrupt for the transport event that would reset the main crq comes in after the driver has been suspended. This patch resolves the issue by removing the calls to kick the receive interrupts handlers and instead directly invoking the main crq interrupt handler. This will ensure that we see the transport event necessary to properly resume the driver. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-29ibmvnic: Fix assignment of RX/TX IRQ'sThomas Falcon1-7/+7
The driver currently creates RX/TX queues during device probe, but assigns IRQ's to them during device open. On reset, however, IRQ's are assigned when resetting the queues. If there is a reset while the device is closed and the device is later opened, the driver will request IRQ's twice, causing the open to fail. This patch assigns the IRQ's in the ibmvnic_init function after the queues are reset or initialized, ensuring IRQ's are only requested once. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-22ibmvnic: Correct return code checking for ibmvnic_init during probeNathan Fontenot1-1/+1
The update to ibmvnic_init to allow an EAGAIN return code broke the calling of ibmvnic_init from ibmvnic_probe. The code now will return from this point in the probe routine if anything other than EAGAIN is returned. The check should be to see if rc is non-zero and not equal to EAGAIN. Without this fix, the vNIC driver can return 0 (success) from its probe routine due to ibmvnic_init returning zero, but before completing the probe process and registering with the netdev layer. Fixes: 6a2fb0e99f9c (ibmvnic: driver initialization for kdump/kexec) Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-22ibmvnic: Fix error handling when registering long-term-mapped buffersThomas Falcon1-45/+34
The patch stores the return code of the REQUEST_MAP_RSP sub-CRQ command in the private data structure, where it can be later checked during device open or a reset. In the case of a reset, the mapping request to the vNIC Server may fail, especially in the case of a partition migration. The driver attempts to handle this by re-allocating the buffer and re-sending the mapping request. The original error handling implementation was removed. The separate function handling the REQUEST_MAP response message was also removed, since it is now simple enough to be handled in the ibmvnic_handle_crq function. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-20ibmvnic: Return from ibmvnic_resume if not in VNIC_OPEN stateJohn Allen1-0/+3
If the ibmvnic driver is not in the VNIC_OPEN state, return from ibmvnic_resume callback. If we are not in the VNIC_OPEN state, interrupts may not be initialized and directly calling the interrupt handler will cause a crash. Signed-off-by: John Allen <[email protected]> Reviewed-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-16ibmvnic: driver initialization for kdump/kexecNathan Fontenot1-5/+19
When booting into the kdump/kexec kernel, pHyp and vios are not prepared for the initialization crq request and a failover transport event is generated. This is not handled correctly. At this point in initialization the driver is still in the 'probing' state and cannot handle a full reset of the driver as is normally done for a failover transport event. To correct this we catch driver resets while still in the 'probing' state and return EAGAIN. This results in the driver tearing down the main crq and calling ibmvnic_init() again. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-15ibmvnic: Exit polling routine correctly during adapter resetThomas Falcon1-3/+6
This patch fixes a bug where, in the case of a device reset, the polling routine will never complete, causing napi_disable to sleep indefinitely when attempting to close the device. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-15ibmvnic: Remove VNIC_CLOSING check from pending_scrqThomas Falcon1-2/+1
Fix a kernel panic resulting from data access of a NULL pointer during device close. The pending_scrq routine is meant to determine whether there is a valid sub-CRQ message awaiting processing. When the device is closing, however, there is a possibility that NULL messages can be processed because pending_scrq will always return 1 even if there no valid message in the queue. It's not clear what this closing state check was originally meant to accomplish, so just remove it. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-15ibmvnic: Sanitize entire SCRQ buffer on resetThomas Falcon1-1/+1
Fixup a typo so that the entire SCRQ buffer is cleaned. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-15ibmvnic: Ensure that TX queues are disabled in __ibmvnic_closeThomas Falcon1-1/+7
Use netif_tx_disable to guarantee that TX queues are disabled when __ibmvnic_close is called by the device reset routine. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-15ibmvnic: Activate disabled RX buffer pools on resetThomas Falcon1-0/+1
RX buffer pools are disabled while awaiting a device reset if firmware indicates that the resource is closed. This patch fixes a bug where pools were not being subsequently enabled after the device reset, causing the device to become inoperable. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-15Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-0/+6
The conflicts were two cases of overlapping changes in batman-adv and the qed driver. Signed-off-by: David S. Miller <[email protected]>
2017-06-13ibmvnic: Remove netdev notify for failover resetsNathan Fontenot1-1/+3
When handling a driver reset due to a failover of the backing server on the vios, doing the netdev_notify_peers() can cause network traffic to stall or halt. Remove the netdev notify call for failover resets. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-13ibmvnic: Client-initiated failoverThomas Falcon1-0/+46
The IBM vNIC protocol provides support for the user to initiate a failover from the client LPAR in case the current backing infrastructure is deemed inadequate or in an error state. Support for two H_VIOCTL sub-commands for vNIC devices are required to implement this function. These commands are H_GET_SESSION_TOKEN and H_SESSION_ERR_DETECTED. "[H_GET_SESSION_TOKEN] is used to obtain a session token from a VNIC client adapter. This token is opaque to the caller and is intended to be used in tandem with the SESSION_ERROR_DETECTED vioctl subfunction." "[H_SESSION_ERR_DETECTED] is used to report that the currently active backing device for a VNIC client adapter is behaving poorly, and that the hypervisor should attempt to fail over to a different backing device, if one is available." To provide tools access to this functionality the vNIC driver creates a sysfs file that, when written to, will send a request to pHyp to failover to a different backing device. Signed-off-by: Thomas Falcon <[email protected]> Reviewed-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-07ibmvnic: Return failure on attempted mtu changeJohn Allen1-0/+6
Changing the mtu is currently not supported in the ibmvnic driver. Implement .ndo_change_mtu in the driver so that attempting to use ifconfig to change the mtu will fail and present the user with an error message. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-06-06Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/netDavid S. Miller1-1/+1
Just some simple overlapping changes in marvell PHY driver and the DSA core code. Signed-off-by: David S. Miller <[email protected]>
2017-06-02ibmvnic: Remove module author mailing addressThomas Falcon1-1/+1
The original author left the project and so far has not responded to emails sent to the listed address. Signed-off-by: John Allen <[email protected]> Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Reset sub-crqs during driver resetNathan Fontenot1-3/+43
When the ibmvnic driver is resetting, we can just reset the sub crqs instead of releasing all of their resources and re-allocting them. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Reset tx/rx pools on driver resetNathan Fontenot1-4/+67
When resetting the ibmvnic driver there is not a need to release and re-allocate the resources for the tx and rx pools. These resources can just be reset to avoid the re-allocations. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Reset the CRQ queue during driver resetNathan Fontenot1-2/+8
When a driver reset operation occurs there is not a need to release the CRQ resources and re-allocate them. Instead a reset of the CRQ will suffice. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Check adapter state during ibmvnic_pollNathan Fontenot1-1/+7
We do not want to process any receive frames if the ibmvnic_poll routine is invoked while a reset is in process. Also, before replenishing the rx pools in the ibmvnic_poll, we want to make sure the adapter is not in the process of closing. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Deactivate RX pool buffer replenishment on H_CLOSEDThomas Falcon1-0/+21
If H_CLOSED is returned, halt RX buffer replenishment activity until firmware sends a notification that the driver can reset. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Halt TX and report carrier off on H_CLOSED return codeThomas Falcon1-2/+8
This patch disables transmissions and reports carrier off if xmit function returns that the hardware TX queue is closed. The driver can then await a signal from firmware to determine the correct reset method. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Non-fatal error handlingJohn Allen1-25/+31
Handle non-fatal error conditions. The process to do this when resetting the driver is to just do __ibmvnic_close followed by __ibmvnic_open. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Fix cleanup of SKB's on driver closeThomas Falcon1-1/+1
A race condition occurs when closing the driver. Free'ing of skb's can race between the close routine and ibmvnic_tx_interrupt. To fix this we move the claenup of tx pools during close to after the sub-CRQ interrupts are disabled. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Send gratuitous arp on resetJohn Allen1-0/+1
Send gratuitous arp after any reset. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Handle failover after failed init crqJohn Allen1-1/+10
Handle case where phyp sends a failover after failing to send the init crq. Signed-off-by: John Allen <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-26ibmvnic: Track state of adapter napisJohn Allen1-9/+28
Track the state of ibmvnic napis. The driver can get into states where it can be reset when napis are already disabled and attempting to disable them again will cause the driver to hang. Signed-off-by: John Allen <[email protected]> Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-18ibmvnic: fix missing unlock on error in __ibmvnic_reset()Wei Yongjun1-0/+1
Add the missing unlock before return from function __ibmvnic_reset() in the error handling case. Fixes: ed651a10875f ("ibmvnic: Updated reset handling") Signed-off-by: Wei Yongjun <[email protected]> Reviewed-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Move queue restarting in ibmvnic_tx_completeNathan Fontenot1-12/+10
Restart of the subqueue should occur outside of the loop processing any tx buffers instead of doing this in the middle of the loop. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Record SKB RX queue during pollThomas Falcon1-0/+1
Map each RX SKB to the RX queue associated with the driver's RX SCRQ. This should improve the RX CPU load balancing issues seen by the performance team. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Continue skb processing after skb completion errorNathan Fontenot1-1/+1
There is not a need to stop processing skbs if we encounter a skb that has a receive completion error. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Check for driver reset first in ibmvnic_xmitNathan Fontenot1-6/+6
Move the check for the driver resetting to the first thing in ibmvnic_xmit(). Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Wait for any pending scrqs entries at driver closeNathan Fontenot1-20/+27
When closing the ibmvnic driver we need to wait for any pending sub crq entries to ensure they are handled. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Clean up tx pools when closingNathan Fontenot1-0/+30
When closing the ibmvnic driver, most notably during the reset path, the tx pools need to be cleaned to ensure there are no hanging skbs that need to be free'ed. The need for this was found during debugging a loss of network traffic after handling a driver reset. The underlying cause was some skbs in the tx pool that were never free'ed. As a result the upper network layers never tried a re-send since it believed the driver still had the skb. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Whitespace correction in release_rx_poolsNathan Fontenot1-1/+1
Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Delete napi's when releasing driver resourcesNathan Fontenot1-0/+9
The napi structs allocated at drivier initializatio need to be free'ed when releasing the drivers resources. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Updated reset handlingNathan Fontenot1-153/+260
The ibmvnic driver has multiple handlers for resetting the driver depending on the reason the reset is needed (failover, lpm, fatal erors,...). All of the reset handlers do essentially the same thing, this patch moves this work to a common reset handler. By doing this we also allow the driver to better handle situations where we can get a reset while handling a reset. The updated reset handling works by adding a reset work item to the list of resets and then scheduling work to perform the reset. This step is necessary because we can receive a reset in interrupt context and we want to handle the reset out of interrupt context. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Replace is_closed with state fieldNathan Fontenot1-7/+13
Replace the is_closed flag in the ibmvnic adapter strcut with a more comprehensive state field that tracks the current state of the driver. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-05-03ibmvnic: Move resource initialization to its own routineNathan Fontenot1-32/+39
Move all of the calls to initialize resources for the driver to a separate routine. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-26ibmvnic: Move initialization of sub crqs to ibmvnic_initNathan Fontenot1-11/+12
The sub crq structures are initialized in interrupt context while handling the response to crqs when negotiating capabilities for the driver. The sub crqs do not need to be initialized at this point and can be moved to being done from ibmvnic_init. Moving the init of the sub crqs to ibmvnic_init also allows use to allocate the memory with GFP_KERNEL instead of GFP_ATOMIC. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-26ibmvnic: Split initialization of scrqs to its own routineNathan Fontenot1-47/+54
Split the sending of capability request crqs and the initialization of sub crqs into their own routines. This is a first step to moving the allocation of sub-crqs out of interrupt context. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-24ibmvnic: Free skb's in cases of failure in transmitThomas Falcon1-3/+15
When an error is encountered during transmit we need to free the skb instead of returning TX_BUSY. Signed-off-by: Thomas Falcon <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-24ibmvnic: Validate napi exist before disabling themNathan Fontenot1-2/+4
Validate that the napi structs exist before trying to disable them at driver close. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-24ibmvnic: Add set_link_state routine for setting adapter link stateNathan Fontenot1-14/+57
Create a common routine for setting the link state for the vnic adapter. This update moves the sending of the crq and waiting for the link state response to a common place. The new routine also adds handling of resending the crq in cases of getting a partial success response. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-24ibmvnic: Move initialization of the stats token to ibmvnic_openNathan Fontenot1-6/+4
We should be initializing the stats token in the same place we initialize the other resources for the driver. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-24ibmvnic: Only retrieve error info if presentNathan Fontenot1-20/+51
When handling a fatal error in the driver, there can be additional error information provided by the vios. This information is not always present, so only retrieve the additional error information when present. Signed-off-by: Nathan Fontenot <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2017-04-24ibmvnic: Insert header on VLAN tagged received frameMurilo Fossa Vicentini1-1/+20
This patch addresses a modification in the PAPR+ specification which now defines a previously reserved value for vNIC capabilities. It indicates whether the system firmware performs a VLAN header stripping on all VLAN tagged received frames, in case it does, the behavior expected is for the ibmvnic driver to be responsible for inserting the VLAN header. Reported-by: Manvanthara B. Puttashankar <[email protected]> Signed-off-by: Murilo Fossa Vicentini <[email protected]> Signed-off-by: David S. Miller <[email protected]>