/[gentoo-x86]/app-emulation/open-vm-tools-kmod/files/fragsize.patch
Gentoo

Contents of /app-emulation/open-vm-tools-kmod/files/fragsize.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sat Feb 4 16:34:59 2012 UTC (8 years, 1 month ago) by vadimk
Branch: MAIN
File MIME type: text/x-diff
patches for kernel ge 3.2.0

(Portage version: 2.1.10.44/cvs/Linux x86_64)

1 diff --git a/modules/linux/vmxnet/vmxnet.c b/modules/linux/vmxnet/vmxnet.c
2 index a6f5740..3c75bb2 100644
3 --- a/modules/linux/vmxnet/vmxnet.c
4 +++ b/modules/linux/vmxnet/vmxnet.c
5 @@ -989,7 +989,7 @@ vmxnet_probe_device(struct pci_dev *pdev, // IN: vmxnet PCI device
6 .ndo_start_xmit = &vmxnet_start_tx,
7 .ndo_stop = &vmxnet_close,
8 .ndo_get_stats = &vmxnet_get_stats,
9 - .ndo_set_multicast_list = &vmxnet_set_multicast_list,
10 + .ndo_set_rx_mode = &vmxnet_set_multicast_list,
11 .ndo_change_mtu = &vmxnet_change_mtu,
12 # ifdef VMW_HAVE_POLL_CONTROLLER
13 .ndo_poll_controller = vmxnet_netpoll,
14 @@ -2033,21 +2033,23 @@ vmxnet_map_pkt(struct sk_buff *skb,
15 offset -= skb_headlen(skb);
16
17 for ( ; nextFrag < skb_shinfo(skb)->nr_frags; nextFrag++){
18 + int fragSize;
19 frag = &skb_shinfo(skb)->frags[nextFrag];
20 + fragSize = skb_frag_size(frag);
21
22 // skip those frags that are completely copied
23 - if (offset >= frag->size){
24 - offset -= frag->size;
25 + if (offset >= fragSize){
26 + offset -= fragSize;
27 } else {
28 // map the part of the frag that is not copied
29 dma = pci_map_page(lp->pdev,
30 - frag->page,
31 + frag->page.p,
32 frag->page_offset + offset,
33 - frag->size - offset,
34 + fragSize - offset,
35 PCI_DMA_TODEVICE);
36 - VMXNET_FILL_SG(xre->sg.sg[nextSg], dma, frag->size - offset);
37 + VMXNET_FILL_SG(xre->sg.sg[nextSg], dma, fragSize - offset);
38 VMXNET_LOG("vmxnet_map_tx: txRing[%u].sg[%d] -> frag[%d]+%u (%uB)\n",
39 - dd->txDriverNext, nextSg, nextFrag, offset, frag->size - offset);
40 + dd->txDriverNext, nextSg, nextFrag, offset, fragSize - offset);
41 nextSg++;
42 nextFrag++;
43
44 @@ -2058,11 +2060,14 @@ vmxnet_map_pkt(struct sk_buff *skb,
45
46 // map the remaining frags, we might need to use additional tx entries
47 for ( ; nextFrag < skb_shinfo(skb)->nr_frags; nextFrag++) {
48 + int fragSize;
49 frag = &skb_shinfo(skb)->frags[nextFrag];
50 + fragSize = skb_frag_size(frag);
51 +
52 dma = pci_map_page(lp->pdev,
53 - frag->page,
54 + frag->page.p,
55 frag->page_offset,
56 - frag->size,
57 + fragSize,
58 PCI_DMA_TODEVICE);
59
60 if (nextSg == VMXNET2_SG_DEFAULT_LENGTH) {
61 @@ -2091,9 +2096,9 @@ vmxnet_map_pkt(struct sk_buff *skb,
62
63 nextSg = 0;
64 }
65 - VMXNET_FILL_SG(xre->sg.sg[nextSg], dma, frag->size);
66 + VMXNET_FILL_SG(xre->sg.sg[nextSg], dma, fragSize);
67 VMXNET_LOG("vmxnet_map_tx: txRing[%u].sg[%d] -> frag[%d] (%uB)\n",
68 - dd->txDriverNext, nextSg, nextFrag, frag->size);
69 + dd->txDriverNext, nextSg, nextFrag, fragSize);
70 nextSg++;
71 }
72
73 @@ -2548,7 +2553,7 @@ vmxnet_rx_frags(Vmxnet_Private *lp, struct sk_buff *skb)
74 if (UNLIKELY(newPage == NULL)) {
75 skb_shinfo(skb)->nr_frags = numFrags;
76 skb->len += skb->data_len;
77 - skb->truesize += skb->data_len;
78 + skb->truesize += PAGE_SIZE;
79
80 compat_dev_kfree_skb(skb, FREE_WRITE);
81
82 @@ -2558,10 +2563,12 @@ vmxnet_rx_frags(Vmxnet_Private *lp, struct sk_buff *skb)
83 }
84
85 pci_unmap_page(pdev, rre2->paddr, PAGE_SIZE, PCI_DMA_FROMDEVICE);
86 - skb_shinfo(skb)->frags[numFrags].page = lp->rxPages[dd->rxDriverNext2];
87 + __skb_frag_set_page(&skb_shinfo(skb)->frags[numFrags],
88 + lp->rxPages[dd->rxDriverNext2]);
89 skb_shinfo(skb)->frags[numFrags].page_offset = 0;
90 skb_shinfo(skb)->frags[numFrags].size = rre2->actualLength;
91 skb->data_len += rre2->actualLength;
92 + skb->truesize += PAGE_SIZE;
93 numFrags++;
94
95 /* refill the buffer */
96 @@ -2579,7 +2586,7 @@ vmxnet_rx_frags(Vmxnet_Private *lp, struct sk_buff *skb)
97 VMXNET_ASSERT(numFrags > 0);
98 skb_shinfo(skb)->nr_frags = numFrags;
99 skb->len += skb->data_len;
100 - skb->truesize += skb->data_len;
101 + skb->truesize += PAGE_SIZE;
102 VMXNET_LOG("vmxnet_rx: %dB from rxRing[%d](%dB)+rxRing2[%d, %d)(%dB)\n",
103 skb->len, dd->rxDriverNext, skb_headlen(skb),
104 firstFrag, dd->rxDriverNext2, skb->data_len);

  ViewVC Help
Powered by ViewVC 1.1.20