File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2909,6 +2909,24 @@ static int iboe_tos_to_sl(struct net_device *ndev, int tos)
2909
2909
return 0 ;
2910
2910
}
2911
2911
2912
+ static __be32 cma_get_roce_udp_flow_label (struct rdma_id_private * id_priv )
2913
+ {
2914
+ struct sockaddr_in6 * addr6 ;
2915
+ u16 dport , sport ;
2916
+ u32 hash , fl ;
2917
+
2918
+ addr6 = (struct sockaddr_in6 * )cma_src_addr (id_priv );
2919
+ fl = be32_to_cpu (addr6 -> sin6_flowinfo ) & IB_GRH_FLOWLABEL_MASK ;
2920
+ if ((cma_family (id_priv ) != AF_INET6 ) || !fl ) {
2921
+ dport = be16_to_cpu (cma_port (cma_dst_addr (id_priv )));
2922
+ sport = be16_to_cpu (cma_port (cma_src_addr (id_priv )));
2923
+ hash = (u32 )sport * 31 + dport ;
2924
+ fl = hash & IB_GRH_FLOWLABEL_MASK ;
2925
+ }
2926
+
2927
+ return cpu_to_be32 (fl );
2928
+ }
2929
+
2912
2930
static int cma_resolve_iboe_route (struct rdma_id_private * id_priv )
2913
2931
{
2914
2932
struct rdma_route * route = & id_priv -> id .route ;
@@ -2975,6 +2993,11 @@ static int cma_resolve_iboe_route(struct rdma_id_private *id_priv)
2975
2993
goto err2 ;
2976
2994
}
2977
2995
2996
+ if (rdma_protocol_roce_udp_encap (id_priv -> id .device ,
2997
+ id_priv -> id .port_num ))
2998
+ route -> path_rec -> flow_label =
2999
+ cma_get_roce_udp_flow_label (id_priv );
3000
+
2978
3001
cma_init_resolve_route_work (work , id_priv );
2979
3002
queue_work (cma_wq , & work -> work );
2980
3003
You can’t perform that action at this time.
0 commit comments