IB/rxe: don't clear the tx queue on every transfer
authorVijay Immanuel <vijayi@attalasystems.com>
Tue, 19 Jun 2018 01:48:56 +0000 (18:48 -0700)
committerJason Gunthorpe <jgg@mellanox.com>
Fri, 29 Jun 2018 18:26:13 +0000 (12:26 -0600)
Do not call sk_dst_set() on every packet transfer because
that calls sk_tx_queue_clear(), which clears the tx queue.
A QP must stay on the same tx queue to maintain packet order.

Signed-off-by: Vijay Immanuel <vijayi@attalasystems.com>
Acked-by: Moni Shoua <monis@mellanox.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
drivers/infiniband/sw/rxe/rxe_net.c

index 79b6994..8094cba 100644 (file)
@@ -223,6 +223,11 @@ static struct dst_entry *rxe_find_route(struct rxe_dev *rxe,
                                        rt6_get_cookie((struct rt6_info *)dst);
 #endif
                }
+
+               if (dst && (qp_type(qp) == IB_QPT_RC)) {
+                       dst_hold(dst);
+                       sk_dst_set(qp->sk->sk, dst);
+               }
        }
        rdma_put_gid_attr(attr);
        return dst;
@@ -397,11 +402,7 @@ static int prepare4(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
        prepare_ipv4_hdr(dst, skb, saddr->s_addr, daddr->s_addr, IPPROTO_UDP,
                         av->grh.traffic_class, av->grh.hop_limit, df, xnet);
 
-       if (qp_type(qp) == IB_QPT_RC)
-               sk_dst_set(qp->sk->sk, dst);
-       else
-               dst_release(dst);
-
+       dst_release(dst);
        return 0;
 }
 
@@ -429,11 +430,7 @@ static int prepare6(struct rxe_dev *rxe, struct rxe_pkt_info *pkt,
                         av->grh.traffic_class,
                         av->grh.hop_limit);
 
-       if (qp_type(qp) == IB_QPT_RC)
-               sk_dst_set(qp->sk->sk, dst);
-       else
-               dst_release(dst);
-
+       dst_release(dst);
        return 0;
 }