diff options
author | Poornima G <pgurusid@redhat.com> | 2019-03-24 09:40:50 +0530 |
---|---|---|
committer | Shyamsundar Ranganathan <srangana@redhat.com> | 2019-04-08 14:14:29 +0000 |
commit | 1fba86169b0850c3fcd02e56d0ddbba3efe9ae78 (patch) | |
tree | 9507980fc71cecf334f8dc9055f91c5d216d6253 /xlators/protocol/client/src/client.c | |
parent | 28bf5c049df5ccf117a049fcf44a388ebee73d26 (diff) |
client-rpc: Fix the payload being sent on the wire
The fops allocate 3 kind of payload(buffer) in the client xlator:
- fop payload, this is the buffer allocated by the write and put fop
- rsphdr paylod, this is the buffer required by the reply cbk of
some fops like lookup, readdir.
- rsp_paylod, this is the buffer required by the reply cbk of fops like
readv etc.
Currently, in the lookup and readdir fop the rsphdr is sent as payload,
hence the allocated rsphdr buffer is also sent on the wire, increasing
the bandwidth consumption on the wire.
With this patch, the issue is fixed.
Fixes: bz#1673058
Change-Id: Ie8158921f4db319e60ad5f52d851fa5c9d4a269b
Signed-off-by: Poornima G <pgurusid@redhat.com>
Diffstat (limited to 'xlators/protocol/client/src/client.c')
-rw-r--r-- | xlators/protocol/client/src/client.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index c5bf28dcfb6..c76777f6d77 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -131,10 +131,7 @@ client_type_to_gf_type(short l_type) int client_submit_request(xlator_t *this, void *req, call_frame_t *frame, rpc_clnt_prog_t *prog, int procnum, fop_cbk_fn_t cbkfn, - struct iobref *iobref, struct iovec *payload, - int payloadcnt, struct iovec *rsp_payload, - int rsp_payload_count, struct iobref *rsp_iobref, - xdrproc_t xdrproc) + client_payload_t *cp, xdrproc_t xdrproc) { int ret = -1; clnt_conf_t *conf = NULL; @@ -180,8 +177,8 @@ client_submit_request(xlator_t *this, void *req, call_frame_t *frame, goto out; } - if (iobref != NULL) { - ret = iobref_merge(new_iobref, iobref); + if (cp && cp->iobref != NULL) { + ret = iobref_merge(new_iobref, cp->iobref); if (ret != 0) { gf_msg(this->name, GF_LOG_WARNING, ENOMEM, PC_MSG_NO_MEMORY, "cannot merge " @@ -224,9 +221,16 @@ client_submit_request(xlator_t *this, void *req, call_frame_t *frame, } /* Send the msg */ - ret = rpc_clnt_submit(conf->rpc, prog, procnum, cbkfn, &iov, count, payload, - payloadcnt, new_iobref, frame, payload, payloadcnt, - rsp_payload, rsp_payload_count, rsp_iobref); + if (cp) { + ret = rpc_clnt_submit(conf->rpc, prog, procnum, cbkfn, &iov, count, + cp->payload, cp->payload_cnt, new_iobref, frame, + cp->rsphdr, cp->rsphdr_cnt, cp->rsp_payload, + cp->rsp_payload_cnt, cp->rsp_iobref); + } else { + ret = rpc_clnt_submit(conf->rpc, prog, procnum, cbkfn, &iov, count, + NULL, 0, new_iobref, frame, NULL, 0, NULL, 0, + NULL); + } if (ret < 0) { gf_msg_debug(this->name, 0, "rpc_clnt_submit failed"); |