]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/spdk/dpdk/drivers/net/enic/base/rq_enet_desc.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / spdk / dpdk / drivers / net / enic / base / rq_enet_desc.h
index 3585bf3ab6590f9d8ab4c5db9ac70af9276c9ef8..c79c0287bfad7f0a215635e9f5c7210179ded15e 100644 (file)
@@ -6,11 +6,13 @@
 #ifndef _RQ_ENET_DESC_H_
 #define _RQ_ENET_DESC_H_
 
+#include <rte_byteorder.h>
+
 /* Ethernet receive queue descriptor: 16B */
 struct rq_enet_desc {
-       __le64 address;
-       __le16 length_type;
-       u8 reserved[6];
+       uint64_t address;
+       uint16_t length_type;
+       uint8_t reserved[6];
 };
 
 enum rq_enet_type_types {
@@ -27,20 +29,20 @@ enum rq_enet_type_types {
 #define RQ_ENET_TYPE_MASK              ((1 << RQ_ENET_TYPE_BITS) - 1)
 
 static inline void rq_enet_desc_enc(volatile struct rq_enet_desc *desc,
-       u64 address, u8 type, u16 length)
+       uint64_t address, uint8_t type, uint16_t length)
 {
-       desc->address = cpu_to_le64(address);
-       desc->length_type = cpu_to_le16((length & RQ_ENET_LEN_MASK) |
+       desc->address = rte_cpu_to_le_64(address);
+       desc->length_type = rte_cpu_to_le_16((length & RQ_ENET_LEN_MASK) |
                ((type & RQ_ENET_TYPE_MASK) << RQ_ENET_LEN_BITS));
 }
 
 static inline void rq_enet_desc_dec(struct rq_enet_desc *desc,
-       u64 *address, u8 *type, u16 *length)
+       uint64_t *address, uint8_t *type, uint16_t *length)
 {
-       *address = le64_to_cpu(desc->address);
-       *length = le16_to_cpu(desc->length_type) & RQ_ENET_LEN_MASK;
-       *type = (u8)((le16_to_cpu(desc->length_type) >> RQ_ENET_LEN_BITS) &
-               RQ_ENET_TYPE_MASK);
+       *address = rte_le_to_cpu_64(desc->address);
+       *length = rte_le_to_cpu_16(desc->length_type) & RQ_ENET_LEN_MASK;
+       *type = (uint8_t)((rte_le_to_cpu_16(desc->length_type) >>
+               RQ_ENET_LEN_BITS) & RQ_ENET_TYPE_MASK);
 }
 
 #endif /* _RQ_ENET_DESC_H_ */