File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -4749,6 +4749,23 @@ static inline u32 rdma_calc_flow_label(u32 lqpn, u32 rqpn)
4749
4749
return (u32 )(v & IB_GRH_FLOWLABEL_MASK );
4750
4750
}
4751
4751
4752
+ /**
4753
+ * rdma_get_udp_sport - Calculate and set UDP source port based on the flow
4754
+ * label. If flow label is not defined in GRH then
4755
+ * calculate it based on lqpn/rqpn.
4756
+ *
4757
+ * @fl: flow label from GRH
4758
+ * @lqpn: local qp number
4759
+ * @rqpn: remote qp number
4760
+ */
4761
+ static inline u16 rdma_get_udp_sport (u32 fl , u32 lqpn , u32 rqpn )
4762
+ {
4763
+ if (!fl )
4764
+ fl = rdma_calc_flow_label (lqpn , rqpn );
4765
+
4766
+ return rdma_flow_label_to_udp_sport (fl );
4767
+ }
4768
+
4752
4769
const struct ib_port_immutable *
4753
4770
ib_port_immutable_read (struct ib_device * dev , unsigned int port );
4754
4771
#endif /* IB_VERBS_H */
You can’t perform that action at this time.
0 commit comments