Skip to content

Commit

Permalink
Merge tag 'for_next' for v1.3-rc3
Browse files Browse the repository at this point in the history
Change-Id: I8a19aa56ad1e15e77c4e307e04b367e74272efc6
  • Loading branch information
rosenbaumalex committed Dec 31, 2014
2 parents 08d174e + b69a343 commit b5338c7
Show file tree
Hide file tree
Showing 57 changed files with 363 additions and 171 deletions.
2 changes: 1 addition & 1 deletion benchmarks/usr/xio_perftest/xio_perftest_client.c
Expand Up @@ -325,7 +325,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *msg,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct thread_data *tdata = (struct thread_data *)cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/usr/xio_perftest/xio_perftest_communication.c
Expand Up @@ -121,7 +121,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_message(struct xio_session *session,
struct xio_msg *msg,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct perf_comm *comm = (struct perf_comm *)cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/usr/xio_perftest/xio_perftest_server.c
Expand Up @@ -89,7 +89,7 @@ struct server_data {
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_prv_data)
{
struct xio_msg *rsp;
Expand Down
2 changes: 1 addition & 1 deletion examples/kernel/hello_world/xio_client.c
Expand Up @@ -137,7 +137,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct session_data *session_data = cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion examples/kernel/hello_world/xio_server.c
Expand Up @@ -195,7 +195,7 @@ static int on_new_session(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct server_data *server_data = cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion examples/kernel/hello_world_mt/xio_mt_client.c
Expand Up @@ -173,7 +173,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct thread_data *tdata;
Expand Down
2 changes: 1 addition & 1 deletion examples/kernel/hello_world_mt/xio_mt_server.c
Expand Up @@ -159,7 +159,7 @@ void process_request(struct thread_data *tdata, struct xio_msg *req)
/*---------------------------------------------------------------------------*/
int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct thread_data *tdata;
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world/xio_client.c
Expand Up @@ -112,7 +112,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct session_data *session_data = (struct session_data *)
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world/xio_server.c
Expand Up @@ -165,7 +165,7 @@ static int on_new_session(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct server_data *server_data = (struct server_data *)cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world_daemon/xioclntd.c
Expand Up @@ -184,7 +184,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct session_data *session_data = (struct session_data *)
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world_daemon/xiosrvd.c
Expand Up @@ -216,7 +216,7 @@ static int on_new_session(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct server_data *server_data = (struct server_data *)cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world_libevent/xio_client.c
Expand Up @@ -124,7 +124,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct session_data *session_data =
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world_libevent/xio_server.c
Expand Up @@ -166,7 +166,7 @@ static int on_new_session(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct server_data *server_data =
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world_mt/xio_mt_client.c
Expand Up @@ -177,7 +177,7 @@ static int on_session_event(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct thread_data *tdata = (struct thread_data *)cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/hello_world_mt/xio_mt_server.c
Expand Up @@ -120,7 +120,7 @@ static void process_request(struct thread_data *tdata,
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct thread_data *tdata = (struct thread_data *)cb_user_context;
Expand Down
2 changes: 1 addition & 1 deletion examples/usr/raio/raio_api.c
Expand Up @@ -341,7 +341,7 @@ static void on_submit_answer(struct xio_msg *rsp)
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct raio_session_data *session_data =
Expand Down
8 changes: 8 additions & 0 deletions examples/usr/raio/raio_bs.c
Expand Up @@ -169,4 +169,12 @@ int raio_bs_cmd_submit(struct raio_bs *dev, struct raio_io_cmd *cmd)
return 0;
}

/*---------------------------------------------------------------------------*/
/* raio_bs_set_last_in_batch */
/*---------------------------------------------------------------------------*/
void raio_bs_set_last_in_batch(struct raio_bs *dev)
{
if (dev->bst->bs_set_last_in_batch)
dev->bst->bs_set_last_in_batch(dev);
}

6 changes: 6 additions & 0 deletions examples/usr/raio/raio_bs.h
Expand Up @@ -47,6 +47,7 @@ struct backingstore_template {
int (*bs_init)(struct raio_bs *dev);
void (*bs_exit)(struct raio_bs *dev);
int (*bs_cmd_submit)(struct raio_bs *dev, struct raio_io_cmd *cmd);
void (*bs_set_last_in_batch)(struct raio_bs *dev);

SLIST_ENTRY(backingstore_template) backingstore_siblings;
};
Expand Down Expand Up @@ -86,6 +87,11 @@ void raio_bs_close(struct raio_bs *dev);
/*---------------------------------------------------------------------------*/
int raio_bs_cmd_submit(struct raio_bs *dev, struct raio_io_cmd *cmd);

/*---------------------------------------------------------------------------*/
/* raio_bs_set_last_in_batch */
/*---------------------------------------------------------------------------*/
void raio_bs_set_last_in_batch(struct raio_bs *dev);

/*---------------------------------------------------------------------------*/
/* register_backingstore_template */
/*---------------------------------------------------------------------------*/
Expand Down
15 changes: 13 additions & 2 deletions examples/usr/raio/raio_bs_aio.c
Expand Up @@ -380,15 +380,25 @@ static int raio_bs_aio_cmd_submit(struct raio_bs *dev, struct raio_io_cmd *cmd)

info->nwaiting++;

if ((info->nwaiting == info->iodepth - info->npending) ||
(cmd->is_last_in_batch)) {
if (info->nwaiting == info->iodepth - info->npending) {
raio_aio_submit_dev_batch(info);
raio_bs_aio_process_events(dev);
}

return 0;
}

/*---------------------------------------------------------------------------*/
/* raio_bs_aio_set_last_in_batch */
/*---------------------------------------------------------------------------*/
static void raio_bs_aio_set_last_in_batch(struct raio_bs *dev)
{
struct raio_bs_aio_info *info = (struct raio_bs_aio_info *)dev->dd;

raio_aio_submit_dev_batch(info);
raio_bs_aio_process_events(dev);
}

/*---------------------------------------------------------------------------*/
/* raio_bs_aio_exit */
/*---------------------------------------------------------------------------*/
Expand All @@ -413,6 +423,7 @@ static struct backingstore_template raio_aio_bst = {
.bs_open = raio_bs_aio_open,
.bs_close = raio_bs_aio_close,
.bs_cmd_submit = raio_bs_aio_cmd_submit,
.bs_set_last_in_batch = raio_bs_aio_set_last_in_batch
};

/*
Expand Down
9 changes: 9 additions & 0 deletions examples/usr/raio/raio_bs_null.c
Expand Up @@ -78,6 +78,14 @@ static inline void raio_bs_null_close(struct raio_bs *dev)
{
}

/*---------------------------------------------------------------------------*/
/* raio_bs_null_set_last_in_batch */
/*---------------------------------------------------------------------------*/
static inline void raio_bs_null_set_last_in_batch(struct raio_bs *dev)
{
}


/*---------------------------------------------------------------------------*/
/* raio_null_bst */
/*---------------------------------------------------------------------------*/
Expand All @@ -87,6 +95,7 @@ static struct backingstore_template raio_null_bst = {
.bs_open = raio_bs_null_open,
.bs_close = raio_bs_null_close,
.bs_cmd_submit = raio_bs_null_cmd_submit,
.bs_set_last_in_batch = raio_bs_null_set_last_in_batch
};

/*---------------------------------------------------------------------------*/
Expand Down
3 changes: 2 additions & 1 deletion examples/usr/raio/raio_client.c
Expand Up @@ -302,6 +302,7 @@ int main(int argc, char *argv[])
double usec, size, rate, pps;
#ifdef WRITE_FILE
int fdw;
char * file = "/tmp/copy";
#endif

file_path = NULL;
Expand Down Expand Up @@ -456,7 +457,7 @@ int main(int argc, char *argv[])
write(
fdw,
events[i].obj->u.c.buf,
actual_len);
events[i].obj->u.c.nbytes);

#endif
raio_pool_put(iocb_pool,
Expand Down
11 changes: 9 additions & 2 deletions examples/usr/raio/raio_handlers.c
Expand Up @@ -643,7 +643,6 @@ static int on_cmd_submit_comp(struct raio_io_cmd *iocmd)
vmsg_sglist_set_nents(&io_u->rsp->out, 0);
sglist[0].iov_len = 0;
}

xio_send_response(io_u->rsp);

return 0;
Expand All @@ -656,6 +655,7 @@ static int raio_handle_submit(void *prv_session_data,
void *prv_portal_data,
struct raio_command *cmd,
char *cmd_data,
int last_in_batch,
struct xio_msg *req)
{
struct raio_io_portal_data *pd =
Expand Down Expand Up @@ -729,12 +729,17 @@ static int raio_handle_submit(void *prv_session_data,
io_u->rsp->user_context = io_u;
io_u->rsp->out.data_iov.nents = 1;


/* issues request to bs */
retval = -raio_bs_cmd_submit(bs_dev, &io_u->iocmd);
if (retval)
goto reject;

if (last_in_batch) {
TAILQ_FOREACH(bs_dev, &pd->dev_list, list) {
raio_bs_set_last_in_batch(bs_dev);
}
}

return 0;
reject:
TAILQ_INSERT_TAIL(&pd->io_u_free_list, io_u, io_u_list);
Expand Down Expand Up @@ -817,6 +822,7 @@ static int raio_handle_destroy_comp(void *prv_session_data,
/* raio_handler_on_req */
/*---------------------------------------------------------------------------*/
int raio_handler_on_req(void *prv_session_data, void *prv_portal_data,
int last_in_batch,
struct xio_msg *req)
{
char *buffer = (char *)req->in.header.iov_base;
Expand All @@ -843,6 +849,7 @@ int raio_handler_on_req(void *prv_session_data, void *prv_portal_data,
raio_handle_submit(prv_session_data,
prv_portal_data,
&cmd, cmd_data,
last_in_batch,
req);
break;
case RAIO_CMD_OPEN:
Expand Down
1 change: 1 addition & 0 deletions examples/usr/raio/raio_handlers.h
Expand Up @@ -66,6 +66,7 @@ void raio_handler_free_portal_data(void *prv_portal_data);
/*---------------------------------------------------------------------------*/
int raio_handler_on_req(void *prv_session_data,
void *prv_portal_data,
int last_in_batch,
struct xio_msg *req);

/*---------------------------------------------------------------------------*/
Expand Down
3 changes: 2 additions & 1 deletion examples/usr/raio/raio_server.c
Expand Up @@ -217,7 +217,7 @@ static void raio_session_disconnect(struct raio_session_data *session_data)
/* on_request callback */
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session, struct xio_msg *req,
int more_in_batch, void *cb_user_context)
int last_in_rxq, void *cb_user_context)
{
struct raio_thread_data *tdata =
(struct raio_thread_data *)cb_user_context;
Expand All @@ -234,6 +234,7 @@ static int on_request(struct xio_session *session, struct xio_msg *req,
disconnect = raio_handler_on_req(
session_data->dd_data,
session_data->portal_data[i].dd_data,
last_in_rxq,
req);
if (disconnect)
raio_session_disconnect(
Expand Down
8 changes: 4 additions & 4 deletions include/xio_base.h
Expand Up @@ -482,7 +482,7 @@ struct xio_session_ops {
*
* @param[in] session the session
* @param[in] msg the incoming message
* @param[in] more_in_batch hint that more incoming messages
* @param[in] last_in_rxq hint that more incoming messages
* are expected
* @param[in] conn_user_context user private data provided in
* connection open on which
Expand All @@ -491,15 +491,15 @@ struct xio_session_ops {
*/
int (*on_msg)(struct xio_session *session,
struct xio_msg *msg,
int more_in_batch,
int last_in_rxq,
void *conn_user_context);

/**
* one way message delivery receipt notification
*
* @param[in] session the session
* @param[in] msg the incoming message
* @param[in] more_in_batch hint that more incoming messages
* @param[in] last_in_rxq hint that more incoming messages
* are expected
* @param[in] conn_user_context user private data provided in
* connection open on which
Expand All @@ -508,7 +508,7 @@ struct xio_session_ops {
*/
int (*on_msg_delivered)(struct xio_session *session,
struct xio_msg *msg,
int more_in_batch,
int last_in_rxq,
void *conn_user_context);

/**
Expand Down
2 changes: 1 addition & 1 deletion regression/usr/reg_basic_mt/reg_basic_mt_client.c
Expand Up @@ -409,7 +409,7 @@ static int on_msg_error(struct xio_session *session,
/*---------------------------------------------------------------------------*/
static int on_response(struct xio_session *session,
struct xio_msg *rsp,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct connection_entry *conn_entry =
Expand Down
2 changes: 1 addition & 1 deletion regression/usr/reg_basic_mt/reg_basic_mt_server.c
Expand Up @@ -183,7 +183,7 @@ static void msg_obj_init(void *user_context, void *obj)
/*---------------------------------------------------------------------------*/
static int on_request(struct xio_session *session,
struct xio_msg *req,
int more_in_batch,
int last_in_rxq,
void *cb_user_context)
{
struct thread_data *tdata = (struct thread_data *)cb_user_context;
Expand Down
2 changes: 2 additions & 0 deletions src/common/xio_common.h
Expand Up @@ -145,6 +145,8 @@ enum xio_msg_flags_ex {
#define IS_FIN(type) ((type) & XIO_FIN)
#define IS_CANCEL(type) ((type) & XIO_CANCEL)
#define IS_CONNECTION_HELLO(type) ((type) & XIO_CONNECTION_HELLO)
#define IS_APPLICATION_MSG(type) \
(IS_MESSAGE(type) || IS_ONE_WAY(type))


/**
Expand Down

0 comments on commit b5338c7

Please sign in to comment.