]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: Rollback credit limit during ZCopy transaction.
authorAmir Vadai <amirv@mellanox.co.il>
Sun, 6 Mar 2011 12:38:08 +0000 (14:38 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:05:45 +0000 (05:05 -0700)
This limit was added at commit 2574b53 ("Abort rx SrcAvail when out of
credits")

Signed-off-by: Amir Vadai <amirv@mellanox.co.il>
drivers/infiniband/ulp/sdp/sdp_bcopy.c
drivers/infiniband/ulp/sdp/sdp_main.c

index 283e5ffe32621ea24579b1347d54ac2c6749c121..1bb367bc17e7653d6b8f3a456a84d5b3d753725f 100644 (file)
@@ -190,10 +190,6 @@ int sdp_post_sends(struct sdp_sock *ssk, gfp_t gfp)
        struct sk_buff *skb;
        int post_count = 0;
        struct sock *sk = sk_ssk(ssk);
-       int min_credits = SDP_MIN_TX_CREDITS;
-
-       if (ssk->rx_sa)
-               min_credits += 2; /* Save 2 credits, one for RdmaRdCompl and one for SendSM */
 
        if (unlikely(!ssk->id)) {
                if (sk->sk_send_head) {
@@ -208,7 +204,7 @@ again:
                sdp_xmit_poll(ssk, 1);
 
        /* Run out of credits, check if got a credit update */
-       if (unlikely(tx_credits(ssk) <= min_credits)) {
+       if (unlikely(tx_credits(ssk) <= SDP_MIN_TX_CREDITS)) {
                sdp_poll_rx_cq(ssk);
 
                if (unlikely(sdp_should_rearm(sk) || !posts_handler(ssk)))
@@ -244,7 +240,7 @@ again:
 
        if (ssk->recv_request &&
            ring_tail(ssk->rx_ring) >= SDP_MIN_TX_CREDITS &&
-           tx_credits(ssk) >= min_credits &&
+           tx_credits(ssk) >= SDP_MIN_TX_CREDITS &&
            sdp_tx_ring_slots_left(ssk)) {
                skb = sdp_alloc_skb_chrcvbuf_ack(sk,
                                ssk->recv_frags * PAGE_SIZE, gfp);
@@ -255,14 +251,14 @@ again:
                post_count++;
        }
 
-       if (tx_credits(ssk) <= min_credits &&
+       if (tx_credits(ssk) <= SDP_MIN_TX_CREDITS &&
               sdp_tx_ring_slots_left(ssk) &&
               sk->sk_send_head &&
                sdp_nagle_off(ssk, sk->sk_send_head)) {
                SDPSTATS_COUNTER_INC(send_miss_no_credits);
        }
 
-       while (tx_credits(ssk) > min_credits &&
+       while (tx_credits(ssk) > SDP_MIN_TX_CREDITS &&
               sdp_tx_ring_slots_left(ssk) &&
               (skb = sk->sk_send_head) &&
                sdp_nagle_off(ssk, skb)) {
index db04097116573a21342a190c32ae171127d8af16..2bb01b2e1c7dfb12b427c8466a6bde2c758b06ef 100644 (file)
@@ -2405,17 +2405,8 @@ skip_copy:
 
 
                if (rx_sa && !(flags & MSG_PEEK)) {
-
-                       if (likely(tx_credits(ssk) > (SDP_MIN_TX_CREDITS + 2))) {
-                               sdp_post_rdma_rd_compl(sk, rx_sa);
-                               sdp_post_sends(ssk, 0);
-                       } else {
-                               sdp_dbg_data(sk, "Run out of credits. Aborting RX "
-                                       "SrcAvail - or else won't be able to "
-                                       "send RdmaRdCompl/SendSM\n");
-                               sdp_abort_rx_srcavail(sk, 1);
-                               rx_sa = NULL;
-                       }
+                       sdp_post_rdma_rd_compl(sk, rx_sa);
+                       sdp_post_sends(ssk, 0);
                }
 
                if (!rx_sa && offset < skb->len)