Netdev List
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net
Subject: [net-next PATCH 3/5] niu: Use eth_skb_pad helper
Date: Tue, 25 Nov 2014 14:44:12 -0800	[thread overview]
Message-ID: <20141125224412.1867.96319.stgit@ahduyck-vm-fedora20> (raw)
In-Reply-To: <20141125223727.1867.43890.stgit@ahduyck-vm-fedora20>

Replace the standard layout for padding an ethernet frame with the
eth_skb_pad call.

Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
 drivers/net/ethernet/sun/niu.c |    9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c
index 904fd1a..4aaa324 100644
--- a/drivers/net/ethernet/sun/niu.c
+++ b/drivers/net/ethernet/sun/niu.c
@@ -6651,13 +6651,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
 		return NETDEV_TX_BUSY;
 	}
 
-	if (skb->len < ETH_ZLEN) {
-		unsigned int pad_bytes = ETH_ZLEN - skb->len;
-
-		if (skb_pad(skb, pad_bytes))
-			goto out;
-		skb_put(skb, pad_bytes);
-	}
+	if (eth_skb_pad(skb))
+		goto out;
 
 	len = sizeof(struct tx_pkt_hdr) + 15;
 	if (skb_headroom(skb) < len) {

  parent reply	other threads:[~2014-11-25 22:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25 22:43 [net-next PATCH 0/5] net: Add helper for padding short Ethernet frames Alexander Duyck
2014-11-25 22:44 ` [net-next PATCH 1/5] etherdevice: Add function for handling padding frame to ETH_ZLEN Alexander Duyck
2014-11-26  0:56   ` Florian Fainelli
2014-11-26  2:44     ` Alexander Duyck
2014-11-25 22:44 ` [net-next PATCH 2/5] ethernet/intel: Use eth_skb_pad helper Alexander Duyck
2014-11-25 23:14   ` Eric Dumazet
2014-11-26  0:44     ` Alexander Duyck
2014-11-26  1:05       ` Florian Fainelli
2014-11-26  1:43       ` Eric Dumazet
2014-11-26  3:19         ` David Miller
2014-11-26  4:01           ` Eric Dumazet
2014-11-26 20:41             ` David Miller
2014-11-25 22:44 ` Alexander Duyck [this message]
2014-11-25 22:44 ` [net-next PATCH 4/5] myri10ge: use " Alexander Duyck
2014-11-25 22:44 ` [net-next PATCH 5/5] r8169: Use eth_skb_pad function Alexander Duyck
2014-11-26  0:02   ` Francois Romieu
2014-11-26  0:33     ` Alexander Duyck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141125224412.1867.96319.stgit@ahduyck-vm-fedora20 \
    --to=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox