From: Vladimir Sokolovsky Date: Tue, 4 Dec 2007 13:49:25 +0000 (+0200) Subject: Applied 'kernel_patches/fixes/sdp_post_credits.patch' X-Git-Tag: v4.1.12-92~264^2~5^2~330 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=aae84e649b6ee64cacd6250df4439e2d2ad35a28;p=users%2Fjedix%2Flinux-maple.git Applied 'kernel_patches/fixes/sdp_post_credits.patch' Signed-off-by: Vladimir Sokolovsky --- diff --git a/drivers/infiniband/ulp/sdp/sdp.h b/drivers/infiniband/ulp/sdp/sdp.h index c1cc57993f03d..31966eb505551 100644 --- a/drivers/infiniband/ulp/sdp/sdp.h +++ b/drivers/infiniband/ulp/sdp/sdp.h @@ -248,6 +248,7 @@ void sdp_reset_sk(struct sock *sk, int rc); void sdp_time_wait_destroy_sk(struct sdp_sock *ssk); void sdp_completion_handler(struct ib_cq *cq, void *cq_context); void sdp_work(struct work_struct *work); +int sdp_post_credits(struct sdp_sock *ssk); void sdp_post_send(struct sdp_sock *ssk, struct sk_buff *skb, u8 mid); void sdp_post_recvs(struct sdp_sock *ssk); int sdp_poll_cq(struct sdp_sock *ssk, struct ib_cq *cq); diff --git a/drivers/infiniband/ulp/sdp/sdp_bcopy.c b/drivers/infiniband/ulp/sdp/sdp_bcopy.c index bcc2ac8f9487b..5bc20fad5e738 100644 --- a/drivers/infiniband/ulp/sdp/sdp_bcopy.c +++ b/drivers/infiniband/ulp/sdp/sdp_bcopy.c @@ -443,6 +443,21 @@ static inline int sdp_nagle_off(struct sdp_sock *ssk, struct sk_buff *skb) (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_PSH); } +int sdp_post_credits(struct sdp_sock *ssk) +{ + if (likely(ssk->bufs > 1) && + likely(ssk->tx_head - ssk->tx_tail < SDP_TX_SIZE)) { + struct sk_buff *skb; + skb = sk_stream_alloc_skb(&ssk->isk.sk, + sizeof(struct sdp_bsdh), + GFP_KERNEL); + if (!skb) + return -ENOMEM; + sdp_post_send(ssk, skb, SDP_MID_DATA); + } + return 0; +} + void sdp_post_sends(struct sdp_sock *ssk, int nonagle) { /* TODO: nonagle? */ diff --git a/drivers/infiniband/ulp/sdp/sdp_cma.c b/drivers/infiniband/ulp/sdp/sdp_cma.c index 3b0508ab744e4..0cab38bb9fbaa 100644 --- a/drivers/infiniband/ulp/sdp/sdp_cma.c +++ b/drivers/infiniband/ulp/sdp/sdp_cma.c @@ -472,6 +472,9 @@ 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)); break; case RDMA_CM_EVENT_CONNECT_ERROR: sdp_dbg(sk, "RDMA_CM_EVENT_CONNECT_ERROR\n");