Re: [PATCH 1/4] RDMA/core: Calculate UDP source port based on flow label or lqpn/rqpn

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




在 2022/1/5 21:51, Mark Zhang 写道:
On 1/5/2022 4:07 PM, yanjun.zhu@xxxxxxxxx wrote:
From: Zhu Yanjun <yanjun.zhu@xxxxxxxxx>

Calculate and set UDP source port based on the flow label. If flow label
is not defined in GRH then calculate it based on lqpn/rqpn.

Signed-off-by: Zhu Yanjun <yanjun.zhu@xxxxxxxxx>
---
  include/rdma/ib_verbs.h | 17 +++++++++++++++++
  1 file changed, 17 insertions(+)

diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 6e9ad656ecb7..2f122aa81f0f 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -4749,6 +4749,23 @@ static inline u32 rdma_calc_flow_label(u32 lqpn, u32 rqpn)
      return (u32)(v & IB_GRH_FLOWLABEL_MASK);
  }
  +/**
+ * rdma_get_udp_sport - Calculate and set UDP source port based on the flow
+ *                      label. If flow label is not defined in GRH then
+ *                      calculate it based on lqpn/rqpn.
+ *
+ * @fl:            flow label from GRH

Indent:
+ * @fl:        flow label from GRH

Thanks. In V2, this problem is fixed.


+ * @lqpn:        local qp number
+ * @rqpn:        remote qp number
+ */
+static inline u16 rdma_get_udp_sport(u32 fl, u32 lqpn, u32 rqpn)
+{
+    if (!fl)
+        fl = rdma_calc_flow_label(lqpn, rqpn);
+
+    return rdma_flow_label_to_udp_sport(fl);
+}
+ >   const struct ib_port_immutable*
  ib_port_immutable_read(struct ib_device *dev, unsigned int port);
  #endif /* IB_VERBS_H */

Maybe this and next patch can be squashed into one?

Why do you think this commit and next commit should be squashed into one?

Best Regards,

Zhu Yanjun




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux