aboutsummaryrefslogtreecommitdiffstats
path: root/include/rdma/ib_sa.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/rdma/ib_sa.h')
-rw-r--r--include/rdma/ib_sa.h49
1 files changed, 3 insertions, 46 deletions
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h
index bacb144f7780..b6ddf2a1b9d8 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -172,12 +172,7 @@ struct sa_path_rec_ib {
172 */ 172 */
173struct sa_path_rec_roce { 173struct sa_path_rec_roce {
174 bool route_resolved; 174 bool route_resolved;
175 u8 dmac[ETH_ALEN]; 175 u8 dmac[ETH_ALEN];
176 /* ignored in IB */
177 int ifindex;
178 /* ignored in IB */
179 struct net *net;
180
181}; 176};
182 177
183struct sa_path_rec_opa { 178struct sa_path_rec_opa {
@@ -556,13 +551,10 @@ int ib_init_ah_from_mcmember(struct ib_device *device, u8 port_num,
556 enum ib_gid_type gid_type, 551 enum ib_gid_type gid_type,
557 struct rdma_ah_attr *ah_attr); 552 struct rdma_ah_attr *ah_attr);
558 553
559/**
560 * ib_init_ah_attr_from_path - Initialize address handle attributes based on
561 * an SA path record.
562 */
563int ib_init_ah_attr_from_path(struct ib_device *device, u8 port_num, 554int ib_init_ah_attr_from_path(struct ib_device *device, u8 port_num,
564 struct sa_path_rec *rec, 555 struct sa_path_rec *rec,
565 struct rdma_ah_attr *ah_attr); 556 struct rdma_ah_attr *ah_attr,
557 const struct ib_gid_attr *sgid_attr);
566 558
567/** 559/**
568 * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec 560 * ib_sa_pack_path - Conert a path record from struct ib_sa_path_rec
@@ -667,45 +659,10 @@ static inline void sa_path_set_dmac_zero(struct sa_path_rec *rec)
667 eth_zero_addr(rec->roce.dmac); 659 eth_zero_addr(rec->roce.dmac);
668} 660}
669 661
670static inline void sa_path_set_ifindex(struct sa_path_rec *rec, int ifindex)
671{
672 if (sa_path_is_roce(rec))
673 rec->roce.ifindex = ifindex;
674}
675
676static inline void sa_path_set_ndev(struct sa_path_rec *rec, struct net *net)
677{
678 if (sa_path_is_roce(rec))
679 rec->roce.net = net;
680}
681
682static inline u8 *sa_path_get_dmac(struct sa_path_rec *rec) 662static inline u8 *sa_path_get_dmac(struct sa_path_rec *rec)
683{ 663{
684 if (sa_path_is_roce(rec)) 664 if (sa_path_is_roce(rec))
685 return rec->roce.dmac; 665 return rec->roce.dmac;
686 return NULL; 666 return NULL;
687} 667}
688
689static inline int sa_path_get_ifindex(struct sa_path_rec *rec)
690{
691 if (sa_path_is_roce(rec))
692 return rec->roce.ifindex;
693 return 0;
694}
695
696static inline struct net *sa_path_get_ndev(struct sa_path_rec *rec)
697{
698 if (sa_path_is_roce(rec))
699 return rec->roce.net;
700 return NULL;
701}
702
703static inline struct net_device *ib_get_ndev_from_path(struct sa_path_rec *rec)
704{
705 return sa_path_get_ndev(rec) ?
706 dev_get_by_index(sa_path_get_ndev(rec),
707 sa_path_get_ifindex(rec))
708 : NULL;
709}
710
711#endif /* IB_SA_H */ 668#endif /* IB_SA_H */