Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jun 2021 14:48:32 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-arm@FreeBSD.org
Subject:   [Bug 256482] [genet] gen_encap() dma loads into active map when 'tx_queue' is full
Message-ID:  <bug-256482-7@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D256482

            Bug ID: 256482
           Summary: [genet] gen_encap() dma loads into active map when
                    'tx_queue' is full
           Product: Base System
           Version: CURRENT
          Hardware: arm64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: arm
          Assignee: freebsd-arm@FreeBSD.org
          Reporter: ghuckriede@blackberry.com

Created attachment 225638
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D225638&action=
=3Dedit
Potential Fix

In gen_encap() #n1053 it always calls bus_dmamap_load_mbuf_sg() into 'map'
(which is the current tx_queue).  If the tx_queue is full, it will load wit=
h a
'map' that already has a currently active mapping.

https://www.freebsd.org/cgi/man.cgi?query=3Dbusdma&sektion=3D9
bus_dmamap_load: "map     A DMA map without a currently active mapping."

Also "(if nsegs =3D=3D 0)" #n1077 shouldn't bus_dmamap_unload() be called as
bus_dmamap_load_mbuf_sq() was successful?

See
https://cgit.freebsd.org/src/tree/sys/arm64/broadcom/genet/if_genet.c?id=3D=
f66a1f40740c63741b6ebe48cb0cbce9e52ef34e
for line number references.

Attached is diff with a potential fix.

Checking for a full queue and returning ENOMEM will allow gen_start_locked(=
) to
set the IFF_DRV_OACTIVE faster without having to needlessly check if the mb=
uf
will fit (it won't).

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-256482-7>