mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-23 23:32:14 +00:00
openvswitch: Remove flow member from struct ovs_skb_cb
The 'flow' memeber was chosen for removal because it's only used in ovs_execute_actions() we can pass it as argument to this function. Signed-off-by: Lorand Jakab <lojakab@cisco.com> Signed-off-by: Pravin B Shelar <pshelar@nicira.com>
This commit is contained in:
parent
1a4e96a0e9
commit
d98612b8c1
3 changed files with 9 additions and 12 deletions
|
@ -865,14 +865,11 @@ static void process_deferred_actions(struct datapath *dp)
|
||||||
|
|
||||||
/* Execute a list of actions against 'skb'. */
|
/* Execute a list of actions against 'skb'. */
|
||||||
int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
|
int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
|
||||||
struct sw_flow_key *key)
|
struct sw_flow_actions *acts, struct sw_flow_key *key)
|
||||||
{
|
{
|
||||||
int level = this_cpu_read(exec_actions_level);
|
int level = this_cpu_read(exec_actions_level);
|
||||||
struct sw_flow_actions *acts;
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
acts = rcu_dereference(OVS_CB(skb)->flow->sf_acts);
|
|
||||||
|
|
||||||
this_cpu_inc(exec_actions_level);
|
this_cpu_inc(exec_actions_level);
|
||||||
OVS_CB(skb)->egress_tun_info = NULL;
|
OVS_CB(skb)->egress_tun_info = NULL;
|
||||||
err = do_execute_actions(dp, skb, key,
|
err = do_execute_actions(dp, skb, key,
|
||||||
|
|
|
@ -257,6 +257,7 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
|
||||||
const struct vport *p = OVS_CB(skb)->input_vport;
|
const struct vport *p = OVS_CB(skb)->input_vport;
|
||||||
struct datapath *dp = p->dp;
|
struct datapath *dp = p->dp;
|
||||||
struct sw_flow *flow;
|
struct sw_flow *flow;
|
||||||
|
struct sw_flow_actions *sf_acts;
|
||||||
struct dp_stats_percpu *stats;
|
struct dp_stats_percpu *stats;
|
||||||
u64 *stats_counter;
|
u64 *stats_counter;
|
||||||
u32 n_mask_hit;
|
u32 n_mask_hit;
|
||||||
|
@ -282,10 +283,10 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
OVS_CB(skb)->flow = flow;
|
ovs_flow_stats_update(flow, key->tp.flags, skb);
|
||||||
|
sf_acts = rcu_dereference(flow->sf_acts);
|
||||||
|
ovs_execute_actions(dp, skb, sf_acts, key);
|
||||||
|
|
||||||
ovs_flow_stats_update(OVS_CB(skb)->flow, key->tp.flags, skb);
|
|
||||||
ovs_execute_actions(dp, skb, key);
|
|
||||||
stats_counter = &stats->n_hit;
|
stats_counter = &stats->n_hit;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
|
@ -524,6 +525,7 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
|
||||||
struct sw_flow_actions *acts;
|
struct sw_flow_actions *acts;
|
||||||
struct sk_buff *packet;
|
struct sk_buff *packet;
|
||||||
struct sw_flow *flow;
|
struct sw_flow *flow;
|
||||||
|
struct sw_flow_actions *sf_acts;
|
||||||
struct datapath *dp;
|
struct datapath *dp;
|
||||||
struct ethhdr *eth;
|
struct ethhdr *eth;
|
||||||
struct vport *input_vport;
|
struct vport *input_vport;
|
||||||
|
@ -579,7 +581,6 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
|
||||||
rcu_assign_pointer(flow->sf_acts, acts);
|
rcu_assign_pointer(flow->sf_acts, acts);
|
||||||
|
|
||||||
OVS_CB(packet)->egress_tun_info = NULL;
|
OVS_CB(packet)->egress_tun_info = NULL;
|
||||||
OVS_CB(packet)->flow = flow;
|
|
||||||
packet->priority = flow->key.phy.priority;
|
packet->priority = flow->key.phy.priority;
|
||||||
packet->mark = flow->key.phy.skb_mark;
|
packet->mark = flow->key.phy.skb_mark;
|
||||||
|
|
||||||
|
@ -597,9 +598,10 @@ static int ovs_packet_cmd_execute(struct sk_buff *skb, struct genl_info *info)
|
||||||
goto err_unlock;
|
goto err_unlock;
|
||||||
|
|
||||||
OVS_CB(packet)->input_vport = input_vport;
|
OVS_CB(packet)->input_vport = input_vport;
|
||||||
|
sf_acts = rcu_dereference(flow->sf_acts);
|
||||||
|
|
||||||
local_bh_disable();
|
local_bh_disable();
|
||||||
err = ovs_execute_actions(dp, packet, &flow->key);
|
err = ovs_execute_actions(dp, packet, sf_acts, &flow->key);
|
||||||
local_bh_enable();
|
local_bh_enable();
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
|
|
|
@ -94,14 +94,12 @@ struct datapath {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* struct ovs_skb_cb - OVS data in skb CB
|
* struct ovs_skb_cb - OVS data in skb CB
|
||||||
* @flow: The flow associated with this packet. May be %NULL if no flow.
|
|
||||||
* @egress_tun_key: Tunnel information about this packet on egress path.
|
* @egress_tun_key: Tunnel information about this packet on egress path.
|
||||||
* NULL if the packet is not being tunneled.
|
* NULL if the packet is not being tunneled.
|
||||||
* @input_vport: The original vport packet came in on. This value is cached
|
* @input_vport: The original vport packet came in on. This value is cached
|
||||||
* when a packet is received by OVS.
|
* when a packet is received by OVS.
|
||||||
*/
|
*/
|
||||||
struct ovs_skb_cb {
|
struct ovs_skb_cb {
|
||||||
struct sw_flow *flow;
|
|
||||||
struct ovs_tunnel_info *egress_tun_info;
|
struct ovs_tunnel_info *egress_tun_info;
|
||||||
struct vport *input_vport;
|
struct vport *input_vport;
|
||||||
};
|
};
|
||||||
|
@ -194,7 +192,7 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 pid, u32 seq,
|
||||||
u8 cmd);
|
u8 cmd);
|
||||||
|
|
||||||
int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
|
int ovs_execute_actions(struct datapath *dp, struct sk_buff *skb,
|
||||||
struct sw_flow_key *);
|
struct sw_flow_actions *acts, struct sw_flow_key *);
|
||||||
|
|
||||||
void ovs_dp_notify_wq(struct work_struct *work);
|
void ovs_dp_notify_wq(struct work_struct *work);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue