[ovs-dev,4/5] datapath: rename flow_stats to sw_flow_stats
diff mbox series

Message ID 1570656134-11957-5-git-send-email-gvrose8192@gmail.com
State New
Headers show
Series
  • Backport upstream Linux kernel patches
Related show

Commit Message

Gregory Rose Oct. 9, 2019, 9:22 p.m. UTC
From: Pablo Neira Ayuso <pablo@netfilter.org>

Upstream commit:
    commit aef833c58d321f09ae4ce4467723542842ba9faf
    Author: Pablo Neira Ayuso <pablo@netfilter.org>
    Date:   Fri Jul 19 18:20:13 2019 +0200

    net: openvswitch: rename flow_stats to sw_flow_stats

    There is a flow_stats structure defined in include/net/flow_offload.h
    and a follow up patch adds #include <net/flow_offload.h> to
    net/sch_generic.h.

    This breaks compilation since OVS codebase includes net/sock.h which
    pulls in linux/filter.h which includes net/sch_generic.h.

    In file included from ./include/net/sch_generic.h:18:0,
                     from ./include/linux/filter.h:25,
                     from ./include/net/sock.h:59,
                     from ./include/linux/tcp.h:19,
                     from net/openvswitch/datapath.c:24

    This definition takes precedence on OVS since it is placed in the
    networking core, so rename flow_stats in OVS to sw_flow_stats since
    this structure is contained in sw_flow.

    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
    Acked-by: Jiri Pirko <jiri@mellanox.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Cc: Pablo Neira Ayuso <pablo@netfilter.org>
Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/flow.c       | 8 ++++----
 datapath/flow.h       | 4 ++--
 datapath/flow_table.c | 6 +++---
 3 files changed, 9 insertions(+), 9 deletions(-)

Comments

0-day Robot Oct. 9, 2019, 10:10 p.m. UTC | #1
Bleep bloop.  Greetings Greg Rose, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
ERROR: Author Pablo Neira Ayuso <pablo@netfilter.org> needs to sign off.
WARNING: Unexpected sign-offs from developers who are not authors or co-authors or committers: Greg Rose <gvrose8192@gmail.com>
Lines checked: 135, Warnings: 1, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
Yi-Hung Wei Oct. 15, 2019, 6:23 p.m. UTC | #2
On Wed, Oct 9, 2019 at 2:25 PM Greg Rose <gvrose8192@gmail.com> wrote:
>
> From: Pablo Neira Ayuso <pablo@netfilter.org>
>
> Upstream commit:
>     commit aef833c58d321f09ae4ce4467723542842ba9faf
>     Author: Pablo Neira Ayuso <pablo@netfilter.org>
>     Date:   Fri Jul 19 18:20:13 2019 +0200
>
>     net: openvswitch: rename flow_stats to sw_flow_stats
>
>     There is a flow_stats structure defined in include/net/flow_offload.h
>     and a follow up patch adds #include <net/flow_offload.h> to
>     net/sch_generic.h.
>
>     This breaks compilation since OVS codebase includes net/sock.h which
>     pulls in linux/filter.h which includes net/sch_generic.h.
>
>     In file included from ./include/net/sch_generic.h:18:0,
>                      from ./include/linux/filter.h:25,
>                      from ./include/net/sock.h:59,
>                      from ./include/linux/tcp.h:19,
>                      from net/openvswitch/datapath.c:24
>
>     This definition takes precedence on OVS since it is placed in the
>     networking core, so rename flow_stats in OVS to sw_flow_stats since
>     this structure is contained in sw_flow.
>
>     Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
>     Acked-by: Jiri Pirko <jiri@mellanox.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
> Cc: Pablo Neira Ayuso <pablo@netfilter.org>
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> ---

Looks good to me.

Acked-by: Yi-Hung Wei <yihung.wei@gmail.com>

Patch
diff mbox series

diff --git a/datapath/flow.c b/datapath/flow.c
index 46e2bac..916f7f4 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -72,7 +72,7 @@  u64 ovs_flow_used_time(unsigned long flow_jiffies)
 void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
 			   const struct sk_buff *skb)
 {
-	struct flow_stats *stats;
+	struct sw_flow_stats *stats;
 	unsigned int cpu = smp_processor_id();
 	int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 
@@ -100,7 +100,7 @@  void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
 			if (likely(flow->stats_last_writer != -1) &&
 			    likely(!rcu_access_pointer(flow->stats[cpu]))) {
 				/* Try to allocate CPU-specific stats. */
-				struct flow_stats *new_stats;
+				struct sw_flow_stats *new_stats;
 
 				new_stats =
 					kmem_cache_alloc_node(flow_stats_cache,
@@ -147,7 +147,7 @@  void ovs_flow_stats_get(const struct sw_flow *flow,
 
 	/* We open code this to make sure cpu 0 is always considered */
 	for (cpu = 0; cpu < nr_cpu_ids; cpu = cpumask_next(cpu, &flow->cpu_used_mask)) {
-		struct flow_stats *stats = rcu_dereference_ovsl(flow->stats[cpu]);
+		struct sw_flow_stats *stats = rcu_dereference_ovsl(flow->stats[cpu]);
 
 		if (stats) {
 			/* Local CPU may write on non-local stats, so we must
@@ -171,7 +171,7 @@  void ovs_flow_stats_clear(struct sw_flow *flow)
 
 	/* We open code this to make sure cpu 0 is always considered */
 	for (cpu = 0; cpu < nr_cpu_ids; cpu = cpumask_next(cpu, &flow->cpu_used_mask)) {
-		struct flow_stats *stats = ovsl_dereference(flow->stats[cpu]);
+		struct sw_flow_stats *stats = ovsl_dereference(flow->stats[cpu]);
 
 		if (stats) {
 			spin_lock_bh(&stats->lock);
diff --git a/datapath/flow.h b/datapath/flow.h
index 1a5df38..5560300 100644
--- a/datapath/flow.h
+++ b/datapath/flow.h
@@ -206,7 +206,7 @@  struct sw_flow_actions {
 	struct nlattr actions[];
 };
 
-struct flow_stats {
+struct sw_flow_stats {
 	u64 packet_count;		/* Number of packets matched. */
 	u64 byte_count;			/* Number of bytes matched. */
 	unsigned long used;		/* Last used time (in jiffies). */
@@ -228,7 +228,7 @@  struct sw_flow {
 	struct cpumask cpu_used_mask;
 	struct sw_flow_mask *mask;
 	struct sw_flow_actions __rcu *sf_acts;
-	struct flow_stats __rcu *stats[]; /* One for each CPU.  First one
+	struct sw_flow_stats __rcu *stats[]; /* One for each CPU.  First one
 					   * is allocated at flow creation time,
 					   * the rest are allocated on demand
 					   * while holding the 'stats[0].lock'.
diff --git a/datapath/flow_table.c b/datapath/flow_table.c
index 83ea2be..76b390e 100644
--- a/datapath/flow_table.c
+++ b/datapath/flow_table.c
@@ -85,7 +85,7 @@  void ovs_flow_mask_key(struct sw_flow_key *dst, const struct sw_flow_key *src,
 struct sw_flow *ovs_flow_alloc(void)
 {
 	struct sw_flow *flow;
-	struct flow_stats *stats;
+	struct sw_flow_stats *stats;
 
 	flow = kmem_cache_zalloc(flow_cache, GFP_KERNEL);
 	if (!flow)
@@ -953,13 +953,13 @@  int ovs_flow_init(void)
 
 	flow_cache = kmem_cache_create("sw_flow", sizeof(struct sw_flow)
 				       + (nr_cpu_ids
-					  * sizeof(struct flow_stats *)),
+					  * sizeof(struct sw_flow_stats *)),
 				       0, 0, NULL);
 	if (flow_cache == NULL)
 		return -ENOMEM;
 
 	flow_stats_cache
-		= kmem_cache_create("sw_flow_stats", sizeof(struct flow_stats),
+		= kmem_cache_create("sw_flow_stats", sizeof(struct sw_flow_stats),
 				    0, SLAB_HWCACHE_ALIGN, NULL);
 	if (flow_stats_cache == NULL) {
 		kmem_cache_destroy(flow_cache);