Commit 0623b98b authored by Heiner Kallweit's avatar Heiner Kallweit Committed by David S. Miller

r8169: improve rtl8169_tso_csum_v2

Simplify the code and avoid the overhead of calling vlan_get_protocol().
Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 145192f8
...@@ -4127,25 +4127,20 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp, ...@@ -4127,25 +4127,20 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
struct sk_buff *skb, u32 *opts) struct sk_buff *skb, u32 *opts)
{ {
u32 transport_offset = (u32)skb_transport_offset(skb); u32 transport_offset = (u32)skb_transport_offset(skb);
u32 mss = skb_shinfo(skb)->gso_size; struct skb_shared_info *shinfo = skb_shinfo(skb);
u32 mss = shinfo->gso_size;
if (mss) { if (mss) {
switch (vlan_get_protocol(skb)) { if (shinfo->gso_type & SKB_GSO_TCPV4) {
case htons(ETH_P_IP):
opts[0] |= TD1_GTSENV4; opts[0] |= TD1_GTSENV4;
break; } else if (shinfo->gso_type & SKB_GSO_TCPV6) {
case htons(ETH_P_IPV6):
if (skb_cow_head(skb, 0)) if (skb_cow_head(skb, 0))
return false; return false;
tcp_v6_gso_csum_prep(skb); tcp_v6_gso_csum_prep(skb);
opts[0] |= TD1_GTSENV6; opts[0] |= TD1_GTSENV6;
break; } else {
default:
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
break;
} }
opts[0] |= transport_offset << GTTCPHO_SHIFT; opts[0] |= transport_offset << GTTCPHO_SHIFT;
......
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