summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2024-08-12 06:47:12 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2024-08-12 06:47:12 +0000
commitc53119f1f03b13288f37692bd176b6273dfae713 (patch)
tree229ad25a57d6e5365c403b4dbc559b0b95ad291f /sys
parent2cf697b5925f6e50d70bc0cb4d044dfb2c0ff085 (diff)
try harder to leave a gap on the tx ring.
i think before this change we could overwrite entries on the ring, which can confuse the chip and the tx completion code. i think. it's funny how much a comparison hurts my brain. ok patrick@ tested by and ok kevlo@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/re.c4
-rw-r--r--sys/dev/pci/if_rge.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index 29074188922..a8967f686df 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.217 2024/01/19 03:46:14 dlg Exp $ */
+/* $OpenBSD: re.c,v 1.218 2024/08/12 06:47:11 dlg Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1834,7 +1834,7 @@ re_start(struct ifqueue *ifq)
free -= idx;
for (;;) {
- if (sc->rl_ldata.rl_tx_ndescs >= free + 2) {
+ if (free < sc->rl_ldata.rl_tx_ndescs + 2) {
ifq_set_oactive(ifq);
break;
}
diff --git a/sys/dev/pci/if_rge.c b/sys/dev/pci/if_rge.c
index b6ba51494d5..4309f2cdf46 100644
--- a/sys/dev/pci/if_rge.c
+++ b/sys/dev/pci/if_rge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_rge.c,v 1.28 2024/08/10 21:53:06 patrick Exp $ */
+/* $OpenBSD: if_rge.c,v 1.29 2024/08/12 06:47:11 dlg Exp $ */
/*
* Copyright (c) 2019, 2020, 2023, 2024
@@ -581,7 +581,7 @@ rge_start(struct ifqueue *ifq)
free -= idx;
for (;;) {
- if (RGE_TX_NSEGS >= free + 2) {
+ if (free < RGE_TX_NSEGS + 2) {
ifq_set_oactive(&ifp->if_snd);
break;
}