memset(&port, 0, sizeof port);
strncpy(port.devname, devname, sizeof port.devname);
port.port = port_no;
- return IOCTL(dpif, ODP_PORT_ADD, &port);
+ if (!ioctl(dpif->fd, ODP_PORT_ADD, &port)) {
+ VLOG_DBG_RL(&dpmsg_rl, "dp%u: added %s as port %"PRIu16,
+ dpif->minor, devname, port_no);
+ return 0;
+ } else {
+ VLOG_WARN_RL(&error_rl, "dp%u: failed to add %s as port "
+ "%"PRIu16": %s", dpif->minor, devname, port_no,
+ strerror(errno));
+ return errno;
+ }
}
int
{
memset(port, 0, sizeof *port);
port->port = port_no;
- return IOCTL(dpif, ODP_PORT_QUERY, port);
+ if (!ioctl(dpif->fd, ODP_PORT_QUERY, port)) {
+ VLOG_DBG_RL(&dpmsg_rl, "dp%u: port %"PRIu16" is device %s",
+ dpif->minor, port_no, port->devname);
+ return 0;
+ } else {
+ VLOG_WARN_RL(&error_rl, "dp%u: failed to query port %"PRIu16": %s",
+ dpif->minor, port_no, strerror(errno));
+ return errno;
+ }
}
int
{
memset(port, 0, sizeof *port);
strncpy(port->devname, devname, sizeof port->devname);
- return IOCTL(dpif, ODP_PORT_QUERY, port);
+ if (!ioctl(dpif->fd, ODP_PORT_QUERY, port)) {
+ VLOG_DBG_RL(&dpmsg_rl, "dp%u: device %s is on port %"PRIu16,
+ dpif->minor, devname, port->port);
+ return 0;
+ } else {
+ VLOG_WARN_RL(&error_rl, "dp%u: failed to query port %s: %s",
+ dpif->minor, devname, strerror(errno));
+ return errno;
+ }
}
int