Lines Matching refs:rec
219 sa_conv_pathrec_to_gid_type(struct sa_path_rec *rec) in sa_conv_pathrec_to_gid_type() argument
221 switch (rec->rec_type) { in sa_conv_pathrec_to_gid_type()
453 u8 port_num, struct sa_path_rec *rec,
462 struct ib_sa_service_rec *rec,
471 struct ib_sa_mcmember_rec rec; member
508 struct ib_sa_mcmember_rec *rec,
537 union ib_gid *mgid, struct ib_sa_mcmember_rec *rec);
544 struct ib_sa_mcmember_rec *rec,
550 struct sa_path_rec *rec,
558 void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute);
564 void ib_sa_unpack_path(void *attribute, struct sa_path_rec *rec);
569 struct ib_sa_guidinfo_rec *rec,
581 static inline bool sa_path_is_roce(struct sa_path_rec *rec) in sa_path_is_roce() argument
583 return ((rec->rec_type == SA_PATH_REC_TYPE_ROCE_V1) || in sa_path_is_roce()
584 (rec->rec_type == SA_PATH_REC_TYPE_ROCE_V2)); in sa_path_is_roce()
587 static inline bool sa_path_is_opa(struct sa_path_rec *rec) in sa_path_is_opa() argument
589 return (rec->rec_type == SA_PATH_REC_TYPE_OPA); in sa_path_is_opa()
592 static inline void sa_path_set_slid(struct sa_path_rec *rec, u32 slid) in sa_path_set_slid() argument
594 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_slid()
595 rec->ib.slid = cpu_to_be16(slid); in sa_path_set_slid()
596 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_slid()
597 rec->opa.slid = cpu_to_be32(slid); in sa_path_set_slid()
600 static inline void sa_path_set_dlid(struct sa_path_rec *rec, u32 dlid) in sa_path_set_dlid() argument
602 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_dlid()
603 rec->ib.dlid = cpu_to_be16(dlid); in sa_path_set_dlid()
604 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_dlid()
605 rec->opa.dlid = cpu_to_be32(dlid); in sa_path_set_dlid()
608 static inline void sa_path_set_raw_traffic(struct sa_path_rec *rec, in sa_path_set_raw_traffic() argument
611 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_raw_traffic()
612 rec->ib.raw_traffic = raw_traffic; in sa_path_set_raw_traffic()
613 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_raw_traffic()
614 rec->opa.raw_traffic = raw_traffic; in sa_path_set_raw_traffic()
617 static inline __be32 sa_path_get_slid(struct sa_path_rec *rec) in sa_path_get_slid() argument
619 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_slid()
620 return htonl(ntohs(rec->ib.slid)); in sa_path_get_slid()
621 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_slid()
622 return rec->opa.slid; in sa_path_get_slid()
626 static inline __be32 sa_path_get_dlid(struct sa_path_rec *rec) in sa_path_get_dlid() argument
628 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_dlid()
629 return htonl(ntohs(rec->ib.dlid)); in sa_path_get_dlid()
630 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_dlid()
631 return rec->opa.dlid; in sa_path_get_dlid()
635 static inline u8 sa_path_get_raw_traffic(struct sa_path_rec *rec) in sa_path_get_raw_traffic() argument
637 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_raw_traffic()
638 return rec->ib.raw_traffic; in sa_path_get_raw_traffic()
639 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_raw_traffic()
640 return rec->opa.raw_traffic; in sa_path_get_raw_traffic()
644 static inline void sa_path_set_dmac(struct sa_path_rec *rec, u8 *dmac) in sa_path_set_dmac() argument
646 if (sa_path_is_roce(rec)) in sa_path_set_dmac()
647 memcpy(rec->roce.dmac, dmac, ETH_ALEN); in sa_path_set_dmac()
650 static inline void sa_path_set_dmac_zero(struct sa_path_rec *rec) in sa_path_set_dmac_zero() argument
652 if (sa_path_is_roce(rec)) in sa_path_set_dmac_zero()
653 eth_zero_addr(rec->roce.dmac); in sa_path_set_dmac_zero()
656 static inline u8 *sa_path_get_dmac(struct sa_path_rec *rec) in sa_path_get_dmac() argument
658 if (sa_path_is_roce(rec)) in sa_path_get_dmac()
659 return rec->roce.dmac; in sa_path_get_dmac()