X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=datapath%2Fdatapath.c;h=2be0ce12c6669dee6970c0e632a9edd6c93628f0;hb=3c52fa7b69609ca8fcfc8de7426f7ebbcba493eb;hp=b95c8f25539fc5d98f44707804c78f44fc629a3c;hpb=58f8f0e703234efbd915009d184dba7c3c90059b;p=openvswitch diff --git a/datapath/datapath.c b/datapath/datapath.c index b95c8f25..2be0ce12 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -252,7 +252,7 @@ static int create_dp(int dp_idx, const char __user *devnamep) /* Allocate table. */ err = -ENOMEM; - rcu_assign_pointer(dp->table, tbl_create(0)); + rcu_assign_pointer(dp->table, tbl_create(TBL_MIN_BUCKETS)); if (!dp->table) goto err_free_dp; @@ -653,7 +653,7 @@ static int flush_flows(struct datapath *dp) struct tbl *old_table = get_table_protected(dp); struct tbl *new_table; - new_table = tbl_create(0); + new_table = tbl_create(TBL_MIN_BUCKETS); if (!new_table) return -ENOMEM; @@ -748,7 +748,7 @@ static struct sw_flow_actions *get_actions(const struct odp_flow *flow) error = -EFAULT; if (copy_from_user(actions->actions, - (struct nlattr __user *)flow->actions, + (struct nlattr __user __force *)flow->actions, flow->actions_len)) goto error_free_actions; error = validate_actions(actions->actions, actions->actions_len); @@ -1018,7 +1018,7 @@ static int do_query_flows(struct datapath *dp, const struct odp_flowvec *flowvec u32 i; for (i = 0; i < flowvec->n_flows; i++) { - struct odp_flow __user *ufp = (struct odp_flow __user *)&flowvec->flows[i]; + struct odp_flow __user *ufp = (struct odp_flow __user __force *)&flowvec->flows[i]; struct odp_flow uf; struct tbl_node *flow_node; int error; @@ -1071,7 +1071,7 @@ static int do_list_flows(struct datapath *dp, const struct odp_flowvec *flowvec) return 0; cbdata.dp = dp; - cbdata.uflows = (struct odp_flow __user *)flowvec->flows; + cbdata.uflows = (struct odp_flow __user __force*)flowvec->flows; cbdata.n_flows = flowvec->n_flows; cbdata.listed_flows = 0; @@ -1121,7 +1121,7 @@ static int do_execute(struct datapath *dp, const struct odp_execute *execute) err = -EFAULT; if (copy_from_user(actions->actions, - (struct nlattr __user *)execute->actions, execute->actions_len)) + (struct nlattr __user __force *)execute->actions, execute->actions_len)) goto error_free_actions; err = validate_actions(actions->actions, execute->actions_len); @@ -1135,7 +1135,7 @@ static int do_execute(struct datapath *dp, const struct odp_execute *execute) err = -EFAULT; if (copy_from_user(skb_put(skb, execute->length), - (const void __user *)execute->data, + (const void __user __force *)execute->data, execute->length)) goto error_free_skb; @@ -1263,6 +1263,7 @@ static int put_port(const struct vport *p, struct odp_port __user *uop) rcu_read_lock(); strncpy(op.devname, vport_get_name(p), sizeof op.devname); strncpy(op.type, vport_get_type(p), sizeof op.type); + vport_get_config(p, op.config); rcu_read_unlock(); op.port = p->port_no; @@ -1339,7 +1340,7 @@ static int list_ports(struct datapath *dp, struct odp_portvec __user *upv) if (copy_from_user(&pv, upv, sizeof pv)) return -EFAULT; - retval = do_list_ports(dp, (struct odp_port __user *)pv.ports, + retval = do_list_ports(dp, (struct odp_port __user __force *)pv.ports, pv.n_ports); if (retval < 0) return retval;