direct-io.hg
changeset 740:4c823ff460e8
bitkeeper revision 1.440 (3f6b23acW_t8O2uqGIWJJ6iBSlBEsg)
e100_main.c:
Some fixes for the e100 driver. Performance will suck but at least it might work now.
e100_main.c:
Some fixes for the e100 driver. Performance will suck but at least it might work now.
author | kaf24@scramble.cl.cam.ac.uk |
---|---|
date | Fri Sep 19 15:41:32 2003 +0000 (2003-09-19) |
parents | 33cdf06502cb |
children | eaff535a8422 |
files | xen/drivers/net/e100/e100_main.c |
line diff
1.1 --- a/xen/drivers/net/e100/e100_main.c Fri Sep 19 14:17:44 2003 +0000 1.2 +++ b/xen/drivers/net/e100/e100_main.c Fri Sep 19 15:41:32 2003 +0000 1.3 @@ -322,10 +322,12 @@ e100_add_skb_to_end(struct e100_private 1.4 1.5 (rx_struct->skb)->dev = bdp->device; 1.6 rfdn = RFD_POINTER(rx_struct->skb, bdp); 1.7 + rfdn = map_domain_mem(__pa(rfdn)); 1.8 rfdn->rfd_header.cb_status = 0; 1.9 rfdn->rfd_header.cb_cmd = __constant_cpu_to_le16(RFD_EL_BIT); 1.10 rfdn->rfd_act_cnt = 0; 1.11 rfdn->rfd_sz = __constant_cpu_to_le16(RFD_DATA_SIZE); 1.12 + unmap_domain_mem(rfdn); 1.13 1.14 pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr, bdp->rfd_size, 1.15 PCI_DMA_TODEVICE); 1.16 @@ -334,6 +336,7 @@ e100_add_skb_to_end(struct e100_private 1.17 rx_struct_last = list_entry(bdp->active_rx_list.prev, 1.18 struct rx_list_elem, list_elem); 1.19 rfd = RFD_POINTER(rx_struct_last->skb, bdp); 1.20 + rfd = map_domain_mem(__pa(rfd)); 1.21 pci_dma_sync_single(bdp->pdev, rx_struct_last->dma_addr, 1.22 4, PCI_DMA_FROMDEVICE); 1.23 put_unaligned(cpu_to_le32(rx_struct->dma_addr), 1.24 @@ -343,6 +346,7 @@ e100_add_skb_to_end(struct e100_private 1.25 8, PCI_DMA_TODEVICE); 1.26 rfd->rfd_header.cb_cmd &= 1.27 __constant_cpu_to_le16((u16) ~RFD_EL_BIT); 1.28 + unmap_domain_mem(rfd); 1.29 1.30 pci_dma_sync_single(bdp->pdev, rx_struct_last->dma_addr, 1.31 4, PCI_DMA_TODEVICE); 1.32 @@ -2017,13 +2021,17 @@ e100_rx_srv(struct e100_private *bdp) 1.33 skb = rx_struct->skb; 1.34 1.35 rfd = RFD_POINTER(skb, bdp); /* locate RFD within skb */ 1.36 + rfd = map_domain_mem(__pa(rfd)); 1.37 1.38 // sync only the RFD header 1.39 pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr, 1.40 bdp->rfd_size, PCI_DMA_FROMDEVICE); 1.41 rfd_status = le16_to_cpu(rfd->rfd_header.cb_status); /* get RFD's status */ 1.42 if (!(rfd_status & RFD_STATUS_COMPLETE)) /* does not contains data yet - exit */ 1.43 + { 1.44 + unmap_domain_mem(rfd); 1.45 break; 1.46 + } 1.47 1.48 /* to allow manipulation with current skb we need to unlink it */ 1.49 list_del(&(rx_struct->list_elem)); 1.50 @@ -2032,12 +2040,15 @@ e100_rx_srv(struct e100_private *bdp) 1.51 * move it to the end of skb list for reuse */ 1.52 if (!(rfd_status & RFD_STATUS_OK)) { 1.53 e100_add_skb_to_end(bdp, rx_struct); 1.54 + unmap_domain_mem(rfd); 1.55 continue; 1.56 } 1.57 1.58 data_sz = min_t(u16, (le16_to_cpu(rfd->rfd_act_cnt) & 0x3fff), 1.59 (sizeof (rfd_t) - bdp->rfd_size)); 1.60 1.61 + unmap_domain_mem(rfd); 1.62 + 1.63 /* now sync all the data */ 1.64 pci_dma_sync_single(bdp->pdev, rx_struct->dma_addr, 1.65 (data_sz + bdp->rfd_size), 1.66 @@ -2063,6 +2074,7 @@ e100_rx_srv(struct e100_private *bdp) 1.67 skb->protocol = eth_type_trans(skb, dev); 1.68 1.69 /* set the checksum info */ 1.70 +#if 0 1.71 if (bdp->flags & DF_CSUM_OFFLOAD) { 1.72 if (bdp->rev_id >= D102_REV_ID) { 1.73 skb->ip_summed = e100_D102_check_checksum(rfd); 1.74 @@ -2070,14 +2082,21 @@ e100_rx_srv(struct e100_private *bdp) 1.75 skb->ip_summed = e100_D101M_checksum(bdp, skb); 1.76 } 1.77 } else { 1.78 +#endif 1.79 skb->ip_summed = CHECKSUM_NONE; 1.80 +#if 0 1.81 } 1.82 - 1.83 +#endif 1.84 + 1.85 +#if 0 1.86 if(bdp->vlgrp && (rfd_status & CB_STATUS_VLAN)) { 1.87 vlan_hwaccel_rx(skb, bdp->vlgrp, be16_to_cpu(rfd->vlanid)); 1.88 } else { 1.89 +#endif 1.90 netif_rx(skb); 1.91 +#if 0 1.92 } 1.93 +#endif 1.94 dev->last_rx = jiffies; 1.95 bdp->drv_stats.net_stats.rx_bytes += skb->len; 1.96