net/mlx5: fix VLAN stripping indication
[dpdk.git] / drivers / net / qede / base / ecore_chain.h
index bc18c41..61e39b5 100644 (file)
@@ -54,6 +54,11 @@ struct ecore_chain_pbl_u32 {
        u32 cons_page_idx;
 };
 
+struct ecore_chain_ext_pbl {
+       dma_addr_t p_pbl_phys;
+       void *p_pbl_virt;
+};
+
 struct ecore_chain_pbl {
        /* Base address of a pre-allocated buffer for pbl */
        dma_addr_t p_phys_table;
@@ -69,6 +74,8 @@ struct ecore_chain_pbl {
                struct ecore_chain_pbl_u16 pbl16;
                struct ecore_chain_pbl_u32 pbl32;
        } u;
+
+       bool external;
 };
 
 struct ecore_chain_u16 {
@@ -118,6 +125,8 @@ struct ecore_chain {
        u16 next_page_mask;
 
        struct ecore_chain_pbl pbl;
+
+       void *dp_ctx;
 };
 
 #define ECORE_CHAIN_PBL_ENTRY_SIZE     (8)
@@ -307,21 +316,23 @@ ecore_chain_advance_page(struct ecore_chain *p_chain, void **p_next_elem,
        (((p)->u.chain32.idx & (p)->elem_per_page_mask) == (p)->usable_per_page)
 
 #define is_unusable_next_idx(p, idx)           \
-       ((((p)->u.chain16.idx + 1) & (p)->elem_per_page_mask) == \
-       (p)->usable_per_page)
+       ((((p)->u.chain16.idx + 1) &            \
+       (p)->elem_per_page_mask) == (p)->usable_per_page)
 
 #define is_unusable_next_idx_u32(p, idx)       \
-       ((((p)->u.chain32.idx + 1) & (p)->elem_per_page_mask) \
-       == (p)->usable_per_page)
+       ((((p)->u.chain32.idx + 1) &            \
+       (p)->elem_per_page_mask) == (p)->usable_per_page)
 
 #define test_and_skip(p, idx)                                          \
        do {                                                            \
                if (is_chain_u16(p)) {                                  \
                        if (is_unusable_idx(p, idx))                    \
-                               (p)->u.chain16.idx += (p)->elem_unusable; \
+                               (p)->u.chain16.idx +=                   \
+                                       (p)->elem_unusable;             \
                } else {                                                \
                        if (is_unusable_idx_u32(p, idx))                \
-                               (p)->u.chain32.idx += (p)->elem_unusable; \
+                               (p)->u.chain32.idx +=                   \
+                                       (p)->elem_unusable;             \
                }                                                       \
        } while (0)
 
@@ -540,12 +551,13 @@ static OSAL_INLINE void ecore_chain_reset(struct ecore_chain *p_chain)
  * @param intended_use
  * @param mode
  * @param cnt_type
+ * @param dp_ctx
  */
 static OSAL_INLINE void
 ecore_chain_init_params(struct ecore_chain *p_chain, u32 page_cnt, u8 elem_size,
                        enum ecore_chain_use_mode intended_use,
                        enum ecore_chain_mode mode,
-                       enum ecore_chain_cnt_type cnt_type)
+                       enum ecore_chain_cnt_type cnt_type, void *dp_ctx)
 {
        /* chain fixed parameters */
        p_chain->p_virt_addr = OSAL_NULL;
@@ -565,10 +577,12 @@ ecore_chain_init_params(struct ecore_chain *p_chain, u32 page_cnt, u8 elem_size,
        p_chain->page_cnt = page_cnt;
        p_chain->capacity = p_chain->usable_per_page * page_cnt;
        p_chain->size = p_chain->elem_per_page * page_cnt;
-
+       p_chain->pbl.external = false;
        p_chain->pbl.p_phys_table = 0;
        p_chain->pbl.p_virt_table = OSAL_NULL;
        p_chain->pbl.pp_virt_addr_tbl = OSAL_NULL;
+
+       p_chain->dp_ctx = dp_ctx;
 }
 
 /**
@@ -721,4 +735,14 @@ static OSAL_INLINE void ecore_chain_pbl_zero_mem(struct ecore_chain *p_chain)
                              ECORE_CHAIN_PAGE_SIZE);
 }
 
+int ecore_chain_print(struct ecore_chain *p_chain, char *buffer,
+                     u32 buffer_size, u32 *element_indx, u32 stop_indx,
+                     bool print_metadata,
+                     int (*func_ptr_print_element)(struct ecore_chain *p_chain,
+                                                   void *p_element,
+                                                   char *buffer),
+                     int (*func_ptr_print_metadata)(struct ecore_chain
+                                                    *p_chain,
+                                                    char *buffer));
+
 #endif /* __ECORE_CHAIN_H__ */