Skip to content

Commit 9611d53

Browse files
Maor Gottliebjgunthorpe
authored andcommitted
RDMA/core: Consider flow label when building skb
Use rdma_flow_label_to_udp_sport to calculate the UDP source port of the RoCEV2 packet. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Maor Gottlieb <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
1 parent d5665a2 commit 9611d53

File tree

1 file changed

+4
-2
lines changed
  • drivers/infiniband/core

1 file changed

+4
-2
lines changed

drivers/infiniband/core/lag.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ static struct sk_buff *rdma_build_skb(struct ib_device *device,
3434
skb_push(skb, sizeof(struct udphdr));
3535
skb_reset_transport_header(skb);
3636
uh = udp_hdr(skb);
37-
uh->source = htons(0xC000);
37+
uh->source =
38+
htons(rdma_flow_label_to_udp_sport(ah_attr->grh.flow_label));
3839
uh->dest = htons(ROCE_V2_UDP_DPORT);
3940
uh->len = htons(sizeof(struct udphdr));
4041

@@ -114,7 +115,8 @@ struct net_device *rdma_lag_get_ah_roce_slave(struct ib_device *device,
114115
struct net_device *master;
115116

116117
if (!(ah_attr->type == RDMA_AH_ATTR_TYPE_ROCE &&
117-
ah_attr->grh.sgid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP))
118+
ah_attr->grh.sgid_attr->gid_type == IB_GID_TYPE_ROCE_UDP_ENCAP &&
119+
ah_attr->grh.flow_label))
118120
return NULL;
119121

120122
rcu_read_lock();

0 commit comments

Comments
 (0)