Module Name: src
Committed By: msaitoh
Date: Wed Jul 7 08:32:51 UTC 2021
Modified Files:
src/sys/dev/pci/ixgbe: ix_txrx.c
Log Message:
Set rxr->next_to_refresh correctly in ixgbe_setup_receive_ring().
ixgbe_setup_receive_ring() fully allocates rx buffers. When a
descriptor ring is full, rxr->next_to_refresh should point to
rxr_next_to_check -1. Before this change, rxr->next_to_refresh
is set to 0 and ixgbe_refresh_mbufs() wastefully loops in
ixgbe_refresh_mbufs() because it means the ring is empty.
To generate a diff of this commit:
cvs rdiff -u -r1.79 -r1.80 src/sys/dev/pci/ixgbe/ix_txrx.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/ixgbe/ix_txrx.c
diff -u src/sys/dev/pci/ixgbe/ix_txrx.c:1.79 src/sys/dev/pci/ixgbe/ix_txrx.c:1.80
--- src/sys/dev/pci/ixgbe/ix_txrx.c:1.79 Thu May 27 06:11:34 2021
+++ src/sys/dev/pci/ixgbe/ix_txrx.c Wed Jul 7 08:32:51 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ix_txrx.c,v 1.79 2021/05/27 06:11:34 msaitoh Exp $ */
+/* $NetBSD: ix_txrx.c,v 1.80 2021/07/07 08:32:51 msaitoh Exp $ */
/******************************************************************************
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.79 2021/05/27 06:11:34 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ix_txrx.c,v 1.80 2021/07/07 08:32:51 msaitoh Exp $");
#include "opt_inet.h"
#include "opt_inet6.h"
@@ -1577,7 +1577,7 @@ ixgbe_setup_receive_ring(struct rx_ring
/* Setup our descriptor indices */
rxr->next_to_check = 0;
- rxr->next_to_refresh = 0;
+ rxr->next_to_refresh = adapter->num_rx_desc - 1; /* Fully allocated */
rxr->lro_enabled = FALSE;
rxr->rx_copies.ev_count = 0;
#if 0 /* NetBSD */