Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
Acked-by: Andy Zhou <azhou@nicira.com>
upcall->dp_ifindex = dp_ifindex;
nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_KEY);
upcall->dp_ifindex = dp_ifindex;
nla = nla_nest_start(user_skb, OVS_PACKET_ATTR_KEY);
- err = ovs_nla_put_flow(dp, pkt_key, pkt_key, user_skb);
+ err = ovs_nla_put_flow(pkt_key, pkt_key, user_skb);
BUG_ON(err);
nla_nest_end(user_skb, nla);
BUG_ON(err);
nla_nest_end(user_skb, nla);
}
/* Called with ovs_mutex or RCU read lock. */
}
/* Called with ovs_mutex or RCU read lock. */
-static int ovs_flow_cmd_fill_match(struct datapath *dp,
- const struct sw_flow *flow,
+static int ovs_flow_cmd_fill_match(const struct sw_flow *flow,
struct sk_buff *skb)
{
struct nlattr *nla;
struct sk_buff *skb)
{
struct nlattr *nla;
if (!nla)
return -EMSGSIZE;
if (!nla)
return -EMSGSIZE;
- err = ovs_nla_put_flow(dp, &flow->unmasked_key,
+ err = ovs_nla_put_flow(&flow->unmasked_key,
&flow->unmasked_key, skb);
if (err)
return err;
&flow->unmasked_key, skb);
if (err)
return err;
if (!nla)
return -EMSGSIZE;
if (!nla)
return -EMSGSIZE;
- err = ovs_nla_put_flow(dp, &flow->key, &flow->mask->key, skb);
+ err = ovs_nla_put_flow(&flow->key, &flow->mask->key, skb);
if (err)
return err;
nla_nest_end(skb, nla);
if (err)
return err;
nla_nest_end(skb, nla);
}
/* Called with ovs_mutex or RCU read lock. */
}
/* Called with ovs_mutex or RCU read lock. */
-static int ovs_flow_cmd_fill_info(struct datapath *dp,
- const struct sw_flow *flow, int dp_ifindex,
+static int ovs_flow_cmd_fill_info(const struct sw_flow *flow, int dp_ifindex,
struct sk_buff *skb, u32 portid,
u32 seq, u32 flags, u8 cmd)
{
struct sk_buff *skb, u32 portid,
u32 seq, u32 flags, u8 cmd)
{
return -EMSGSIZE;
ovs_header->dp_ifindex = dp_ifindex;
return -EMSGSIZE;
ovs_header->dp_ifindex = dp_ifindex;
- err = ovs_flow_cmd_fill_match(dp, flow, skb);
+ err = ovs_flow_cmd_fill_match(flow, skb);
if (!skb || IS_ERR(skb))
return skb;
if (!skb || IS_ERR(skb))
return skb;
- retval = ovs_flow_cmd_fill_info(dp, flow, dp_ifindex, skb,
+ retval = ovs_flow_cmd_fill_info(flow, dp_ifindex, skb,
info->snd_portid, info->snd_seq, 0,
cmd);
BUG_ON(retval < 0);
info->snd_portid, info->snd_seq, 0,
cmd);
BUG_ON(retval < 0);
- error = ovs_flow_cmd_fill_info(dp, new_flow,
+ error = ovs_flow_cmd_fill_info(new_flow,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
rcu_assign_pointer(flow->sf_acts, acts);
if (unlikely(reply)) {
rcu_assign_pointer(flow->sf_acts, acts);
if (unlikely(reply)) {
- error = ovs_flow_cmd_fill_info(dp, flow,
+ error = ovs_flow_cmd_fill_info(flow,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
rcu_assign_pointer(flow->sf_acts, acts);
if (unlikely(reply)) {
rcu_assign_pointer(flow->sf_acts, acts);
if (unlikely(reply)) {
- error = ovs_flow_cmd_fill_info(dp, flow,
+ error = ovs_flow_cmd_fill_info(flow,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
if (likely(reply)) {
if (likely(!IS_ERR(reply))) {
rcu_read_lock(); /* Keep RCU checker happy. */
if (likely(reply)) {
if (likely(!IS_ERR(reply))) {
rcu_read_lock(); /* Keep RCU checker happy. */
- err = ovs_flow_cmd_fill_info(dp, flow,
+ err = ovs_flow_cmd_fill_info(flow,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
ovs_header->dp_ifindex,
reply, info->snd_portid,
info->snd_seq, 0,
- if (ovs_flow_cmd_fill_info(dp, flow, ovs_header->dp_ifindex, skb,
+ if (ovs_flow_cmd_fill_info(flow, ovs_header->dp_ifindex, skb,
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
OVS_FLOW_CMD_NEW) < 0)
NETLINK_CB(cb->skb).portid,
cb->nlh->nlmsg_seq, NLM_F_MULTI,
OVS_FLOW_CMD_NEW) < 0)
return metadata_from_nlattrs(&match, &attrs, a, false);
}
return metadata_from_nlattrs(&match, &attrs, a, false);
}
-int ovs_nla_put_flow(struct datapath *dp, const struct sw_flow_key *swkey,
+int ovs_nla_put_flow(const struct sw_flow_key *swkey,
const struct sw_flow_key *output, struct sk_buff *skb)
{
struct ovs_key_ethernet *eth_key;
const struct sw_flow_key *output, struct sk_buff *skb)
{
struct ovs_key_ethernet *eth_key;
void ovs_match_init(struct sw_flow_match *match,
struct sw_flow_key *key, struct sw_flow_mask *mask);
void ovs_match_init(struct sw_flow_match *match,
struct sw_flow_key *key, struct sw_flow_mask *mask);
-int ovs_nla_put_flow(struct datapath *dp, const struct sw_flow_key *,
+int ovs_nla_put_flow(const struct sw_flow_key *,
const struct sw_flow_key *, struct sk_buff *);
int ovs_nla_get_flow_metadata(const struct nlattr *, struct sw_flow_key *);
const struct sw_flow_key *, struct sk_buff *);
int ovs_nla_get_flow_metadata(const struct nlattr *, struct sw_flow_key *);