net/ice/base: add dedicate MAC type for E810
[dpdk.git] / drivers / net / ice / base / ice_osdep.h
index 45b9f36..0955f56 100644 (file)
@@ -120,13 +120,13 @@ writeq(uint64_t value, volatile void *addr)
 #endif /* __INTEL_NET_BASE_OSDEP__ */
 
 #ifndef __always_unused
-#define __always_unused  __attribute__((unused))
+#define __always_unused  __rte_unused
 #endif
 #ifndef __maybe_unused
-#define __maybe_unused  __attribute__((unused))
+#define __maybe_unused  __rte_unused
 #endif
 #ifndef __packed
-#define __packed  __attribute__((packed))
+#define __packed  __rte_packed
 #endif
 
 #ifndef BIT_ULL
@@ -180,12 +180,12 @@ struct ice_dma_mem {
        u64 pa;
        u32 size;
        const void *zone;
-} __attribute__((packed));
+} __rte_packed;
 
 struct ice_virt_mem {
        void *va;
        u32 size;
-} __attribute__((packed));
+} __rte_packed;
 
 #define ice_malloc(h, s)    rte_zmalloc(NULL, s, 0)
 #define ice_calloc(h, c, s) rte_zmalloc(NULL, (c) * (s), 0)
@@ -219,14 +219,14 @@ ice_release_lock(struct ice_lock *sp)
 }
 
 static inline void
-ice_destroy_lock(__attribute__((unused)) struct ice_lock *sp)
+ice_destroy_lock(__rte_unused struct ice_lock *sp)
 {
 }
 
 struct ice_hw;
 
 static inline void *
-ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw,
+ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
                  struct ice_dma_mem *mem, u64 size)
 {
        const struct rte_memzone *mz = NULL;
@@ -252,7 +252,7 @@ ice_alloc_dma_mem(__attribute__((unused)) struct ice_hw *hw,
 }
 
 static inline void
-ice_free_dma_mem(__attribute__((unused)) struct ice_hw *hw,
+ice_free_dma_mem(__rte_unused struct ice_hw *hw,
                 struct ice_dma_mem *mem)
 {
        PMD_DRV_LOG(DEBUG, "memzone %s to be freed with physical address: "
@@ -345,6 +345,21 @@ static inline void list_add_tail(struct ice_list_entry *entry,
                                  member) :                                    \
                     0)
 
+#define LIST_FOR_EACH_ENTRY_SAFE(pos, tmp, head, type, member)                \
+       for ((pos) = (head)->lh_first ?                                        \
+                    container_of((head)->lh_first, struct type, member) :     \
+                    0,                                                        \
+                    (tmp) = (pos) == 0 ? 0 : ((pos)->member.next.le_next ?    \
+                    container_of((pos)->member.next.le_next, struct type,     \
+                                 member) :                                    \
+                    0);                                                       \
+            (pos);                                                            \
+            (pos) = (tmp),                                                    \
+            (tmp) = (pos) == 0 ? 0 : ((tmp)->member.next.le_next ?            \
+                    container_of((pos)->member.next.le_next, struct type,     \
+                                 member) :                                    \
+                    0))
+
 #define LIST_REPLACE_INIT(list_head, head) do {                                \
        (head)->lh_first = (list_head)->lh_first;                       \
        INIT_LIST_HEAD(list_head);                                      \
@@ -358,8 +373,6 @@ static inline void list_add_tail(struct ice_list_entry *entry,
 #define HLIST_DEL(entry)                       LIST_DEL(entry)
 #define HLIST_FOR_EACH_ENTRY(pos, head, type, member) \
        LIST_FOR_EACH_ENTRY(pos, head, type, member)
-#define LIST_FOR_EACH_ENTRY_SAFE(pos, tmp, head, type, member) \
-       LIST_FOR_EACH_ENTRY(pos, head, type, member)
 
 #ifndef ICE_DBG_TRACE
 #define ICE_DBG_TRACE          BIT_ULL(0)