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: [PATCH v2 4/6] niu: Use eth_skb_pad helper
Date: Wed, 03 Dec 2014 08:17:52 -0800	[thread overview]
Message-ID: <20141203161752.9223.4795.stgit@ahduyck-vm-fedora20> (raw)
In-Reply-To: <20141203161440.9223.39633.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-12-03 16:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-03 16:17 [PATCH v2 0/6] net: Add helper for padding short Ethernet frames Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 1/6] net: Add functions for handling padding frame and adding to length Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 2/6] ethernet/intel: Use eth_skb_pad and skb_put_padto helpers Alexander Duyck
2014-12-03 19:25   ` Jeff Kirsher
2014-12-03 16:17 ` [PATCH v2 3/6] emulex: Use skb_put_padto instead of skb_padto() and skb->len assignment Alexander Duyck
2014-12-03 16:17 ` Alexander Duyck [this message]
2014-12-03 16:17 ` [PATCH v2 5/6] myri10ge: use eth_skb_pad helper Alexander Duyck
2014-12-03 18:56   ` Sergei Shtylyov
2014-12-03 16:18 ` [PATCH v2 6/6] r8169: Use eth_skb_pad function Alexander Duyck
2014-12-09  1:48 ` [PATCH v2 0/6] net: Add helper for padding short Ethernet frames David Miller

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=20141203161752.9223.4795.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