From 1dfd2c79ec99679fa8c03164449c26081d95e6ec Mon Sep 17 00:00:00 2001 From: mbuhl Date: Fri, 11 Nov 2022 16:41:44 +0000 Subject: [PATCH] Due to checksum offloading one more element could be written to the ring than there is space available. ok dlg --- sys/dev/pci/if_igc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/pci/if_igc.c b/sys/dev/pci/if_igc.c index 734bc8b0275..a904d43c66b 100644 --- a/sys/dev/pci/if_igc.c +++ b/sys/dev/pci/if_igc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_igc.c,v 1.9 2022/06/02 07:41:17 mbuhl Exp $ */ +/* $OpenBSD: if_igc.c,v 1.10 2022/11/11 16:41:44 mbuhl Exp $ */ /*- * SPDX-License-Identifier: BSD-2-Clause * @@ -978,7 +978,7 @@ igc_start(struct ifqueue *ifq) mask = sc->num_tx_desc - 1; for (;;) { - if (free <= IGC_MAX_SCATTER) { + if (free <= IGC_MAX_SCATTER + 1) { ifq_set_oactive(ifq); break; } @@ -1005,6 +1005,7 @@ igc_start(struct ifqueue *ifq) /* Consume the first descriptor */ prod++; prod &= mask; + free--; } for (i = 0; i < map->dm_nsegs; i++) { -- 2.20.1