One more velocity fix.

This commit is contained in:
Dave Jones 2010-09-01 21:45:56 -04:00
parent c348adbe39
commit 705539efb5
2 changed files with 12 additions and 7 deletions

View File

@ -48,7 +48,7 @@ Summary: The Linux kernel
# reset this by hand to 1 (or to 0 and then use rpmdev-bumpspec).
# scripts/rebase.sh should be made to do that for you, actually.
#
%global baserelease 15
%global baserelease 16
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@ -1896,6 +1896,9 @@ fi
# and build.
%changelog
* Wed Sep 01 2010 Dave Jones <davej@redhat.com> 2.6.35.4-16
- Another VIA Velocity fix. This time in ifdown path.
* Wed Sep 01 2010 Dave Jones <davej@redhat.com> 2.6.35.4-15
- Improved version of the VIA Velocity DMA fix.

View File

@ -33,10 +33,10 @@ Reported-by: Dave Jones <davej@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c
index fd69095..4167e1f 100644
index fd69095..258c368 100644
--- a/drivers/net/via-velocity.c
+++ b/drivers/net/via-velocity.c
@@ -1705,28 +1705,21 @@ err_free_dma_rings_0:
@@ -1705,28 +1705,24 @@ err_free_dma_rings_0:
* recycle it, if not then unmap the buffer.
*/
static void velocity_free_tx_buf(struct velocity_info *vptr,
@ -51,7 +51,9 @@ index fd69095..4167e1f 100644
- */
- if (tdinfo->skb_dma) {
- int i;
-
+ if (unlikely(!tdinfo->skb))
+ return;
- for (i = 0; i < tdinfo->nskb_dma; i++) {
- size_t pktlen = max_t(size_t, skb->len, ETH_ZLEN);
+ pci_unmap_single(vptr->pdev, tdinfo->skb_dma[0],
@ -74,7 +76,7 @@ index fd69095..4167e1f 100644
dev_kfree_skb_irq(skb);
tdinfo->skb = NULL;
}
@@ -1739,22 +1732,8 @@ static void velocity_free_td_ring_entry(struct velocity_info *vptr,
@@ -1739,22 +1735,8 @@ static void velocity_free_td_ring_entry(struct velocity_info *vptr,
int q, int n)
{
struct velocity_td_info *td_info = &(vptr->tx.infos[q][n]);
@ -98,7 +100,7 @@ index fd69095..4167e1f 100644
}
/**
@@ -1925,7 +1904,7 @@ static int velocity_tx_srv(struct velocity_info *vptr)
@@ -1925,7 +1907,7 @@ static int velocity_tx_srv(struct velocity_info *vptr)
stats->tx_packets++;
stats->tx_bytes += tdinfo->skb->len;
}
@ -107,7 +109,7 @@ index fd69095..4167e1f 100644
vptr->tx.used[qnum]--;
}
vptr->tx.tail[qnum] = idx;
@@ -2534,9 +2513,7 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
@@ -2534,9 +2516,7 @@ static netdev_tx_t velocity_xmit(struct sk_buff *skb,
return NETDEV_TX_OK;
}