From patchwork Thu Jan 28 21:25:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Troy Kisky X-Patchwork-Id: 8154621 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1E86A9F9E8 for ; Thu, 28 Jan 2016 21:59:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4786A2021B for ; Thu, 28 Jan 2016 21:59:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8408620218 for ; Thu, 28 Jan 2016 21:59:06 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOuZL-0002dI-1W; Thu, 28 Jan 2016 21:57:35 +0000 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aOu7p-00060C-Cb for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2016 21:29:10 +0000 Received: by mail-pa0-x232.google.com with SMTP id uo6so29722421pac.1 for ; Thu, 28 Jan 2016 13:28:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tcsBuFZ8taDhz2Y9hZBxDzgN9ah3wZjFLMJZjiX7fmY=; b=AC2Cw6AMNRtkkcq9LSfV0+YmRtjFF6cgvCTnXLd6YaD2jK4Y2P2ORsGr3daAc2kBS4 6KOMwOsMJjAOdU/jpPleYtxZ8luUcwZcLnTbz8O8zMJ8yXqjdGordREjMzRRjhS/pDLz pz1J396jL+l788kXJt/lVvRytLCNFyG5PrSQnvSjSmQkOGw9+mkSxnbVw2hew6eYuYjY c9R+bKilR3NlUB4aDOb5BSV+QrvLOvsPEmxV7WX3GQpYm1YY7VFE7S36vj7O0I4UPxl8 ZDEwhueClQFAQUp7oon6bSdd3a1pkgzWceKSA3usaA4CQQMGU65enpz9wkoQWUUAiB1w yGrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tcsBuFZ8taDhz2Y9hZBxDzgN9ah3wZjFLMJZjiX7fmY=; b=hlOOcxP8mY5BKdrCPk+qd20LFwAreKbRmA7WO3ybT4TEExCo/WcSUcq0aiCg1PLimg DYqKkTYirBOGEyOp7BPk1hyuy2dc6Fr0ri+CXC9Net/El2lyBVe+iYapPvt+uXnWbNcP ir9aZGzeToEM7KqOeKExK0QNICpoNq4qJvgWIGAI/E9MxiGGszImpYVcg37Z2b/AE6e+ xMxFfCR6X3GnNZnxBFa+iMU0J+iL4gaA4qQ7nRj1peoC1Wq/9t+DnImpI1+EwfRFt+Fs BYZdP3K9s8OQOxHEDwk8RMzEuR/gN58pfSNZNn6VFaNyCkYNWWeZ4pSjUCopfnDJtLXP pKNw== X-Gm-Message-State: AG10YOQaKuIT88N39mGxYiUncL1jpN+yFBTFZgyrD63aPNddulzAlN+L+Y8zEE0xdoJ9vQ== X-Received: by 10.66.235.162 with SMTP id un2mr7888593pac.17.1454016528911; Thu, 28 Jan 2016 13:28:48 -0800 (PST) Received: from localhost.localdomain (wsip-70-184-93-199.ph.ph.cox.net. [70.184.93.199]) by smtp.googlemail.com with ESMTPSA id c90sm18583190pfd.31.2016.01.28.13.28.47 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 28 Jan 2016 13:28:48 -0800 (PST) From: Troy Kisky To: netdev@vger.kernel.org, davem@davemloft.net, B38611@freescale.com Subject: [PATCH net-next 24/40] net: fec: return NETDEV_TX_BUSY, when not enough space in ring Date: Thu, 28 Jan 2016 14:25:48 -0700 Message-Id: <1454016364-30985-25-git-send-email-troy.kisky@boundarydevices.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> References: <1454016364-30985-1-git-send-email-troy.kisky@boundarydevices.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160128_132909_507447_2C6C8CEA X-CRM114-Status: GOOD ( 10.28 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fabio.estevam@freescale.com, andrew@lunn.ch, linux@arm.linux.org.uk, Troy Kisky , laci@boundarydevices.com, l.stach@pengutronix.de, shawnguo@kernel.org, linux-arm-kernel@lists.infradead.org, tremyfr@gmail.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Troy Kisky --- drivers/net/ethernet/freescale/fec_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index 29c5781..98b9be2 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -424,10 +424,9 @@ static int fec_enet_txq_submit_skb(struct fec_enet_priv_tx_q *txq, entries_free = fec_enet_get_free_txdesc_num(txq); if (entries_free < MAX_SKB_FRAGS + 1) { - dev_kfree_skb_any(skb); if (net_ratelimit()) netdev_err(ndev, "NOT enough BD for SG!\n"); - return NETDEV_TX_OK; + return NETDEV_TX_BUSY; } /* Protocol checksum off-load for TCP and UDP. */ @@ -653,10 +652,9 @@ static int fec_enet_txq_submit_tso(struct fec_enet_priv_tx_q *txq, int ret; if (tso_count_descs(skb) >= fec_enet_get_free_txdesc_num(txq)) { - dev_kfree_skb_any(skb); if (net_ratelimit()) netdev_err(ndev, "NOT enough BD for TSO!\n"); - return NETDEV_TX_OK; + return NETDEV_TX_BUSY; } /* Protocol checksum off-load for TCP and UDP. */