net/mlx5: use SPDX tags in 6WIND copyrighted files
[dpdk.git] / lib / librte_latencystats / rte_latencystats.c
index 3850b88..6633020 100644 (file)
@@ -1,33 +1,5 @@
-/*-
- *   BSD LICENSE
- *
- *   Copyright(c) 2017 Intel Corporation. All rights reserved.
- *
- *   Redistribution and use in source and binary forms, with or without
- *   modification, are permitted provided that the following conditions
- *   are met:
- *
- *     * Redistributions of source code must retain the above copyright
- *       notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above copyright
- *       notice, this list of conditions and the following disclaimer in
- *       the documentation and/or other materials provided with the
- *       distribution.
- *     * Neither the name of Intel Corporation nor the names of its
- *       contributors may be used to endorse or promote products derived
- *       from this software without specific prior written permission.
- *
- *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *   A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *   OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *   SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- *   LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- *   DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *   THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *   (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+/* SPDX-License-Identifier: BSD-3-Clause
+ * Copyright(c) 2017 Intel Corporation
  */
 
 #include <unistd.h>
@@ -42,7 +14,6 @@
 #include <rte_metrics.h>
 #include <rte_memzone.h>
 #include <rte_lcore.h>
-#include <rte_timer.h>
 
 #include "rte_latencystats.h"
 
@@ -136,7 +107,7 @@ rte_latencystats_fill_values(struct rte_metric_value *values)
 }
 
 static uint16_t
-add_time_stamps(uint8_t pid __rte_unused,
+add_time_stamps(uint16_t pid __rte_unused,
                uint16_t qid __rte_unused,
                struct rte_mbuf **pkts,
                uint16_t nb_pkts,
@@ -166,7 +137,7 @@ add_time_stamps(uint8_t pid __rte_unused,
 }
 
 static uint16_t
-calc_latency(uint8_t pid __rte_unused,
+calc_latency(uint16_t pid __rte_unused,
                uint16_t qid __rte_unused,
                struct rte_mbuf **pkts,
                uint16_t nb_pkts,
@@ -227,10 +198,10 @@ rte_latencystats_init(uint64_t app_samp_intvl,
                rte_latency_stats_flow_type_fn user_cb)
 {
        unsigned int i;
-       uint8_t pid;
+       uint16_t pid;
        uint16_t qid;
        struct rxtx_cbs *cbs = NULL;
-       const uint8_t nb_ports = rte_eth_dev_count();
+       const uint16_t nb_ports = rte_eth_dev_count();
        const char *ptr_strings[NUM_LATENCY_STATS] = {0};
        const struct rte_memzone *mz = NULL;
        const unsigned int flags = 0;
@@ -291,11 +262,11 @@ rte_latencystats_init(uint64_t app_samp_intvl,
 int
 rte_latencystats_uninit(void)
 {
-       uint8_t pid;
+       uint16_t pid;
        uint16_t qid;
        int ret = 0;
        struct rxtx_cbs *cbs = NULL;
-       const uint8_t nb_ports = rte_eth_dev_count();
+       const uint16_t nb_ports = rte_eth_dev_count();
 
        /** De register Rx/Tx callbacks */
        for (pid = 0; pid < nb_ports; pid++) {