diff mbox

[ovs-dev,2/5] datapath: Optimize updating for OvS flow_stats.

Message ID 1503512502-8836-2-git-send-email-gvrose8192@gmail.com
State Superseded
Headers show

Commit Message

Gregory Rose Aug. 23, 2017, 6:21 p.m. UTC
Upstream commit:
    commit c57c054eb5b1ccf230c49f736f7a018fcbc3e952
    Author: Tonghao Zhang <xiangxia.m.yue@gmail.com>
    Date:   Mon Jul 17 23:28:05 2017 -0700

    openvswitch: Optimize updating for OvS flow_stats.

    In the ovs_flow_stats_update(), we only use the node
    var to alloc flow_stats struct. But this is not a
    common case, it is unnecessary to call the numa_node_id()
    everytime. This patch is not a bugfix, but there maybe
    a small increase.

    Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
---
 datapath/flow.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Joe Stringer Aug. 23, 2017, 11:24 p.m. UTC | #1
On 23 August 2017 at 11:21, Greg Rose <gvrose8192@gmail.com> wrote:
> Upstream commit:
>     commit c57c054eb5b1ccf230c49f736f7a018fcbc3e952
>     Author: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>     Date:   Mon Jul 17 23:28:05 2017 -0700
>
>     openvswitch: Optimize updating for OvS flow_stats.
>
>     In the ovs_flow_stats_update(), we only use the node
>     var to alloc flow_stats struct. But this is not a
>     common case, it is unnecessary to call the numa_node_id()
>     everytime. This patch is not a bugfix, but there maybe
>     a small increase.
>
>     Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
>     Signed-off-by: David S. Miller <davem@davemloft.net>
>
> Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> ---

Thanks for the backports, the rest of this series LGTM. I'm running a
quick build check on Travis in the mean time, but once we have an
answer on patch #1 I'd be happy to apply this series.

Cheers,
Joe
Gregory Rose Aug. 24, 2017, 12:42 a.m. UTC | #2
On 08/23/2017 04:24 PM, Joe Stringer wrote:
> On 23 August 2017 at 11:21, Greg Rose <gvrose8192@gmail.com> wrote:
> > Upstream commit:
> >      commit c57c054eb5b1ccf230c49f736f7a018fcbc3e952
> >      Author: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >      Date:   Mon Jul 17 23:28:05 2017 -0700
> >
> >      openvswitch: Optimize updating for OvS flow_stats.
> >
> >      In the ovs_flow_stats_update(), we only use the node
> >      var to alloc flow_stats struct. But this is not a
> >      common case, it is unnecessary to call the numa_node_id()
> >      everytime. This patch is not a bugfix, but there maybe
> >      a small increase.
> >
> >      Signed-off-by: Tonghao Zhang <xiangxia.m.yue@gmail.com>
> >      Signed-off-by: David S. Miller <davem@davemloft.net>
> >
> > Signed-off-by: Greg Rose <gvrose8192@gmail.com>
> > ---
>
> Thanks for the backports, the rest of this series LGTM. I'm running a
> quick build check on Travis in the mean time, but once we have an
> answer on patch #1 I'd be happy to apply this series.
>
> Cheers,
> Joe
>
Thanks Joe - let me work in your suggestion for patch #1 and then I'll resend V2
of the series.

- Greg
diff mbox

Patch

diff --git a/datapath/flow.c b/datapath/flow.c
index 9bf3eba..09edf8c 100644
--- a/datapath/flow.c
+++ b/datapath/flow.c
@@ -71,7 +71,6 @@  void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
 			   const struct sk_buff *skb)
 {
 	struct flow_stats *stats;
-	int node = numa_node_id();
 	int cpu = smp_processor_id();
 	int len = skb->len + (skb_vlan_tag_present(skb) ? VLAN_HLEN : 0);
 
@@ -107,7 +106,7 @@  void ovs_flow_stats_update(struct sw_flow *flow, __be16 tcp_flags,
                                                               __GFP_THISNODE |
                                                               __GFP_NOWARN |
 							      __GFP_NOMEMALLOC,
-							      node);
+							      numa_node_id());
 				if (likely(new_stats)) {
 					new_stats->used = jiffies;
 					new_stats->packet_count = 1;