From: Thomas Falcon <hidden> Date: 2017-01-25 21:02:32
Move most interrupt handler processing into a tasklet, and
introduce a delay after re-enabling interrupts to fix timing
issues encountered in hardware testing.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 21 +++++++++++++++++++--
drivers/net/ethernet/ibm/ibmvnic.h | 1 +
2 files changed, 20 insertions(+), 2 deletions(-)
@@ -3421,7 +3433,6 @@ static irqreturn_t ibmvnic_interrupt(int irq, void *instance)booldone=false;spin_lock_irqsave(&queue->lock,flags);-vio_disable_interrupts(vdev);while(!done){/* Pull all the valid messages off the CRQ */while((crq=ibmvnic_next_crq(adapter))!=NULL){
@@ -3429,6 +3440,8 @@ static irqreturn_t ibmvnic_interrupt(int irq, void *instance)crq->generic.first=0;}vio_enable_interrupts(vdev);+/* delay in case of firmware hiccup */+mdelay(10);crq=ibmvnic_next_crq(adapter);if(crq){vio_disable_interrupts(vdev);
From: Thomas Falcon <hidden> Date: 2017-01-25 21:02:33
When a IBM VNIC client driver requests a faulty device setting, the
server returns an acceptable value for the client to request.
This 64 bit value was incorrectly being swapped as a 32 bit value,
resulting in loss of data. This patch corrects that by using
the 64 bit swap function.
Signed-off-by: John Allen <redacted>
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
From: Thomas Falcon <hidden> Date: 2017-01-25 21:02:33
In the current driver, the MTU is set to the maximum value
capable for the backing device. This patch sets the MTU to the
default value for a Linux net device. It also corrects a
discrepancy between MTU values received from firmware, which includes
the ethernet header length, and net device MTU values. Finally, it removes
redundant min/max MTU assignments after device initialization.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
From: Thomas Falcon <hidden> Date: 2017-01-25 21:02:34
Error reports received from firmware were not being converted from
big endian values, leading to bogus error codes reported on little
endian systems.
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
@@ -2185,12 +2185,12 @@ static void handle_error_info_rsp(union ibmvnic_crq *crq,if(!found){dev_err(dev,"Couldn't find error id %x\n",-crq->request_error_rsp.error_id);+be32_to_cpu(crq->request_error_rsp.error_id));return;}dev_err(dev,"Detailed info for error id %x:",-crq->request_error_rsp.error_id);+be32_to_cpu(crq->request_error_rsp.error_id));for(i=0;i<error_buff->len;i++){pr_cont("%02x",(int)error_buff->buff[i]);
@@ -2269,8 +2269,8 @@ static void handle_error_indication(union ibmvnic_crq *crq,dev_err(dev,"Firmware reports %serror id %x, cause %d\n",crq->error_indication.flags&IBMVNIC_FATAL_ERROR?"FATAL ":"",-crq->error_indication.error_id,-crq->error_indication.error_cause);+be32_to_cpu(crq->error_indication.error_id),+be16_to_cpu(crq->error_indication.error_cause));error_buff=kmalloc(sizeof(*error_buff),GFP_ATOMIC);if(!error_buff)
From: Thomas Falcon <hidden> Date: 2017-01-25 21:02:38
Initialize this completion structure before requesting that
a buffer be long-term mapped . This fix resolves a bug where firmware
sends a response before the structure is initialized.
Signed-off-by: John Allen <redacted>
Signed-off-by: Nathan Fontenot <redacted>
Signed-off-by: Thomas Falcon <redacted>
---
drivers/net/ethernet/ibm/ibmvnic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: David Miller <davem@davemloft.net> Date: 2017-01-26 04:04:26
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:19 -0600
Move most interrupt handler processing into a tasklet, and
introduce a delay after re-enabling interrupts to fix timing
issues encountered in hardware testing.
Signed-off-by: Thomas Falcon <redacted>
I don't think you have any idea what the real problem is. This looks
like a hack, at best. Next patch you'll increase the delay to "20",
right? And if that doesn't work you'll try "40".
Or if you do know the reason, you need to explain it in detail in this
commit message so that we can properly evaluate this patch.
Furthermore, if you're going to move all of your packet processing
into software interrupt context, you might as well use NAPI polling
which is a purposefully built piece of infrastructure for doing
exactly this.
From: David Miller <davem@davemloft.net> Date: 2017-01-26 04:05:12
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:20 -0600
In the current driver, the MTU is set to the maximum value
capable for the backing device. This patch sets the MTU to the
default value for a Linux net device.
Why are you doing this?
What happens to users who depend upon the current behavior.
They will break, and that isn't acceptable.
From: Thomas Falcon <hidden> Date: 2017-01-26 16:44:36
On 01/25/2017 10:04 PM, David Miller wrote:
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:19 -0600
quoted
Move most interrupt handler processing into a tasklet, and
introduce a delay after re-enabling interrupts to fix timing
issues encountered in hardware testing.
Signed-off-by: Thomas Falcon <redacted>
I don't think you have any idea what the real problem is. This looks
like a hack, at best. Next patch you'll increase the delay to "20",
right? And if that doesn't work you'll try "40".
Or if you do know the reason, you need to explain it in detail in this
commit message so that we can properly evaluate this patch.
You're right, I should have given more explanation in the commit message about the bug encountered and our reasons for this sort of fix. The issue is that there are some scenarios during the device init where multiple messages are sent by firmware in one interrupt request.
We have observed behavior where messages are delayed, resulting in the interrupt handler completing before the delayed messages can be processed, fouling up the device bring-up in the device probing and elsewhere. The goal of the delay is to buy some time for the hypervisor to forward all the CRQ messages from the firmware.
Furthermore, if you're going to move all of your packet processing
into software interrupt context, you might as well use NAPI polling
which is a purposefully built piece of infrastructure for doing
exactly this.
This interrupt handler doesn't handle packet processing, but communications between the driver and firmware for device settings and resource allocation. Packet processing is done with different interrupts that do use NAPI polling.
From: Thomas Falcon <hidden> Date: 2017-01-26 16:44:39
On 01/25/2017 10:05 PM, David Miller wrote:
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:20 -0600
quoted
In the current driver, the MTU is set to the maximum value
capable for the backing device. This patch sets the MTU to the
default value for a Linux net device.
Why are you doing this?
What happens to users who depend upon the current behavior.
They will break, and that isn't acceptable.
The current behavior was already broken. We were seeing firmware errors when sending jumbo sized packets . We plan to add proper support for jumbo sized packets as soon as possible.
From: David Miller <davem@davemloft.net> Date: 2017-01-26 17:56:37
From: Thomas Falcon <redacted>
Date: Thu, 26 Jan 2017 10:44:22 -0600
On 01/25/2017 10:04 PM, David Miller wrote:
quoted
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:19 -0600
quoted
Move most interrupt handler processing into a tasklet, and
introduce a delay after re-enabling interrupts to fix timing
issues encountered in hardware testing.
Signed-off-by: Thomas Falcon <redacted>
I don't think you have any idea what the real problem is. This looks
like a hack, at best. Next patch you'll increase the delay to "20",
right? And if that doesn't work you'll try "40".
Or if you do know the reason, you need to explain it in detail in this
commit message so that we can properly evaluate this patch.
You're right, I should have given more explanation in the commit message about the bug encountered and our reasons for this sort of fix. The issue is that there are some scenarios during the device init where multiple messages are sent by firmware in one interrupt request.
We have observed behavior where messages are delayed, resulting in the interrupt handler completing before the delayed messages can be processed, fouling up the device bring-up in the device probing and elsewhere. The goal of the delay is to buy some time for the hypervisor to forward all the CRQ messages from the firmware.
Then isn't there an event you can sleep and wait for, or a piece of state for
you to poll and test for in a timeout based loop?
This delay is a bad solution for the problem of waiting for A to happen
before you do B.
From: David Miller <davem@davemloft.net> Date: 2017-01-26 17:57:03
From: Thomas Falcon <redacted>
Date: Thu, 26 Jan 2017 10:44:31 -0600
On 01/25/2017 10:05 PM, David Miller wrote:
quoted
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:20 -0600
quoted
In the current driver, the MTU is set to the maximum value
capable for the backing device. This patch sets the MTU to the
default value for a Linux net device.
Why are you doing this?
What happens to users who depend upon the current behavior.
They will break, and that isn't acceptable.
The current behavior was already broken. We were seeing firmware errors when sending jumbo sized packets . We plan to add proper support for jumbo sized packets as soon as possible.
Need to be explained, with a full detailed history of how things got this way,
in your commit message.
From: Thomas Falcon <hidden> Date: 2017-01-26 18:57:11
On 01/26/2017 11:56 AM, David Miller wrote:
From: Thomas Falcon <redacted>
Date: Thu, 26 Jan 2017 10:44:22 -0600
quoted
On 01/25/2017 10:04 PM, David Miller wrote:
quoted
From: Thomas Falcon <redacted>
Date: Wed, 25 Jan 2017 15:02:19 -0600
quoted
Move most interrupt handler processing into a tasklet, and
introduce a delay after re-enabling interrupts to fix timing
issues encountered in hardware testing.
Signed-off-by: Thomas Falcon <redacted>
I don't think you have any idea what the real problem is. This looks
like a hack, at best. Next patch you'll increase the delay to "20",
right? And if that doesn't work you'll try "40".
Or if you do know the reason, you need to explain it in detail in this
commit message so that we can properly evaluate this patch.
You're right, I should have given more explanation in the commit message about the bug encountered and our reasons for this sort of fix. The issue is that there are some scenarios during the device init where multiple messages are sent by firmware in one interrupt request.
We have observed behavior where messages are delayed, resulting in the interrupt handler completing before the delayed messages can be processed, fouling up the device bring-up in the device probing and elsewhere. The goal of the delay is to buy some time for the hypervisor to forward all the CRQ messages from the firmware.
Then isn't there an event you can sleep and wait for, or a piece of state for
you to poll and test for in a timeout based loop?
This delay is a bad solution for the problem of waiting for A to happen
before you do B.
Understood. We will come up with a better fix. Thanks for your attention.
This interrupt function doesn't process packets, but message passing between firmware and driver for determining device capabilities and available resources, such as the number TX and RX queues.