rcu_assign_pointer(dp->ports[parms->port_no], vport);
list_add_rcu(&vport->node, &dp->port_list);
- dp->n_ports++;
dp_ifinfo_notify(RTM_NEWLINK, vport);
}
dp_ifinfo_notify(RTM_DELLINK, p);
/* First drop references to device. */
- p->dp->n_ports--;
list_del_rcu(&p->node);
rcu_assign_pointer(p->dp->ports[p->port_no], NULL);
static int get_dp_stats(struct datapath *dp, struct odp_stats __user *statsp)
{
- struct tbl *table = get_table_protected(dp);
struct odp_stats stats;
int i;
- stats.n_flows = tbl_count(table);
- stats.cur_capacity = tbl_n_buckets(table);
- stats.max_capacity = TBL_MAX_BUCKETS;
- stats.n_ports = dp->n_ports;
- stats.max_ports = DP_MAX_PORTS;
stats.n_frags = stats.n_hit = stats.n_missed = stats.n_lost = 0;
for_each_possible_cpu(i) {
const struct dp_stats_percpu *percpu_stats;
stats.n_missed += local_stats.n_missed;
stats.n_lost += local_stats.n_lost;
}
- stats.max_miss_queue = DP_MAX_QUEUE_LEN;
- stats.max_action_queue = DP_MAX_QUEUE_LEN;
return copy_to_user(statsp, &stats, sizeof(stats)) ? -EFAULT : 0;
}