const char *buf, size_t len,
void (*set)(struct datapath *, unsigned long))
{
-#if 0
struct datapath *dp = dp_dev_get_dp(to_net_dev(d));
-#endif
char *endp;
unsigned long val;
(*set)(br, val);
spin_unlock_bh(&br->lock);
#else
- printk("xxx writing dp parms not supported yet!\n");
+ printk("%s: xxx writing dp parms not supported yet!\n",
+ dp->netdev->name);
#endif
return len;
}
if (br_is_root_bridge(br))
br->bridge_forward_delay = delay;
#else
- printk("xxx attempt to set_forward_delay()\n");
+ printk("%s: xxx attempt to set_forward_delay()\n", dp->netdev->name);
#endif
}
if (br_is_root_bridge(br))
br->bridge_hello_time = t;
#else
- printk("xxx attempt to set_hello_time()\n");
+ printk("%s: xxx attempt to set_hello_time()\n", dp->netdev->name);
#endif
}
if (br_is_root_bridge(br))
br->bridge_max_age = t;
#else
- printk("xxx attempt to set_max_age()\n");
+ printk("%s: xxx attempt to set_max_age()\n", dp->netdev->name);
#endif
}
#if 0
br->ageing_time = clock_t_to_jiffies(val);
#else
- printk("xxx attempt to set_ageing_time()\n");
+ printk("%s: xxx attempt to set_ageing_time()\n", dp->netdev->name);
#endif
}
const char *buf,
size_t len)
{
-#if 0
struct datapath *dp = dp_dev_get_dp(to_net_dev(d));
+#if 0
char *endp;
unsigned long val;
br_stp_set_enabled(br, val);
rtnl_unlock();
#else
- printk("xxx attempt to set_stp_state()\n");
+ printk("%s: xxx attempt to set_stp_state()\n", dp->netdev->name);
#endif
return len;
#if 0
br_stp_set_bridge_priority(br, (u16) val);
#else
- printk("xxx attempt to set_priority()\n");
+ printk("%s: xxx attempt to set_priority()\n", dp->netdev->name);
#endif
}
static ssize_t store_group_addr(struct class_device *d,
const char *buf, size_t len)
{
-#if 0
struct datapath *dp = dp_dev_get_dp(to_net_dev(d));
+#if 0
unsigned new_addr[6];
int i;
br->group_addr[i] = new_addr[i];
spin_unlock_bh(&br->lock);
#else
- printk("xxx attempt to store_group_addr()\n");
+ printk("%s: xxx attempt to store_group_addr()\n", dp->netdev->name);
#endif
return len;
}
struct attribute * attr,
const char * buf, size_t count)
{
+ struct net_bridge_port * p = to_brport(kobj);
#if 0
struct brport_attribute * brport_attr = to_brport_attr(attr);
- struct net_bridge_port * p = to_brport(kobj);
char *endp;
unsigned long val;
#endif
rtnl_unlock();
}
#else
- printk("xxx writing port parms not supported yet!\n");
+ printk("%s: xxx writing port parms not supported yet!\n",
+ p->dp->netdev->name);
#endif
return ret;
}
*/
#include "chain.h"
+#include "datapath.h"
#include "flow.h"
#include "table.h"
#include <linux/module.h>
if (table == NULL)
return -ENOMEM;
if (chain->n_tables >= CHAIN_MAX_TABLES) {
- printk("too many tables in chain\n");
+ printk("%s: too many tables in chain\n", chain->dp->netdev->name);
table->destroy(table);
return -ENOBUFS;
}
if ((openflow_len + sizeof(struct ofp_header)) > UINT16_MAX) {
if (net_ratelimit())
- printk("alloc_openflow_skb: openflow message too large: %zu\n",
- openflow_len);
+ printk("%s: alloc_openflow_skb: openflow message too large: %zu\n",
+ dp->netdev->name, openflow_len);
return NULL;
}
skb = *pskb = genlmsg_new(genl_len, GFP_ATOMIC);
if (!skb) {
if (net_ratelimit())
- printk("alloc_openflow_skb: genlmsg_new failed\n");
+ printk("%s: alloc_openflow_skb: genlmsg_new failed\n",
+ dp->netdev->name);
return NULL;
}
int
dp_xmit_skb(struct sk_buff *skb)
{
+ struct datapath *dp = skb->dev->br_port->dp;
int len = skb->len;
+
if (packet_length(skb) > skb->dev->mtu && !skb_is_gso(skb)) {
- printk("dropped over-mtu packet: %d > %d\n",
- packet_length(skb), skb->dev->mtu);
+ printk("%s: dropped over-mtu packet: %d > %d\n",
+ dp->netdev->name, packet_length(skb), skb->dev->mtu);
kfree_skb(skb);
return -E2BIG;
}
* the skb. */
if (!skb->dev) {
if (net_ratelimit())
- printk("skb device not set forwarding to in_port\n");
+ printk("%s: skb device not set forwarding to in_port\n",
+ dp->netdev->name);
kfree_skb(skb);
return -ESRCH;
}
/* To send to the input port, must use OFPP_IN_PORT */
kfree_skb(skb);
if (net_ratelimit())
- printk("can't directly forward to input port\n");
+ printk("%s: can't directly forward to input port\n",
+ dp->netdev->name);
return -EINVAL;
}
if (p->config & OFPPC_NO_FWD && !ignore_no_fwd) {
bad_port:
kfree_skb(skb);
if (net_ratelimit())
- printk("can't forward to bad port %d\n", out_port);
+ printk("%s: can't forward to bad port %d\n", dp->netdev->name,
+ out_port);
return -ENOENT;
}
const struct ofp_action_header *ah, uint16_t type)
{
const struct openflow_action *act = &of_actions[type];
+ struct datapath *dp = skb->dev->br_port->dp;
if (act->execute) {
if (!make_writable(&skb)) {
if (net_ratelimit())
- printk("make_writable failed\n");
+ printk("%s: make_writable failed\n", dp->netdev->name);
return skb;
}
skb = act->execute(skb, key, ah);
{
struct ofp_action_vendor_header *avh
= (struct ofp_action_vendor_header *)ah;
+ struct datapath *dp = skb->dev->br_port->dp;
/* NB: If changes need to be made to the packet, a call should be
* made to make_writable or its equivalent first. */
default:
/* This should not be possible due to prior validation. */
if (net_ratelimit())
- printk("attempt to execute action with unknown vendor: %#x\n",
- ntohl(avh->vendor));
+ printk("%s: attempt to execute action with unknown vendor: %#x\n",
+ dp->netdev->name, ntohl(avh->vendor));
break;
}
if (!skb) {
if (net_ratelimit())
- printk("execute_actions lost skb\n");
+ printk("%s: execute_actions lost skb\n",
+ dp->netdev->name);
return;
}
}
if (actions_len > (ntohs(opo->header.length) - sizeof *opo)) {
if (net_ratelimit())
- printk("message too short for number of actions\n");
+ printk("%s: message too short for number of actions\n",
+ chain->dp->netdev->name);
return -EINVAL;
}
return nx_recv_msg(chain, sender, msg);
default:
if (net_ratelimit())
- printk("unknown vendor: 0x%x\n", ntohl(ovh->vendor));
+ printk("%s: unknown vendor: 0x%x\n", chain->dp->netdev->name,
+ ntohl(ovh->vendor));
dp_send_error_msg(chain->dp, sender, OFPET_BAD_REQUEST,
OFPBRC_BAD_VENDOR, msg, ntohs(ovh->header.length));
return -EINVAL;
}
if (ntohs(oh->length) != length) {
if (net_ratelimit())
- printk("received message length wrong: %d/%d\n",
- ntohs(oh->length), length);
+ printk("%s: received message length wrong: %d/%d\n",
+ chain->dp->netdev->name, ntohs(oh->length), length);
return -EINVAL;
}
/* Found it! */
if (!make_writable(&skb)) {
if (net_ratelimit())
- printk("make_writable failed\n");
+ printk("%s: make_writable failed\n",
+ p->dp->netdev->name);
return -EINVAL;
}
m->used = jiffies;
nskb = skb_copy(skb, GFP_ATOMIC);
if (!nskb) {
if (net_ratelimit())
- printk("skb copy failed for icmp reply\n");
+ printk("%s: skb copy failed for icmp reply\n",
+ p->dp->netdev->name);
return -1;
}
if (!p) {
if (net_ratelimit())
- printk("Attempt to remove snat on non-existent port: %d\n", port);
+ printk("%s: attempt to remove snat on non-existent port: %d\n",
+ dp->netdev->name, port);
return -EINVAL;
}
/* SNAT not configured on this port */
spin_unlock_irqrestore(&p->lock, flags);
if (net_ratelimit())
- printk("Attempt to remove snat on non-snat port: %d\n", port);
+ printk("%s: attempt to remove snat on non-snat port: %d\n",
+ dp->netdev->name, port);
return -EINVAL;
}
if (!p) {
if (net_ratelimit())
- printk("Attempt to add snat on non-existent port: %d\n", port);
+ printk("%s: attempt to add snat on non-existent port: %d\n",
+ dp->netdev->name, port);
return -EINVAL;
}