[pnfs] [PATCH] Removed sessions hard-coded 32678 byte max sizes
William A. (Andy) Adamson
andros at citi.umich.edu
Fri Mar 16 12:52:47 EDT 2007
On 3/16/07, Iyer, Rahul <Rahul.Iyer at netapp.com> wrote:
>
> Hi Andy,
> Please don't apply this patch. These changes are valid, but if you look
> at my slot table patches, the 32768 value has been used in
> nfs4_init_channel_attrs. That, IMHO, is the right place to put this code
> in.
ok, i'll only apply the server side.
-->Andy
Thanks
> Regards
> Rahul
>
>
> > -----Original Message-----
> > From: William A. (Andy) Adamson [mailto:andros at citi.umich.edu]
> > Sent: Friday, March 16, 2007 8:12 AM
> > To: pnfs at linux-nfs.org
> > Subject: Re: [pnfs] [PATCH] Removed sessions hard-coded 32678
> > byte max sizes
> >
> > if there are no objections - i will apply this patch.
> >
> > -->Andy
> >
> >
> > On 3/15/07, Andy Adamson <andros at umich.edu > wrote:
> >
> > Client: replace fore and back channel 32768
> > max_rqst_sz, max_resp_sz, and
> > max_resp_sz_cached with NFS_MAX_FILE_IO_SIZE.
> >
> > Server: use svc_max_payload(rqstp) to set fore and back
> > channel sizes
> >
> > NOTE: This is really sessions branch code - but is
> > dependant on the largeio
> > patch in the pNFS branch. We decided to leave it in the
> > pNFS branch.
> > ---
> > fs/nfs/nfs4xdr.c | 12 ++++++------
> > fs/nfsd/nfs4state.c | 9 +++++++++
> > 2 files changed, 15 insertions(+), 6 deletions(-)
> >
> > diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
> > index f2a5c21..4f18c2f 100644
> > --- a/fs/nfs/nfs4xdr.c
> > +++ b/fs/nfs/nfs4xdr.c
> > @@ -1498,18 +1498,18 @@ static int
> > encode_create_session(struct xdr_stream *xdr, struct nfs41_create_ses
> > RESERVE_SPACE(2*28); /* 2
> > channel_attrs */
> >
> > /* Fore Channel */
> > - WRITE32(32768); /* max
> > req size */
> > - WRITE32(32768); /* max
> > resp size */
> > - WRITE32(32768); /* Max
> > resp size cached */
> > + WRITE32(NFS_MAX_FILE_IO_SIZE); /* max
> > req size */
> > + WRITE32(NFS_MAX_FILE_IO_SIZE); /* max
> > resp size */
> > + WRITE32(NFS_MAX_FILE_IO_SIZE); /* Max
> > resp size cached */
> > WRITE32(RPC_DEF_SLOT_TABLE); /* max
> > operations */
> > WRITE32(RPC_DEF_SLOT_TABLE); /* max
> > requests */
> > WRITE32(0); /*
> > Streamchannel attrs */
> > WRITE32(0);
> > /*rdmachannel_attrs */
> >
> > /* Back Channel */
> > - WRITE32(32768); /* max
> > req size */
> > - WRITE32(32768); /* max
> > resp size */
> > - WRITE32(32768); /* Max
> > resp size cached */
> > + WRITE32(NFS_MAX_FILE_IO_SIZE); /* max
> > req size */
> > + WRITE32(NFS_MAX_FILE_IO_SIZE); /* max
> > resp size */
> > + WRITE32(NFS_MAX_FILE_IO_SIZE); /* Max
> > resp size cached */
> > WRITE32(RPC_DEF_SLOT_TABLE); /* max
> > operations */
> > WRITE32(RPC_DEF_SLOT_TABLE); /* max
> > requests */
> > WRITE32(0); /*
> > Streamchannel attrs */
> > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> > index 43fa8ff..259228f 100644
> > --- a/fs/nfsd/nfs4state.c
> > +++ b/fs/nfsd/nfs4state.c
> > @@ -74,6 +74,8 @@ static stateid_t onestateid;
> > /* bits all 1 */
> > #define ZERO_STATEID(stateid) (!memcmp((stateid),
> > &zerostateid, sizeof(stateid_t)))
> > #define ONE_STATEID(stateid) (!memcmp((stateid),
> > &onestateid, sizeof(stateid_t)))
> >
> > +extern __u32 svc_max_payload(const struct svc_rqst *rqstp);
> > +
> > /* forward declarations */
> > static struct nfs4_stateid * find_stateid(stateid_t
> > *stid, int flags);
> > static struct nfs4_delegation *
> > find_delegation_stateid(struct inode *ino, stateid_t *stid);
> > @@ -1253,6 +1255,7 @@ int nfsd4_create_session(struct
> > svc_rqst *rqstp, struct nfsd4_create_session *se
> > {
> > u32 ip_addr = rqstp->rq_addr.sin_addr.s_addr;
> > struct nfs4_client *conf, *unconf;
> > + __u32 max_blocksize = svc_max_payload(rqstp);
> > int status = 0;
> >
> > if (STALE_CLIENTID(&session->clientid))
> > @@ -1302,6 +1305,12 @@ int nfsd4_create_session(struct
> > svc_rqst *rqstp, struct nfsd4_create_session *se
> > out_replay:
> > memcpy(session->sessionid, conf->cl_sessionid, 16);
> > session->seqid = conf->cl_seqid;
> > + session->fore_channel.maxreq_sz = max_blocksize;
> > + session->fore_channel.maxresp_sz = max_blocksize;
> > + session->fore_channel.maxresp_cached = max_blocksize;
> > + session->back_channel.maxreq_sz = max_blocksize;
> > + session->back_channel.maxresp_sz = max_blocksize;
> > + session->back_channel.maxresp_cached = max_blocksize;
> > out:
> > nfs4_unlock_state();
> > dprintk("%s returns %d %d\n", __FUNCTION__,
> > status, ntohl(status));
> > --
> > 1.5.0.2
> >
> >
> >
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://linux-nfs.org/pipermail/pnfs/attachments/20070316/ea1089fd/attachment-0001.htm
More information about the pNFS
mailing list