Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 or Linux-OpenIB */
0002 /* Copyright (c) 2016 - 2021 Intel Corporation */
0003 #ifndef IRDMA_UDA_H
0004 #define IRDMA_UDA_H
0005 
0006 #define IRDMA_UDA_MAX_FSI_MGS   4096
0007 #define IRDMA_UDA_MAX_PFS   16
0008 #define IRDMA_UDA_MAX_VFS   128
0009 
0010 struct irdma_sc_cqp;
0011 
0012 struct irdma_ah_info {
0013     struct irdma_sc_vsi *vsi;
0014     u32 pd_idx;
0015     u32 dst_arpindex;
0016     u32 dest_ip_addr[4];
0017     u32 src_ip_addr[4];
0018     u32 flow_label;
0019     u32 ah_idx;
0020     u16 vlan_tag;
0021     u8 insert_vlan_tag;
0022     u8 tc_tos;
0023     u8 hop_ttl;
0024     u8 mac_addr[ETH_ALEN];
0025     bool ah_valid:1;
0026     bool ipv4_valid:1;
0027     bool do_lpbk:1;
0028 };
0029 
0030 struct irdma_sc_ah {
0031     struct irdma_sc_dev *dev;
0032     struct irdma_ah_info ah_info;
0033 };
0034 
0035 int irdma_sc_add_mcast_grp(struct irdma_mcast_grp_info *ctx,
0036                struct irdma_mcast_grp_ctx_entry_info *mg);
0037 int irdma_sc_del_mcast_grp(struct irdma_mcast_grp_info *ctx,
0038                struct irdma_mcast_grp_ctx_entry_info *mg);
0039 int irdma_sc_access_ah(struct irdma_sc_cqp *cqp, struct irdma_ah_info *info,
0040                u32 op, u64 scratch);
0041 int irdma_access_mcast_grp(struct irdma_sc_cqp *cqp,
0042                struct irdma_mcast_grp_info *info, u32 op,
0043                u64 scratch);
0044 
0045 static inline void irdma_sc_init_ah(struct irdma_sc_dev *dev, struct irdma_sc_ah *ah)
0046 {
0047     ah->dev = dev;
0048 }
0049 
0050 static inline int irdma_sc_create_ah(struct irdma_sc_cqp *cqp,
0051                      struct irdma_ah_info *info, u64 scratch)
0052 {
0053     return irdma_sc_access_ah(cqp, info, IRDMA_CQP_OP_CREATE_ADDR_HANDLE,
0054                   scratch);
0055 }
0056 
0057 static inline int irdma_sc_destroy_ah(struct irdma_sc_cqp *cqp,
0058                       struct irdma_ah_info *info, u64 scratch)
0059 {
0060     return irdma_sc_access_ah(cqp, info, IRDMA_CQP_OP_DESTROY_ADDR_HANDLE,
0061                   scratch);
0062 }
0063 
0064 static inline int irdma_sc_create_mcast_grp(struct irdma_sc_cqp *cqp,
0065                         struct irdma_mcast_grp_info *info,
0066                         u64 scratch)
0067 {
0068     return irdma_access_mcast_grp(cqp, info, IRDMA_CQP_OP_CREATE_MCAST_GRP,
0069                       scratch);
0070 }
0071 
0072 static inline int irdma_sc_modify_mcast_grp(struct irdma_sc_cqp *cqp,
0073                         struct irdma_mcast_grp_info *info,
0074                         u64 scratch)
0075 {
0076     return irdma_access_mcast_grp(cqp, info, IRDMA_CQP_OP_MODIFY_MCAST_GRP,
0077                       scratch);
0078 }
0079 
0080 static inline int irdma_sc_destroy_mcast_grp(struct irdma_sc_cqp *cqp,
0081                          struct irdma_mcast_grp_info *info,
0082                          u64 scratch)
0083 {
0084     return irdma_access_mcast_grp(cqp, info, IRDMA_CQP_OP_DESTROY_MCAST_GRP,
0085                       scratch);
0086 }
0087 #endif /* IRDMA_UDA_H */