linux/drivers/infiniband/sw/rxe/rxe_hdr.h

/* SPDX-License-Identifier: GPL-2.0 OR Linux-OpenIB */
/*
 * Copyright (c) 2016 Mellanox Technologies Ltd. All rights reserved.
 * Copyright (c) 2015 System Fabric Works, Inc. All rights reserved.
 */

#ifndef RXE_HDR_H
#define RXE_HDR_H

/* extracted information about a packet carried in an sk_buff struct fits in
 * the skbuff cb array. Must be at most 48 bytes. stored in control block of
 * sk_buff for received packets.
 */
struct rxe_pkt_info {};

/* Macros should be used only for received skb */
static inline struct rxe_pkt_info *SKB_TO_PKT(struct sk_buff *skb)
{}

static inline struct sk_buff *PKT_TO_SKB(struct rxe_pkt_info *pkt)
{}

/*
 * IBA header types and methods
 *
 * Some of these are for reference and completeness only since
 * rxe does not currently support RD transport
 * most of this could be moved into IB core. ib_pack.h has
 * part of this but is incomplete
 *
 * Header specific routines to insert/extract values to/from headers
 * the routines that are named __hhh_(set_)fff() take a pointer to a
 * hhh header and get(set) the fff field. The routines named
 * hhh_(set_)fff take a packet info struct and find the
 * header and field based on the opcode in the packet.
 * Conversion to/from network byte order from cpu order is also done.
 */

#define RXE_ICRC_SIZE
#define RXE_MAX_HDR_LENGTH

/******************************************************************************
 * Base Transport Header
 ******************************************************************************/
struct rxe_bth {};

#define BTH_TVER
#define BTH_DEF_PKEY

#define BTH_SE_MASK
#define BTH_MIG_MASK
#define BTH_PAD_MASK
#define BTH_TVER_MASK
#define BTH_FECN_MASK
#define BTH_BECN_MASK
#define BTH_RESV6A_MASK
#define BTH_QPN_MASK
#define BTH_ACK_MASK
#define BTH_RESV7_MASK
#define BTH_PSN_MASK

static inline u8 __bth_opcode(void *arg)
{}

static inline void __bth_set_opcode(void *arg, u8 opcode)
{}

static inline u8 __bth_se(void *arg)
{}

static inline void __bth_set_se(void *arg, int se)
{}

static inline u8 __bth_mig(void *arg)
{}

static inline void __bth_set_mig(void *arg, u8 mig)
{}

static inline u8 __bth_pad(void *arg)
{}

static inline void __bth_set_pad(void *arg, u8 pad)
{}

static inline u8 __bth_tver(void *arg)
{}

static inline void __bth_set_tver(void *arg, u8 tver)
{}

static inline u16 __bth_pkey(void *arg)
{}

static inline void __bth_set_pkey(void *arg, u16 pkey)
{}

static inline u32 __bth_qpn(void *arg)
{}

static inline void __bth_set_qpn(void *arg, u32 qpn)
{}

static inline int __bth_fecn(void *arg)
{}

static inline void __bth_set_fecn(void *arg, int fecn)
{}

static inline int __bth_becn(void *arg)
{}

static inline void __bth_set_becn(void *arg, int becn)
{}

static inline u8 __bth_resv6a(void *arg)
{}

static inline void __bth_set_resv6a(void *arg)
{}

static inline int __bth_ack(void *arg)
{}

static inline void __bth_set_ack(void *arg, int ack)
{}

static inline void __bth_set_resv7(void *arg)
{}

static inline u32 __bth_psn(void *arg)
{}

static inline void __bth_set_psn(void *arg, u32 psn)
{}

static inline u8 bth_opcode(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_opcode(struct rxe_pkt_info *pkt, u8 opcode)
{}

static inline u8 bth_se(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_se(struct rxe_pkt_info *pkt, int se)
{}

static inline u8 bth_mig(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_mig(struct rxe_pkt_info *pkt, u8 mig)
{}

static inline u8 bth_pad(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_pad(struct rxe_pkt_info *pkt, u8 pad)
{}

static inline u8 bth_tver(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_tver(struct rxe_pkt_info *pkt, u8 tver)
{}

static inline u16 bth_pkey(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_pkey(struct rxe_pkt_info *pkt, u16 pkey)
{}

static inline u32 bth_qpn(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_qpn(struct rxe_pkt_info *pkt, u32 qpn)
{}

static inline int bth_fecn(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_fecn(struct rxe_pkt_info *pkt, int fecn)
{}

static inline int bth_becn(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_becn(struct rxe_pkt_info *pkt, int becn)
{}

static inline u8 bth_resv6a(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_resv6a(struct rxe_pkt_info *pkt)
{}

static inline int bth_ack(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_ack(struct rxe_pkt_info *pkt, int ack)
{}

static inline void bth_set_resv7(struct rxe_pkt_info *pkt)
{}

static inline u32 bth_psn(struct rxe_pkt_info *pkt)
{}

static inline void bth_set_psn(struct rxe_pkt_info *pkt, u32 psn)
{}

static inline void bth_init(struct rxe_pkt_info *pkt, u8 opcode, int se,
			    int mig, int pad, u16 pkey, u32 qpn, int ack_req,
			    u32 psn)
{}

/******************************************************************************
 * Reliable Datagram Extended Transport Header
 ******************************************************************************/
struct rxe_rdeth {};

#define RDETH_EEN_MASK

static inline u8 __rdeth_een(void *arg)
{}

static inline void __rdeth_set_een(void *arg, u32 een)
{}

static inline u8 rdeth_een(struct rxe_pkt_info *pkt)
{}

static inline void rdeth_set_een(struct rxe_pkt_info *pkt, u32 een)
{}

/******************************************************************************
 * Datagram Extended Transport Header
 ******************************************************************************/
struct rxe_deth {};

#define GSI_QKEY
#define DETH_SQP_MASK

static inline u32 __deth_qkey(void *arg)
{}

static inline void __deth_set_qkey(void *arg, u32 qkey)
{}

static inline u32 __deth_sqp(void *arg)
{}

static inline void __deth_set_sqp(void *arg, u32 sqp)
{}

static inline u32 deth_qkey(struct rxe_pkt_info *pkt)
{}

static inline void deth_set_qkey(struct rxe_pkt_info *pkt, u32 qkey)
{}

static inline u32 deth_sqp(struct rxe_pkt_info *pkt)
{}

static inline void deth_set_sqp(struct rxe_pkt_info *pkt, u32 sqp)
{}

/******************************************************************************
 * RDMA Extended Transport Header
 ******************************************************************************/
struct rxe_reth {};

static inline u64 __reth_va(void *arg)
{}

static inline void __reth_set_va(void *arg, u64 va)
{}

static inline u32 __reth_rkey(void *arg)
{}

static inline void __reth_set_rkey(void *arg, u32 rkey)
{}

static inline u32 __reth_len(void *arg)
{}

static inline void __reth_set_len(void *arg, u32 len)
{}

static inline u64 reth_va(struct rxe_pkt_info *pkt)
{}

static inline void reth_set_va(struct rxe_pkt_info *pkt, u64 va)
{}

static inline u32 reth_rkey(struct rxe_pkt_info *pkt)
{}

static inline void reth_set_rkey(struct rxe_pkt_info *pkt, u32 rkey)
{}

static inline u32 reth_len(struct rxe_pkt_info *pkt)
{}

static inline void reth_set_len(struct rxe_pkt_info *pkt, u32 len)
{}

/******************************************************************************
 * FLUSH Extended Transport Header
 ******************************************************************************/

struct rxe_feth {};

#define FETH_PLT_MASK
#define FETH_SEL_MASK
#define FETH_SEL_SHIFT

static inline u32 __feth_plt(void *arg)
{}

static inline u32 __feth_sel(void *arg)
{}

static inline u32 feth_plt(struct rxe_pkt_info *pkt)
{}

static inline u32 feth_sel(struct rxe_pkt_info *pkt)
{}

static inline void feth_init(struct rxe_pkt_info *pkt, u8 type, u8 level)
{}

/******************************************************************************
 * Atomic Extended Transport Header
 ******************************************************************************/
struct rxe_atmeth {} __packed;

static inline u64 __atmeth_va(void *arg)
{}

static inline void __atmeth_set_va(void *arg, u64 va)
{}

static inline u32 __atmeth_rkey(void *arg)
{}

static inline void __atmeth_set_rkey(void *arg, u32 rkey)
{}

static inline u64 __atmeth_swap_add(void *arg)
{}

static inline void __atmeth_set_swap_add(void *arg, u64 swap_add)
{}

static inline u64 __atmeth_comp(void *arg)
{}

static inline void __atmeth_set_comp(void *arg, u64 comp)
{}

static inline u64 atmeth_va(struct rxe_pkt_info *pkt)
{}

static inline void atmeth_set_va(struct rxe_pkt_info *pkt, u64 va)
{}

static inline u32 atmeth_rkey(struct rxe_pkt_info *pkt)
{}

static inline void atmeth_set_rkey(struct rxe_pkt_info *pkt, u32 rkey)
{}

static inline u64 atmeth_swap_add(struct rxe_pkt_info *pkt)
{}

static inline void atmeth_set_swap_add(struct rxe_pkt_info *pkt, u64 swap_add)
{}

static inline u64 atmeth_comp(struct rxe_pkt_info *pkt)
{}

static inline void atmeth_set_comp(struct rxe_pkt_info *pkt, u64 comp)
{}

/******************************************************************************
 * Ack Extended Transport Header
 ******************************************************************************/
struct rxe_aeth {};

#define AETH_SYN_MASK
#define AETH_MSN_MASK

enum aeth_syndrome {};

static inline u8 __aeth_syn(void *arg)
{}

static inline void __aeth_set_syn(void *arg, u8 syn)
{}

static inline u32 __aeth_msn(void *arg)
{}

static inline void __aeth_set_msn(void *arg, u32 msn)
{}

static inline u8 aeth_syn(struct rxe_pkt_info *pkt)
{}

static inline void aeth_set_syn(struct rxe_pkt_info *pkt, u8 syn)
{}

static inline u32 aeth_msn(struct rxe_pkt_info *pkt)
{}

static inline void aeth_set_msn(struct rxe_pkt_info *pkt, u32 msn)
{}

/******************************************************************************
 * Atomic Ack Extended Transport Header
 ******************************************************************************/
struct rxe_atmack {};

static inline u64 __atmack_orig(void *arg)
{}

static inline void __atmack_set_orig(void *arg, u64 orig)
{}

static inline u64 atmack_orig(struct rxe_pkt_info *pkt)
{}

static inline void atmack_set_orig(struct rxe_pkt_info *pkt, u64 orig)
{}

/******************************************************************************
 * Immediate Extended Transport Header
 ******************************************************************************/
struct rxe_immdt {};

static inline __be32 __immdt_imm(void *arg)
{}

static inline void __immdt_set_imm(void *arg, __be32 imm)
{}

static inline __be32 immdt_imm(struct rxe_pkt_info *pkt)
{}

static inline void immdt_set_imm(struct rxe_pkt_info *pkt, __be32 imm)
{}

/******************************************************************************
 * Invalidate Extended Transport Header
 ******************************************************************************/
struct rxe_ieth {};

static inline u32 __ieth_rkey(void *arg)
{}

static inline void __ieth_set_rkey(void *arg, u32 rkey)
{}

static inline u32 ieth_rkey(struct rxe_pkt_info *pkt)
{}

static inline void ieth_set_rkey(struct rxe_pkt_info *pkt, u32 rkey)
{}

enum rxe_hdr_length {};

static inline size_t header_size(struct rxe_pkt_info *pkt)
{}

static inline void *payload_addr(struct rxe_pkt_info *pkt)
{}

static inline size_t payload_size(struct rxe_pkt_info *pkt)
{}

#endif /* RXE_HDR_H */