#include <linux/kernel.h>
#include <linux/ethtool.h>
#include <linux/phy.h>
+#include <linux/ratelimit.h>
#include <net/dst.h>
if (priv->last_link) {
netif_carrier_on(dev);
if (priv->queue != -1)
- DEBUGPRINT("%s: %u Mbps %s duplex, "
- "port %2d, queue %2d\n",
- dev->name, priv->phydev->speed,
- priv->phydev->duplex ?
- "Full" : "Half",
- priv->port, priv->queue);
+ printk_ratelimited("%s: %u Mbps %s duplex, "
+ "port %2d, queue %2d\n",
+ dev->name, priv->phydev->speed,
+ priv->phydev->duplex ?
+ "Full" : "Half",
+ priv->port, priv->queue);
else
- DEBUGPRINT("%s: %u Mbps %s duplex, "
- "port %2d, POW\n",
- dev->name, priv->phydev->speed,
- priv->phydev->duplex ?
- "Full" : "Half",
- priv->port);
+ printk_ratelimited("%s: %u Mbps %s duplex, "
+ "port %2d, POW\n",
+ dev->name, priv->phydev->speed,
+ priv->phydev->duplex ?
+ "Full" : "Half",
+ priv->port);
} else {
netif_carrier_off(dev);
- DEBUGPRINT("%s: Link down\n", dev->name);
+ printk_ratelimited("%s: Link down\n", dev->name);
}
}
}
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/phy.h>
+#include <linux/ratelimit.h>
#include <net/dst.h>
#include <asm/octeon/octeon.h>
cvmx_write_csr(CVMX_GMXX_RXX_INT_REG
(index, interface),
gmxx_rxx_int_reg.u64);
- DEBUGPRINT("%s: Using 10Mbps with software "
- "preamble removal\n",
- dev->name);
+ printk_ratelimited("%s: Using 10Mbps with software "
+ "preamble removal\n",
+ dev->name);
}
}
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
if (priv->queue != -1)
- DEBUGPRINT("%s: %u Mbps %s duplex, "
- "port %2d, queue %2d\n",
- dev->name, link_info.s.speed,
- (link_info.s.full_duplex) ?
- "Full" : "Half",
- priv->port, priv->queue);
+ printk_ratelimited("%s: %u Mbps %s duplex, "
+ "port %2d, queue %2d\n",
+ dev->name, link_info.s.speed,
+ (link_info.s.full_duplex) ?
+ "Full" : "Half",
+ priv->port, priv->queue);
else
- DEBUGPRINT("%s: %u Mbps %s duplex, "
- "port %2d, POW\n",
- dev->name, link_info.s.speed,
- (link_info.s.full_duplex) ?
- "Full" : "Half",
- priv->port);
+ printk_ratelimited("%s: %u Mbps %s duplex, "
+ "port %2d, POW\n",
+ dev->name, link_info.s.speed,
+ (link_info.s.full_duplex) ?
+ "Full" : "Half",
+ priv->port);
} else {
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
- DEBUGPRINT("%s: Link down\n", dev->name);
+ printk_ratelimited("%s: Link down\n", dev->name);
}
}
}
#include <linux/ip.h>
#include <linux/string.h>
#include <linux/prefetch.h>
+#include <linux/ratelimit.h>
#include <linux/smp.h>
#include <net/dst.h>
#ifdef CONFIG_XFRM
if (*ptr == 0xd5) {
/*
- DEBUGPRINT("Port %d received 0xd5 preamble\n", work->ipprt);
+ printk_ratelimited("Port %d received 0xd5 preamble\n", work->ipprt);
*/
work->packet_ptr.s.addr += i + 1;
work->len -= i + 5;
} else if ((*ptr & 0xf) == 0xd) {
/*
- DEBUGPRINT("Port %d received 0x?d preamble\n", work->ipprt);
+ printk_ratelimited("Port %d received 0x?d preamble\n", work->ipprt);
*/
work->packet_ptr.s.addr += i;
work->len -= i + 4;
ptr++;
}
} else {
- DEBUGPRINT("Port %d unknown preamble, packet "
- "dropped\n",
- work->ipprt);
+ printk_ratelimited("Port %d unknown preamble, packet "
+ "dropped\n",
+ work->ipprt);
/*
cvmx_helper_dump_packet(work);
*/
}
}
} else {
- DEBUGPRINT("Port %d receive error code %d, packet dropped\n",
- work->ipprt, work->word2.snoip.err_code);
+ printk_ratelimited("Port %d receive error code %d, packet dropped\n",
+ work->ipprt, work->word2.snoip.err_code);
cvm_oct_free_work(work);
return 1;
}
*/
skb = dev_alloc_skb(work->len);
if (!skb) {
- DEBUGPRINT("Port %d failed to allocate skbuff, packet dropped\n",
- work->ipprt);
+ printk_ratelimited("Port %d failed to allocate "
+ "skbuff, packet dropped\n",
+ work->ipprt);
cvm_oct_free_work(work);
continue;
}
} else {
/* Drop any packet received for a device that isn't up */
/*
- DEBUGPRINT("%s: Device not up, packet dropped\n",
+ printk_ratelimited("%s: Device not up, packet dropped\n",
dev->name);
*/
#ifdef CONFIG_64BIT
* Drop any packet received for a device that
* doesn't exist.
*/
- DEBUGPRINT("Port %d not controlled by Linux, packet dropped\n",
+ printk_ratelimited("Port %d not controlled by Linux, packet dropped\n",
work->ipprt);
dev_kfree_skb_irq(skb);
}
**********************************************************************/
#include <linux/kernel.h>
#include <linux/netdevice.h>
+#include <linux/ratelimit.h>
#include <net/dst.h>
#include <asm/octeon/octeon.h>
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
if (priv->queue != -1)
- DEBUGPRINT
+ printk_ratelimited
("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
dev->name, link_info.s.speed,
(link_info.s.full_duplex) ? "Full" : "Half",
priv->port, priv->queue);
else
- DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n",
- dev->name, link_info.s.speed,
- (link_info.s.full_duplex) ? "Full" : "Half",
- priv->port);
+ printk_ratelimited
+ ("%s: %u Mbps %s duplex, port %2d, POW\n",
+ dev->name, link_info.s.speed,
+ (link_info.s.full_duplex) ? "Full" : "Half",
+ priv->port);
} else {
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
- DEBUGPRINT("%s: Link down\n", dev->name);
+ printk_ratelimited("%s: Link down\n", dev->name);
}
}
#include <linux/init.h>
#include <linux/etherdevice.h>
#include <linux/ip.h>
+#include <linux/ratelimit.h>
#include <linux/string.h>
#include <net/dst.h>
#ifdef CONFIG_XFRM
priv->queue + qos,
pko_command, hw_buffer,
CVMX_PKO_LOCK_NONE))) {
- DEBUGPRINT("%s: Failed to send the packet\n", dev->name);
+ printk_ratelimited("%s: Failed to send the packet\n", dev->name);
queue_type = QUEUE_DROP;
}
skip_xmit:
/* Get a work queue entry */
cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
if (unlikely(work == NULL)) {
- DEBUGPRINT("%s: Failed to allocate a work queue entry\n",
- dev->name);
+ printk_ratelimited("%s: Failed to allocate a work "
+ "queue entry\n", dev->name);
priv->stats.tx_dropped++;
dev_kfree_skb(skb);
return 0;
/* Get a packet buffer */
packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL);
if (unlikely(packet_buffer == NULL)) {
- DEBUGPRINT("%s: Failed to allocate a packet buffer\n",
- dev->name);
+ printk_ratelimited("%s: Failed to allocate a packet buffer\n",
+ dev->name);
cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1));
priv->stats.tx_dropped++;
dev_kfree_skb(skb);
* Contact Cavium Networks for more information
*********************************************************************/
-#define DEBUGPRINT(format, ...) do { if (printk_ratelimit()) \
- printk(format, ##__VA_ARGS__); \
- } while (0)
-
/**
* cvm_oct_get_buffer_ptr - convert packet data address to pointer
* @packet_ptr: Packet data hardware address
**********************************************************************/
#include <linux/kernel.h>
#include <linux/netdevice.h>
+#include <linux/ratelimit.h>
#include <net/dst.h>
#include <asm/octeon/octeon.h>
if (!netif_carrier_ok(dev))
netif_carrier_on(dev);
if (priv->queue != -1)
- DEBUGPRINT
- ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
- dev->name, link_info.s.speed,
- (link_info.s.full_duplex) ? "Full" : "Half",
- priv->port, priv->queue);
+ printk_ratelimited
+ ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
+ dev->name, link_info.s.speed,
+ (link_info.s.full_duplex) ? "Full" : "Half",
+ priv->port, priv->queue);
else
- DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n",
- dev->name, link_info.s.speed,
- (link_info.s.full_duplex) ? "Full" : "Half",
- priv->port);
+ printk_ratelimited
+ ("%s: %u Mbps %s duplex, port %2d, POW\n",
+ dev->name, link_info.s.speed,
+ (link_info.s.full_duplex) ? "Full" : "Half",
+ priv->port);
} else {
if (netif_carrier_ok(dev))
netif_carrier_off(dev);
- DEBUGPRINT("%s: Link down\n", dev->name);
+ printk_ratelimited("%s: Link down\n", dev->name);
}
}