Commit 207c5f44 authored by Alexander Duyck's avatar Alexander Duyck Committed by David S. Miller

r8169: Use eth_skb_pad function

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: default avatarAlexander Duyck <alexander.h.duyck@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b0b9f333
...@@ -6836,14 +6836,6 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb, ...@@ -6836,14 +6836,6 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
return -EIO; 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) 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; return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
...@@ -6984,7 +6976,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, ...@@ -6984,7 +6976,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
u8 ip_protocol; u8 ip_protocol;
if (unlikely(rtl_test_hw_pad_bug(tp, skb))) 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) { if (transport_offset > TCPHO_MAX) {
netif_warn(tp, tx_err, tp->dev, netif_warn(tp, tx_err, tp->dev,
...@@ -7019,7 +7011,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, ...@@ -7019,7 +7011,7 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
opts[1] |= transport_offset << TCPHO_SHIFT; opts[1] |= transport_offset << TCPHO_SHIFT;
} else { } else {
if (unlikely(rtl_test_hw_pad_bug(tp, skb))) if (unlikely(rtl_test_hw_pad_bug(tp, skb)))
return rtl_skb_pad(skb); return !eth_skb_pad(skb);
} }
return true; return true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment