Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 144048 Details for
Bug 217930
[RHEL3] Netdump for 8139cp driver
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
New patch to add netdump support to 8139cp
linux-2.4.21-8139-netpoll-2.patch (text/plain), 4.03 KB, created by
Chris Lalancette
on 2006-12-19 22:08:11 UTC
(
hide
)
Description:
New patch to add netdump support to 8139cp
Filename:
MIME Type:
Creator:
Chris Lalancette
Created:
2006-12-19 22:08:11 UTC
Size:
4.03 KB
patch
obsolete
>--- linux-2.4.21/drivers/net/8139cp.c.orig 2006-12-19 22:10:59.000000000 -0500 >+++ linux-2.4.21/drivers/net/8139cp.c 2006-12-19 22:11:06.000000000 -0500 >@@ -299,6 +299,9 @@ static const unsigned int cp_intr_mask = > RxOK | RxErr | RxEmpty | RxFIFOOvr | > TxOK | TxErr | TxEmpty; > >+static const unsigned int cp_rx_intr_mask = >+ RxOK | RxErr | RxEmpty | RxFIFOOvr; >+ > static const unsigned int cp_rx_config = > (RX_FIFO_THRESH << RxCfgFIFOShift) | > (RX_DMA_BURST << RxCfgDMAShift); >@@ -1693,6 +1696,147 @@ static void cp_vlan_rx_kill_vid(struct n > } > #endif > >+static int >+cp_rx_poll(struct net_device *dev, int *budget) >+{ >+ struct cp_private *cp = dev->priv; >+ unsigned rx_tail = cp->rx_tail; >+ unsigned rx_work = dev->quota; >+ unsigned rx; >+ >+ rx_status_loop: >+ rx = 0; >+ cpw16(IntrStatus, cp_rx_intr_mask); >+ >+ while (1) { >+ u32 status, len; >+ dma_addr_t mapping; >+ struct sk_buff *skb, *new_skb; >+ struct cp_desc *desc; >+ unsigned buflen; >+ >+ skb = cp->rx_skb[rx_tail].skb; >+ if (!skb) >+ BUG(); >+ >+ desc = &cp->rx_ring[rx_tail]; >+ status = le32_to_cpu(desc->opts1); >+ if (status & DescOwn) >+ break; >+ >+ len = (status & 0x1fff) - 4; >+ mapping = cp->rx_skb[rx_tail].mapping; >+ >+ if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) { >+ /* we don't support incoming fragmented frames. >+ * instead, we attempt to ensure that the >+ * pre-allocated RX skbs are properly sized such >+ * that RX fragments are never encountered >+ */ >+ cp_rx_err_acct(cp, rx_tail, status, len); >+ cp->net_stats.rx_dropped++; >+ cp->cp_stats.rx_frags++; >+ goto rx_next; >+ } >+ >+ if (status & (RxError | RxErrFIFO)) { >+ cp_rx_err_acct(cp, rx_tail, status, len); >+ goto rx_next; >+ } >+ >+ if (netif_msg_rx_status(cp)) >+ printk(KERN_DEBUG "%s: rx slot %d status 0x%x len %d\n", >+ cp->dev->name, rx_tail, status, len); >+ >+ buflen = cp->rx_buf_sz + RX_OFFSET; >+ new_skb = dev_alloc_skb (buflen); >+ if (!new_skb) { >+ cp->net_stats.rx_dropped++; >+ goto rx_next; >+ } >+ >+ skb_reserve(new_skb, RX_OFFSET); >+ new_skb->dev = cp->dev; >+ >+ pci_unmap_single(cp->pdev, mapping, >+ buflen, PCI_DMA_FROMDEVICE); >+ >+ /* Handle checksum offloading for incoming packets. */ >+ if (cp_rx_csum_ok(status)) >+ skb->ip_summed = CHECKSUM_UNNECESSARY; >+ else >+ skb->ip_summed = CHECKSUM_NONE; >+ >+ skb_put(skb, len); >+ >+ mapping = >+ cp->rx_skb[rx_tail].mapping = >+ pci_map_single(cp->pdev, new_skb->tail, >+ buflen, PCI_DMA_FROMDEVICE); >+ cp->rx_skb[rx_tail].skb = new_skb; >+ >+ cp_rx_skb(cp, skb, desc); >+ rx++; >+ >+rx_next: >+ cp->rx_ring[rx_tail].opts2 = 0; >+ cp->rx_ring[rx_tail].addr = cpu_to_le64(mapping); >+ if (rx_tail == (CP_RX_RING_SIZE - 1)) >+ desc->opts1 = cpu_to_le32(DescOwn | RingEnd | >+ cp->rx_buf_sz); >+ else >+ desc->opts1 = cpu_to_le32(DescOwn | cp->rx_buf_sz); >+ rx_tail = NEXT_RX(rx_tail); >+ >+ if (!rx_work--) >+ break; >+ } >+ >+ cp->rx_tail = rx_tail; >+ >+ dev->quota -= rx; >+ *budget -= rx; >+ >+ /* if we did not reach work limit, then we're done with >+ * this round of polling >+ */ >+ if (rx_work) { >+ if (cpr16(IntrStatus) & cp_rx_intr_mask) >+ goto rx_status_loop; >+ >+ local_irq_disable(); >+ cpw16_f(IntrMask, cp_intr_mask); >+ __netif_rx_complete(dev); >+ local_irq_enable(); >+ >+ return 0; /* done */ >+ } >+ >+ return 1; /* not done */ >+} >+ >+#ifdef HAVE_POLL_CONTROLLER >+static void >+cp_netpoll(struct net_device *dev) >+{ >+ struct cp_private *cp = dev->priv; >+ >+ if (unlikely(netdump_mode)) { >+ int bogus_budget = 64; >+ >+ dev->quota = dev->weight; >+ cp_interrupt(cp->pdev->irq, dev, NULL); >+ >+ if (dev->poll_list.prev) >+ cp_rx_poll(dev, &bogus_budget); >+ } else { >+ disable_irq(cp->pdev->irq); >+ cp_interrupt(cp->pdev->irq, dev, NULL); >+ enable_irq(cp->pdev->irq); >+ } >+} >+#endif >+ > /* Serial EEPROM section. */ > > /* EEPROM_Ctrl bits. */ >@@ -1889,6 +2033,10 @@ static int __devinit cp_init_one (struct > dev->vlan_rx_kill_vid = cp_vlan_rx_kill_vid; > #endif > >+ dev->poll = cp_rx_poll; >+#ifdef HAVE_POLL_CONTROLLER >+ dev->poll_controller = cp_netpoll; >+#endif > dev->irq = pdev->irq; > > rc = register_netdev(dev);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 217930
:
142515
|
144048
|
147255