fm10k: ensure we process SM mbx when processing VF mbx
Subsystems (2)
PATCH 1/2 fm10k: ensure we process SM mbx when processing VF mbx
When we process VF mailboxes, the driver is likely going to also queue up messages to the switch manager. This process merely queues up the FIFO, but doesn't actually begin the transmission process. Because we hold the mailbox lock during this VF processing, the PF<->SM mailbox is not getting processed at this time. Ensure that we actually process the PF<->SM mailbox in between each PF<->VF mailbox.
This should ensure prompt transmission of the messages queued up after each VF message is received and handled.
--- drivers/net/ethernet/intel/fm10k/fm10k_iov.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_iov.c +3 -0
@@ -126,6 +126,9 @@ s32 fm10k_iov_mbx(struct fm10k_intfc *interface)struct fm10k_mbx_info *mbx = &vf_info->mbx;u16 glort = vf_info->glort; +/* process the SM mailbox first to drain outgoing messages */ + hw->mbx.ops.process (hw, &hw->mbx); +/* verify port mapping is valid, if not reset port */ if (vf_info->vf_flags && !fm10k_glort_valid_pf (hw, glort)) hw->iov.ops.reset_lport (hw, vf_info);
Signature · 1 line
2.12.0.rc1.272.g5157a0d593b8
PATCH 2/2 fm10k: reschedule service event if we stall the PF<->SM mailbox
When we are handling PF<->VF mailbox messages, it is possible that the VF will send us so many messages that the PF<->SM FIFO will fill up. In this case, we stop the loop and wait until the service event is rescheduled.
Normally this should happen due to an interrupt. But it is possible that we don't get another interrupt for a while and it isn't until the service timer actually reschedules us. Instead, simply reschedule immediately which will cause the service event to be run again as soon as we exit.
This ensures that we promptly handle all of the PF<->VF messages with minimal delay, while still giving time for the SM mailbox to drain.
--- drivers/net/ethernet/intel/fm10k/fm10k_iov.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/intel/fm10k/fm10k_iov.c +4 -0
@@ -143,6 +143,10 @@ s32 fm10k_iov_mbx(struct fm10k_intfc *interface)if (!hw->mbx.ops.tx_ready (&hw->mbx,FM10K_VFMBX_MSG_MTU )) {/* keep track of how many times this occurs */ interface->hw_sm_mbx_full++; + +/* make sure we try again momentarily */ +fm10k_service_event_schedule (interface); +break ; }
Signature · 1 line
2.12.0.rc1.272.g5157a0d593b8
Singh
PATCH 2/2 fm10k: reschedule service event if we stall the PF<->SM mailbox
Quoted 21 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Wednesday, March 8, 2017 3:56 PM
To: Intel Wired LAN <[email protected]>
Subject: [Intel-wired-lan] [PATCH 2/2] fm10k: reschedule service event if we stall the PF<->SM mailboxWhen we are handling PF<->VF mailbox messages, it is possible that the VF will send us so many messages that the PF<->SM FIFO will fill up. In this case, we stop the loop and wait until the service event is rescheduled.
Normally this should happen due to an interrupt. But it is possible that we don't get another interrupt for a while and it isn't until the service timer actually reschedules us. Instead, simply reschedule immediately which will cause the service event to be run again as soon as we exit.
Quoted 5 lines
This ensures that we promptly handle all of the PF<->VF messages with minimal delay, while still giving time for the SM mailbox to drain.
Signed-off-by Jacob Keller <[email protected]>---
Singh
PATCH 1/2 fm10k: ensure we process SM mbx when processing VF mbx
In reply to Jacob KellerQuoted 16 lines
-----Original Message-----
From: Intel-wired-lan [mailto:intel-wired-lan-bounces at lists.osuosl.org] On Behalf Of Jacob Keller
Sent: Wednesday, March 8, 2017 3:56 PM
To: Intel Wired LAN <[email protected]>
Subject: [Intel-wired-lan] [PATCH 1/2] fm10k: ensure we process SM mbx when processing VF mbxWhen we process VF mailboxes, the driver is likely going to also queue up messages to the switch manager. This process merely queues up the FIFO, but doesn't actually begin the transmission process. Because we hold the mailbox lock during this VF processing, the PF<->SM mailbox is not getting processed at this time. Ensure that we actually process the PF<->SM mailbox in between each PF<->VF mailbox.
Quoted 5 lines
This should ensure prompt transmission of the messages queued up after each VF message is received and handled.
Signed-off-by Jacob Keller <[email protected]>---