diff mbox

[V9fs-developer,1/3,net/9p] Fix the size of receive buffer packing onto VirtIO ring.

Message ID 1309475921-12171-1-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

jvrao June 30, 2011, 11:18 p.m. UTC
Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
---
 net/9p/trans_virtio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Aneesh Kumar K.V July 1, 2011, 11:14 a.m. UTC | #1
On Thu, 30 Jun 2011 16:18:40 -0700, "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com> wrote:
> msize represents the maximum PDU size that includes P9_IOHDRSZ.
> 
> Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
> ---
>  net/9p/client.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/net/9p/client.c b/net/9p/client.c
> index 9e3b0e6..1b89351 100644
> --- a/net/9p/client.c
> +++ b/net/9p/client.c
> @@ -821,8 +821,8 @@ struct p9_client *p9_client_create(const char *dev_name, char *options)
>  	if (err)
>  		goto destroy_fidpool;
> 
> -	if ((clnt->msize+P9_IOHDRSZ) > clnt->trans_mod->maxsize)
> -		clnt->msize = clnt->trans_mod->maxsize-P9_IOHDRSZ;
> +	if (clnt->msize > clnt->trans_mod->maxsize)
> +		clnt->msize = clnt->trans_mod->maxsize;
> 
>  	err = p9_client_version(clnt);
>  	if (err)

Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>

-aneesh

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
Aneesh Kumar K.V July 1, 2011, 11:21 a.m. UTC | #2
On Thu, 30 Jun 2011 16:18:39 -0700, "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com> wrote:
> Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
> ---
>  net/9p/trans_virtio.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
> index 244e707..0ec5423 100644
> --- a/net/9p/trans_virtio.c
> +++ b/net/9p/trans_virtio.c
> @@ -367,7 +367,7 @@ req_retry_pinned:
>  		in += inp;
>  	} else {
>  		in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata,
> -				client->msize);
> +				req->rc->capacity);
>  	}
> 
>  	err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc);

So when will req->rc->capacity be different from client->msize ? Can we
get details for that documented in p9_tag_alloc ?

The above pack_sg_list will only be called for non-zero copy case ? In
that case won't client->size be same as rc->capacity ?

-aneesh

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
jvrao July 1, 2011, 4:29 p.m. UTC | #3
On 07/01/2011 04:21 AM, Aneesh Kumar K.V wrote:
> On Thu, 30 Jun 2011 16:18:39 -0700, "Venkateswararao Jujjuri (JV)"<jvrao@linux.vnet.ibm.com>  wrote:
>> Signed-off-by: Venkateswararao Jujjuri "<jvrao@linux.vnet.ibm.com>
>> ---
>>   net/9p/trans_virtio.c |    2 +-
>>   1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
>> index 244e707..0ec5423 100644
>> --- a/net/9p/trans_virtio.c
>> +++ b/net/9p/trans_virtio.c
>> @@ -367,7 +367,7 @@ req_retry_pinned:
>>   		in += inp;
>>   	} else {
>>   		in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata,
>> -				client->msize);
>> +				req->rc->capacity);
>>   	}
>>
>>   	err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc);
> So when will req->rc->capacity be different from client->msize ? Can we
> get details for that documented in p9_tag_alloc ?
>
> The above pack_sg_list will only be called for non-zero copy case ? In
> that case won't client->size be same as rc->capacity ?
you mean client->msize?

Yes this else case is only in the non-zc case.
Basically the client->msize is the maximum pdu size.
say our msize is 128k, and we are doing a TVERSION, the logic
falls into the else case where no ZC is needed. In this case
we are operating with the rc->capacity not the entire msize.

Thanks,
JV
> -aneesh


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
diff mbox

Patch

diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 244e707..0ec5423 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -367,7 +367,7 @@  req_retry_pinned:
 		in += inp;
 	} else {
 		in = pack_sg_list(chan->sg, out, VIRTQUEUE_NUM, rdata,
-				client->msize);
+				req->rc->capacity);
 	}
 
 	err = virtqueue_add_buf(chan->vq, chan->sg, out, in, req->tc);