Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp414821ybv; Thu, 20 Feb 2020 00:33:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyFaZsuqL6naKpHl432EkJ8mDpAwu7BcLyoaJDepKEkUVyG6MXJOphr03/kfSzaE3agb3pH X-Received: by 2002:a9d:4d99:: with SMTP id u25mr9288301otk.216.1582187599253; Thu, 20 Feb 2020 00:33:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582187599; cv=none; d=google.com; s=arc-20160816; b=wDLONeKOc2bI/Ko7lCv8FbPsDuIIvccE/cCuE825T5BS/KB1A9N3gWWn5vwYllYhYF tv//ncM+e1H8nbKAEGN9ZDpHhSd+pYZ5Wg97zjzQDoAnh618rIK/OiSCH5QHGTKF/fzY EkFYdxOICB7aInn8oIJoQWm/s1pMvcuPUwiLhqHDRNpMIJ65MbzDwr9ebKb40hAlyg1u de5/G0ToIxj79Q7KR3LumSiNSGyBOOyp0A6ngBnV0HXxSfVcG3poETy9MCRK4ic9Igy6 oT0TwHJ7za2V3d2vqgXs+9il/qaZbb5lZh6EMEdW4fx8O6983bnJzKH8udb92wC8rO1O XmuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:dkim-signature; bh=7+zMtiRPD9PylegTc1JKnQNYaBlvdg/mSjzow4ll1cQ=; b=EBhJ0yTb73Tl0N26iJo9QfQkvm9Eeufub3lJ4ujhpE1LG06giyecDIptpy6lJ0R29t l0ofsH6UMJ1IjGZwlW6uao86zA7A9HwhnPs1gg66OLFuEYFH6nSxlQMnm6oaaAnCBzvN 3QqyRzFhEFJbJyLydv2N2RQFK228TMAStH+9aag24HBiSUuQrFV+Hul0FVfv62/aIUv0 x60BD399tiO4N9wb4jhhQRh0t+XM8DRNt2MRGF4rpmSjQLfFEkqHVZQdYaDTTLgDw5lP Z3nlj8Ns+M9K3iUcK9iPQNdjPXaFgeXWACh+yIwZkAxVIIR7WcTHzpUubbVDtEnDHNSV vJLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=DfB4M8Vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w18si1429830otl.54.2020.02.20.00.33.06; Thu, 20 Feb 2020 00:33:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@geanix.com header.s=first header.b=DfB4M8Vq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=geanix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbgBTIdC (ORCPT + 99 others); Thu, 20 Feb 2020 03:33:02 -0500 Received: from first.geanix.com ([116.203.34.67]:43076 "EHLO first.geanix.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726501AbgBTIdC (ORCPT ); Thu, 20 Feb 2020 03:33:02 -0500 Received: from localhost (unknown [193.163.1.7]) by first.geanix.com (Postfix) with ESMTPSA id 6FDECABE2F; Thu, 20 Feb 2020 08:32:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=geanix.com; s=first; t=1582187579; bh=7fJH91fFHjiUXtmwG2jBMWpcDq/boOo9eUL36++h+i8=; h=From:To:Cc:Subject:References:Date:In-Reply-To; b=DfB4M8VqU8kTqcfghs5TeBFdORfpRU2MDPkS4nqrSVC+bK9H/MDeqQCulS33Xia+7 MOWvLr3lrd1qYlx9j0HYK23jj3Amgql5uoTKeXJmtgFPScxp8ESrVrPWG2dCo6BPmF 5r9SYM2A2lp58eeDqi9klcaLempfjO2NA34g6wcn6KZxPCZ9Llis8ycRNmfFxNctPj VMKf8Nmm5ZaKCcBGOel6f+ZoIUXrEFpS+NwJl4XOFh1jHtnF7X8lPzZssLPPVUVeAG CRJdqmHokbuMIaT8EBYFQ+Ov+jAHFg9SuOQPWzoFR/JN25DmNE0o1lzlEP0gAfEQFK 7Ty11hZcZZxiA== From: Esben Haabendal To: David Miller Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, andrew@lunn.ch, michal.simek@xilinx.com, ynezz@true.cz Subject: Re: [PATCH net 2/4] net: ll_temac: Add more error handling of dma_map_single() calls References: <65907810dd82de3fcaad9869f328ab32800c67ea.1582108989.git.esben@geanix.com> <20200219.105954.1568022053134111448.davem@davemloft.net> Date: Thu, 20 Feb 2020 09:32:58 +0100 In-Reply-To: <20200219.105954.1568022053134111448.davem@davemloft.net> (David Miller's message of "Wed, 19 Feb 2020 10:59:54 -0800 (PST)") Message-ID: <87v9o18xqd.fsf@geanix.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-2.1 required=4.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on 05ff821c8cf1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Miller writes: > From: Esben Haabendal > Date: Wed, 19 Feb 2020 11:54:00 +0100 > >> @@ -863,12 +865,13 @@ temac_start_xmit(struct sk_buff *skb, struct net_device *ndev) >> skb_dma_addr = dma_map_single(ndev->dev.parent, skb->data, >> skb_headlen(skb), DMA_TO_DEVICE); >> cur_p->len = cpu_to_be32(skb_headlen(skb)); >> + if (WARN_ON_ONCE(dma_mapping_error(ndev->dev.parent, skb_dma_addr))) >> + return NETDEV_TX_BUSY; > > The appropriate behavior in this situation is to drop the packet and return > NETDEV_TX_OK. Ok, and I guess the same goes for the error handling of dma_map_single() of one of the fragments later in same function. /Esben