]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/dpdk/lib/librte_efd/rte_efd.c
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / lib / librte_efd / rte_efd.c
index 14e493bc33733a3b980dfe2d5f750fbbf70b3ac3..6a799556d4bd0bd486937fe9f41514f006355bcd 100644 (file)
@@ -20,6 +20,7 @@
 #include <rte_ring.h>
 #include <rte_jhash.h>
 #include <rte_hash_crc.h>
+#include <rte_tailq.h>
 
 #include "rte_efd.h"
 #if defined(RTE_ARCH_X86)
@@ -180,7 +181,7 @@ struct efd_offline_group_rules {
        /**< Array with all values of the keys of the group. */
 
        uint8_t bin_id[EFD_MAX_GROUP_NUM_RULES];
-       /**< Stores the bin for each correspending key to
+       /**< Stores the bin for each corresponding key to
         * avoid having to recompute it
         */
 };
@@ -206,7 +207,7 @@ struct efd_offline_chunk_rules {
 struct efd_online_group_entry {
        efd_hashfunc_t hash_idx[RTE_EFD_VALUE_NUM_BITS];
        efd_lookuptbl_t lookup_table[RTE_EFD_VALUE_NUM_BITS];
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * A single chunk record, containing EFD_TARGET_CHUNK_NUM_RULES rules.
@@ -222,7 +223,7 @@ struct efd_online_chunk {
 
        struct efd_online_group_entry groups[EFD_CHUNK_NUM_GROUPS];
        /**< Array of all the groups in the chunk. */
-} __attribute__((__packed__));
+} __rte_packed;
 
 /**
  * EFD table structure
@@ -532,7 +533,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
 
        num_chunks_shift = rte_bsf32(num_chunks);
 
-       rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_write_lock();
 
        /*
         * Guarantee there's no existing: this is normally already checked
@@ -685,7 +686,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
 
        te->data = (void *) table;
        TAILQ_INSERT_TAIL(efd_list, te, next);
-       rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_write_unlock();
 
        snprintf(ring_name, sizeof(ring_name), "HT_%s", table->name);
        /* Create ring (Dummy slot index is not enqueued) */
@@ -705,7 +706,7 @@ rte_efd_create(const char *name, uint32_t max_num_rules, uint32_t key_len,
        return table;
 
 error_unlock_exit:
-       rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_write_unlock();
        rte_efd_free(table);
 
        return NULL;
@@ -720,7 +721,7 @@ rte_efd_find_existing(const char *name)
 
        efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list);
 
-       rte_rwlock_read_lock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_read_lock();
 
        TAILQ_FOREACH(te, efd_list, next)
        {
@@ -728,7 +729,7 @@ rte_efd_find_existing(const char *name)
                if (strncmp(name, table->name, RTE_EFD_NAMESIZE) == 0)
                        break;
        }
-       rte_rwlock_read_unlock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_read_unlock();
 
        if (te == NULL) {
                rte_errno = ENOENT;
@@ -751,7 +752,7 @@ rte_efd_free(struct rte_efd_table *table)
                rte_free(table->chunks[socket_id]);
 
        efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list);
-       rte_rwlock_write_lock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_write_lock();
 
        TAILQ_FOREACH_SAFE(te, efd_list, next, temp) {
                if (te->data == (void *) table) {
@@ -761,7 +762,7 @@ rte_efd_free(struct rte_efd_table *table)
                }
        }
 
-       rte_rwlock_write_unlock(RTE_EAL_TAILQ_RWLOCK);
+       rte_mcfg_tailq_write_unlock();
        rte_ring_free(table->free_slots);
        rte_free(table->offline_chunks);
        rte_free(table->keys);