On 16.10.2015. 20:30, Mark Kettenis wrote:
>> Date: Fri, 16 Oct 2015 14:13:52 +0200
>> From: Martin Pieuchot <[email protected]>
>>
>> On 08/10/15(Thu) 20:49, Mark Kettenis wrote:
>>>> Date: Wed, 30 Sep 2015 14:30:11 +0200 (CEST)
>>>> From: Mark Kettenis <[email protected]>
>>>>
>>>> Since people seemed to like my diff for em(4), here is one for ix(4).
>>>> In addition to unlocking the rx completion path, this one also uses
>>>> intr_barrier() and removes the rx mutex that claudio@ put in recently.
>>>>
>>>> I don't have any ix(4) hardware. So the only guarantee is that this
>>>> compiles ;).
>>>
>>> Based on the experience with em(4), here is an updated diff.
>>
>> What's happening to this? Mark did you get any test report?
>
> Got a report from Hrvoje Popovski that this triggers OACTIVE a lot and
> sometimes even gets stuck completely.
Hi,
i tried to apply this patch to today's current and there are some
errors. could it be because of dlg@ IFF_OACTIVE mpsafe patch?
File to patch: /usr/src/sys/dev/pci/if_ix.c
Patching file /usr/src/sys/dev/pci/if_ix.c using Plan A...
Hunk #1 succeeded at 210.
Hunk #2 succeeded at 525 (offset -2 lines).
Hunk #3 succeeded at 857 (offset -2 lines).
Hunk #4 failed at 867.
Hunk #5 succeeded at 884 (offset -2 lines).
Hunk #6 succeeded at 907 (offset -2 lines).
Hunk #7 succeeded at 1049 (offset -2 lines).
Hunk #8 succeeded at 1115 (offset -2 lines).
Hunk #9 succeeded at 1132 (offset -2 lines).
Hunk #10 succeeded at 1307 (offset 1 line).
Hunk #11 succeeded at 2188 (offset -2 lines).
Hunk #12 succeeded at 2311 (offset 1 line).
Hunk #13 succeeded at 2335 (offset -2 lines).
Hunk #14 succeeded at 2350 (offset 1 line).
Hunk #15 succeeded at 2381 (offset -2 lines).
Hunk #16 failed at 2422.
Hunk #17 succeeded at 2592 (offset 1 line).
Hunk #18 succeeded at 2604 (offset -2 lines).
Hunk #19 succeeded at 2774 (offset 1 line).
Hunk #20 succeeded at 2826 (offset -2 lines).
Hunk #21 succeeded at 2841 (offset 1 line).
Hunk #22 succeeded at 2872 (offset -2 lines).
Hunk #23 failed at 2954.
3 out of 23 hunks failed--saving rejects to /usr/src/sys/dev/pci/if_ix.c.rej
# cat /usr/src/sys/dev/pci/if_ix.c.rej
@@ -872,11 +867,8 @@
if (ISSET(ifp->if_flags, IFF_RUNNING)) {
ixgbe_rxeof(que);
- refill = 1;
-
- if (ISSET(ifp->if_flags, IFF_OACTIVE))
- was_active = 1;
ixgbe_txeof(txr);
+ refill = 1;
}
if (refill) {
@@ -2435,31 +2422,24 @@
txr->next_to_clean = first;
+ num_avail = atomic_add_int_nv(&txr->tx_avail, processed);
+
+ /* All clean, turn off the timer */
+ if (num_avail == sc->num_tx_desc)
+ ifp->if_timer = 0;
+
/*
* If we have enough room, clear IFF_OACTIVE to tell the stack that
- * it is OK to send packets. If there are no pending descriptors,
- * clear the timeout. Otherwise, if some descriptors have been
freed,
- * restart the timeout.
+ * it is OK to send packets.
*/
- if (txr->tx_avail > IXGBE_TX_CLEANUP_THRESHOLD) {
- ifp->if_flags &= ~IFF_OACTIVE;
-
- /* If all are clean turn off the timer */
- if (txr->tx_avail == sc->num_tx_desc) {
- ifp->if_timer = 0;
- txr->watchdog_timer = 0;
- KERNEL_UNLOCK();
- return FALSE;
- }
- /* Some were cleaned, so reset timer */
- else if (processed) {
- ifp->if_timer = IXGBE_TX_TIMEOUT;
- txr->watchdog_timer = IXGBE_TX_TIMEOUT;
- }
+ if (ISSET(ifp->if_flags, IFF_OACTIVE) &&
+ num_avail > IXGBE_TX_OP_THRESHOLD) {
+ KERNEL_LOCK();
+ CLR(ifp->if_flags, IFF_OACTIVE);
+ ixgbe_start(ifp);
+ KERNEL_UNLOCK();
}
- KERNEL_UNLOCK();
-
return TRUE;
}
@@ -2982,10 +2954,6 @@
i = 0;
}
rxr->next_to_check = i;
- mtx_leave(&sc->rx_mtx);
-
- while ((mp = ml_dequeue(&free_ml)))
- m_freem(mp);
if_input(ifp, &ml);