git.droids-corp.org
/
dpdk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
net/ice/base: print link configure error
[dpdk.git]
/
drivers
/
net
/
ice
/
base
/
ice_osdep.h
diff --git
a/drivers/net/ice/base/ice_osdep.h
b/drivers/net/ice/base/ice_osdep.h
index
0955f56
..
f4cc762
100644
(file)
--- a/
drivers/net/ice/base/ice_osdep.h
+++ b/
drivers/net/ice/base/ice_osdep.h
@@
-1,5
+1,5
@@
/* SPDX-License-Identifier: BSD-3-Clause
/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2018 Intel Corporation
+ * Copyright(c) 2018
-2021
Intel Corporation
*/
#ifndef _ICE_OSDEP_H_
*/
#ifndef _ICE_OSDEP_H_
@@
-24,6
+24,8
@@
#include <rte_random.h>
#include <rte_io.h>
#include <rte_random.h>
#include <rte_io.h>
+#include "ice_alloc.h"
+
#include "../ice_logs.h"
#ifndef __INTEL_NET_BASE_OSDEP__
#include "../ice_logs.h"
#ifndef __INTEL_NET_BASE_OSDEP__
@@
-60,9
+62,24
@@
typedef uint64_t s64;
#define __be64 uint64_t
#endif
#define __be64 uint64_t
#endif
+/* Avoid macro redefinition warning on Windows */
+#ifdef RTE_EXEC_ENV_WINDOWS
+#ifdef min
+#undef min
+#endif
+#ifdef max
+#undef max
+#endif
+#endif
#define min(a, b) RTE_MIN(a, b)
#define max(a, b) RTE_MAX(a, b)
#define min(a, b) RTE_MIN(a, b)
#define max(a, b) RTE_MAX(a, b)
+#ifdef RTE_EXEC_ENV_WINDOWS
+#define ice_access _access
+#else
+#define ice_access access
+#endif
+
#define FIELD_SIZEOF(t, f) RTE_SIZEOF_FIELD(t, f)
#define ARRAY_SIZE(arr) RTE_DIM(arr)
#define FIELD_SIZEOF(t, f) RTE_SIZEOF_FIELD(t, f)
#define ARRAY_SIZE(arr) RTE_DIM(arr)
@@
-76,6
+93,7
@@
typedef uint64_t s64;
#define CPU_TO_BE16(o) rte_cpu_to_be_16(o)
#define CPU_TO_BE32(o) rte_cpu_to_be_32(o)
#define CPU_TO_BE64(o) rte_cpu_to_be_64(o)
#define CPU_TO_BE16(o) rte_cpu_to_be_16(o)
#define CPU_TO_BE32(o) rte_cpu_to_be_32(o)
#define CPU_TO_BE64(o) rte_cpu_to_be_64(o)
+#define BE16_TO_CPU(o) rte_be_to_cpu_16(o)
#define NTOHS(a) rte_be_to_cpu_16(a)
#define NTOHL(a) rte_be_to_cpu_32(a)
#define NTOHS(a) rte_be_to_cpu_16(a)
#define NTOHL(a) rte_be_to_cpu_32(a)
@@
-162,6
+180,7
@@
do { \
#endif
#define ICE_PCI_REG_WRITE(reg, value) writel(value, reg)
#endif
#define ICE_PCI_REG_WRITE(reg, value) writel(value, reg)
+#define ICE_PCI_REG_WC_WRITE(reg, value) rte_write32_wc(value, reg)
#define ICE_READ_REG(hw, reg) rd32(hw, reg)
#define ICE_WRITE_REG(hw, reg, value) wr32(hw, reg, value)
#define ICE_READ_REG(hw, reg) rd32(hw, reg)
#define ICE_WRITE_REG(hw, reg, value) wr32(hw, reg, value)
@@
-193,7
+212,6
@@
struct ice_virt_mem {
#define ice_memset(a, b, c, d) memset((a), (b), (c))
#define ice_memcpy(a, b, c, d) rte_memcpy((a), (b), (c))
#define ice_memset(a, b, c, d) memset((a), (b), (c))
#define ice_memcpy(a, b, c, d) rte_memcpy((a), (b), (c))
-#define ice_memdup(a, b, c, d) rte_memcpy(ice_malloc(a, c), b, c)
/* SW spinlock */
struct ice_lock {
/* SW spinlock */
struct ice_lock {
@@
-225,6
+243,19
@@
ice_destroy_lock(__rte_unused struct ice_lock *sp)
struct ice_hw;
struct ice_hw;
+static __rte_always_inline void *
+ice_memdup(__rte_unused struct ice_hw *hw, const void *src, size_t size,
+ __rte_unused enum ice_memcpy_type dir)
+{
+ void *p;
+
+ p = ice_malloc(hw, size);
+ if (p)
+ rte_memcpy(p, src, size);
+
+ return p;
+}
+
static inline void *
ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
struct ice_dma_mem *mem, u64 size)
static inline void *
ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
struct ice_dma_mem *mem, u64 size)
@@
-243,7
+274,7
@@
ice_alloc_dma_mem(__rte_unused struct ice_hw *hw,
mem->size = size;
mem->va = mz->addr;
mem->size = size;
mem->va = mz->addr;
- mem->pa = mz->
phys_addr
;
+ mem->pa = mz->
iova
;
mem->zone = (const void *)mz;
PMD_DRV_LOG(DEBUG, "memzone %s allocated with physical address: "
"%"PRIu64, mz->name, mem->pa);
mem->zone = (const void *)mz;
PMD_DRV_LOG(DEBUG, "memzone %s allocated with physical address: "
"%"PRIu64, mz->name, mem->pa);