23 #define M0_TRACE_SUBSYSTEM M0_TRACE_SUBSYS_RPC 77 return ab->
u.ab_extra.abr_bulk;
92 return fom->fo_fop->f_item.ri_session->s_conn;
144 ab->
u.ab_extra.abr_bulk = atbulk;
173 rbuf = rpcbulk_tlist_head(&rbulk->
rb_buflist);
220 for (
i = 0;
i < segs_nr; ++
i) {
243 uint64_t
size = ab->
u.ab_send.bdd_used;
304 &atbulk->
ac_nb, &rbuf);
362 M0_PRE(in->
u.ab_recv.bdd_used >= blen);
368 for (
i = 0;
i < segs_nr; ++
i) {
391 out->u.ab_extra.abr_user_buf = *
buf;
409 return M0_ERR_INFO(-EPROTO,
"Incorrect AT type %u",
438 ab->
u.ab_extra.abr_bulk =
NULL;
487 ab->
u.ab_extra.abr_user_buf = *
buf;
536 bool use_bulk =
false;
549 out->u.ab_buf = *repbuf;
563 in->
u.ab_recv.bdd_used >= repbuf->
b_nob) {
574 out->u.ab_rep.abr_rc =
rc;
575 out->u.ab_rep.abr_len = repbuf->
b_nob;
602 rc =
out->u.ab_rep.abr_rc;
620 return M0_ERR_INFO(-EPROTO,
"Incorrect AT type rcvd %u",
626 *
out = rcvd->
u.ab_buf;
628 rc = rcvd->
u.ab_rep.abr_rc;
643 "AT type mismatch rcvd %u",
655 *len = rcvd->
u.ab_rep.abr_len;
673 rc = rcvd->
u.ab_rep.abr_rc;
718 ret = ab->
u.ab_buf.b_nob;
721 ret = ab->
u.ab_send.bdd_used;
724 ret = ab->
u.ab_recv.bdd_used;
727 ret = ab->
u.ab_rep.abr_len;
735 #undef M0_TRACE_SUBSYSTEM static m0_bcount_t seg_size
M0_INTERNAL m0_bcount_t m0_net_domain_get_max_buffer_segment_size(struct m0_net_domain *dom)
static int rpc_at_bulk_csend(struct m0_rpc_at_buf *ab, const struct m0_buf *buf)
M0_INTERNAL void m0_chan_wait(struct m0_clink *link)
M0_INTERNAL void m0_fom_wakeup(struct m0_fom *fom)
M0_INTERNAL bool m0_buf_is_set(const struct m0_buf *buf)
M0_INTERNAL void m0_mutex_unlock(struct m0_mutex *mutex)
struct m0_fom * ac_user_fom
struct m0_net_buffer ac_nb
static int rpc_at_bulk_srecv_rc(const struct m0_rpc_at_buf *ab, struct m0_buf *buf)
M0_INTERNAL void m0_clink_init(struct m0_clink *link, m0_chan_cb_t cb)
M0_INTERNAL void m0_clink_del(struct m0_clink *link)
static void rpc_at_bulk_fini(struct rpc_at_bulk *atbulk)
M0_INTERNAL int m0_rpc_bulk_store(struct m0_rpc_bulk *rbulk, const struct m0_rpc_conn *conn, struct m0_net_buf_desc_data *to_desc, const struct m0_net_buffer_callbacks *bulk_cb)
M0_INTERNAL void m0_clink_del_lock(struct m0_clink *link)
static bool m0_addr_is_aligned(const void *addr, unsigned shift)
struct m0_bufvec nb_buffer
void(* sa_cb)(struct m0_sm_group *grp, struct m0_sm_ast *)
static struct m0_sm_group * grp
M0_INTERNAL int m0_bufvec_splice(const struct m0_bufvec *bvec, m0_bcount_t nr, struct m0_buf *buf)
M0_INTERNAL int m0_rpc_bulk_buf_databuf_add(struct m0_rpc_bulk_buf *rbuf, void *buf, m0_bcount_t count, m0_bindex_t index, struct m0_net_domain *netdom)
M0_INTERNAL void m0_rpc_at_init(struct m0_rpc_at_buf *ab)
struct m0_sm_group fl_group
M0_INTERNAL void m0_sm_ast_post(struct m0_sm_group *grp, struct m0_sm_ast *ast)
M0_INTERNAL bool m0_rpc_at_is_set(const struct m0_rpc_at_buf *ab)
M0_INTERNAL void m0_rpc_bulk_fini(struct m0_rpc_bulk *rbulk)
static void rpc_at_bulk_store_del(struct m0_rpc_bulk *rbulk)
struct m0_net_domain * ntm_dom
struct m0_rpc_at_buf * ac_atbuf
M0_INTERNAL int m0_rpc_at_add(struct m0_rpc_at_buf *ab, const struct m0_buf *buf, const struct m0_rpc_conn *conn)
M0_INTERNAL void m0_fom_wait_on(struct m0_fom *fom, struct m0_chan *chan, struct m0_fom_callback *cb)
M0_INTERNAL int m0_pageshift_get(void)
M0_INTERNAL int m0_rpc_at_load(struct m0_rpc_at_buf *ab, struct m0_fom *fom, int next_phase)
M0_INTERNAL void m0_mutex_lock(struct m0_mutex *mutex)
static int struct dentry int struct nameidata * nd
M0_INTERNAL int m0_rpc_at_reply(struct m0_rpc_at_buf *in, struct m0_rpc_at_buf *out, struct m0_buf *repbuf, struct m0_fom *fom, int next_phase)
M0_INTERNAL void m0_rpc_bulk_buflist_empty(struct m0_rpc_bulk *rbulk)
M0_INTERNAL int m0_rpc_at_rep_get(struct m0_rpc_at_buf *sent, struct m0_rpc_at_buf *rcvd, struct m0_buf *out)
int m0_bufvec_alloc_aligned(struct m0_bufvec *bufvec, uint32_t num_segs, m0_bcount_t seg_size, unsigned shift)
static struct m0_sm_ast ast[NR]
M0_INTERNAL int m0_rpc_bulk_load(struct m0_rpc_bulk *rbulk, const struct m0_rpc_conn *conn, struct m0_net_buf_desc_data *from_desc, const struct m0_net_buffer_callbacks *bulk_cb)
struct m0_rpc_machine * c_rpc_machine
#define M0_ERR_INFO(rc, fmt,...)
return M0_ERR(-EOPNOTSUPP)
m0_bcount_t rm_bulk_cutoff
M0_INTERNAL bool m0_rpc_at_rep_is_bulk(const struct m0_rpc_at_buf *rcvd, uint64_t *len)
#define M0_AMB(obj, ptr, field)
enum m0_net_queue_type nb_qtype
M0_TL_DECLARE(rpcbulk, M0_INTERNAL, struct m0_rpc_bulk_buf)
struct m0_net_buffer * bb_nbuf
static bool rpc_at_ssend_complete_cb(struct m0_clink *clink)
struct m0_net_transfer_mc rm_tm
static uint64_t rpc_at_bulk_segs_nr(const struct rpc_at_bulk *atbulk, m0_bcount_t data_size, m0_bcount_t *seg_size)
M0_INTERNAL void m0_rpc_bulk_init(struct m0_rpc_bulk *rbulk)
static struct m0_bufvec bvec
static void rpc_at_ssend_ast_cb(struct m0_sm_group *grp, struct m0_sm_ast *ast)
M0_INTERNAL int m0_rpc_at_get(const struct m0_rpc_at_buf *ab, struct m0_buf *buf)
M0_INTERNAL int m0_rpc_at_reply_rc(struct m0_rpc_at_buf *out)
static int rpc_at_bulk_nb_alloc(struct m0_rpc_at_buf *ab, uint64_t size)
M0_INTERNAL void m0_net_desc_free(struct m0_net_buf_desc *desc)
union m0_rpc_at_buf::@447 u
M0_INTERNAL void m0_buf_free(struct m0_buf *buf)
static struct m0_clink clink[RDWR_REQUEST_MAX]
static uint64_t min64u(uint64_t a, uint64_t b)
static uint64_t data_size(const struct m0_pdclust_layout *play)
static int rpc_at_bulk_ssend(struct m0_rpc_at_buf *in, struct m0_rpc_at_buf *out, struct m0_buf *buf, struct m0_fom *fom)
static int rpc_at_bulk_srecv(struct m0_rpc_at_buf *ab, struct m0_fom *fom)
M0_INTERNAL void m0_bufvec_free_aligned(struct m0_bufvec *bufvec, unsigned shift)
const struct m0_rpc_conn * ac_conn
void m0_clink_add_lock(struct m0_chan *chan, struct m0_clink *link)
static struct rpc_at_bulk * rpc_at_bulk(const struct m0_rpc_at_buf *ab)
static int rpc_at_bulk_crecv(struct m0_rpc_at_buf *ab, uint32_t len)
M0_TL_DESCR_DECLARE(rpcbulk, M0_EXTERN)
struct m0_fom_locality * fo_loc
#define M0_ALLOC_PTR(ptr)
M0_INTERNAL uint64_t m0_rpc_at_len(const struct m0_rpc_at_buf *ab)
struct m0_rpc_bulk ac_bulk
M0_INTERNAL void m0_rpc_at_fini(struct m0_rpc_at_buf *ab)
M0_INTERNAL void m0_clink_fini(struct m0_clink *link)
M0_INTERNAL bool m0_rpc_bulk_is_empty(struct m0_rpc_bulk *rbulk)
M0_INTERNAL void m0_fom_callback_cancel(struct m0_fom_callback *cb)
static struct m0_rpc_conn * fom_conn(const struct m0_fom *fom)
static int rpc_at_bulk_init(struct m0_rpc_at_buf *ab, const struct m0_rpc_conn *conn)
static struct m0_net_domain * rpc_at_bulk_ndom(const struct rpc_at_bulk *atbulk)
M0_INTERNAL void m0_rpc_bulk_store_del(struct m0_rpc_bulk *rbulk)
void m0_fom_phase_set(struct m0_fom *fom, int phase)
const struct m0_net_buffer_callbacks m0_rpc__buf_bulk_cb
static enum m0_net_queue_type rpc_at_bulk_qtype(struct m0_rpc_bulk *rbulk)
M0_INTERNAL int m0_rpc_bulk_buf_add(struct m0_rpc_bulk *rbulk, uint32_t segs_nr, m0_bcount_t length, struct m0_net_domain *netdom, struct m0_net_buffer *nb, struct m0_rpc_bulk_buf **out)
M0_INTERNAL int m0_rpc_at_rep2inline(struct m0_rpc_at_buf *sent, struct m0_rpc_at_buf *rcvd)
static m0_bcount_t rpc_at_bulk_cutoff(const struct m0_rpc_conn *conn)
M0_INTERNAL void m0_rpc_at_detach(struct m0_rpc_at_buf *ab)
M0_INTERNAL int m0_rpc_at_recv(struct m0_rpc_at_buf *ab, const struct m0_rpc_conn *conn, uint32_t len, bool force_bulk)
#define m0_tl_forall(name, var, head,...)
#define M0_IMPOSSIBLE(fmt,...)
static void rpc_at_bulk_nb_free(struct rpc_at_bulk *atbulk)