]> git.hungrycats.org Git - linux/commitdiff
[PATCH] e1000 bug
authorAndrew Morton <akpm@osdl.org>
Sat, 20 Sep 2003 10:48:53 +0000 (06:48 -0400)
committerStephen Hemminger <shemminger@osdl.org>
Sat, 20 Sep 2003 10:48:53 +0000 (06:48 -0400)
Rick Lindsley <ricklind@us.ibm.com> wrote:
>
> since it's been out for a while you probably already know, but the patch
> for e1000_main.c has a bug in it.  Looks like it will fail at line 1550 if
> compiled with NETIF_F_TSO defined.
>

So it will.  I blame the gcc developers.

 25-akpm/drivers/net/e1000/e1000_main.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

drivers/net/e1000/e1000_main.c

index 4bf0772ee632124eb82f2ebb731fa4317fc87807..168d89fa8cb473c8cfb211b2a0782ac90492ffbc 100644 (file)
@@ -1536,19 +1536,24 @@ e1000_tx_map(struct e1000_adapter *adapter, struct sk_buff *skb,
        struct e1000_buffer *buffer_info;
        unsigned int len = skb->len, max_per_txd = E1000_MAX_DATA_PER_TXD;
        unsigned int offset = 0, size, count = 0, i;
+#ifdef NETIF_F_TSO
+       unsigned int mss;
+#endif
+       unsigned int nr_frags;
+       unsigned int f;
 
 #ifdef NETIF_F_TSO
-       unsigned int mss = skb_shinfo(skb)->tso_size;
+       mss = skb_shinfo(skb)->tso_size;
        /* The controller does a simple calculation to 
         * make sure there is enough room in the FIFO before
         * initiating the DMA for each buffer.  The calc is:
         * 4 = ceil(buffer len/mss).  To make sure we don't
         * overrun the FIFO, adjust the max buffer len if mss
         * drops. */
-       if(mss) max_per_txd = min(mss << 2, max_per_txd);
+       if (mss)
+               max_per_txd = min(mss << 2, max_per_txd);
 #endif
-       unsigned int nr_frags = skb_shinfo(skb)->nr_frags;
-       unsigned int f;
+       nr_frags = skb_shinfo(skb)->nr_frags;
        len -= skb->data_len;
 
        i = tx_ring->next_to_use;