Skip to contentSkip to conversation

r8169: improve r8169_csum_workaround

PATCH Applied Heiner Kallweit 2 participants 2 messages May 31, 2019 – Jun 3, 2019

Subsystems (3)
lore
Share & tools
lore

Heiner Kallweit

author maintainer
#0 lore raw

PATCH 1/1 r8169: improve r8169_csum_workaround

Use helper skb_is_gso() and simplify access to tx_dropped.

---
 drivers/net/ethernet/realtek/r8169.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/net/ethernet/realtek/r8169.c +2 -5
index 12dab52ee..2705eb510 100644
@@ -5727,7 +5727,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 static void r8169_csum_workaround(struct rtl8169_private *tp,
 				  struct sk_buff *skb)
 {
-	if (skb_shinfo(skb)->gso_size) {
+	if (skb_is_gso(skb)) {
 		netdev_features_t features = tp->dev->features;
 		struct sk_buff *segs, *nskb;
 
@@ -5750,11 +5750,8 @@ static void r8169_csum_workaround(struct rtl8169_private *tp,
 
 		rtl8169_start_xmit(skb, tp->dev);
 	} else {
-		struct net_device_stats *stats;
-
 drop:
-		stats = &tp->dev->stats;
-		stats->tx_dropped++;
+		tp->dev->stats.tx_dropped++;
 		dev_kfree_skb_any(skb);
 	}
 }
Signature · 1 line
2.21.0