[ovs-dev,v4,2/3] dpif-netdev: Rename rxq_cycle_sort to compare_rxq_cycles.

Message ID 1511466117-27191-2-git-send-email-ktraynor@redhat.com
State New
Delegated to: Ian Stokes
Headers show
Series
  • [ovs-dev,v4,1/3] dpif-netdev: Add port/queue tiebreaker to rxq_cycle_sort.
Related show

Commit Message

Kevin Traynor Nov. 23, 2017, 7:41 p.m.
This function is used for comparison between queues
as part of the sort. It does not do the sort itself.
As such, give it a more appropriate name.

Suggested-by: Billy O'Mahony <billy.o.mahony@intel.com>
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---

V4: Added patch into series after suggestion by Billy

 lib/dpif-netdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

O Mahony, Billy Nov. 24, 2017, 10:31 a.m. | #1
Acked-by: Billy O'Mahony

> -----Original Message-----
> From: Kevin Traynor [mailto:ktraynor@redhat.com]
> Sent: Thursday, November 23, 2017 7:42 PM
> To: dev@openvswitch.org; aserdean@ovn.org; i.maximets@samsung.com; O
> Mahony, Billy <billy.o.mahony@intel.com>; Stokes, Ian <ian.stokes@intel.com>
> Cc: Kevin Traynor <ktraynor@redhat.com>
> Subject: [PATCH v4 2/3] dpif-netdev: Rename rxq_cycle_sort to
> compare_rxq_cycles.
> 
> This function is used for comparison between queues as part of the sort. It does
> not do the sort itself.
> As such, give it a more appropriate name.
> 
> Suggested-by: Billy O'Mahony <billy.o.mahony@intel.com>
> Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
> ---
> 
> V4: Added patch into series after suggestion by Billy
> 
>  lib/dpif-netdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c index f5cdd92..657df71 100644
> --- a/lib/dpif-netdev.c
> +++ b/lib/dpif-netdev.c
> @@ -3446,5 +3446,5 @@ rr_numa_list_destroy(struct rr_numa_list *rr)
>  /* Sort Rx Queues by the processing cycles they are consuming. */  static int -
> rxq_cycle_sort(const void *a, const void *b)
> +compare_rxq_cycles(const void *a, const void *b)
>  {
>      struct dp_netdev_rxq *qa;
> @@ -3535,5 +3535,5 @@ rxq_scheduling(struct dp_netdev *dp, bool pinned)
> OVS_REQUIRES(dp->port_mutex)
>          /* Sort the queues in order of the processing cycles
>           * they consumed during their last pmd interval. */
> -        qsort(rxqs, n_rxqs, sizeof *rxqs, rxq_cycle_sort);
> +        qsort(rxqs, n_rxqs, sizeof *rxqs, compare_rxq_cycles);
>      }
> 
> --
> 1.8.3.1

Patch

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index f5cdd92..657df71 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -3446,5 +3446,5 @@  rr_numa_list_destroy(struct rr_numa_list *rr)
 /* Sort Rx Queues by the processing cycles they are consuming. */
 static int
-rxq_cycle_sort(const void *a, const void *b)
+compare_rxq_cycles(const void *a, const void *b)
 {
     struct dp_netdev_rxq *qa;
@@ -3535,5 +3535,5 @@  rxq_scheduling(struct dp_netdev *dp, bool pinned) OVS_REQUIRES(dp->port_mutex)
         /* Sort the queues in order of the processing cycles
          * they consumed during their last pmd interval. */
-        qsort(rxqs, n_rxqs, sizeof *rxqs, rxq_cycle_sort);
+        qsort(rxqs, n_rxqs, sizeof *rxqs, compare_rxq_cycles);
     }