From fea9eedac3a6e4dd82dd39da333492670dcc3b59 Mon Sep 17 00:00:00 2001 From: Eric Dumazet Date: Tue, 12 May 2009 20:48:02 +0000 Subject: [PATCH] --- yaml --- r: 150223 b: refs/heads/master c: d62fda082c48b417b47a553860abf75d9cf8b591 h: refs/heads/master i: 150221: 97c1d0f52ea9e63a75cc2e6ca65057c8e77b8c53 150219: c530d401a4bd479fdc4fbedd266ce3b9b6f419d8 150215: bdebb0059f87465b603109ef414d262f27301ad6 150207: ea865d37c76032bd253722d88dd87638856e49de v: v3 --- [refs] | 2 +- trunk/drivers/net/bnx2.c | 18 +++++++++++------- trunk/drivers/net/bnx2.h | 2 ++ 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index cfaf7b043cf3..3c8bc12063fb 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9dc20c5f78c53bf57fb7874b6e942842e1db20d3 +refs/heads/master: d62fda082c48b417b47a553860abf75d9cf8b591 diff --git a/trunk/drivers/net/bnx2.c b/trunk/drivers/net/bnx2.c index b0cb29d4cc01..c37acc1d10ac 100644 --- a/trunk/drivers/net/bnx2.c +++ b/trunk/drivers/net/bnx2.c @@ -2630,14 +2630,15 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) tx_buf = &txr->tx_buf_ring[sw_ring_cons]; skb = tx_buf->skb; + /* prefetch skb_end_pointer() to speedup skb_shinfo(skb) */ + prefetch(&skb->end); + /* partial BD completions possible with TSO packets */ - if (skb_is_gso(skb)) { + if (tx_buf->is_gso) { u16 last_idx, last_ring_idx; - last_idx = sw_cons + - skb_shinfo(skb)->nr_frags + 1; - last_ring_idx = sw_ring_cons + - skb_shinfo(skb)->nr_frags + 1; + last_idx = sw_cons + tx_buf->nr_frags + 1; + last_ring_idx = sw_ring_cons + tx_buf->nr_frags + 1; if (unlikely(last_ring_idx >= MAX_TX_DESC_CNT)) { last_idx++; } @@ -2649,7 +2650,7 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) skb_dma_unmap(&bp->pdev->dev, skb, DMA_TO_DEVICE); tx_buf->skb = NULL; - last = skb_shinfo(skb)->nr_frags; + last = tx_buf->nr_frags; for (i = 0; i < last; i++) { sw_cons = NEXT_TX_BD(sw_cons); @@ -2662,7 +2663,8 @@ bnx2_tx_int(struct bnx2 *bp, struct bnx2_napi *bnapi, int budget) if (tx_pkt == budget) break; - hw_cons = bnx2_get_hw_tx_cons(bnapi); + if (hw_cons == sw_cons) + hw_cons = bnx2_get_hw_tx_cons(bnapi); } txr->hw_tx_cons = hw_cons; @@ -6179,6 +6181,8 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev) txbd->tx_bd_vlan_tag_flags = vlan_tag_flags | TX_BD_FLAGS_START; last_frag = skb_shinfo(skb)->nr_frags; + tx_buf->nr_frags = last_frag; + tx_buf->is_gso = skb_is_gso(skb); for (i = 0; i < last_frag; i++) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; diff --git a/trunk/drivers/net/bnx2.h b/trunk/drivers/net/bnx2.h index 5b570e17c839..026ed1c84698 100644 --- a/trunk/drivers/net/bnx2.h +++ b/trunk/drivers/net/bnx2.h @@ -6552,6 +6552,8 @@ struct sw_pg { struct sw_tx_bd { struct sk_buff *skb; + unsigned short is_gso; + unsigned short nr_frags; }; #define SW_RXBD_RING_SIZE (sizeof(struct sw_bd) * RX_DESC_CNT)