git: 1a57779234d4 - stable/13 - netmap: Fix a queue length check in the generic port rx path
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 01 Feb 2023 17:31:58 UTC
The branch stable/13 has been updated by markj:
URL: https://cgit.FreeBSD.org/src/commit/?id=1a57779234d4590fc16cba26305105f5c6fdd42b
commit 1a57779234d4590fc16cba26305105f5c6fdd42b
Author: Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2023-01-23 19:41:55 +0000
Commit: Mark Johnston <markj@FreeBSD.org>
CommitDate: 2023-02-01 17:22:31 +0000
netmap: Fix a queue length check in the generic port rx path
The check is ok by default, since the default value of
netmap_generic_ringsize is 1024. But we should check against the
configured "ring" size.
Reviewed by: vmaffione
MFC after: 1 week
Sponsored by: Zenarmor
Sponsored by: OPNsense
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D38062
(cherry picked from commit 539437c8281d24450bacded3734276acd9983e90)
---
sys/dev/netmap/netmap_generic.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sys/dev/netmap/netmap_generic.c b/sys/dev/netmap/netmap_generic.c
index f3125860b869..f726cf471177 100644
--- a/sys/dev/netmap/netmap_generic.c
+++ b/sys/dev/netmap/netmap_generic.c
@@ -838,7 +838,7 @@ generic_rx_handler(struct ifnet *ifp, struct mbuf *m)
nm_prlim(2, "Warning: driver pushed up big packet "
"(size=%d)", (int)MBUF_LEN(m));
m_freem(m);
- } else if (unlikely(mbq_len(&kring->rx_queue) > 1024)) {
+ } else if (unlikely(mbq_len(&kring->rx_queue) > na->num_rx_desc)) {
m_freem(m);
} else {
mbq_safe_enqueue(&kring->rx_queue, m);