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: 9567741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4FE8360572 for ; Sat, 11 Feb 2017 01:50:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3E4FD2853B for ; Sat, 11 Feb 2017 01:50:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3315D285DE; Sat, 11 Feb 2017 01:50:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BAE2E2853B for ; Sat, 11 Feb 2017 01:50:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753416AbdBKBuK (ORCPT ); Fri, 10 Feb 2017 20:50:10 -0500 Received: from mail-lf0-f50.google.com ([209.85.215.50]:35464 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753399AbdBKBuI (ORCPT ); Fri, 10 Feb 2017 20:50:08 -0500 Received: by mail-lf0-f50.google.com with SMTP id n124so30760923lfd.2 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=Nj3IeRRCuIWBLlCeWx6fa4E6OQsavSDdx5puEYKeSBeBjOMRBXoI1g+p+36fNQ5cZD idHwFpNLmIAnQWlx595cV5oLBZ5YCSaDlDAyp3gTZONnYJl2quz5yT2J0fTGLZALzWCY 8BwFVilDtWomBtbsG2MzyXyFy+8WtZKauakj2XyHoMx1hLz6TbEVAUTVYClmEDjL+Enw a2UzAURJmmmZtD0sVtU7C5jJlED7NIX4H18sXVUjl045Jt1KyQqn+/C/Rn8piv8dllah f0Q5/pEp+UF7xFldmvoREdyg9bR+T75ab3vHivi9ruccRqt8EifZ4pEEEdwS2QWYzTWQ h6/A== X-Gm-Message-State: AMke39nXYHwt0EVVKtzlM/fo8VR56qxtKW5HyGw6ebS2x250lfbhdrtE8qtp6D69COJU6HiI 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-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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 &&