}
static int do_answer_query(struct datapath *dp, struct sw_flow *flow,
- u32 query_flags,
struct odp_flow_stats __user *ustats,
struct nlattr __user *actions,
u32 __user *actions_lenp)
spin_lock_bh(&flow->lock);
get_stats(flow, &stats);
- if (query_flags & ODPFF_ZERO_TCP_FLAGS)
- flow->tcp_flags = 0;
-
spin_unlock_bh(&flow->lock);
if (copy_to_user(ustats, &stats, sizeof(struct odp_flow_stats)) ||
}
static int answer_query(struct datapath *dp, struct sw_flow *flow,
- u32 query_flags, struct odp_flow __user *ufp)
+ struct odp_flow __user *ufp)
{
struct nlattr __user *actions;
if (get_user(actions, (struct nlattr __user * __user *)&ufp->actions))
return -EFAULT;
- return do_answer_query(dp, flow, query_flags,
- &ufp->stats, actions, &ufp->actions_len);
+ return do_answer_query(dp, flow, &ufp->stats, actions, &ufp->actions_len);
}
static struct sw_flow *do_del_flow(struct datapath *dp, const struct nlattr __user *key, u32 key_len)
if (IS_ERR(flow))
return PTR_ERR(flow);
- error = answer_query(dp, flow, 0, ufp);
+ error = answer_query(dp, flow, ufp);
flow_deferred_free(flow);
return error;
}
flow_node = tbl_lookup(table, &flow.key, flow_hash(&key), flow_cmp);
if (!flow_node)
return -ENOENT;
- return answer_query(dp, flow_cast(flow_node), flow.flags, uflow);
+ return answer_query(dp, flow_cast(flow_node), uflow);
}
static struct sw_flow *do_dump_flow(struct datapath *dp, u32 __user *state)
return -EFAULT;
if (!flow)
- return put_user(ODPFF_EOF, &uflowp->flags);
+ return put_user(0, &uflowp->key_len);
- if (put_user(0, &uflowp->flags) ||
- get_user(ukey, (struct nlattr __user * __user*)&uflowp->key) ||
+ if (get_user(ukey, (struct nlattr __user * __user*)&uflowp->key) ||
get_user(key_len, &uflowp->key_len))
return -EFAULT;
if (put_user(key_len, &uflowp->key_len))
return -EFAULT;
- return answer_query(dp, flow, 0, uflowp);
+ return answer_query(dp, flow, uflowp);
}
static int do_execute(struct datapath *dp, const struct odp_execute *execute)
__get_user(key, &compat->key) ||
__get_user(flow->key_len, &compat->key_len) ||
__get_user(actions, &compat->actions) ||
- __get_user(flow->actions_len, &compat->actions_len) ||
- __get_user(flow->flags, &compat->flags))
+ __get_user(flow->actions_len, &compat->actions_len))
return -EFAULT;
flow->key = (struct nlattr __force *)compat_ptr(key);
}
static int compat_answer_query(struct datapath *dp, struct sw_flow *flow,
- u32 query_flags,
struct compat_odp_flow __user *ufp)
{
compat_uptr_t actions;
if (get_user(actions, &ufp->actions))
return -EFAULT;
- return do_answer_query(dp, flow, query_flags, &ufp->stats,
+ return do_answer_query(dp, flow, &ufp->stats,
compat_ptr(actions), &ufp->actions_len);
}
if (IS_ERR(flow))
return PTR_ERR(flow);
- error = compat_answer_query(dp, flow, 0, ufp);
+ error = compat_answer_query(dp, flow, ufp);
flow_deferred_free(flow);
return error;
}
flow_node = tbl_lookup(table, &key, flow_hash(&key), flow_cmp);
if (!flow_node)
return -ENOENT;
- return compat_answer_query(dp, flow_cast(flow_node), flow.flags, uflow);
+ return compat_answer_query(dp, flow_cast(flow_node), uflow);
}
static int compat_dump_flow(struct datapath *dp, struct compat_odp_flow_dump __user *udumpp)
uflowp = compat_ptr(compat_ufp);
if (!flow)
- return put_user(ODPFF_EOF, &uflowp->flags);
+ return put_user(0, &uflowp->key_len);
- if (put_user(0, &uflowp->flags) ||
- get_user(ukey, &uflowp->key) ||
+ if (get_user(ukey, &uflowp->key) ||
get_user(key_len, &uflowp->key_len))
return -EFAULT;
if (put_user(key_len, &uflowp->key_len))
return -EFAULT;
- return compat_answer_query(dp, flow, 0, uflowp);
+ return compat_answer_query(dp, flow, uflowp);
}
static int compat_execute(struct datapath *dp, const struct compat_odp_execute __user *uexecute)