/* Used by dpif_linux_get_all_names(). */
char *local_ifname;
- int minor;
+ int dp_idx;
/* Change notification. */
int local_ifindex; /* Ifindex of local port. */
struct dpif_linux_vport vport_request, vport;
struct dpif_linux_dp dp_request, dp;
struct ofpbuf *buf;
- int minor;
+ int dp_idx;
int error;
error = dpif_linux_init();
return error;
}
- minor = !strncmp(name, "dp", 2)
- && isdigit((unsigned char)name[2]) ? atoi(name + 2) : -1;
+ dp_idx = (!strncmp(name, "dp", 2)
+ && isdigit((unsigned char)name[2]) ? atoi(name + 2) : -1);
/* Create or look up datapath. */
dpif_linux_dp_init(&dp_request);
dp_request.cmd = create ? ODP_DP_CMD_NEW : ODP_DP_CMD_GET;
- dp_request.dp_idx = minor;
- dp_request.name = minor < 0 ? name : NULL;
+ dp_request.dp_idx = dp_idx;
+ dp_request.name = dp_idx < 0 ? name : NULL;
error = dpif_linux_dp_transact(&dp_request, &dp, &buf);
if (error) {
return error;
vport_request.cmd = ODP_VPORT_CMD_GET;
vport_request.dp_idx = dp.dp_idx;
vport_request.port_no = ODPP_LOCAL;
- vport_request.name = minor < 0 ? name : NULL;
+ vport_request.name = dp_idx < 0 ? name : NULL;
error = dpif_linux_vport_transact(&vport_request, &vport, &buf);
if (error) {
return error;
dpif->listen_mask = 0;
dpif->local_ifname = xstrdup(local_vport->name);
dpif->local_ifindex = local_vport->ifindex;
- dpif->minor = dp_idx;
+ dpif->dp_idx = dp_idx;
shash_init(&dpif->changed_ports);
dpif->change_error = false;
*dpifp = &dpif->dpif;
{
struct dpif_linux *dpif = dpif_linux_cast(dpif_);
- svec_add_nocopy(all_names, xasprintf("dp%d", dpif->minor));
+ svec_add_nocopy(all_names, xasprintf("dp%d", dpif->dp_idx));
svec_add(all_names, dpif->local_ifname);
return 0;
}
dpif_linux_dp_init(&dp);
dp.cmd = ODP_DP_CMD_DEL;
- dp.dp_idx = dpif->minor;
+ dp.dp_idx = dpif->dp_idx;
return dpif_linux_dp_transact(&dp, NULL, NULL);
}
dpif_linux_dp_init(&dp);
dp.cmd = ODP_DP_CMD_SET;
- dp.dp_idx = dpif->minor;
+ dp.dp_idx = dpif->dp_idx;
dp.ipv4_frags = drop_frags ? ODP_DP_FRAG_DROP : ODP_DP_FRAG_ZERO;
return dpif_linux_dp_transact(&dp, NULL, NULL);
}
dpif_linux_vport_init(&request);
request.cmd = ODP_VPORT_CMD_NEW;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
request.type = netdev_vport_get_vport_type(netdev);
if (request.type == ODP_VPORT_TYPE_UNSPEC) {
VLOG_WARN_RL(&error_rl, "%s: cannot create port `%s' because it has "
dpif_linux_vport_init(&vport);
vport.cmd = ODP_VPORT_CMD_DEL;
- vport.dp_idx = dpif->minor;
+ vport.dp_idx = dpif->dp_idx;
vport.port_no = port_no;
return dpif_linux_vport_transact(&vport, NULL, NULL);
}
dpif_linux_vport_init(&request);
request.cmd = ODP_VPORT_CMD_GET;
- request.dp_idx = dpif_linux_cast(dpif)->minor;
+ request.dp_idx = dpif_linux_cast(dpif)->dp_idx;
request.port_no = port_no;
request.name = port_name;
dpif_linux_flow_init(&flow);
flow.cmd = ODP_FLOW_CMD_DEL;
- flow.dp_idx = dpif->minor;
+ flow.dp_idx = dpif->dp_idx;
return dpif_linux_flow_transact(&flow, NULL, NULL);
}
dpif_linux_vport_init(&request);
request.cmd = ODP_DP_CMD_GET;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
buf = ofpbuf_new(1024);
dpif_linux_vport_to_ofpbuf(&request, buf);
dpif_linux_flow_init(&request);
request.cmd = ODP_FLOW_CMD_GET;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
request.key = key;
request.key_len = key_len;
error = dpif_linux_flow_transact(&request, &reply, &buf);
dpif_linux_flow_init(&request);
request.cmd = flags & DPIF_FP_CREATE ? ODP_FLOW_CMD_NEW : ODP_FLOW_CMD_SET;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
request.key = key;
request.key_len = key_len;
request.actions = actions;
dpif_linux_flow_init(&request);
request.cmd = ODP_FLOW_CMD_DEL;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
request.key = key;
request.key_len = key_len;
error = dpif_linux_flow_transact(&request,
dpif_linux_flow_init(&request);
request.cmd = ODP_DP_CMD_GET;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
buf = ofpbuf_new(1024);
dpif_linux_flow_to_ofpbuf(&request, buf);
ODP_PACKET_CMD_EXECUTE, 1);
execute = ofpbuf_put_uninit(buf, sizeof *execute);
- execute->dp_idx = dpif->minor;
+ execute->dp_idx = dpif->dp_idx;
nl_msg_put_unspec(buf, ODP_PACKET_ATTR_PACKET, packet->data, packet->size);
nl_msg_put_unspec(buf, ODP_PACKET_ATTR_ACTIONS, actions, actions_len);
dpif_linux_dp_init(&dp);
dp.cmd = ODP_DP_CMD_SET;
- dp.dp_idx = dpif->minor;
+ dp.dp_idx = dpif->dp_idx;
dp.sampling = &probability;
return dpif_linux_dp_transact(&dp, NULL, NULL);
}
error = parse_odp_packet(buf, upcall, &dp_idx);
if (!error
- && dp_idx == dpif->minor
+ && dp_idx == dpif->dp_idx
&& dpif->listen_mask & (1u << upcall->type)) {
return 0;
}
dpif_linux_dp_init(&request);
request.cmd = ODP_DP_CMD_GET;
- request.dp_idx = dpif->minor;
+ request.dp_idx = dpif->dp_idx;
return dpif_linux_dp_transact(&request, reply, bufp);
}