From patchwork Sat Feb 11 01:49:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivan Khoronzhuk X-Patchwork-Id: 93812 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp799140obz; Fri, 10 Feb 2017 17:50:16 -0800 (PST) X-Received: by 10.99.188.10 with SMTP id q10mr14244150pge.106.1486777816752; Fri, 10 Feb 2017 17:50:16 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s26si3229189pgd.417.2017.02.10.17.50.16; Fri, 10 Feb 2017 17:50:16 -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=@linaro.org; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753480AbdBKBuL (ORCPT + 25 others); Fri, 10 Feb 2017 20:50:11 -0500 Received: from mail-lf0-f47.google.com ([209.85.215.47]:33125 "EHLO mail-lf0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753407AbdBKBuI (ORCPT ); Fri, 10 Feb 2017 20:50:08 -0500 Received: by mail-lf0-f47.google.com with SMTP id x1so30831124lff.0 for ; Fri, 10 Feb 2017 17:50:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=i+xg8IfR5xnPKPALhKdfbZAzr3UBdirRd4RAPDTROPM=; b=jhbSjlLJDnlxXlAprDrZcHBE1Eah7Ap5+YuhlnFGbR26NFz9+QmfcbTma8Q1Am2qaK tABTCye6ps3nN/9EdRKzvAU6MCGrq4YGBRccNqMghWgeidxhXRoTbMuTwikYoIGJThuF lDI9faJB/cplJg9NtZPUD6yKYK+liQIyyXsSI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=i+xg8IfR5xnPKPALhKdfbZAzr3UBdirRd4RAPDTROPM=; b=gbBimUzHicRO8iE4ZOFwytLL/X1Bs4TX+SgtdPBqkRFlIBq1YZKnZSNg0GThlZngOX LzDXyQm0hDRl0yivf5zoa9/f5oMinjKXX4I5taijH/QbChZMTpj5pZUSRM0Ehg60l/pR 4vKAAl+r7EGQiKUG8iIosNYVZXhtKSXbUWsiwzWG9m5aMcYYUcolQuC5Vk555e2rdk01 9FQFUa3ecLgSdph4nmdalnbvySiSmg+NStpaGQloy57fFbm4yAXtceq+1uCJlkULnhBA 9zw7ibb0bInLCX9Cy4gMU0Sr1vUONf4cO1koWSifyu1L9pX9v6oLSqnWrKIxDqyJKG7K ZcqA== X-Gm-Message-State: AMke39klFjgYKwObMUdevL39xz2L5mfNzIvB7IEhMS7zjqPbgY2aNNxPSX3wAxATU8cMUIFt X-Received: by 10.46.14.25 with SMTP id 25mr4061524ljo.55.1486777801715; Fri, 10 Feb 2017 17:50:01 -0800 (PST) Received: from localhost.localdomain (183-224-132-95.pool.ukrtel.net. [95.132.224.183]) by smtp.gmail.com with ESMTPSA id l196sm325654lfe.65.2017.02.10.17.50.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 Feb 2017 17:50:00 -0800 (PST) From: Ivan Khoronzhuk To: mugunthanvnm@ti.com Cc: grygorii.strashko@ti.com, netdev@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, Ivan Khoronzhuk Subject: [PATCH] net: ethernet: ti: cpsw: return NET_XMIT_DROP if skb_padto failed Date: Sat, 11 Feb 2017 03:49:57 +0200 Message-Id: <1486777797-28143-1-git-send-email-ivan.khoronzhuk@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If skb_padto failed the skb has been dropped already, so it was consumed, but it doesn't mean it was sent, thus no need to update queue tx time, etc. So, return NET_XMIT_DROP as more appropriate. Signed-off-by: Ivan Khoronzhuk --- Based on net-next/master drivers/net/ethernet/ti/cpsw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 4d1c0c3..503fa8a 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -1604,7 +1604,7 @@ static netdev_tx_t cpsw_ndo_start_xmit(struct sk_buff *skb, if (skb_padto(skb, CPSW_MIN_PACKET_SIZE)) { cpsw_err(priv, tx_err, "packet pad failed\n"); ndev->stats.tx_dropped++; - return NETDEV_TX_OK; + return NET_XMIT_DROP; } if (skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP &&