Lines Matching refs:batch

891 static void smbdirect_connection_send_batch_init(struct smbdirect_send_batch *batch,  in smbdirect_connection_send_batch_init()  argument
895 INIT_LIST_HEAD(&batch->msg_list); in smbdirect_connection_send_batch_init()
896 batch->wr_cnt = 0; in smbdirect_connection_send_batch_init()
897 batch->need_invalidate_rkey = need_invalidate_rkey; in smbdirect_connection_send_batch_init()
898 batch->remote_key = remote_key; in smbdirect_connection_send_batch_init()
899 batch->credit = 0; in smbdirect_connection_send_batch_init()
903 struct smbdirect_send_batch *batch, in smbdirect_connection_send_batch_flush() argument
909 if (list_empty(&batch->msg_list)) in smbdirect_connection_send_batch_flush()
912 first = list_first_entry(&batch->msg_list, in smbdirect_connection_send_batch_flush()
915 last = list_last_entry(&batch->msg_list, in smbdirect_connection_send_batch_flush()
919 if (batch->need_invalidate_rkey) { in smbdirect_connection_send_batch_flush()
921 first->wr.ex.invalidate_rkey = batch->remote_key; in smbdirect_connection_send_batch_flush()
922 batch->need_invalidate_rkey = false; in smbdirect_connection_send_batch_flush()
923 batch->remote_key = 0; in smbdirect_connection_send_batch_flush()
938 list_splice_tail_init(&batch->msg_list, &last->sibling_list); in smbdirect_connection_send_batch_flush()
939 batch->wr_cnt = 0; in smbdirect_connection_send_batch_flush()
953 if (is_last && !ret && batch->credit) { in smbdirect_connection_send_batch_flush()
954 atomic_add(batch->credit, &sc->send_io.bcredits.count); in smbdirect_connection_send_batch_flush()
955 batch->credit = 0; in smbdirect_connection_send_batch_flush()
968 struct smbdirect_send_batch *batch = (struct smbdirect_send_batch *)storage; in smbdirect_init_send_batch_storage() local
971 BUILD_BUG_ON(sizeof(*batch) > sizeof(*storage)); in smbdirect_init_send_batch_storage()
973 smbdirect_connection_send_batch_init(batch, in smbdirect_init_send_batch_storage()
977 return batch; in smbdirect_init_send_batch_storage()
982 struct smbdirect_send_batch *batch) in smbdirect_connection_wait_for_send_bcredit() argument
986 if (batch->credit) in smbdirect_connection_wait_for_send_bcredit()
998 batch->credit = 1; in smbdirect_connection_wait_for_send_bcredit()
1003 struct smbdirect_send_batch *batch) in smbdirect_connection_wait_for_send_lcredit() argument
1005 if (batch && atomic_read(&sc->send_io.lcredits.count) <= 1) { in smbdirect_connection_wait_for_send_lcredit()
1008 ret = smbdirect_connection_send_batch_flush(sc, batch, false); in smbdirect_connection_wait_for_send_lcredit()
1022 struct smbdirect_send_batch *batch) in smbdirect_connection_wait_for_send_credits() argument
1024 if (batch && (batch->wr_cnt >= 16 || atomic_read(&sc->send_io.credits.count) <= 1)) { in smbdirect_connection_wait_for_send_credits()
1027 ret = smbdirect_connection_send_batch_flush(sc, batch, false); in smbdirect_connection_wait_for_send_credits()
1043 struct smbdirect_send_batch *batch, in smbdirect_connection_post_send_io() argument
1060 if (batch) { in smbdirect_connection_post_send_io()
1062 if (!list_empty(&batch->msg_list)) { in smbdirect_connection_post_send_io()
1065 last = list_last_entry(&batch->msg_list, in smbdirect_connection_post_send_io()
1070 list_add_tail(&msg->sibling_list, &batch->msg_list); in smbdirect_connection_post_send_io()
1071 batch->wr_cnt++; in smbdirect_connection_post_send_io()
1080 struct smbdirect_send_batch *batch, in smbdirect_connection_send_single_iter() argument
1121 if (!batch) { in smbdirect_connection_send_single_iter()
1123 batch = &_batch; in smbdirect_connection_send_single_iter()
1126 ret = smbdirect_connection_wait_for_send_bcredit(sc, batch); in smbdirect_connection_send_single_iter()
1130 ret = smbdirect_connection_wait_for_send_lcredit(sc, batch); in smbdirect_connection_send_single_iter()
1134 ret = smbdirect_connection_wait_for_send_credits(sc, batch); in smbdirect_connection_send_single_iter()
1237 ret = smbdirect_connection_post_send_io(sc, batch, msg); in smbdirect_connection_send_single_iter()
1246 if (batch == &_batch) { in smbdirect_connection_send_single_iter()
1247 ret = smbdirect_connection_send_batch_flush(sc, batch, true); in smbdirect_connection_send_single_iter()
1261 atomic_add(batch->credit, &sc->send_io.bcredits.count); in smbdirect_connection_send_single_iter()
1262 batch->credit = 0; in smbdirect_connection_send_single_iter()
1300 struct smbdirect_send_batch batch; in smbdirect_connection_send_iter() local
1343 smbdirect_connection_send_batch_init(&batch, need_invalidate, remote_key); in smbdirect_connection_send_iter()
1346 &batch, in smbdirect_connection_send_iter()
1356 ret = smbdirect_connection_send_batch_flush(sc, &batch, true); in smbdirect_connection_send_iter()