Lines Matching refs:rec

193 		sa_conv_pathrec_to_gid_type(struct sa_path_rec *rec)  in sa_conv_pathrec_to_gid_type()  argument
195 switch (rec->rec_type) { in sa_conv_pathrec_to_gid_type()
413 u32 port_num, struct sa_path_rec *rec,
421 struct ib_sa_mcmember_rec rec; member
459 struct ib_sa_mcmember_rec *rec,
488 union ib_gid *mgid, struct ib_sa_mcmember_rec *rec);
495 struct ib_sa_mcmember_rec *rec,
501 struct sa_path_rec *rec,
509 void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute);
515 void ib_sa_unpack_path(void *attribute, struct sa_path_rec *rec);
520 struct ib_sa_guidinfo_rec *rec,
528 static inline bool sa_path_is_roce(struct sa_path_rec *rec) in sa_path_is_roce() argument
530 return ((rec->rec_type == SA_PATH_REC_TYPE_ROCE_V1) || in sa_path_is_roce()
531 (rec->rec_type == SA_PATH_REC_TYPE_ROCE_V2)); in sa_path_is_roce()
534 static inline bool sa_path_is_opa(struct sa_path_rec *rec) in sa_path_is_opa() argument
536 return (rec->rec_type == SA_PATH_REC_TYPE_OPA); in sa_path_is_opa()
539 static inline void sa_path_set_slid(struct sa_path_rec *rec, u32 slid) in sa_path_set_slid() argument
541 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_slid()
542 rec->ib.slid = cpu_to_be16(slid); in sa_path_set_slid()
543 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_slid()
544 rec->opa.slid = cpu_to_be32(slid); in sa_path_set_slid()
547 static inline void sa_path_set_dlid(struct sa_path_rec *rec, u32 dlid) in sa_path_set_dlid() argument
549 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_dlid()
550 rec->ib.dlid = cpu_to_be16(dlid); in sa_path_set_dlid()
551 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_dlid()
552 rec->opa.dlid = cpu_to_be32(dlid); in sa_path_set_dlid()
555 static inline void sa_path_set_raw_traffic(struct sa_path_rec *rec, in sa_path_set_raw_traffic() argument
558 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_raw_traffic()
559 rec->ib.raw_traffic = raw_traffic; in sa_path_set_raw_traffic()
560 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_raw_traffic()
561 rec->opa.raw_traffic = raw_traffic; in sa_path_set_raw_traffic()
564 static inline __be32 sa_path_get_slid(struct sa_path_rec *rec) in sa_path_get_slid() argument
566 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_slid()
567 return htonl(ntohs(rec->ib.slid)); in sa_path_get_slid()
568 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_slid()
569 return rec->opa.slid; in sa_path_get_slid()
573 static inline __be32 sa_path_get_dlid(struct sa_path_rec *rec) in sa_path_get_dlid() argument
575 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_dlid()
576 return htonl(ntohs(rec->ib.dlid)); in sa_path_get_dlid()
577 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_dlid()
578 return rec->opa.dlid; in sa_path_get_dlid()
582 static inline u8 sa_path_get_raw_traffic(struct sa_path_rec *rec) in sa_path_get_raw_traffic() argument
584 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_raw_traffic()
585 return rec->ib.raw_traffic; in sa_path_get_raw_traffic()
586 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_raw_traffic()
587 return rec->opa.raw_traffic; in sa_path_get_raw_traffic()
591 static inline void sa_path_set_dmac(struct sa_path_rec *rec, u8 *dmac) in sa_path_set_dmac() argument
593 if (sa_path_is_roce(rec)) in sa_path_set_dmac()
594 memcpy(rec->roce.dmac, dmac, ETH_ALEN); in sa_path_set_dmac()
597 static inline void sa_path_set_dmac_zero(struct sa_path_rec *rec) in sa_path_set_dmac_zero() argument
599 if (sa_path_is_roce(rec)) in sa_path_set_dmac_zero()
600 eth_zero_addr(rec->roce.dmac); in sa_path_set_dmac_zero()
603 static inline u8 *sa_path_get_dmac(struct sa_path_rec *rec) in sa_path_get_dmac() argument
605 if (sa_path_is_roce(rec)) in sa_path_get_dmac()
606 return rec->roce.dmac; in sa_path_get_dmac()