Netdev List
 help / color / mirror / Atom feed
From: Alexander Duyck <alexander.h.duyck@redhat.com>
To: netdev@vger.kernel.org
Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>,
	davem@davemloft.net
Subject: [PATCH v2 6/6] r8169: Use eth_skb_pad function
Date: Wed, 03 Dec 2014 08:18:04 -0800	[thread overview]
Message-ID: <20141203161804.9223.79689.stgit@ahduyck-vm-fedora20> (raw)
In-Reply-To: <20141203161440.9223.39633.stgit@ahduyck-vm-fedora20>

Replace rtl_skb_pad with eth_skb_pad since they do the same thing.

Cc: Realtek linux nic maintainers <nic_swsd@realtek.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
 drivers/net/ethernet/realtek/r8169.c |   12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index cf154f7..e9b44fc 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6832,14 +6832,6 @@ err_out:
 	return -EIO;
 }
 
-static bool rtl_skb_pad(struct sk_buff *skb)
-{
-	if (skb_padto(skb, ETH_ZLEN))
-		return false;
-	skb_put(skb, ETH_ZLEN - skb->len);
-	return true;
-}
-
 static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp, struct sk_buff *skb)
 {
 	return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
@@ -6980,7 +6972,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
 		u8 ip_protocol;
 
 		if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
-			return skb_checksum_help(skb) == 0 && rtl_skb_pad(skb);
+			return !(skb_checksum_help(skb) || eth_skb_pad(skb));
 
 		if (transport_offset > TCPHO_MAX) {
 			netif_warn(tp, tx_err, tp->dev,
@@ -7015,7 +7007,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
 		opts[1] |= transport_offset << TCPHO_SHIFT;
 	} else {
 		if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
-			return rtl_skb_pad(skb);
+			return !eth_skb_pad(skb);
 	}
 
 	return true;

  parent reply	other threads:[~2014-12-03 16:18 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 ` [PATCH v2 4/6] niu: Use eth_skb_pad helper Alexander Duyck
2014-12-03 16:17 ` [PATCH v2 5/6] myri10ge: use " Alexander Duyck
2014-12-03 18:56   ` Sergei Shtylyov
2014-12-03 16:18 ` Alexander Duyck [this message]
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=20141203161804.9223.79689.stgit@ahduyck-vm-fedora20 \
    --to=alexander.h.duyck@redhat.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nic_swsd@realtek.com \
    /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