Motr  M0
Functional Specification for fop bulk client.

Data Structures

The io bulk client design includes data structures like

  • m0_io_fop An in-memory definition of io fop which binds the io fop with its network buffer.

Subroutines

Constructors and Destructors

Accessors and Invariants

Operational Interfaces

Command Usage

Not Applicable.

Recipes

Using bulk APIs on client side.

  • IO bulk client allocates memory for a m0_io_fop and invokes m0_io_fop_init() by providing fop type.
  • IO bulk client invokes m0_rpc_bulk_buf_databuf_add() till all pages or user buffers are added to m0_rpc_bulk structure and then invokes
  • Bulk client invokes m0_rpc_bulk_store() to store the network buffer memory descriptor/s to io fop wire format. The network buffer memory descriptor is retrieved after adding the network buffer to transfer machine belonging to m0_rpc_machine.
  • Bulk client invokes m0_rpc_post() to submit the fop to rpc layer.
  • The network buffers added by bulk client to m0_rpc_bulk structure are removed and deallocated by network buffer completion callbacks. Bulk client user need not remove or deallocate these network buffers by itself. The m0_io_fop structure can be populated and used like this.
m0_io_fop_init(iofop, ftype);
do {
m0_rpc_bulk_buf_add(&iofop->if_rbulk, rbuf);
..
..
} while (not_empty);
..
m0_rpc_bulk_buf_store(rbuf, rpcitem, net_buf_desc);
..
m0_rpc_post(rpc_item);

Using bulk APIs on server side.

  • Motr io server program (ioservice) creates a m0_rpc_bulk structure and invokes m0_rpc_bulk_init().
  • Ioservice invokes m0_rpc_bulk_buf_add() to attach buffers to the m0_rpc_bulk structure.
  • Typically, ioservice uses a pre-allocated and pre-registered pool of network buffers which are supposed to be used while doing bulk transfer. These buffers are provided while invoking m0_rpc_bulk_buf_add() API.
  • Ioservice invokes m0_rpc_bulk_load() to start the zero copy of data from sender. Since server side sends the reply fop, it does not need m0_io_fop structures since it deals with request IO fops.
See also
m0_rpc_bulk
do {
m0_rpc_bulk_buf_add(rbulk->rbuf, segs_nr, length, netdom, nb, &out);
..
..
} while(request_io_fop->io_buf_desc_list is not finished);
m0_clink_add_lock(&rbulk->rb_chan, &clink);
m0_rpc_bulk_buf_load(rbulk, conn, &request_io_fop->desc_list);
..
..
send_reply_fop();
Bulk IO client Detailed Functional Specification