]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: Fix bug in crossing SrcAvail
authorAmir Vadai <amirv@mellanox.co.il>
Wed, 24 Feb 2010 08:59:31 +0000 (10:59 +0200)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:48 +0000 (05:04 -0700)
* Handle RdmaRdCompl in interrupt, before splitted to two Q's
  This way the handling is sequencial, and no race could occure
  between RdmaRdCompl and SrcAvailCancel
* Fixed an error when checking that RdmaRdCompl is not for
  old SrcAvail

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

index 44d9f1a2e5a8429b4d620e1b051679e98f4f7e8b..f1b6d439770ddb2b16d8f7726aadfbe025249b72 100644 (file)
@@ -464,10 +464,6 @@ static int sdp_process_rx_ctl_skb(struct sdp_sock *ssk, struct sk_buff *skb)
                break;
        case SDP_MID_RDMARDCOMPL:
                {
-                       struct sdp_rrch *rrch = (struct sdp_rrch *)(h+1);
-                       sdp_dbg_data(sk, "RdmaRdCompl message arrived\n");
-                       sdp_handle_rdma_read_compl(ssk, ntohl(h->mseq_ack),
-                                       ntohl(rrch->len));
                        __kfree_skb(skb);
                } break;
        case SDP_MID_SENDSM:
@@ -579,6 +575,15 @@ static int sdp_process_rx_skb(struct sdp_sock *ssk, struct sk_buff *skb)
                                        ntohl(h->mseq), ntohl(h->mseq_ack));
                        ssk->srcavail_cancel_mseq = ntohl(h->mseq);
                }
+
+
+               if (h->mid == SDP_MID_RDMARDCOMPL) {
+                       struct sdp_rrch *rrch = (struct sdp_rrch *)(h+1);
+                       sdp_dbg_data(sk, "RdmaRdCompl message arrived\n");
+                       sdp_handle_rdma_read_compl(ssk, ntohl(h->mseq_ack),
+                                       ntohl(rrch->len));
+               }
+
                skb_queue_tail(&ssk->rx_ctl_q, skb);
 
                return 0;
index e5a59c082d7c558edfd33fc9bea37cfa6120c4f6..04b30977ca0d6eac7f070f95ad2c54f3658e5488 100644 (file)
@@ -190,7 +190,7 @@ static int sdp_wait_rdmardcompl(struct sdp_sock *ssk, long *timeo_p,
                                break;
                        }
 
-                       if (ssk->rx_sa) {
+                       if (ssk->rx_sa && (tx_sa->bytes_acked < tx_sa->bytes_sent)) {
                                sdp_dbg_data(sk, "Crossing SrcAvail - aborting this\n");
                                tx_sa->abort_flags |= TX_SA_CROSS_SEND;
                                SDPSTATS_COUNTER_INC(zcopy_cross_send);
@@ -346,7 +346,7 @@ void sdp_handle_sendsm(struct sdp_sock *ssk, u32 mseq_ack)
                goto out;
        }
 
-       if (mseq_ack < ssk->tx_sa->mseq) {
+       if (ssk->tx_sa->mseq > mseq_ack) {
                sdp_dbg_data(sk, "SendSM arrived for old SrcAvail. "
                        "SendSM mseq_ack: 0x%x, SrcAvail mseq: 0x%x\n",
                        mseq_ack, ssk->tx_sa->mseq);
@@ -383,7 +383,7 @@ void sdp_handle_rdma_read_compl(struct sdp_sock *ssk, u32 mseq_ack,
                goto out;
        }
 
-       if (ssk->tx_sa->mseq < mseq_ack) {
+       if (ssk->tx_sa->mseq > mseq_ack) {
                sdp_dbg_data(sk, "RdmaRdCompl arrived for old SrcAvail. "
                        "SendSM mseq_ack: 0x%x, SrcAvail mseq: 0x%x\n",
                        mseq_ack, ssk->tx_sa->mseq);