Lines Matching refs:rec
192 sa_conv_pathrec_to_gid_type(struct sa_path_rec *rec)
194 switch (rec->rec_type) {
426 u8 port_num, struct sa_path_rec *rec,
435 struct ib_sa_service_rec *rec,
444 struct ib_sa_mcmember_rec rec;
458 * @rec: SA multicast member record specifying group attributes.
459 * @comp_mask: Component mask indicating which group attributes of %rec are
481 struct ib_sa_mcmember_rec *rec,
507 * @rec: Location to copy SA multicast member record.
510 union ib_gid *mgid, struct ib_sa_mcmember_rec *rec);
517 struct ib_sa_mcmember_rec *rec,
523 struct sa_path_rec *rec,
531 void ib_sa_pack_path(struct sa_path_rec *rec, void *attribute);
537 void ib_sa_unpack_path(void *attribute, struct sa_path_rec *rec);
542 struct ib_sa_guidinfo_rec *rec,
554 static inline bool sa_path_is_roce(struct sa_path_rec *rec)
556 return ((rec->rec_type == SA_PATH_REC_TYPE_ROCE_V1) ||
557 (rec->rec_type == SA_PATH_REC_TYPE_ROCE_V2));
560 static inline bool sa_path_is_opa(struct sa_path_rec *rec)
562 return (rec->rec_type == SA_PATH_REC_TYPE_OPA);
565 static inline void sa_path_set_slid(struct sa_path_rec *rec, u32 slid)
567 if (rec->rec_type == SA_PATH_REC_TYPE_IB)
568 rec->ib.slid = cpu_to_be16(slid);
569 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA)
570 rec->opa.slid = cpu_to_be32(slid);
573 static inline void sa_path_set_dlid(struct sa_path_rec *rec, u32 dlid)
575 if (rec->rec_type == SA_PATH_REC_TYPE_IB)
576 rec->ib.dlid = cpu_to_be16(dlid);
577 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA)
578 rec->opa.dlid = cpu_to_be32(dlid);
581 static inline void sa_path_set_raw_traffic(struct sa_path_rec *rec,
584 if (rec->rec_type == SA_PATH_REC_TYPE_IB)
585 rec->ib.raw_traffic = raw_traffic;
586 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA)
587 rec->opa.raw_traffic = raw_traffic;
590 static inline __be32 sa_path_get_slid(struct sa_path_rec *rec)
592 if (rec->rec_type == SA_PATH_REC_TYPE_IB)
593 return htonl(ntohs(rec->ib.slid));
594 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA)
595 return rec->opa.slid;
599 static inline __be32 sa_path_get_dlid(struct sa_path_rec *rec)
601 if (rec->rec_type == SA_PATH_REC_TYPE_IB)
602 return htonl(ntohs(rec->ib.dlid));
603 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA)
604 return rec->opa.dlid;
608 static inline u8 sa_path_get_raw_traffic(struct sa_path_rec *rec)
610 if (rec->rec_type == SA_PATH_REC_TYPE_IB)
611 return rec->ib.raw_traffic;
612 else if (rec->rec_type == SA_PATH_REC_TYPE_OPA)
613 return rec->opa.raw_traffic;
617 static inline void sa_path_set_dmac(struct sa_path_rec *rec, u8 *dmac)
619 if (sa_path_is_roce(rec))
620 memcpy(rec->roce.dmac, dmac, ETH_ALEN);
623 static inline void sa_path_set_dmac_zero(struct sa_path_rec *rec)
625 if (sa_path_is_roce(rec))
626 eth_zero_addr(rec->roce.dmac);
629 static inline u8 *sa_path_get_dmac(struct sa_path_rec *rec)
631 if (sa_path_is_roce(rec))
632 return rec->roce.dmac;