Lines Matching refs:rec
192 sa_conv_pathrec_to_gid_type(struct sa_path_rec *rec) in sa_conv_pathrec_to_gid_type() argument
194 switch (rec->rec_type) { in sa_conv_pathrec_to_gid_type()
412 u32 port_num, struct sa_path_rec *rec,
420 struct ib_sa_mcmember_rec rec; member
458 struct ib_sa_mcmember_rec *rec,
487 union ib_gid *mgid, struct ib_sa_mcmember_rec *rec);
494 struct ib_sa_mcmember_rec *rec,
500 struct sa_path_rec *rec,
508 void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute);
514 void ib_sa_unpack_path(void *attribute, struct sa_path_rec *rec);
519 struct ib_sa_guidinfo_rec *rec,
527 static inline bool sa_path_is_roce(struct sa_path_rec *rec) in sa_path_is_roce() argument
529 return ((rec->rec_type == SA_PATH_REC_TYPE_ROCE_V1) || in sa_path_is_roce()
530 (rec->rec_type == SA_PATH_REC_TYPE_ROCE_V2)); in sa_path_is_roce()
533 static inline bool sa_path_is_opa(struct sa_path_rec *rec) in sa_path_is_opa() argument
535 return (rec->rec_type == SA_PATH_REC_TYPE_OPA); in sa_path_is_opa()
538 static inline void sa_path_set_slid(struct sa_path_rec *rec, u32 slid) in sa_path_set_slid() argument
540 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_slid()
541 rec->ib.slid = cpu_to_be16(slid); in sa_path_set_slid()
542 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_slid()
543 rec->opa.slid = cpu_to_be32(slid); in sa_path_set_slid()
546 static inline void sa_path_set_dlid(struct sa_path_rec *rec, u32 dlid) in sa_path_set_dlid() argument
548 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_dlid()
549 rec->ib.dlid = cpu_to_be16(dlid); in sa_path_set_dlid()
550 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_dlid()
551 rec->opa.dlid = cpu_to_be32(dlid); in sa_path_set_dlid()
554 static inline void sa_path_set_raw_traffic(struct sa_path_rec *rec, in sa_path_set_raw_traffic() argument
557 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_set_raw_traffic()
558 rec->ib.raw_traffic = raw_traffic; in sa_path_set_raw_traffic()
559 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_set_raw_traffic()
560 rec->opa.raw_traffic = raw_traffic; in sa_path_set_raw_traffic()
563 static inline __be32 sa_path_get_slid(struct sa_path_rec *rec) in sa_path_get_slid() argument
565 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_slid()
566 return htonl(ntohs(rec->ib.slid)); in sa_path_get_slid()
567 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_slid()
568 return rec->opa.slid; in sa_path_get_slid()
572 static inline __be32 sa_path_get_dlid(struct sa_path_rec *rec) in sa_path_get_dlid() argument
574 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_dlid()
575 return htonl(ntohs(rec->ib.dlid)); in sa_path_get_dlid()
576 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_dlid()
577 return rec->opa.dlid; in sa_path_get_dlid()
581 static inline u8 sa_path_get_raw_traffic(struct sa_path_rec *rec) in sa_path_get_raw_traffic() argument
583 if (rec->rec_type == SA_PATH_REC_TYPE_IB) in sa_path_get_raw_traffic()
584 return rec->ib.raw_traffic; in sa_path_get_raw_traffic()
585 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA) in sa_path_get_raw_traffic()
586 return rec->opa.raw_traffic; in sa_path_get_raw_traffic()
590 static inline void sa_path_set_dmac(struct sa_path_rec *rec, u8 *dmac) in sa_path_set_dmac() argument
592 if (sa_path_is_roce(rec)) in sa_path_set_dmac()
593 memcpy(rec->roce.dmac, dmac, ETH_ALEN); in sa_path_set_dmac()
596 static inline void sa_path_set_dmac_zero(struct sa_path_rec *rec) in sa_path_set_dmac_zero() argument
598 if (sa_path_is_roce(rec)) in sa_path_set_dmac_zero()
599 eth_zero_addr(rec->roce.dmac); in sa_path_set_dmac_zero()
602 static inline u8 *sa_path_get_dmac(struct sa_path_rec *rec) in sa_path_get_dmac() argument
604 if (sa_path_is_roce(rec)) in sa_path_get_dmac()
605 return rec->roce.dmac; in sa_path_get_dmac()