Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  * Shared Memory Communications over RDMA (SMC-R) and RoCE
0004  *
0005  * Manage send buffer
0006  *
0007  * Copyright IBM Corp. 2016
0008  *
0009  * Author(s):  Ursula Braun <ubraun@linux.vnet.ibm.com>
0010  */
0011 
0012 #ifndef SMC_TX_H
0013 #define SMC_TX_H
0014 
0015 #include <linux/socket.h>
0016 #include <linux/types.h>
0017 
0018 #include "smc.h"
0019 #include "smc_cdc.h"
0020 
0021 static inline int smc_tx_prepared_sends(struct smc_connection *conn)
0022 {
0023     union smc_host_cursor sent, prep;
0024 
0025     smc_curs_copy(&sent, &conn->tx_curs_sent, conn);
0026     smc_curs_copy(&prep, &conn->tx_curs_prep, conn);
0027     return smc_curs_diff(conn->sndbuf_desc->len, &sent, &prep);
0028 }
0029 
0030 void smc_tx_pending(struct smc_connection *conn);
0031 void smc_tx_work(struct work_struct *work);
0032 void smc_tx_init(struct smc_sock *smc);
0033 int smc_tx_sendmsg(struct smc_sock *smc, struct msghdr *msg, size_t len);
0034 int smc_tx_sendpage(struct smc_sock *smc, struct page *page, int offset,
0035             size_t size, int flags);
0036 int smc_tx_sndbuf_nonempty(struct smc_connection *conn);
0037 void smc_tx_sndbuf_nonfull(struct smc_sock *smc);
0038 void smc_tx_consumer_update(struct smc_connection *conn, bool force);
0039 int smcd_tx_ism_write(struct smc_connection *conn, void *data, size_t len,
0040               u32 offset, int signal);
0041 
0042 #endif /* SMC_TX_H */