]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
sdp: fix bad credits advertised when connection initiated
authorAmir Vadai <amirv@mellanox.co.il>
Wed, 1 Jul 2009 16:38:06 +0000 (19:38 +0300)
committerMukesh Kacker <mukesh.kacker@oracle.com>
Tue, 6 Oct 2015 12:04:34 +0000 (05:04 -0700)
This enables removing the ugly post credits after connection
establishment

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

index 53f4b9539e2d164d791d6ecc98d4ea0c6598db34..d03d6afa7d3f38e2e9a41aa362efe20468f98222 100644 (file)
@@ -602,9 +602,6 @@ void sdp_proc_unregister(void);
 /* sdp_cma.c */
 int sdp_cma_handler(struct rdma_cm_id *, struct rdma_cm_event *);
 
-/* sdp_bcopy.c */
-int sdp_post_credits(struct sdp_sock *ssk);
-
 /* sdp_tx.c */
 int sdp_tx_ring_create(struct sdp_sock *ssk, struct ib_device *device);
 void sdp_tx_ring_destroy(struct sdp_sock *ssk);
index e2c4ffdd52c31cbfa19b59e6ac927da1e72bd349..8ccd583bfd42b6cc332101038c9e1ca2699053e1 100644 (file)
@@ -160,33 +160,6 @@ out2:
                mod_timer(&ssk->nagle_timer, jiffies + SDP_NAGLE_TIMEOUT);
 }
 
-int sdp_post_credits(struct sdp_sock *ssk)
-{
-       int post_count = 0;
-
-       sdp_dbg_data(&ssk->isk.sk, "credits: %d remote credits: %d "
-                       "tx ring slots left: %d send_head: %p\n",
-               tx_credits(ssk), remote_credits(ssk),
-               sdp_tx_ring_slots_left(&ssk->tx_ring),
-               ssk->isk.sk.sk_send_head);
-
-       if (likely(tx_credits(ssk) > 1) &&
-           likely(sdp_tx_ring_slots_left(&ssk->tx_ring))) {
-               struct sk_buff *skb;
-               skb = sdp_stream_alloc_skb(&ssk->isk.sk,
-                                         sizeof(struct sdp_bsdh),
-                                         GFP_KERNEL);
-               if (!skb)
-                       return -ENOMEM;
-               sdp_post_send(ssk, skb, SDP_MID_DATA);
-               post_count++;
-       }
-
-       if (post_count)
-               sdp_xmit_poll(ssk, 0);
-       return post_count;
-}
-
 void sdp_post_sends(struct sdp_sock *ssk, int nonagle)
 {
        /* TODO: nonagle? */
index 83447b10f1d949c257383f6333af10178cfc47c3..2354fff381795d35ff9a5eab8d7340d08496dc7c 100644 (file)
@@ -371,7 +371,7 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                                ring_posted(sdp_sk(child)->rx_ring));
                memset(&hah, 0, sizeof hah);
                hah.bsdh.mid = SDP_MID_HELLO_ACK;
-               hah.bsdh.bufs = htons(remote_credits(sdp_sk(child)));
+               hah.bsdh.bufs = htons(ring_posted(sdp_sk(child)->rx_ring));
                hah.bsdh.len = htonl(sizeof(struct sdp_bsdh) + SDP_HAH_SIZE);
                hah.majv_minv = SDP_MAJV_MINV;
                hah.ext_max_adverts = 1; /* Doesn't seem to be mandated by spec,
@@ -400,9 +400,6 @@ int sdp_cma_handler(struct rdma_cm_id *id, struct rdma_cm_event *event)
                        rdma_reject(id, NULL, 0);
                else
                        rc = rdma_accept(id, NULL);
-
-               if (!rc)
-                       rc = sdp_post_credits(sdp_sk(sk)) < 0 ?: 0;
                break;
        case RDMA_CM_EVENT_CONNECT_ERROR:
                sdp_dbg(sk, "RDMA_CM_EVENT_CONNECT_ERROR\n");