Commit 7a2eaf93 authored by Christian Dietrich's avatar Christian Dietrich Committed by Greg Kroah-Hartman

staging: octeon: use printk_ratelimited instead of printk_ratelimit

As per printk_ratelimit comment, it should not be used
Signed-off-by: default avatarChristian Dietrich <christian.dietrich@informatik.uni-erlangen.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9d17653c
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/ethtool.h> #include <linux/ethtool.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/ratelimit.h>
#include <net/dst.h> #include <net/dst.h>
...@@ -129,22 +130,22 @@ static void cvm_oct_adjust_link(struct net_device *dev) ...@@ -129,22 +130,22 @@ static void cvm_oct_adjust_link(struct net_device *dev)
if (priv->last_link) { if (priv->last_link) {
netif_carrier_on(dev); netif_carrier_on(dev);
if (priv->queue != -1) if (priv->queue != -1)
DEBUGPRINT("%s: %u Mbps %s duplex, " printk_ratelimited("%s: %u Mbps %s duplex, "
"port %2d, queue %2d\n", "port %2d, queue %2d\n",
dev->name, priv->phydev->speed, dev->name, priv->phydev->speed,
priv->phydev->duplex ? priv->phydev->duplex ?
"Full" : "Half", "Full" : "Half",
priv->port, priv->queue); priv->port, priv->queue);
else else
DEBUGPRINT("%s: %u Mbps %s duplex, " printk_ratelimited("%s: %u Mbps %s duplex, "
"port %2d, POW\n", "port %2d, POW\n",
dev->name, priv->phydev->speed, dev->name, priv->phydev->speed,
priv->phydev->duplex ? priv->phydev->duplex ?
"Full" : "Half", "Full" : "Half",
priv->port); priv->port);
} else { } else {
netif_carrier_off(dev); netif_carrier_off(dev);
DEBUGPRINT("%s: Link down\n", dev->name); printk_ratelimited("%s: Link down\n", dev->name);
} }
} }
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/phy.h> #include <linux/phy.h>
#include <linux/ratelimit.h>
#include <net/dst.h> #include <net/dst.h>
#include <asm/octeon/octeon.h> #include <asm/octeon/octeon.h>
...@@ -116,9 +117,9 @@ static void cvm_oct_rgmii_poll(struct net_device *dev) ...@@ -116,9 +117,9 @@ static void cvm_oct_rgmii_poll(struct net_device *dev)
cvmx_write_csr(CVMX_GMXX_RXX_INT_REG cvmx_write_csr(CVMX_GMXX_RXX_INT_REG
(index, interface), (index, interface),
gmxx_rxx_int_reg.u64); gmxx_rxx_int_reg.u64);
DEBUGPRINT("%s: Using 10Mbps with software " printk_ratelimited("%s: Using 10Mbps with software "
"preamble removal\n", "preamble removal\n",
dev->name); dev->name);
} }
} }
...@@ -174,23 +175,23 @@ static void cvm_oct_rgmii_poll(struct net_device *dev) ...@@ -174,23 +175,23 @@ static void cvm_oct_rgmii_poll(struct net_device *dev)
if (!netif_carrier_ok(dev)) if (!netif_carrier_ok(dev))
netif_carrier_on(dev); netif_carrier_on(dev);
if (priv->queue != -1) if (priv->queue != -1)
DEBUGPRINT("%s: %u Mbps %s duplex, " printk_ratelimited("%s: %u Mbps %s duplex, "
"port %2d, queue %2d\n", "port %2d, queue %2d\n",
dev->name, link_info.s.speed, dev->name, link_info.s.speed,
(link_info.s.full_duplex) ? (link_info.s.full_duplex) ?
"Full" : "Half", "Full" : "Half",
priv->port, priv->queue); priv->port, priv->queue);
else else
DEBUGPRINT("%s: %u Mbps %s duplex, " printk_ratelimited("%s: %u Mbps %s duplex, "
"port %2d, POW\n", "port %2d, POW\n",
dev->name, link_info.s.speed, dev->name, link_info.s.speed,
(link_info.s.full_duplex) ? (link_info.s.full_duplex) ?
"Full" : "Half", "Full" : "Half",
priv->port); priv->port);
} else { } else {
if (netif_carrier_ok(dev)) if (netif_carrier_ok(dev))
netif_carrier_off(dev); netif_carrier_off(dev);
DEBUGPRINT("%s: Link down\n", dev->name); printk_ratelimited("%s: Link down\n", dev->name);
} }
} }
} }
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <linux/ip.h> #include <linux/ip.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/prefetch.h> #include <linux/prefetch.h>
#include <linux/ratelimit.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <net/dst.h> #include <net/dst.h>
#ifdef CONFIG_XFRM #ifdef CONFIG_XFRM
...@@ -186,13 +187,13 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work) ...@@ -186,13 +187,13 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
if (*ptr == 0xd5) { 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->packet_ptr.s.addr += i + 1;
work->len -= i + 5; work->len -= i + 5;
} else if ((*ptr & 0xf) == 0xd) { } 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->packet_ptr.s.addr += i;
work->len -= i + 4; work->len -= i + 4;
...@@ -203,9 +204,9 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work) ...@@ -203,9 +204,9 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
ptr++; ptr++;
} }
} else { } else {
DEBUGPRINT("Port %d unknown preamble, packet " printk_ratelimited("Port %d unknown preamble, packet "
"dropped\n", "dropped\n",
work->ipprt); work->ipprt);
/* /*
cvmx_helper_dump_packet(work); cvmx_helper_dump_packet(work);
*/ */
...@@ -214,8 +215,8 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work) ...@@ -214,8 +215,8 @@ static inline int cvm_oct_check_rcv_error(cvmx_wqe_t *work)
} }
} }
} else { } else {
DEBUGPRINT("Port %d receive error code %d, packet dropped\n", printk_ratelimited("Port %d receive error code %d, packet dropped\n",
work->ipprt, work->word2.snoip.err_code); work->ipprt, work->word2.snoip.err_code);
cvm_oct_free_work(work); cvm_oct_free_work(work);
return 1; return 1;
} }
...@@ -334,8 +335,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) ...@@ -334,8 +335,9 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
*/ */
skb = dev_alloc_skb(work->len); skb = dev_alloc_skb(work->len);
if (!skb) { if (!skb) {
DEBUGPRINT("Port %d failed to allocate skbuff, packet dropped\n", printk_ratelimited("Port %d failed to allocate "
work->ipprt); "skbuff, packet dropped\n",
work->ipprt);
cvm_oct_free_work(work); cvm_oct_free_work(work);
continue; continue;
} }
...@@ -429,7 +431,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) ...@@ -429,7 +431,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
} else { } else {
/* Drop any packet received for a device that isn't up */ /* 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); dev->name);
*/ */
#ifdef CONFIG_64BIT #ifdef CONFIG_64BIT
...@@ -444,7 +446,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget) ...@@ -444,7 +446,7 @@ static int cvm_oct_napi_poll(struct napi_struct *napi, int budget)
* Drop any packet received for a device that * Drop any packet received for a device that
* doesn't exist. * 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); work->ipprt);
dev_kfree_skb_irq(skb); dev_kfree_skb_irq(skb);
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
**********************************************************************/ **********************************************************************/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/ratelimit.h>
#include <net/dst.h> #include <net/dst.h>
#include <asm/octeon/octeon.h> #include <asm/octeon/octeon.h>
...@@ -90,20 +91,21 @@ static void cvm_oct_sgmii_poll(struct net_device *dev) ...@@ -90,20 +91,21 @@ static void cvm_oct_sgmii_poll(struct net_device *dev)
if (!netif_carrier_ok(dev)) if (!netif_carrier_ok(dev))
netif_carrier_on(dev); netif_carrier_on(dev);
if (priv->queue != -1) if (priv->queue != -1)
DEBUGPRINT printk_ratelimited
("%s: %u Mbps %s duplex, port %2d, queue %2d\n", ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
dev->name, link_info.s.speed, dev->name, link_info.s.speed,
(link_info.s.full_duplex) ? "Full" : "Half", (link_info.s.full_duplex) ? "Full" : "Half",
priv->port, priv->queue); priv->port, priv->queue);
else else
DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", printk_ratelimited
dev->name, link_info.s.speed, ("%s: %u Mbps %s duplex, port %2d, POW\n",
(link_info.s.full_duplex) ? "Full" : "Half", dev->name, link_info.s.speed,
priv->port); (link_info.s.full_duplex) ? "Full" : "Half",
priv->port);
} else { } else {
if (netif_carrier_ok(dev)) if (netif_carrier_ok(dev))
netif_carrier_off(dev); netif_carrier_off(dev);
DEBUGPRINT("%s: Link down\n", dev->name); printk_ratelimited("%s: Link down\n", dev->name);
} }
} }
......
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/ip.h> #include <linux/ip.h>
#include <linux/ratelimit.h>
#include <linux/string.h> #include <linux/string.h>
#include <net/dst.h> #include <net/dst.h>
#ifdef CONFIG_XFRM #ifdef CONFIG_XFRM
...@@ -446,7 +447,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -446,7 +447,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
priv->queue + qos, priv->queue + qos,
pko_command, hw_buffer, pko_command, hw_buffer,
CVMX_PKO_LOCK_NONE))) { 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; queue_type = QUEUE_DROP;
} }
skip_xmit: skip_xmit:
...@@ -525,8 +526,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) ...@@ -525,8 +526,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
/* Get a work queue entry */ /* Get a work queue entry */
cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL); cvmx_wqe_t *work = cvmx_fpa_alloc(CVMX_FPA_WQE_POOL);
if (unlikely(work == NULL)) { if (unlikely(work == NULL)) {
DEBUGPRINT("%s: Failed to allocate a work queue entry\n", printk_ratelimited("%s: Failed to allocate a work "
dev->name); "queue entry\n", dev->name);
priv->stats.tx_dropped++; priv->stats.tx_dropped++;
dev_kfree_skb(skb); dev_kfree_skb(skb);
return 0; return 0;
...@@ -535,8 +536,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev) ...@@ -535,8 +536,8 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
/* Get a packet buffer */ /* Get a packet buffer */
packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL); packet_buffer = cvmx_fpa_alloc(CVMX_FPA_PACKET_POOL);
if (unlikely(packet_buffer == NULL)) { if (unlikely(packet_buffer == NULL)) {
DEBUGPRINT("%s: Failed to allocate a packet buffer\n", printk_ratelimited("%s: Failed to allocate a packet buffer\n",
dev->name); dev->name);
cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1)); cvmx_fpa_free(work, CVMX_FPA_WQE_POOL, DONT_WRITEBACK(1));
priv->stats.tx_dropped++; priv->stats.tx_dropped++;
dev_kfree_skb(skb); dev_kfree_skb(skb);
......
...@@ -25,10 +25,6 @@ ...@@ -25,10 +25,6 @@
* Contact Cavium Networks for more information * 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 * cvm_oct_get_buffer_ptr - convert packet data address to pointer
* @packet_ptr: Packet data hardware address * @packet_ptr: Packet data hardware address
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
**********************************************************************/ **********************************************************************/
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/ratelimit.h>
#include <net/dst.h> #include <net/dst.h>
#include <asm/octeon/octeon.h> #include <asm/octeon/octeon.h>
...@@ -89,20 +90,21 @@ static void cvm_oct_xaui_poll(struct net_device *dev) ...@@ -89,20 +90,21 @@ static void cvm_oct_xaui_poll(struct net_device *dev)
if (!netif_carrier_ok(dev)) if (!netif_carrier_ok(dev))
netif_carrier_on(dev); netif_carrier_on(dev);
if (priv->queue != -1) if (priv->queue != -1)
DEBUGPRINT printk_ratelimited
("%s: %u Mbps %s duplex, port %2d, queue %2d\n", ("%s: %u Mbps %s duplex, port %2d, queue %2d\n",
dev->name, link_info.s.speed, dev->name, link_info.s.speed,
(link_info.s.full_duplex) ? "Full" : "Half", (link_info.s.full_duplex) ? "Full" : "Half",
priv->port, priv->queue); priv->port, priv->queue);
else else
DEBUGPRINT("%s: %u Mbps %s duplex, port %2d, POW\n", printk_ratelimited
dev->name, link_info.s.speed, ("%s: %u Mbps %s duplex, port %2d, POW\n",
(link_info.s.full_duplex) ? "Full" : "Half", dev->name, link_info.s.speed,
priv->port); (link_info.s.full_duplex) ? "Full" : "Half",
priv->port);
} else { } else {
if (netif_carrier_ok(dev)) if (netif_carrier_ok(dev))
netif_carrier_off(dev); netif_carrier_off(dev);
DEBUGPRINT("%s: Link down\n", dev->name); printk_ratelimited("%s: Link down\n", dev->name);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment