#ifndef UCT_SCOPY_IFACE_H
#define UCT_SCOPY_IFACE_H
#include "scopy_ep.h"
#include <uct/base/uct_iface.h>
#include <uct/sm/base/sm_iface.h>
#define uct_scopy_trace_data(_tx) \
ucs_trace_data("%s [tx %p iov %zu/%zu length %zu/%zu] to %" PRIx64 "(%+ld)", \
uct_scopy_tx_op_str[(_tx)->op], (_tx), \
(_tx)->iov_iter.iov_index, (_tx)->iov_cnt, \
uct_iov_iter_flat_offset((_tx)->iov, (_tx)->iov_cnt, \
&(_tx)->iov_iter), \
uct_iov_total_length((_tx)->iov, (_tx)->iov_cnt), \
(_tx)->remote_addr, (_tx)->rkey)
extern ucs_config_field_t uct_scopy_iface_config_table[];
typedef struct uct_scopy_iface_config {
uct_sm_iface_config_t super;
size_t max_iov;
size_t seg_size;
unsigned tx_quota;
uct_iface_mpool_config_t tx_mpool;
} uct_scopy_iface_config_t;
typedef struct uct_scopy_iface {
uct_sm_iface_t super;
ucs_arbiter_t arbiter;
ucs_mpool_t tx_mpool;
uct_scopy_ep_tx_func_t tx;
struct {
size_t max_iov;
size_t seg_size;
unsigned tx_quota;
} config;
} uct_scopy_iface_t;
typedef struct uct_scopy_iface_ops {
uct_iface_internal_ops_t super;
uct_scopy_ep_tx_func_t ep_tx;
} uct_scopy_iface_ops_t;
void uct_scopy_iface_query(uct_scopy_iface_t *iface, uct_iface_attr_t *iface_attr);
UCS_CLASS_DECLARE(uct_scopy_iface_t, uct_iface_ops_t*, uct_scopy_iface_ops_t*,
uct_md_h, uct_worker_h, const uct_iface_params_t*,
const uct_iface_config_t*);
unsigned uct_scopy_iface_progress(uct_iface_h tl_iface);
ucs_status_t uct_scopy_iface_event_arm(uct_iface_h tl_iface, unsigned events);
ucs_status_t uct_scopy_iface_flush(uct_iface_h tl_iface, unsigned flags,
uct_completion_t *comp);
#endif