Christoph Lameter said, at 2012/11/9 1:18:
> On Thu, 8 Nov 2012, Shan Wei wrote:
>
>> Christoph Lameter said, at 2012/11/3 1:46:
u64_stats_update_begin(&stats->sync);
stats->tx_packets++;
>>>
>>> Use this_cpu_inc(vport->percpu_stats->packets) here?
>>
>> Lots of net
On Thu, 8 Nov 2012, Shan Wei wrote:
> Christoph Lameter said, at 2012/11/3 1:46:
> >>u64_stats_update_begin(&stats->sync);
> >>stats->tx_packets++;
> >
> > Use this_cpu_inc(vport->percpu_stats->packets) here?
>
> Lots of network drivers use u64_stats_sync infrastructure for
Christoph Lameter said, at 2012/11/3 1:46:
>> u64_stats_update_begin(&stats->sync);
>> stats->tx_packets++;
>
> Use this_cpu_inc(vport->percpu_stats->packets) here?
Lots of network drivers use u64_stats_sync infrastructure for statistics
on 32bit or 64bit hosts no matte
On Sat, 3 Nov 2012, Shan Wei wrote:
> +++ b/net/openvswitch/datapath.c
> @@ -208,7 +208,7 @@ void ovs_dp_process_received_packet(struct vport *p,
> struct sk_buff *skb)
> int error;
> int key_len;
>
> - stats = per_cpu_ptr(dp->stats_percpu, smp_processor_id());
> + stats = thi
From: Shan Wei
no change vs v1.
Lots of drivers use this kind to read/write per-cpu variable.
stats = this_cpu_ptr(dp->stats_percpu);
u64_stats_update_begin(&stats->sync);
stats->tx_packets++;
u64_stats_update_begin(&stats->sync);
Signed-off-by: Shan Wei
---
net/openvswitch/d
On Thu, 1 Nov 2012, Jesse Gross wrote:
> On Thu, Nov 1, 2012 at 7:33 AM, Christoph Lameter wrote:
> > On Thu, 1 Nov 2012, Shan Wei wrote:
> >
> >> But for different field in same per-cpu variable, how to guarantee n_missed
> >> and n_hit are from same cpu?
> >> this_cpu_read(dp->stats_percpu->n_m
On Thu, Nov 1, 2012 at 7:33 AM, Christoph Lameter wrote:
> On Thu, 1 Nov 2012, Shan Wei wrote:
>
>> But for different field in same per-cpu variable, how to guarantee n_missed
>> and n_hit are from same cpu?
>> this_cpu_read(dp->stats_percpu->n_missed);
>> [processor changed]
>> this_cpu_read(dp->
2012/11/1 Christoph Lameter
>
> > In addition, following usage of per_cpu_ptr can be replaced by
> this_cpu_read.
> >
> > cpu=get_cpu()
> >
> > *per_cpu_ptr(p,cpu)
> >
> >
> > put_cpu()
>
> Right.
>
>
Thanks very much,
I will resubmit new patchset.
On Thu, 1 Nov 2012, Shan Wei wrote:
> But for different field in same per-cpu variable, how to guarantee n_missed
> and n_hit are from same cpu?
> this_cpu_read(dp->stats_percpu->n_missed);
> [processor changed]
> this_cpu_read(dp->stats_percpu->n_hit);
What does current guarantee that? If it is
Christoph Lameter said, at 2012/11/1 1:39:
> On Wed, 31 Oct 2012, Shan Wei wrote:
>
>> --- a/net/openvswitch/datapath.c
>> +++ b/net/openvswitch/datapath.c
>> @@ -208,7 +208,7 @@ void ovs_dp_process_received_packet(struct vport *p,
>> struct sk_buff *skb)
>> int error;
>> int key_len;
>
On Wed, 31 Oct 2012, Shan Wei wrote:
> --- a/net/openvswitch/datapath.c
> +++ b/net/openvswitch/datapath.c
> @@ -208,7 +208,7 @@ void ovs_dp_process_received_packet(struct vport *p,
> struct sk_buff *skb)
> int error;
> int key_len;
>
> - stats = per_cpu_ptr(dp->stats_percpu, smp_
From: Shan Wei
Signed-off-by: Shan Wei
---
net/openvswitch/datapath.c |4 ++--
net/openvswitch/vport.c|5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index 4c4b62c..77d16a5 100644
--- a/net/openvswitch/
12 matches
Mail list logo