git: 539437c8281d - main - netmap: Fix a queue length check in the generic port rx path
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 23 Jan 2023 19:52:46 UTC
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=539437c8281d24450bacded3734276acd9983e90 commit 539437c8281d24450bacded3734276acd9983e90 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2023-01-23 19:41:55 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2023-01-23 19:41:55 +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 --- 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 a57da84e1d24..f075cd4bd306 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);