From nobody Mon Jan 23 19:52:46 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P113f47dXz3bFlZ; Mon, 23 Jan 2023 19:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P113f3J5bz4Hfc; Mon, 23 Jan 2023 19:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674503566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nhcRukKbaIm1RRFm2lBQxQxqBb9xZcIYWQIwSBiJI3Y=; b=mar+ZzFKXPmWqSuY3tm3mCTSTMjBQYwjIEaHa6xoR5S2RFvnuUgDAYAdlofZpUFOfFhZzJ +j34JFEGyYMHK8DnBPP40DWn9cuMogr4O2fL0lzrkcyTIU1EEMh2GlRnh9qgquPIF+Cvvn LwprrrOvrXXJha3COOt7WXew4DrCCNZTQwz6T+dGWbVSDN5JFg9q7Qd7RrKhgevSOtls8k tBFK+mvi9Yv/5lAfdhzZuxQlLn6neMlx4xkR+jWmktG8amfE/t+Gn+HOI2gOQR7oDHZGG2 Si0z4RrDXCZw19Y7F4l37JW201JNhNhIS6TLhlKXglFyX4b1hq7f/pnTCwRFvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674503566; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=nhcRukKbaIm1RRFm2lBQxQxqBb9xZcIYWQIwSBiJI3Y=; b=dhxsHeT1rKaF8iQ0y3TKyuk/ZTayIrV19FD3IGFUB8nQ1wLGU15xuO3ANhcN0POXBLKOj5 5P06bviJLfEfwfRKHU9ZELak8N8WjHIguKU3+j3s7oSzif5X7dqewWt5/VH1XiYrlHFaIt pxH7VJ4G0hS/UPUZI8IDoL2Fl9Zcs2WA+3A9+4Q4Myeezv2zqx3zT/RloUFlIoSs57PL+i TORZpm6hV3t45ZP9sdSawtr/rq/ydkxRUcNm+LI8PkE+1J235IVFb8iFgPMlXikeAbXJlG KGXZg9U5lbloynYPahwk0/CDxoDvZxfaoExgWm5vDxg8JIhlqOQ+6HcsusmmMg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674503566; a=rsa-sha256; cv=none; b=KiP/ArCRMghN53P6yKUVXp43vdvtRGKKqrsox5RybsrdcqupwNb4m0VPyJE3GL3CFVtVdS IO9zmIk6V7jBe4X7MGFj8kkDRFSiAxw5YhQXfq15t1jHGPG5dEnYVo5Wwyu+jradDklp06 tzZmgYNHof4f3qiKWQwasjhiqq++diHUxz152QvZplJihFKu+ksPM2OI/kRf674S9O2MM0 6eCp2pm3Ah2zqkNt+JOp1Iqonkp/X6bSwoS+XEcFA4Me9y7a7f4WeXScN1i9bII38hNJVB FeTFNgVGPD9juBm86YS3rhtlFjttvarNXu0cj5PkPetOHMYKui+7VfbyNPnQng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P113f2NnQzhQg; Mon, 23 Jan 2023 19:52:46 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30NJqkbi015509; Mon, 23 Jan 2023 19:52:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30NJqkpl015508; Mon, 23 Jan 2023 19:52:46 GMT (envelope-from git) Date: Mon, 23 Jan 2023 19:52:46 GMT Message-Id: <202301231952.30NJqkpl015508@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 539437c8281d - main - netmap: Fix a queue length check in the generic port rx path List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 539437c8281d24450bacded3734276acd9983e90 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=539437c8281d24450bacded3734276acd9983e90 commit 539437c8281d24450bacded3734276acd9983e90 Author: Mark Johnston AuthorDate: 2023-01-23 19:41:55 +0000 Commit: Mark Johnston 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);