NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Low capped TCP network speeds over the Internet



z411%omaera.org@localhost (z411) writes:

>That said, even though the packet loss got much better, with wm(4) it
>still enters retransmission loops fairly often before it is able to
>recover again. I recorded the worst case:


You may want to try this patch. It restricts each wm interface to a single
send queue. A real fix would restrict each flow to a single queue, so
that packets are not reordered. The patch also bumps the send queue
to 4k packets, maybe not ideal, but that needs further analysis.


Index: sys/dev/pci/if_wm.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/if_wm.c,v
retrieving revision 1.801
diff -p -u -r1.801 if_wm.c
--- sys/dev/pci/if_wm.c 10 Nov 2024 11:46:24 -0000      1.801
+++ sys/dev/pci/if_wm.c 6 Mar 2026 05:41:33 -0000
@@ -208,7 +208,7 @@ static int wm_watchdog_timeout = WM_WATC
  * m_defrag() is called to reduce it.
  */
 #define        WM_NTXSEGS              64
-#define        WM_IFQUEUELEN           256
+#define        WM_IFQUEUELEN           4096
 #define        WM_TXQUEUELEN_MAX       64
 #define        WM_TXQUEUELEN_MAX_82547 16
 #define        WM_TXQUEUELEN(txq)      ((txq)->txq_num)
@@ -224,7 +224,7 @@ static int wm_watchdog_timeout = WM_WATC
 
 #define        WM_MAXTXDMA              (2 * round_page(IP_MAXPACKET)) /* for TSO */
 
-#define        WM_TXINTERQSIZE         256
+#define        WM_TXINTERQSIZE         4096
 
 #ifndef WM_TX_PROCESS_LIMIT_DEFAULT
 #define        WM_TX_PROCESS_LIMIT_DEFAULT             100U
@@ -8842,6 +8842,7 @@ static inline int
 wm_select_txqueue(struct ifnet *ifp, struct mbuf *m)
 {
        struct wm_softc *sc = ifp->if_softc;
+#if 0
        u_int cpuid = cpu_index(curcpu());
 
        /*
@@ -8850,6 +8851,9 @@ wm_select_txqueue(struct ifnet *ifp, str
         * distribute by flowid(RSS has value).
         */
        return ((cpuid + ncpu - sc->sc_affinity_offset) % ncpu) % sc->sc_nqueues;
+#else
+       return (sc->sc_affinity_offset + if_get_index(ifp)) % sc->sc_nqueues;
+#endif
 }
 
 static inline bool



>> What I do not yet understand is what causes the packet loss.
>Most of it, or at least the low speeds, seemed to be caused by vioif(4).

It's not just vioif :)




Home | Main Index | Thread Index | Old Index