Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/usb Enable multiple outstanding transfers.
details: https://anonhg.NetBSD.org/src/rev/296df4b1203b
branches: trunk
changeset: 447245:296df4b1203b
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sat Jan 05 07:56:07 2019 +0000
description:
Enable multiple outstanding transfers.
iperf3 now shows 250MBit/s for sending and 225MBit/s for receiving.
diffstat:
sys/dev/usb/if_mue.c | 46 ++++++++++++++++++++++++++++++----------------
sys/dev/usb/if_muevar.h | 6 +++---
2 files changed, 33 insertions(+), 19 deletions(-)
diffs (126 lines):
diff -r 59441552a0d2 -r 296df4b1203b sys/dev/usb/if_mue.c
--- a/sys/dev/usb/if_mue.c Sat Jan 05 06:59:46 2019 +0000
+++ b/sys/dev/usb/if_mue.c Sat Jan 05 07:56:07 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_mue.c,v 1.26 2018/12/28 22:55:20 rin Exp $ */
+/* $NetBSD: if_mue.c,v 1.27 2019/01/05 07:56:07 mlelstv Exp $ */
/* $OpenBSD: if_mue.c,v 1.3 2018/08/04 16:42:46 jsg Exp $ */
/*
@@ -20,7 +20,7 @@
/* Driver for Microchip LAN7500/LAN7800 chipsets. */
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.26 2018/12/28 22:55:20 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_mue.c,v 1.27 2019/01/05 07:56:07 mlelstv Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -1155,6 +1155,9 @@
}
}
+ cd->mue_tx_prod = 0;
+ cd->mue_tx_cnt = 0;
+
return 0;
}
@@ -1258,8 +1261,6 @@
return EIO;
}
- sc->mue_cdata.mue_tx_cnt++;
-
return 0;
}
@@ -1566,6 +1567,7 @@
{
struct mue_chain *c = priv;
struct mue_softc *sc = c->mue_sc;
+ struct mue_cdata *cd = &sc->mue_cdata;
struct ifnet *ifp = GET_IFP(sc);
int s;
@@ -1573,7 +1575,8 @@
return;
s = splnet();
-
+ KASSERT(cd->mue_tx_cnt > 0);
+ cd->mue_tx_cnt--;
if (__predict_false(status != USBD_NORMAL_COMPLETION)) {
if (status == USBD_NOT_STARTED || status == USBD_CANCELLED) {
splx(s);
@@ -1757,6 +1760,8 @@
{
struct mue_softc *sc = ifp->if_softc;
struct mbuf *m;
+ struct mue_cdata *cd = &sc->mue_cdata;
+ int idx;
if (__predict_false(!sc->mue_link)) {
DPRINTF(sc, "no link\n");
@@ -1769,20 +1774,29 @@
return;
}
- IFQ_POLL(&ifp->if_snd, m);
- if (m == NULL)
- return;
+ idx = cd->mue_tx_prod;
+ while (cd->mue_tx_cnt < MUE_TX_LIST_CNT) {
+ IFQ_POLL(&ifp->if_snd, m);
+ if (m == NULL)
+ break;
+
+ if (__predict_false(mue_encap(sc, m, idx))) {
+ ifp->if_oerrors++;
+ break;
+ }
+ IFQ_DEQUEUE(&ifp->if_snd, m);
- if (__predict_false(mue_encap(sc, m, 0))) {
- ifp->if_oerrors++;
- return;
+ bpf_mtap(ifp, m, BPF_D_OUT);
+ m_freem(m);
+
+ idx = (idx + 1) % MUE_TX_LIST_CNT;
+ cd->mue_tx_cnt++;
+
}
- IFQ_DEQUEUE(&ifp->if_snd, m);
+ cd->mue_tx_prod = idx;
- bpf_mtap(ifp, m, BPF_D_OUT);
- m_freem(m);
-
- ifp->if_flags |= IFF_OACTIVE;
+ if (cd->mue_tx_cnt >= MUE_TX_LIST_CNT)
+ ifp->if_flags |= IFF_OACTIVE;
/* Set a timeout in case the chip goes out to lunch. */
ifp->if_timer = 5;
diff -r 59441552a0d2 -r 296df4b1203b sys/dev/usb/if_muevar.h
--- a/sys/dev/usb/if_muevar.h Sat Jan 05 06:59:46 2019 +0000
+++ b/sys/dev/usb/if_muevar.h Sat Jan 05 07:56:07 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_muevar.h,v 1.3 2018/12/11 08:16:57 rin Exp $ */
+/* $NetBSD: if_muevar.h,v 1.4 2019/01/05 07:56:07 mlelstv Exp $ */
/* $OpenBSD: if_muereg.h,v 1.1 2018/08/03 01:50:15 kevlo Exp $ */
/*
@@ -31,9 +31,9 @@
};
struct mue_cdata {
-#define MUE_TX_LIST_CNT 1
+#define MUE_TX_LIST_CNT 4
struct mue_chain mue_tx_chain[MUE_TX_LIST_CNT];
-#define MUE_RX_LIST_CNT 1
+#define MUE_RX_LIST_CNT 4
struct mue_chain mue_rx_chain[MUE_RX_LIST_CNT];
int mue_tx_prod;
int mue_tx_cons;
Home |
Main Index |
Thread Index |
Old Index