net/e1000: fix PCI config read check
[dpdk.git] / lib / librte_distributor / rte_distributor_private.h
index 82b0daf..33cd894 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
  */
 
 #ifndef _RTE_DIST_PRIV_H_
@@ -69,7 +41,7 @@ extern "C" {
 
 /**
  * Maximum number of workers allowed.
- * Be aware of increasing the limit, becaus it is limited by how we track
+ * Be aware of increasing the limit, because it is limited by how we track
  * in-flight tags. See in_flight_bitmask and rte_distributor_process
  */
 #define RTE_DISTRIB_MAX_WORKERS 64
@@ -83,14 +55,14 @@ extern "C" {
  * the next cache line to worker 0, we pad this out to three cache lines.
  * Only 64-bits of the memory is actually used though.
  */
-union rte_distributor_buffer {
+union rte_distributor_buffer_v20 {
        volatile int64_t bufptr64;
        char pad[RTE_CACHE_LINE_SIZE*3];
 } __rte_cache_aligned;
 
 /*
  * Transfer up to 8 mbufs at a time to/from workers, and
- * flow matching algorithm optimised for 8 flow IDs at a time
+ * flow matching algorithm optimized for 8 flow IDs at a time
  */
 #define RTE_DIST_BURST_SIZE 8
 
@@ -108,8 +80,8 @@ struct rte_distributor_returned_pkts {
        struct rte_mbuf *mbufs[RTE_DISTRIB_MAX_RETURNS];
 };
 
-struct rte_distributor {
-       TAILQ_ENTRY(rte_distributor) next;    /**< Next in list. */
+struct rte_distributor_v20 {
+       TAILQ_ENTRY(rte_distributor_v20) next;    /**< Next in list. */
 
        char name[RTE_DISTRIBUTOR_NAMESIZE];  /**< Name of the ring. */
        unsigned int num_workers;             /**< Number of workers polling */
@@ -124,7 +96,7 @@ struct rte_distributor {
 
        struct rte_distributor_backlog backlog[RTE_DISTRIB_MAX_WORKERS];
 
-       union rte_distributor_buffer bufs[RTE_DISTRIB_MAX_WORKERS];
+       union rte_distributor_buffer_v20 bufs[RTE_DISTRIB_MAX_WORKERS];
 
        struct rte_distributor_returned_pkts returns;
 };
@@ -144,7 +116,7 @@ enum rte_distributor_match_function {
  * We can pass up to 8 mbufs at a time in one cacheline.
  * There is a separate cacheline for returns in the burst API.
  */
-struct rte_distributor_buffer_v1705 {
+struct rte_distributor_buffer {
        volatile int64_t bufptr64[RTE_DIST_BURST_SIZE]
                __rte_cache_aligned; /* <= outgoing to worker */
 
@@ -158,8 +130,8 @@ struct rte_distributor_buffer_v1705 {
        int count __rte_cache_aligned;       /* <= number of current mbufs */
 };
 
-struct rte_distributor_v1705 {
-       TAILQ_ENTRY(rte_distributor_v1705) next;    /**< Next in list. */
+struct rte_distributor {
+       TAILQ_ENTRY(rte_distributor) next;    /**< Next in list. */
 
        char name[RTE_DISTRIBUTOR_NAMESIZE];  /**< Name of the ring. */
        unsigned int num_workers;             /**< Number of workers polling */
@@ -176,17 +148,22 @@ struct rte_distributor_v1705 {
        struct rte_distributor_backlog backlog[RTE_DISTRIB_MAX_WORKERS]
                        __rte_cache_aligned;
 
-       struct rte_distributor_buffer_v1705 bufs[RTE_DISTRIB_MAX_WORKERS];
+       struct rte_distributor_buffer bufs[RTE_DISTRIB_MAX_WORKERS];
 
        struct rte_distributor_returned_pkts returns;
 
        enum rte_distributor_match_function dist_match_fn;
 
-       struct rte_distributor *d_v20;
+       struct rte_distributor_v20 *d_v20;
 };
 
 void
-find_match_scalar(struct rte_distributor_v1705 *d,
+find_match_scalar(struct rte_distributor *d,
+                       uint16_t *data_ptr,
+                       uint16_t *output_ptr);
+
+void
+find_match_vec(struct rte_distributor *d,
                        uint16_t *data_ptr,
                        uint16_t *output_ptr);