* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
if (!*dirp) {
struct proc_dir_entry *dir;
if (brc_lookup_entry(parent, dir_name)) {
- printk(KERN_WARNING "%s proc directory exists, can't "
- "simulate--probably its real module is "
- "loaded\n", dir_name);
+ pr_warn("%s proc directory exists, can't simulate--"
+ "probably its real module is loaded\n",
+ dir_name);
return NULL;
}
dir = *dirp = proc_mkdir(dir_name, parent);
* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/kernel.h>
#include <asm/uaccess.h>
#include <linux/completion.h>
/* Wait for reply. */
error = -ETIMEDOUT;
if (!wait_for_completion_timeout(&brc_done, BRC_TIMEOUT)) {
- printk(KERN_WARNING "brcompat: timed out waiting for userspace\n");
+ pr_warn("timed out waiting for userspace\n");
goto error;
}
err_unregister:
genl_unregister_family(&brc_genl_family);
error:
- printk(KERN_EMERG "brcompat: failed to install!");
+ pr_emerg("failed to install!\n");
return err;
}
/* Functions for managing the dp interface/device. */
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/init.h>
#include <linux/module.h>
#include <linux/fs.h>
static void suppress_loop(struct datapath *dp, struct sw_flow_actions *actions)
{
if (net_ratelimit())
- printk(KERN_WARNING "%s: flow looped %d times, dropping\n",
- dp_name(dp), DP_MAX_LOOPS);
+ pr_warn("%s: flow looped %d times, dropping\n",
+ dp_name(dp), DP_MAX_LOOPS);
actions->n_actions = 0;
}
break;
default:
if (net_ratelimit())
- printk(KERN_ERR "Attempting to checksum a non-"
- "TCP/UDP packet, dropping a protocol"
- " %d packet", iph->protocol);
+ pr_err("Attempting to checksum a non-TCP/UDP packet, "
+ "dropping a protocol %d packet",
+ iph->protocol);
goto out;
}
break;
#endif
default:
- printk(KERN_ERR "openvswitch: unknown checksum type %d\n",
- skb->ip_summed);
+ pr_err("unknown checksum type %d\n", skb->ip_summed);
/* None seems the safest... */
OVS_CB(skb)->ip_summed = OVS_CSUM_NONE;
}
* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/version.h>
/*
#if !defined(HAVE_SKB_WARN_LRO) && defined(NETIF_F_LRO)
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/netdevice.h>
void __skb_warn_lro_forwarding(const struct sk_buff *skb)
{
if (net_ratelimit())
- printk(KERN_WARNING "%s: received packets cannot be forwarded"
- " while LRO is enabled\n", skb->dev->name);
+ pr_warn("%s: received packets cannot be forwarded while LRO is enabled\n",
+ skb->dev->name);
}
#endif
* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/version.h>
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,26)
return defrag(skb, true);
else {
if (net_ratelimit())
- printk(KERN_WARNING "openvswitch: unparsable packet receive on capwap socket\n");
+ pr_warn("unparsable packet receive on capwap socket\n");
kfree_skb(skb);
return NULL;
error_sock:
sock_release(capwap_rcv_socket);
error:
- printk(KERN_WARNING "openvswitch: cannot register capwap protocol handler\n");
+ pr_warn("cannot register capwap protocol handler\n");
return err;
}
if (hlen + ~FRAG_OFF_MASK + 1 > dst_mtu(dst)) {
if (net_ratelimit())
- printk(KERN_WARNING "openvswitch: capwap link mtu (%d) is less than minimum packet (%d)\n",
+ pr_warn("capwap link mtu (%d) is less than minimum packet (%d)\n",
dst_mtu(dst), hlen + ~FRAG_OFF_MASK + 1);
goto error;
}
* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/if.h>
#include <linux/skbuff.h>
#include <linux/ip.h>
err = inet_add_protocol(&gre_protocol_handlers, IPPROTO_GRE);
if (err) {
- printk(KERN_WARNING "openvswitch: cannot register gre protocol handler\n");
+ pr_warn("cannot register gre protocol handler\n");
goto out;
}
* kernel, by Linus Torvalds and others.
*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
#include <linux/dcache.h>
#include <linux/etherdevice.h>
#include <linux/if.h>
mutex_unlock(&vport_mutex);
}
-#define ASSERT_VPORT() do { \
- if (unlikely(!mutex_is_locked(&vport_mutex))) { \
- printk(KERN_ERR "openvswitch: vport lock not held at %s (%d)\n", \
- __FILE__, __LINE__); \
- dump_stack(); \
- } \
-} while(0)
+#define ASSERT_VPORT() \
+do { \
+ if (unlikely(!mutex_is_locked(&vport_mutex))) { \
+ pr_err("vport lock not held at %s (%d)\n", \
+ __FILE__, __LINE__); \
+ dump_stack(); \
+ } \
+} while (0)
/**
* vport_init - initialize vport subsystem
struct hlist_node *node;
if (unlikely(!mutex_is_locked(&vport_mutex) && !rtnl_is_locked())) {
- printk(KERN_ERR "openvswitch: neither RTNL nor vport lock held in vport_locate\n");
+ pr_err("neither RTNL nor vport lock held in vport_locate\n");
dump_stack();
}
mtu = vport_get_mtu(vport);
if (unlikely(packet_length(skb) > mtu && !skb_is_gso(skb))) {
if (net_ratelimit())
- printk(KERN_WARNING "%s: dropped over-mtu packet: %d > %d\n",
- dp_name(vport_get_dp_port(vport)->dp), packet_length(skb), mtu);
+ pr_warn("%s: dropped over-mtu packet: %d > %d\n",
+ dp_name(vport_get_dp_port(vport)->dp),
+ packet_length(skb), mtu);
goto error;
}