blob: 07e6ad76224a0cd1b2fe5bb91d7acaa4eb977534 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Ursula Braune6727f32017-01-09 16:55:23 +01002/*
3 * Shared Memory Communications over RDMA (SMC-R) and RoCE
4 *
5 * Manage send buffer
6 *
7 * Copyright IBM Corp. 2016
8 *
9 * Author(s): Ursula Braun <ubraun@linux.vnet.ibm.com>
10 */
11
12#ifndef SMC_TX_H
13#define SMC_TX_H
14
15#include <linux/socket.h>
16#include <linux/types.h>
17
18#include "smc.h"
19#include "smc_cdc.h"
20
21static inline int smc_tx_prepared_sends(struct smc_connection *conn)
22{
23 union smc_host_cursor sent, prep;
24
Stefan Rasplbac6de72018-07-23 13:53:09 +020025 smc_curs_copy(&sent, &conn->tx_curs_sent, conn);
26 smc_curs_copy(&prep, &conn->tx_curs_prep, conn);
Hans Wippel69cb7dc2018-05-18 09:34:10 +020027 return smc_curs_diff(conn->sndbuf_desc->len, &sent, &prep);
Ursula Braune6727f32017-01-09 16:55:23 +010028}
29
Eric Dumazetbe7f3e52018-05-17 03:54:21 -070030void smc_tx_work(struct work_struct *work);
Ursula Braune6727f32017-01-09 16:55:23 +010031void smc_tx_init(struct smc_sock *smc);
32int smc_tx_sendmsg(struct smc_sock *smc, struct msghdr *msg, size_t len);
33int smc_tx_sndbuf_nonempty(struct smc_connection *conn);
34void smc_tx_sndbuf_nonfull(struct smc_sock *smc);
Stefan Rasplde8474e2018-05-23 16:38:11 +020035void smc_tx_consumer_update(struct smc_connection *conn, bool force);
Hans Wippelbe244f22018-06-28 19:05:10 +020036int smcd_tx_ism_write(struct smc_connection *conn, void *data, size_t len,
37 u32 offset, int signal);
Ursula Braune6727f32017-01-09 16:55:23 +010038
39#endif /* SMC_TX_H */