🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: muc.lists.freebsd.bugs
Article #4

[Bug 299203] re driver's netmap deregistration should unload the dma mappings

#4
From: bugzilla-noreply
Date: Wed, 07 Oct 2026 13:06
67 lines
4076 bytes
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=299203

            Bug ID: 299203
           Summary: re driver's netmap deregistration should unload the
                    dma mappings
           Product: Base System
           Version: 14.5-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: mibelanger@qnx.com

Running pkt_gen twice with an invariants build should show the issue.
e.g.
pkt-gen -i re0 -f tx -n 1 -X 

The following addition to the deregistration in if_re_netmap.h should resolve
the issue:

/*
 * Register/unregister. We are already under netmap lock.
 */
static int
re_netmap_reg(struct netmap_adapter *na, int onoff)
{
        if_t ifp = na->ifp;
        struct rl_softc *adapter = if_getsoftc(ifp);

        RL_LOCK(adapter);
        re_stop(adapter); /* also clears IFF_DRV_RUNNING */
        if (onoff) {
                nm_set_native_flags(na);
        } else {
                nm_clear_native_flags(na);
#if PROPOSED_FIX
                /* Clean up Tx ring mappings */
                for (int i = 0; i < adapter->rl_ldata.rl_tx_desc_cnt; i++ ) {
                        netmap_unload_map(na, adapter->rl_ldata.rl_tx_mtag,
                            adapter->rl_ldata.rl_tx_desc[i].tx_dmamap);
                }
                /* Clean up Rx ring mappings */
                for (int i = 0; i < adapter->rl_ldata.rl_rx_desc_cnt; i++ ) {
                        netmap_unload_map(na, adapter->rl_ldata.rl_rx_mtag,
                            adapter->rl_ldata.rl_rx_desc[i].rx_dmamap);
                }
#endif
        }
        re_init_locked(adapter);        /* also enables intr */
        RL_UNLOCK(adapter);
        return (if_getdrvflags(ifp) & IFF_DRV_RUNNING ? 0 : 1);
}

-- 
You are receiving this mail because:
You are the assignee for the bug.

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-admin@muc.de
Technical Details
Message-ID: <bug-299203-227@https.bugs.freebsd.org/bugzilla/>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!2.eu.feeder.erje.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!news.space.net!news.muc.de!.POSTED.news.muc.de!not-for-mail
From: bugzilla-noreply@freebsd.org
Newsgroups: muc.lists.freebsd.bugs
Subject: [Bug 299203] re driver's netmap deregistration should unload the dma
 mappings
Date: Wed, 07 Oct 2026 13:06:54 +0000
Organization: Newsgate at muc.de e.V.
Sender: owner-freebsd-bugs@FreeBSD.org
Approved: news-admin@muc.de
Distribution: world
Message-ID: <bug-299203-227@https.bugs.freebsd.org/bugzilla/>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: news.muc.de; posting-host="news.muc.de:193.149.48.2";
	logging-data="80359"; mail-complaints-to="news-admin@muc.de"
X-Original-To: bugs@mlmmj.nyi.freebsd.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim;
	t=1791378414;
	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=b7R+ni+qvlY83qyhIgZovWPyNByvJV94Uv6NS4UDMJc=;
	b=Y9mHg/D1G3ouKACAVkL/JmIpq2qQ8Zqp+ljyxTEySCNUY1F2XX3dplO9V3fMiuxq+smwLN
	sXGYyPtDSVb9C9cEo8x+Hi9FBmwDc0Ggz+IGy7yO5Qr/VY07M0xRS6Cj+RxTnDRPWFSbVO
	etHl95eqfb2zMi6ZgwpiYDqV4MAOyHNnHmXGZTQ1DmjXv7117mwCuUOXSzAjz8A6RLFPOj
	arAxkQltDvXmccLCtyBR56L3OONo5ZtrDTunUYEkVxBoU9RaAGQBhwO/ZRdrL212FdmuYG
	R8SDr3kgGDSTwBw3cJMu8jJFomRw2W07vTfPMmgHhjwUc0v7X4DxP9/XlGMIIw==
X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f
Auto-Submitted: auto-generated
Precedence: list
X-Newsgate-Id: f02c70b8849f+
X-No-Archive: Yes