From patchwork Tue Nov 4 06:01:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pravin B Shelar X-Patchwork-Id: 407152 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id B180F1400E2 for ; Thu, 6 Nov 2014 07:02:17 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752180AbaKEUCL (ORCPT ); Wed, 5 Nov 2014 15:02:11 -0500 Received: from na6sys009bog002.obsmtp.com ([74.125.150.44]:54765 "HELO na6sys009bog002.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1752167AbaKEUCJ (ORCPT ); Wed, 5 Nov 2014 15:02:09 -0500 Received: from mail-pd0-f177.google.com ([209.85.192.177]) (using TLSv1) by na6sys009bob002.postini.com ([74.125.148.12]) with SMTP ID DSNKVFqCQIRkZ3zBojjch/v9HDrJkqbdmR8T@postini.com; Wed, 05 Nov 2014 12:02:08 PST Received: by mail-pd0-f177.google.com with SMTP id v10so1364892pde.36 for ; Wed, 05 Nov 2014 12:02:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=S6qnSyFLYk8++nymw3yeX2JI88BplWAnpEUUQEq/EkY=; b=aPPs/tki7kRpWxa3v9YaxZ4Kn9NLM+3wHqgQ9OLWzpFsLmaIVBQOiIJQt4Y9N/WX9/ 8dx0ehjE2sU7u0gD09PukEsBgwysKa4RNF2+sq4l92Zbaq9rUQjYans1uES1sivoEptZ 9EfJJ5PUsunBuzaDQa7TE2S7/kclILA8PiBY4teO8akt1P4uR6cqXBbeZ30Iz6hVy5if Xfpok1TlrYi2ZbuxLgE7aptBUVMLEFtxMrbuV0Q5FK0RnvtiuOW8hvN900+3ch561U9T cuAow5UEPZijlI80t2enKJVlA3hZMk65QRHa/bwzHIUIwWLvSL/B7iuox4fuhd9/ZYxE SPBg== X-Gm-Message-State: ALoCoQlO6FZwlu/Z6VI15+CXgY7XNnT/rX0wBmCxswKt9x6x3PKV4mB45/buiGTfeOZQTZ1UOrh1kGVzA2IqEdnsj35flVm1uVzBaE80OeN72qraGaj5h0m5b9vN55UQRBRIDM0hObJXphYUAr83qtE0FnF7NiNrLA== X-Received: by 10.68.206.98 with SMTP id ln2mr58890608pbc.83.1415217728104; Wed, 05 Nov 2014 12:02:08 -0800 (PST) X-Received: by 10.68.206.98 with SMTP id ln2mr58890596pbc.83.1415217727975; Wed, 05 Nov 2014 12:02:07 -0800 (PST) Received: from localhost ([76.126.242.203]) by mx.google.com with ESMTPSA id ri9sm3984356pbc.5.2014.11.05.12.02.07 for (version=TLSv1.1 cipher=RC4-SHA bits=128/128); Wed, 05 Nov 2014 12:02:07 -0800 (PST) From: Pravin B Shelar To: davem@davemloft.net Cc: netdev@vger.kernel.org, Lorand Jakab , Pravin B Shelar Subject: [PATCH net-next 11/14] openvswitch: Remove flow member from struct ovs_skb_cb Date: Mon, 3 Nov 2014 22:01:56 -0800 Message-Id: <1415080916-1953-1-git-send-email-pshelar@nicira.com> X-Mailer: git-send-email 1.7.1 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Lorand Jakab 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 Signed-off-by: Pravin B Shelar --- net/openvswitch/actions.c | 5 +---- net/openvswitch/datapath.c | 12 +++++++----- net/openvswitch/datapath.h | 4 +--- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/net/openvswitch/actions.c b/net/openvswitch/actions.c index 9fd33c0..f7e5891 100644 --- a/net/openvswitch/actions.c +++ b/net/openvswitch/actions.c @@ -865,14 +865,11 @@ static void process_deferred_actions(struct datapath *dp) /* Execute a list of actions against '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); - struct sw_flow_actions *acts; int err; - acts = rcu_dereference(OVS_CB(skb)->flow->sf_acts); - this_cpu_inc(exec_actions_level); OVS_CB(skb)->egress_tun_info = NULL; err = do_execute_actions(dp, skb, key, diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index cdbc44c..4fd8a45 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c @@ -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; struct datapath *dp = p->dp; struct sw_flow *flow; + struct sw_flow_actions *sf_acts; struct dp_stats_percpu *stats; u64 *stats_counter; u32 n_mask_hit; @@ -282,10 +283,10 @@ void ovs_dp_process_packet(struct sk_buff *skb, struct sw_flow_key *key) 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; 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 sk_buff *packet; struct sw_flow *flow; + struct sw_flow_actions *sf_acts; struct datapath *dp; struct ethhdr *eth; 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); OVS_CB(packet)->egress_tun_info = NULL; - OVS_CB(packet)->flow = flow; packet->priority = flow->key.phy.priority; 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; OVS_CB(packet)->input_vport = input_vport; + sf_acts = rcu_dereference(flow->sf_acts); local_bh_disable(); - err = ovs_execute_actions(dp, packet, &flow->key); + err = ovs_execute_actions(dp, packet, sf_acts, &flow->key); local_bh_enable(); rcu_read_unlock(); diff --git a/net/openvswitch/datapath.h b/net/openvswitch/datapath.h index 9741354..1c56a80 100644 --- a/net/openvswitch/datapath.h +++ b/net/openvswitch/datapath.h @@ -94,14 +94,12 @@ struct datapath { /** * 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. * NULL if the packet is not being tunneled. * @input_vport: The original vport packet came in on. This value is cached * when a packet is received by OVS. */ struct ovs_skb_cb { - struct sw_flow *flow; struct ovs_tunnel_info *egress_tun_info; struct vport *input_vport; }; @@ -194,7 +192,7 @@ struct sk_buff *ovs_vport_cmd_build_info(struct vport *, u32 pid, u32 seq, u8 cmd); 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);