1 /*********************************************************************
2 * Author: Cavium Networks
4 * Contact: support@caviumnetworks.com
5 * This file is part of the OCTEON SDK
7 * Copyright (c) 2003-2010 Cavium Networks
9 * This file is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License, Version 2, as
11 * published by the Free Software Foundation.
13 * This file is distributed in the hope that it will be useful, but
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
15 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE, TITLE, or
16 * NONINFRINGEMENT. See the GNU General Public License for more
19 * You should have received a copy of the GNU General Public License
20 * along with this file; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 * or visit http://www.gnu.org/licenses/.
24 * This file may also be available under a different license from Cavium.
25 * Contact Cavium Networks for more information
26 *********************************************************************/
27 #include <linux/module.h>
28 #include <linux/kernel.h>
29 #include <linux/netdevice.h>
30 #include <linux/init.h>
31 #include <linux/etherdevice.h>
33 #include <linux/ratelimit.h>
34 #include <linux/string.h>
35 #include <linux/interrupt.h>
38 #include <linux/xfrm.h>
40 #endif /* CONFIG_XFRM */
42 #include <linux/atomic.h>
44 #include <asm/octeon/octeon.h>
46 #include "ethernet-defines.h"
47 #include "octeon-ethernet.h"
48 #include "ethernet-tx.h"
49 #include "ethernet-util.h"
51 #include <asm/octeon/cvmx-wqe.h>
52 #include <asm/octeon/cvmx-fau.h>
53 #include <asm/octeon/cvmx-pip.h>
54 #include <asm/octeon/cvmx-pko.h>
55 #include <asm/octeon/cvmx-helper.h>
57 #include <asm/octeon/cvmx-gmxx-defs.h>
59 #define CVM_OCT_SKB_CB(skb) ((u64 *)((skb)->cb))
62 * You can define GET_SKBUFF_QOS() to override how the skbuff output
63 * function determines which output queue is used. The default
64 * implementation always uses the base queue for the port. If, for
65 * example, you wanted to use the skb->priority field, define
66 * GET_SKBUFF_QOS as: #define GET_SKBUFF_QOS(skb) ((skb)->priority)
68 #ifndef GET_SKBUFF_QOS
69 #define GET_SKBUFF_QOS(skb) 0
72 static void cvm_oct_tx_do_cleanup(unsigned long arg);
73 static DECLARE_TASKLET(cvm_oct_tx_cleanup_tasklet, cvm_oct_tx_do_cleanup, 0);
75 /* Maximum number of SKBs to try to free per xmit packet. */
76 #define MAX_SKB_TO_FREE (MAX_OUT_QUEUE_DEPTH * 2)
78 static inline int32_t cvm_oct_adjust_skb_to_free(int32_t skb_to_free, int fau)
81 undo = skb_to_free > 0 ? MAX_SKB_TO_FREE : skb_to_free +
84 cvmx_fau_atomic_add32(fau, -undo);
85 skb_to_free = -skb_to_free > MAX_SKB_TO_FREE ? MAX_SKB_TO_FREE :
90 static void cvm_oct_kick_tx_poll_watchdog(void)
92 union cvmx_ciu_timx ciu_timx;
94 ciu_timx.s.one_shot = 1;
95 ciu_timx.s.len = cvm_oct_tx_poll_interval;
96 cvmx_write_csr(CVMX_CIU_TIMX(1), ciu_timx.u64);
99 void cvm_oct_free_tx_skbs(struct net_device *dev)
102 int qos, queues_per_port;
104 int total_remaining = 0;
106 struct octeon_ethernet *priv = netdev_priv(dev);
108 queues_per_port = cvmx_pko_get_num_queues(priv->port);
109 /* Drain any pending packets in the free list */
110 for (qos = 0; qos < queues_per_port; qos++) {
111 if (skb_queue_len(&priv->tx_free_list[qos]) == 0)
113 skb_to_free = cvmx_fau_fetch_and_add32(priv->fau+qos*4,
115 skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
119 total_freed += skb_to_free;
120 if (skb_to_free > 0) {
121 struct sk_buff *to_free_list = NULL;
122 spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
123 while (skb_to_free > 0) {
125 t = __skb_dequeue(&priv->tx_free_list[qos]);
126 t->next = to_free_list;
130 spin_unlock_irqrestore(&priv->tx_free_list[qos].lock,
132 /* Do the actual freeing outside of the lock. */
133 while (to_free_list) {
134 struct sk_buff *t = to_free_list;
135 to_free_list = to_free_list->next;
136 dev_kfree_skb_any(t);
139 total_remaining += skb_queue_len(&priv->tx_free_list[qos]);
141 if (total_freed >= 0 && netif_queue_stopped(dev))
142 netif_wake_queue(dev);
144 cvm_oct_kick_tx_poll_watchdog();
148 * cvm_oct_xmit - transmit a packet
149 * @skb: Packet to send
150 * @dev: Device info structure
152 * Returns Always returns NETDEV_TX_OK
154 int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
156 cvmx_pko_command_word0_t pko_command;
157 union cvmx_buf_ptr hw_buffer;
158 uint64_t old_scratch;
159 uint64_t old_scratch2;
162 enum {QUEUE_CORE, QUEUE_HW, QUEUE_DROP} queue_type;
163 struct octeon_ethernet *priv = netdev_priv(dev);
164 struct sk_buff *to_free_list;
166 int32_t buffers_to_free;
169 #if REUSE_SKBUFFS_WITHOUT_FREE
170 unsigned char *fpa_head;
174 * Prefetch the private data structure. It is larger than the
180 * The check on CVMX_PKO_QUEUES_PER_PORT_* is designed to
181 * completely remove "qos" in the event neither interface
182 * supports multiple queues per port.
184 if ((CVMX_PKO_QUEUES_PER_PORT_INTERFACE0 > 1) ||
185 (CVMX_PKO_QUEUES_PER_PORT_INTERFACE1 > 1)) {
186 qos = GET_SKBUFF_QOS(skb);
189 else if (qos >= cvmx_pko_get_num_queues(priv->port))
194 if (USE_ASYNC_IOBDMA) {
195 /* Save scratch in case userspace is using it */
197 old_scratch = cvmx_scratch_read64(CVMX_SCR_SCRATCH);
198 old_scratch2 = cvmx_scratch_read64(CVMX_SCR_SCRATCH + 8);
201 * Fetch and increment the number of packets to be
204 cvmx_fau_async_fetch_and_add32(CVMX_SCR_SCRATCH + 8,
205 FAU_NUM_PACKET_BUFFERS_TO_FREE,
207 cvmx_fau_async_fetch_and_add32(CVMX_SCR_SCRATCH,
213 * We have space for 6 segment pointers, If there will be more
214 * than that, we must linearize.
216 if (unlikely(skb_shinfo(skb)->nr_frags > 5)) {
217 if (unlikely(__skb_linearize(skb))) {
218 queue_type = QUEUE_DROP;
219 if (USE_ASYNC_IOBDMA) {
221 * Get the number of skbuffs in use
226 cvmx_scratch_read64(CVMX_SCR_SCRATCH);
229 * Get the number of skbuffs in use
232 skb_to_free = cvmx_fau_fetch_and_add32(
233 priv->fau + qos * 4, MAX_SKB_TO_FREE);
235 skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free,
236 priv->fau + qos * 4);
237 spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
243 * The CN3XXX series of parts has an errata (GMX-401) which
244 * causes the GMX block to hang if a collision occurs towards
245 * the end of a <68 byte packet. As a workaround for this, we
246 * pad packets to be 68 bytes whenever we are in half duplex
247 * mode. We don't handle the case of having a small packet but
248 * no room to add the padding. The kernel should always give
249 * us at least a cache line
251 if ((skb->len < 64) && OCTEON_IS_MODEL(OCTEON_CN3XXX)) {
252 union cvmx_gmxx_prtx_cfg gmx_prt_cfg;
253 int interface = INTERFACE(priv->port);
254 int index = INDEX(priv->port);
257 /* We only need to pad packet in half duplex mode */
259 cvmx_read_csr(CVMX_GMXX_PRTX_CFG(index, interface));
260 if (gmx_prt_cfg.s.duplex == 0) {
261 int add_bytes = 64 - skb->len;
262 if ((skb_tail_pointer(skb) + add_bytes) <=
263 skb_end_pointer(skb))
264 memset(__skb_put(skb, add_bytes), 0,
270 /* Build the PKO command */
272 pko_command.s.n2 = 1; /* Don't pollute L2 with the outgoing packet */
273 pko_command.s.segs = 1;
274 pko_command.s.total_bytes = skb->len;
275 pko_command.s.size0 = CVMX_FAU_OP_SIZE_32;
276 pko_command.s.subone0 = 1;
278 pko_command.s.dontfree = 1;
280 /* Build the PKO buffer pointer */
282 if (skb_shinfo(skb)->nr_frags == 0) {
283 hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data);
284 hw_buffer.s.pool = 0;
285 hw_buffer.s.size = skb->len;
287 hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)skb->data);
288 hw_buffer.s.pool = 0;
289 hw_buffer.s.size = skb_headlen(skb);
290 CVM_OCT_SKB_CB(skb)[0] = hw_buffer.u64;
291 for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
292 struct skb_frag_struct *fs = skb_shinfo(skb)->frags + i;
293 hw_buffer.s.addr = XKPHYS_TO_PHYS(
294 (u64)(page_address(fs->page.p) +
296 hw_buffer.s.size = fs->size;
297 CVM_OCT_SKB_CB(skb)[i + 1] = hw_buffer.u64;
299 hw_buffer.s.addr = XKPHYS_TO_PHYS((u64)CVM_OCT_SKB_CB(skb));
300 hw_buffer.s.size = skb_shinfo(skb)->nr_frags + 1;
301 pko_command.s.segs = skb_shinfo(skb)->nr_frags + 1;
302 pko_command.s.gather = 1;
303 goto dont_put_skbuff_in_hw;
307 * See if we can put this skb in the FPA pool. Any strange
308 * behavior from the Linux networking stack will most likely
309 * be caused by a bug in the following code. If some field is
310 * in use by the network stack and gets carried over when a
311 * buffer is reused, bad things may happen. If in doubt and
312 * you dont need the absolute best performance, disable the
313 * define REUSE_SKBUFFS_WITHOUT_FREE. The reuse of buffers has
314 * shown a 25% increase in performance under some loads.
316 #if REUSE_SKBUFFS_WITHOUT_FREE
317 fpa_head = skb->head + 256 - ((unsigned long)skb->head & 0x7f);
318 if (unlikely(skb->data < fpa_head)) {
320 * printk("TX buffer beginning can't meet FPA
321 * alignment constraints\n");
323 goto dont_put_skbuff_in_hw;
326 ((skb_end_pointer(skb) - fpa_head) < CVMX_FPA_PACKET_POOL_SIZE)) {
328 printk("TX buffer isn't large enough for the FPA\n");
330 goto dont_put_skbuff_in_hw;
332 if (unlikely(skb_shared(skb))) {
334 printk("TX buffer sharing data with someone else\n");
336 goto dont_put_skbuff_in_hw;
338 if (unlikely(skb_cloned(skb))) {
340 printk("TX buffer has been cloned\n");
342 goto dont_put_skbuff_in_hw;
344 if (unlikely(skb_header_cloned(skb))) {
346 printk("TX buffer header has been cloned\n");
348 goto dont_put_skbuff_in_hw;
350 if (unlikely(skb->destructor)) {
352 printk("TX buffer has a destructor\n");
354 goto dont_put_skbuff_in_hw;
356 if (unlikely(skb_shinfo(skb)->nr_frags)) {
358 printk("TX buffer has fragments\n");
360 goto dont_put_skbuff_in_hw;
364 sizeof(*skb) + skb_end_offset(skb))) {
366 printk("TX buffer truesize has been changed\n");
368 goto dont_put_skbuff_in_hw;
372 * We can use this buffer in the FPA. We don't need the FAU
375 pko_command.s.dontfree = 0;
377 hw_buffer.s.back = ((unsigned long)skb->data >> 7) -
378 ((unsigned long)fpa_head >> 7);
380 *(struct sk_buff **)(fpa_head - sizeof(void *)) = skb;
383 * The skbuff will be reused without ever being freed. We must
384 * cleanup a bunch of core things.
386 dst_release(skb_dst(skb));
387 skb_dst_set(skb, NULL);
389 secpath_put(skb->sp);
394 #ifdef CONFIG_NET_SCHED
396 #ifdef CONFIG_NET_CLS_ACT
398 #endif /* CONFIG_NET_CLS_ACT */
399 #endif /* CONFIG_NET_SCHED */
400 #endif /* REUSE_SKBUFFS_WITHOUT_FREE */
402 dont_put_skbuff_in_hw:
404 /* Check if we can use the hardware checksumming */
405 if (USE_HW_TCPUDP_CHECKSUM && (skb->protocol == htons(ETH_P_IP)) &&
406 (ip_hdr(skb)->version == 4) && (ip_hdr(skb)->ihl == 5) &&
407 ((ip_hdr(skb)->frag_off == 0) || (ip_hdr(skb)->frag_off == 1 << 14))
408 && ((ip_hdr(skb)->protocol == IPPROTO_TCP)
409 || (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
410 /* Use hardware checksum calc */
411 pko_command.s.ipoffp1 = sizeof(struct ethhdr) + 1;
414 if (USE_ASYNC_IOBDMA) {
415 /* Get the number of skbuffs in use by the hardware */
417 skb_to_free = cvmx_scratch_read64(CVMX_SCR_SCRATCH);
418 buffers_to_free = cvmx_scratch_read64(CVMX_SCR_SCRATCH + 8);
420 /* Get the number of skbuffs in use by the hardware */
421 skb_to_free = cvmx_fau_fetch_and_add32(priv->fau + qos * 4,
424 cvmx_fau_fetch_and_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, 0);
427 skb_to_free = cvm_oct_adjust_skb_to_free(skb_to_free, priv->fau+qos*4);
430 * If we're sending faster than the receive can free them then
431 * don't do the HW free.
433 if ((buffers_to_free < -100) && !pko_command.s.dontfree)
434 pko_command.s.dontfree = 1;
436 if (pko_command.s.dontfree) {
437 queue_type = QUEUE_CORE;
438 pko_command.s.reg0 = priv->fau+qos*4;
440 queue_type = QUEUE_HW;
442 if (USE_ASYNC_IOBDMA)
443 cvmx_fau_async_fetch_and_add32(
444 CVMX_SCR_SCRATCH, FAU_TOTAL_TX_TO_CLEAN, 1);
446 spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
448 /* Drop this packet if we have too many already queued to the HW */
449 if (unlikely(skb_queue_len(&priv->tx_free_list[qos]) >=
450 MAX_OUT_QUEUE_DEPTH)) {
452 if (dev->tx_queue_len != 0) {
453 /* Drop the lock when notifying the core. */
454 spin_unlock_irqrestore(&priv->tx_free_list[qos].lock,
456 netif_stop_queue(dev);
457 spin_lock_irqsave(&priv->tx_free_list[qos].lock,
460 /* If not using normal queueing. */
461 queue_type = QUEUE_DROP;
466 cvmx_pko_send_packet_prepare(priv->port, priv->queue + qos,
469 /* Send the packet to the output queue */
470 if (unlikely(cvmx_pko_send_packet_finish(priv->port,
472 pko_command, hw_buffer,
473 CVMX_PKO_LOCK_NONE))) {
474 printk_ratelimited("%s: Failed to send the packet\n",
476 queue_type = QUEUE_DROP;
481 switch (queue_type) {
483 skb->next = to_free_list;
485 priv->stats.tx_dropped++;
488 cvmx_fau_atomic_add32(FAU_NUM_PACKET_BUFFERS_TO_FREE, -1);
491 __skb_queue_tail(&priv->tx_free_list[qos], skb);
497 while (skb_to_free > 0) {
498 struct sk_buff *t = __skb_dequeue(&priv->tx_free_list[qos]);
499 t->next = to_free_list;
504 spin_unlock_irqrestore(&priv->tx_free_list[qos].lock, flags);
506 /* Do the actual freeing outside of the lock. */
507 while (to_free_list) {
508 struct sk_buff *t = to_free_list;
509 to_free_list = to_free_list->next;
510 dev_kfree_skb_any(t);
513 if (USE_ASYNC_IOBDMA) {
515 total_to_clean = cvmx_scratch_read64(CVMX_SCR_SCRATCH);
516 /* Restore the scratch area */
517 cvmx_scratch_write64(CVMX_SCR_SCRATCH, old_scratch);
518 cvmx_scratch_write64(CVMX_SCR_SCRATCH + 8, old_scratch2);
520 total_to_clean = cvmx_fau_fetch_and_add32(
521 FAU_TOTAL_TX_TO_CLEAN, 1);
524 if (total_to_clean & 0x3ff) {
526 * Schedule the cleanup tasklet every 1024 packets for
527 * the pathological case of high traffic on one port
528 * delaying clean up of packets on a different port
529 * that is blocked waiting for the cleanup.
531 tasklet_schedule(&cvm_oct_tx_cleanup_tasklet);
534 cvm_oct_kick_tx_poll_watchdog();
540 * cvm_oct_xmit_pow - transmit a packet to the POW
541 * @skb: Packet to send
542 * @dev: Device info structure
544 * Returns Always returns zero
546 int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
548 struct octeon_ethernet *priv = netdev_priv(dev);
552 /* Get a work queue entry */
553 cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
554 if (unlikely(work == NULL)) {
555 printk_ratelimited("%s: Failed to allocate a work queue entry\n",
557 priv->stats.tx_dropped++;
562 /* Get a packet buffer */
563 packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL);
564 if (unlikely(packet_buffer == NULL)) {
565 printk_ratelimited("%s: Failed to allocate a packet buffer\n",
567 cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1));
568 priv->stats.tx_dropped++;
574 * Calculate where we need to copy the data to. We need to
575 * leave 8 bytes for a next pointer (unused). We also need to
576 * include any configure skip. Then we need to align the IP
577 * packet src and dest into the same 64bit word. The below
578 * calculation may add a little extra, but that doesn't
581 copy_location = packet_buffer + sizeof(uint64_t);
582 copy_location += ((CVMX_HELPER_FIRST_MBUFF_SKIP + 7) & 0xfff8) + 6;
585 * We have to copy the packet since whoever processes this
586 * packet will free it to a hardware pool. We can't use the
587 * trick of counting outstanding packets like in
590 memcpy(copy_location, skb->data, skb->len);
593 * Fill in some of the work queue fields. We may need to add
594 * more if the software at the other end needs them.
596 work->hw_chksum = skb->csum;
597 work->len = skb->len;
598 work->ipprt = priv->port;
599 work->qos = priv->port & 0x7;
600 work->grp = pow_send_group;
601 work->tag_type = CVMX_HELPER_INPUT_TAG_TYPE;
602 work->tag = pow_send_group; /* FIXME */
603 /* Default to zero. Sets of zero later are commented out */
605 work->word2.s.bufs = 1;
606 work->packet_ptr.u64 = 0;
607 work->packet_ptr.s.addr = cvmx_ptr_to_phys(copy_location);
608 work->packet_ptr.s.pool = CVMX_FPA_PACKET_POOL;
609 work->packet_ptr.s.size = CVMX_FPA_PACKET_POOL_SIZE;
610 work->packet_ptr.s.back = (copy_location - packet_buffer) >> 7;
612 if (skb->protocol == htons(ETH_P_IP)) {
613 work->word2.s.ip_offset = 14;
615 work->word2.s.vlan_valid = 0; /* FIXME */
616 work->word2.s.vlan_cfi = 0; /* FIXME */
617 work->word2.s.vlan_id = 0; /* FIXME */
618 work->word2.s.dec_ipcomp = 0; /* FIXME */
620 work->word2.s.tcp_or_udp =
621 (ip_hdr(skb)->protocol == IPPROTO_TCP)
622 || (ip_hdr(skb)->protocol == IPPROTO_UDP);
625 work->word2.s.dec_ipsec = 0;
626 /* We only support IPv4 right now */
627 work->word2.s.is_v6 = 0;
628 /* Hardware would set to zero */
629 work->word2.s.software = 0;
630 /* No error, packet is internal */
631 work->word2.s.L4_error = 0;
633 work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0)
634 || (ip_hdr(skb)->frag_off ==
637 /* Assume Linux is sending a good packet */
638 work->word2.s.IP_exc = 0;
640 work->word2.s.is_bcast = (skb->pkt_type == PACKET_BROADCAST);
641 work->word2.s.is_mcast = (skb->pkt_type == PACKET_MULTICAST);
643 /* This is an IP packet */
644 work->word2.s.not_IP = 0;
645 /* No error, packet is internal */
646 work->word2.s.rcv_error = 0;
647 /* No error, packet is internal */
648 work->word2.s.err_code = 0;
652 * When copying the data, include 4 bytes of the
653 * ethernet header to align the same way hardware
656 memcpy(work->packet_data, skb->data + 10,
657 sizeof(work->packet_data));
660 work->word2.snoip.vlan_valid = 0; /* FIXME */
661 work->word2.snoip.vlan_cfi = 0; /* FIXME */
662 work->word2.snoip.vlan_id = 0; /* FIXME */
663 work->word2.snoip.software = 0; /* Hardware would set to zero */
665 work->word2.snoip.is_rarp = skb->protocol == htons(ETH_P_RARP);
666 work->word2.snoip.is_arp = skb->protocol == htons(ETH_P_ARP);
667 work->word2.snoip.is_bcast =
668 (skb->pkt_type == PACKET_BROADCAST);
669 work->word2.snoip.is_mcast =
670 (skb->pkt_type == PACKET_MULTICAST);
671 work->word2.snoip.not_IP = 1; /* IP was done up above */
673 /* No error, packet is internal */
674 work->word2.snoip.rcv_error = 0;
675 /* No error, packet is internal */
676 work->word2.snoip.err_code = 0;
678 memcpy(work->packet_data, skb->data, sizeof(work->packet_data));
681 /* Submit the packet to the POW */
682 cvmx_pow_work_submit(work, work->tag, work->tag_type, work->qos,
684 priv->stats.tx_packets++;
685 priv->stats.tx_bytes += skb->len;
691 * cvm_oct_tx_shutdown_dev - free all skb that are currently queued for TX.
692 * @dev: Device being shutdown
695 void cvm_oct_tx_shutdown_dev(struct net_device *dev)
697 struct octeon_ethernet *priv = netdev_priv(dev);
701 for (qos = 0; qos < 16; qos++) {
702 spin_lock_irqsave(&priv->tx_free_list[qos].lock, flags);
703 while (skb_queue_len(&priv->tx_free_list[qos]))
704 dev_kfree_skb_any(__skb_dequeue
705 (&priv->tx_free_list[qos]));
706 spin_unlock_irqrestore(&priv->tx_free_list[qos].lock, flags);
710 static void cvm_oct_tx_do_cleanup(unsigned long arg)
714 for (port = 0; port < TOTAL_NUMBER_OF_PORTS; port++) {
715 if (cvm_oct_device[port]) {
716 struct net_device *dev = cvm_oct_device[port];
717 cvm_oct_free_tx_skbs(dev);
722 static irqreturn_t cvm_oct_tx_cleanup_watchdog(int cpl, void *dev_id)
724 /* Disable the interrupt. */
725 cvmx_write_csr(CVMX_CIU_TIMX(1), 0);
726 /* Do the work in the tasklet. */
727 tasklet_schedule(&cvm_oct_tx_cleanup_tasklet);
731 void cvm_oct_tx_initialize(void)
735 /* Disable the interrupt. */
736 cvmx_write_csr(CVMX_CIU_TIMX(1), 0);
737 /* Register an IRQ handler to receive CIU_TIMX(1) interrupts */
738 i = request_irq(OCTEON_IRQ_TIMER1,
739 cvm_oct_tx_cleanup_watchdog, 0,
740 "Ethernet", cvm_oct_device);
743 panic("Could not acquire Ethernet IRQ %d\n", OCTEON_IRQ_TIMER1);
746 void cvm_oct_tx_shutdown(void)
748 /* Free the interrupt handler */
749 free_irq(OCTEON_IRQ_TIMER1, cvm_oct_device);