From owner-freebsd-arm@freebsd.org Sat May 30 02:22:22 2020 Return-Path: Delivered-To: freebsd-arm@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0300F2F6A7C for ; Sat, 30 May 2020 02:22:22 +0000 (UTC) (envelope-from thomas-bsd@skibo.net) Received: from bonobo.elm.relay.mailchannels.net (bonobo.elm.relay.mailchannels.net [23.83.212.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 49YlZN2SL8z3ctZ for ; Sat, 30 May 2020 02:22:19 +0000 (UTC) (envelope-from thomas-bsd@skibo.net) X-Sender-Id: dreamhost|x-authsender|thomas-bsd@skibo.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 9CCCF400795 for ; Sat, 30 May 2020 02:22:17 +0000 (UTC) Received: from pdx1-sub0-mail-a47.g.dreamhost.com (100-96-23-33.trex.outbound.svc.cluster.local [100.96.23.33]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E6DA2400EED for ; Sat, 30 May 2020 02:22:16 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|thomas-bsd@skibo.net Received: from pdx1-sub0-mail-a47.g.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.8); Sat, 30 May 2020 02:22:17 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|thomas-bsd@skibo.net X-MailChannels-Auth-Id: dreamhost X-Decisive-Inform: 5161a35d223c11e5_1590805337357_3140088564 X-MC-Loop-Signature: 1590805337357:2562348958 X-MC-Ingress-Time: 1590805337357 Received: from pdx1-sub0-mail-a47.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a47.g.dreamhost.com (Postfix) with ESMTP id A8EC79B26D for ; Fri, 29 May 2020 19:22:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=skibo.net; h=mime-version :date:from:to:subject:in-reply-to:references:message-id :content-type:content-transfer-encoding; s=skibo.net; bh=jEjCRDX LNl7BOqfXeBCRwZXKaVI=; b=Xwsf9lB6SyWkIzQuO3OZwTfvv70ZdIiL6eFfTFT i+zlH7iGnRi4+oa82wG2vCXhGZQsQcos4JOjLw+1+ml6E49L875sGH2FsXVJkerx DrUTCvF5/aLO8P0P2gK6f59e4lhlAgc7ALrdV/4mi2QbAMyLVcFpSf/l4MVkcJi0 L76A= Received: from webmail.dreamhost.com (ip-66-33-200-4.dreamhost.com [66.33.200.4]) (Authenticated sender: thomas-bsd@skibo.net) by pdx1-sub0-mail-a47.g.dreamhost.com (Postfix) with ESMTPA id 7BE1C9B268 for ; Fri, 29 May 2020 19:22:16 -0700 (PDT) MIME-Version: 1.0 Date: Fri, 29 May 2020 19:22:16 -0700 X-DH-BACKEND: pdx1-sub0-mail-a47 From: thomas-bsd@skibo.net To: freebsd-arm@freebsd.org Subject: Re: bus_dmamap_load_mbuf_sg failures In-Reply-To: <20200524214128.GA3881@piedmont> References: <20200524214128.GA3881@piedmont> User-Agent: DreamHost Webmail/1.4.1 Message-ID: X-Sender: thomas-bsd@skibo.net Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduhedruddvledgheehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpffftgfetoffjqffuvfenuceurghilhhouhhtmecufedttdenucenucfjughrpeggfffhvffujghffgfkgigtgfesthejjhdttdervdenucfhrhhomhepthhhohhmrghsqdgsshgusehskhhisghordhnvghtnecuggftrfgrthhtvghrnhepudegheetveeifedvgeelkeehudejteffffekgfdvvdekffffueevgeevteekuefhnecuffhomhgrihhnpehfrhgvvggsshgurdhorhhgnecukfhppeeiiedrfeefrddvtddtrdegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhppdhhvghlohepfigvsghmrghilhdrughrvggrmhhhohhsthdrtghomhdpihhnvghtpeeiiedrfeefrddvtddtrdegpdhrvghtuhhrnhdqphgrthhhpehthhhomhgrshdqsghsugesshhkihgsohdrnhgvthdpmhgrihhlfhhrohhmpehthhhomhgrshdqsghsugesshhkihgsohdrnhgvthdpnhhrtghpthhtohepfhhrvggvsghsugdqrghrmhesfhhrvggvsghsugdrohhrgh X-Rspamd-Queue-Id: 49YlZN2SL8z3ctZ X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=skibo.net header.s=skibo.net header.b=Xwsf9lB6; dmarc=none; spf=pass (mx1.freebsd.org: domain of thomas-bsd@skibo.net designates 23.83.212.22 as permitted sender) smtp.mailfrom=thomas-bsd@skibo.net X-Spamd-Result: default: False [-2.52 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_FIVE(0.00)[6]; R_DKIM_ALLOW(-0.20)[skibo.net:s=skibo.net]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:23.83.208.1/20]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-arm@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-0.99)[-0.990]; DMARC_NA(0.00)[skibo.net]; DKIM_TRACE(0.00)[skibo.net:+]; NEURAL_HAM_SHORT(-0.06)[-0.056]; FROM_NO_DN(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[23.83.212.22:from]; NEURAL_HAM_MEDIUM(-0.98)[-0.976]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:36483, ipnet:23.83.208.0/21, country:CA]; MID_RHS_MATCH_FROM(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[23.83.212.22:from] X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 May 2020 02:22:22 -0000 On 2020-05-24 14:41, Thomas Skibo wrote: > Hello. > > I just tracked down a bug in a network driver on an arm64 system I am > tinkering with. It seems when bus_dmamap_load_mbuf_sg() fails with > EFBIG > due to too many segments, things are not cleaned up and it causes the > subsequent attempt at bus_dmamap_load_mbuf_sg() with the defragged mbuf > to > fail too (EFBIG again). > > I noticed that in the arm version of busdma_machdep.c, when > _bus_dmamap_load_buffer() fails with EFBIG, it calls > bus_dmamap_unload() on > exit which cleans up the dma map. In the arm64 version of > busdma_bounce.c, > when bounce_bus_dmamap_load_buffer() fails, it does not. Is this a bug > or > are we expected to call bus_dmamap_unload() on a failed > bus_dmamap_load* call? > > I looked around at other architectures and it is inconsistent: arm and > mips > do the unload but x86, arm64, and riscv do not. > > --Thomas > > ===== > Thomas Skibo > thomas-bsd@skibo.net I have filed a bug for this. It seems only arm64 and riscv have this issue. https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246852