[ovs-dev,v2,2/2] dpif-netdev-perf: Print SMC statistics.

Message ID 20180928112413.10792-3-i.maximets@samsung.com
State Accepted
Delegated to: Ian Stokes
Headers show
Series
  • dpif-netdev: Docs and stats fixes.
Related show

Commit Message

Ilya Maximets Sept. 28, 2018, 11:24 a.m.
Printing of the SMC hits missed in the 'dpif-netdev/pmd-perf-show'
appctl command.

CC: Yipeng Wang <yipeng1.wang@intel.com>
Fixes: 60d8ccae135f ("dpif-netdev: Add SMC cache after EMC cache")
Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
---
 lib/dpif-netdev-perf.c      | 3 +++
 lib/dpif-netdev-perf.h      | 2 +-
 lib/dpif-netdev-unixctl.man | 3 ++-
 3 files changed, 6 insertions(+), 2 deletions(-)

Comments

Ian Stokes Oct. 10, 2018, 6:35 p.m. | #1
> Printing of the SMC hits missed in the 'dpif-netdev/pmd-perf-show'
> appctl command.
> 

Thanks Ilya,

This looks good, I'll add this to the pull request this week.

I've held off applying the Cycles clarification patch for the moment as flagged in the mail below.

https://mail.openvswitch.org/pipermail/ovs-dev/2018-October/352904.html

If there's a v2 of cycle clarification patch I'll take the formatting of the smc stats into account when applying as I think they would be changed from 

"  - SMC hits:      %12"PRIu64"  (%4.1f %%)\n"

to

"  - SMC hits:        %12"PRIu64"  (%5.1f %%)\n"

If that makes sense?

Ian

> CC: Yipeng Wang <yipeng1.wang@intel.com>
> Fixes: 60d8ccae135f ("dpif-netdev: Add SMC cache after EMC cache")
> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
> ---
>  lib/dpif-netdev-perf.c      | 3 +++
>  lib/dpif-netdev-perf.h      | 2 +-
>  lib/dpif-netdev-unixctl.man | 3 ++-
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c index
> 13f1010c9..92ac38dab 100644
> --- a/lib/dpif-netdev-perf.c
> +++ b/lib/dpif-netdev-perf.c
> @@ -206,6 +206,7 @@ pmd_perf_format_overall_stats(struct ds *str, struct
> pmd_perf_stats *s,
>              "  Rx packets:      %12"PRIu64"  (%.0f Kpps, %.0f
> cycles/pkt)\n"
>              "  Datapath passes: %12"PRIu64"  (%.2f passes/pkt)\n"
>              "  - EMC hits:      %12"PRIu64"  (%4.1f %%)\n"
> +            "  - SMC hits:      %12"PRIu64"  (%4.1f %%)\n"
>              "  - Megaflow hits: %12"PRIu64"  (%4.1f %%, %.2f subtbl
> lookups/"
> 
> "hit)\n"
>              "  - Upcalls:       %12"PRIu64"  (%4.1f %%, %.1f
> us/upcall)\n"
> @@ -215,6 +216,8 @@ pmd_perf_format_overall_stats(struct ds *str, struct
> pmd_perf_stats *s,
>              passes, rx_packets ? 1.0 * passes / rx_packets : 0,
>              stats[PMD_STAT_EXACT_HIT],
>              100.0 * stats[PMD_STAT_EXACT_HIT] / passes,
> +            stats[PMD_STAT_SMC_HIT],
> +            100.0 * stats[PMD_STAT_SMC_HIT] / passes,
>              stats[PMD_STAT_MASKED_HIT],
>              100.0 * stats[PMD_STAT_MASKED_HIT] / passes,
>              stats[PMD_STAT_MASKED_HIT]
> diff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h index
> 299d52a98..859c05613 100644
> --- a/lib/dpif-netdev-perf.h
> +++ b/lib/dpif-netdev-perf.h
> @@ -56,7 +56,7 @@ extern "C" {
> 
>  enum pmd_stat_type {
>      PMD_STAT_EXACT_HIT,     /* Packets that had an exact match (emc). */
> -    PMD_STAT_SMC_HIT,        /* Packets that had a sig match hit (SMC).
> */
> +    PMD_STAT_SMC_HIT,       /* Packets that had a sig match hit (SMC). */
>      PMD_STAT_MASKED_HIT,    /* Packets that matched in the flow table. */
>      PMD_STAT_MISS,          /* Packets that did not match and upcall was
> ok. */
>      PMD_STAT_LOST,          /* Packets that did not match and upcall
> failed. */
> diff --git a/lib/dpif-netdev-unixctl.man b/lib/dpif-netdev-unixctl.man
> index c46f6b19c..0705f1cfb 100644
> --- a/lib/dpif-netdev-unixctl.man
> +++ b/lib/dpif-netdev-unixctl.man
> @@ -11,7 +11,7 @@ Shows performance statistics for one or all pmd threads
> of the datapath  \fIdp\fR. The special thread "main" sums up the
> statistics of every non pmd  thread.
> 
> -The sum of "emc hits", "megaflow hits" and "miss" is the number of
> +The sum of "emc hits", "smc hits", "megaflow hits" and "miss" is the
> +number of
>  packet lookups performed by the datapath. Beware that a recirculated
> packet  experiences one additional lookup per recirculation, so there may
> be  more lookups than forwarded packets in the datapath.
> @@ -135,6 +135,7 @@ pmd thread numa_id 0 core_id 1:
>    Rx packets:           2399607  (2381 Kpps, 848 cycles/pkt)
>    Datapath passes:      3599415  (1.50 passes/pkt)
>    - EMC hits:            336472  ( 9.3 %)
> +  - SMC hits:                 0  ( 0.0 %)
>    - Megaflow hits:      3262943  (90.7 %, 1.00 subtbl lookups/hit)
>    - Upcalls:                  0  ( 0.0 %, 0.0 us/upcall)
>    - Lost upcalls:             0  ( 0.0 %)
> --
> 2.17.1
Ilya Maximets Oct. 11, 2018, 11:49 a.m. | #2
On 10.10.2018 21:35, Stokes, Ian wrote:
>> Printing of the SMC hits missed in the 'dpif-netdev/pmd-perf-show'
>> appctl command.
>>
> 
> Thanks Ilya,
> 
> This looks good, I'll add this to the pull request this week.
> 
> I've held off applying the Cycles clarification patch for the moment as flagged in the mail below.
> 
> https://mail.openvswitch.org/pipermail/ovs-dev/2018-October/352904.html
> 
> If there's a v2 of cycle clarification patch I'll take the formatting of the smc stats into account when applying as I think they would be changed from 
> 
> "  - SMC hits:      %12"PRIu64"  (%4.1f %%)\n"
> 
> to
> 
> "  - SMC hits:        %12"PRIu64"  (%5.1f %%)\n"
> 
> If that makes sense?

Sure. Thanks.

> 
> Ian
> 
>> CC: Yipeng Wang <yipeng1.wang@intel.com>
>> Fixes: 60d8ccae135f ("dpif-netdev: Add SMC cache after EMC cache")
>> Signed-off-by: Ilya Maximets <i.maximets@samsung.com>
>> Acked-by: Yipeng Wang <yipeng1.wang@intel.com>
>> ---
>>  lib/dpif-netdev-perf.c      | 3 +++
>>  lib/dpif-netdev-perf.h      | 2 +-
>>  lib/dpif-netdev-unixctl.man | 3 ++-
>>  3 files changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c index
>> 13f1010c9..92ac38dab 100644
>> --- a/lib/dpif-netdev-perf.c
>> +++ b/lib/dpif-netdev-perf.c
>> @@ -206,6 +206,7 @@ pmd_perf_format_overall_stats(struct ds *str, struct
>> pmd_perf_stats *s,
>>              "  Rx packets:      %12"PRIu64"  (%.0f Kpps, %.0f
>> cycles/pkt)\n"
>>              "  Datapath passes: %12"PRIu64"  (%.2f passes/pkt)\n"
>>              "  - EMC hits:      %12"PRIu64"  (%4.1f %%)\n"
>> +            "  - SMC hits:      %12"PRIu64"  (%4.1f %%)\n"
>>              "  - Megaflow hits: %12"PRIu64"  (%4.1f %%, %.2f subtbl
>> lookups/"
>>
>> "hit)\n"
>>              "  - Upcalls:       %12"PRIu64"  (%4.1f %%, %.1f
>> us/upcall)\n"
>> @@ -215,6 +216,8 @@ pmd_perf_format_overall_stats(struct ds *str, struct
>> pmd_perf_stats *s,
>>              passes, rx_packets ? 1.0 * passes / rx_packets : 0,
>>              stats[PMD_STAT_EXACT_HIT],
>>              100.0 * stats[PMD_STAT_EXACT_HIT] / passes,
>> +            stats[PMD_STAT_SMC_HIT],
>> +            100.0 * stats[PMD_STAT_SMC_HIT] / passes,
>>              stats[PMD_STAT_MASKED_HIT],
>>              100.0 * stats[PMD_STAT_MASKED_HIT] / passes,
>>              stats[PMD_STAT_MASKED_HIT]
>> diff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h index
>> 299d52a98..859c05613 100644
>> --- a/lib/dpif-netdev-perf.h
>> +++ b/lib/dpif-netdev-perf.h
>> @@ -56,7 +56,7 @@ extern "C" {
>>
>>  enum pmd_stat_type {
>>      PMD_STAT_EXACT_HIT,     /* Packets that had an exact match (emc). */
>> -    PMD_STAT_SMC_HIT,        /* Packets that had a sig match hit (SMC).
>> */
>> +    PMD_STAT_SMC_HIT,       /* Packets that had a sig match hit (SMC). */
>>      PMD_STAT_MASKED_HIT,    /* Packets that matched in the flow table. */
>>      PMD_STAT_MISS,          /* Packets that did not match and upcall was
>> ok. */
>>      PMD_STAT_LOST,          /* Packets that did not match and upcall
>> failed. */
>> diff --git a/lib/dpif-netdev-unixctl.man b/lib/dpif-netdev-unixctl.man
>> index c46f6b19c..0705f1cfb 100644
>> --- a/lib/dpif-netdev-unixctl.man
>> +++ b/lib/dpif-netdev-unixctl.man
>> @@ -11,7 +11,7 @@ Shows performance statistics for one or all pmd threads
>> of the datapath  \fIdp\fR. The special thread "main" sums up the
>> statistics of every non pmd  thread.
>>
>> -The sum of "emc hits", "megaflow hits" and "miss" is the number of
>> +The sum of "emc hits", "smc hits", "megaflow hits" and "miss" is the
>> +number of
>>  packet lookups performed by the datapath. Beware that a recirculated
>> packet  experiences one additional lookup per recirculation, so there may
>> be  more lookups than forwarded packets in the datapath.
>> @@ -135,6 +135,7 @@ pmd thread numa_id 0 core_id 1:
>>    Rx packets:           2399607  (2381 Kpps, 848 cycles/pkt)
>>    Datapath passes:      3599415  (1.50 passes/pkt)
>>    - EMC hits:            336472  ( 9.3 %)
>> +  - SMC hits:                 0  ( 0.0 %)
>>    - Megaflow hits:      3262943  (90.7 %, 1.00 subtbl lookups/hit)
>>    - Upcalls:                  0  ( 0.0 %, 0.0 us/upcall)
>>    - Lost upcalls:             0  ( 0.0 %)
>> --
>> 2.17.1
> 
> 
>

Patch

diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c
index 13f1010c9..92ac38dab 100644
--- a/lib/dpif-netdev-perf.c
+++ b/lib/dpif-netdev-perf.c
@@ -206,6 +206,7 @@  pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,
             "  Rx packets:      %12"PRIu64"  (%.0f Kpps, %.0f cycles/pkt)\n"
             "  Datapath passes: %12"PRIu64"  (%.2f passes/pkt)\n"
             "  - EMC hits:      %12"PRIu64"  (%4.1f %%)\n"
+            "  - SMC hits:      %12"PRIu64"  (%4.1f %%)\n"
             "  - Megaflow hits: %12"PRIu64"  (%4.1f %%, %.2f subtbl lookups/"
                                                                      "hit)\n"
             "  - Upcalls:       %12"PRIu64"  (%4.1f %%, %.1f us/upcall)\n"
@@ -215,6 +216,8 @@  pmd_perf_format_overall_stats(struct ds *str, struct pmd_perf_stats *s,
             passes, rx_packets ? 1.0 * passes / rx_packets : 0,
             stats[PMD_STAT_EXACT_HIT],
             100.0 * stats[PMD_STAT_EXACT_HIT] / passes,
+            stats[PMD_STAT_SMC_HIT],
+            100.0 * stats[PMD_STAT_SMC_HIT] / passes,
             stats[PMD_STAT_MASKED_HIT],
             100.0 * stats[PMD_STAT_MASKED_HIT] / passes,
             stats[PMD_STAT_MASKED_HIT]
diff --git a/lib/dpif-netdev-perf.h b/lib/dpif-netdev-perf.h
index 299d52a98..859c05613 100644
--- a/lib/dpif-netdev-perf.h
+++ b/lib/dpif-netdev-perf.h
@@ -56,7 +56,7 @@  extern "C" {
 
 enum pmd_stat_type {
     PMD_STAT_EXACT_HIT,     /* Packets that had an exact match (emc). */
-    PMD_STAT_SMC_HIT,        /* Packets that had a sig match hit (SMC). */
+    PMD_STAT_SMC_HIT,       /* Packets that had a sig match hit (SMC). */
     PMD_STAT_MASKED_HIT,    /* Packets that matched in the flow table. */
     PMD_STAT_MISS,          /* Packets that did not match and upcall was ok. */
     PMD_STAT_LOST,          /* Packets that did not match and upcall failed. */
diff --git a/lib/dpif-netdev-unixctl.man b/lib/dpif-netdev-unixctl.man
index c46f6b19c..0705f1cfb 100644
--- a/lib/dpif-netdev-unixctl.man
+++ b/lib/dpif-netdev-unixctl.man
@@ -11,7 +11,7 @@  Shows performance statistics for one or all pmd threads of the datapath
 \fIdp\fR. The special thread "main" sums up the statistics of every non pmd
 thread.
 
-The sum of "emc hits", "megaflow hits" and "miss" is the number of
+The sum of "emc hits", "smc hits", "megaflow hits" and "miss" is the number of
 packet lookups performed by the datapath. Beware that a recirculated packet
 experiences one additional lookup per recirculation, so there may be
 more lookups than forwarded packets in the datapath.
@@ -135,6 +135,7 @@  pmd thread numa_id 0 core_id 1:
   Rx packets:           2399607  (2381 Kpps, 848 cycles/pkt)
   Datapath passes:      3599415  (1.50 passes/pkt)
   - EMC hits:            336472  ( 9.3 %)
+  - SMC hits:                 0  ( 0.0 %)
   - Megaflow hits:      3262943  (90.7 %, 1.00 subtbl lookups/hit)
   - Upcalls:                  0  ( 0.0 %, 0.0 us/upcall)
   - Lost upcalls:             0  ( 0.0 %)