Linux NFS development
 help / color / mirror / Atom feed
From: Chuck Lever <chuck.lever@oracle.com>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: nfs@lists.sourceforge.net
Subject: Re: [PATCH 18/20] SUNRPC: Add IPv6 address support to	net/sunrpc/xprtsock.c
Date: Mon, 13 Aug 2007 09:57:36 -0400	[thread overview]
Message-ID: <46C06350.6080709@oracle.com> (raw)
In-Reply-To: <1186844473.17941.23.camel@heimdal.trondhjem.org>

[-- Attachment #1: Type: text/plain, Size: 2660 bytes --]



Trond Myklebust wrote:
> On Mon, 2007-08-06 at 11:57 -0400, Chuck Lever wrote:
>> Finalize support for setting up RPC client transports to remote RPC
>> services addressed via IPv6.
>>
>> Based on work done by Gilles Quillard at Bull Open Source.
>>
>> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
>> Cc: Aurelien Charbon <aurelien.charbon@ext.bull.net>
>> ---
>>
>>  net/sunrpc/xprtsock.c |   57 ++++++++++++++++++++++++++++++++++++++++---------
>>  1 files changed, 47 insertions(+), 10 deletions(-)
>>
>> diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
>> index 391b88d..fb55c1c 100644
>> --- a/net/sunrpc/xprtsock.c
>> +++ b/net/sunrpc/xprtsock.c
>> @@ -13,6 +13,9 @@
>>   *  (C) 1999 Trond Myklebust <trond.myklebust@fys.uio.no>
>>   *
>>   * IP socket transport implementation, (C) 2005 Chuck Lever <cel@netapp.com>
>> + *
>> + * IPv6 support contributed by Gilles Quillard, Bull Open Source, 2005.
>> + *   <gilles.quillard@bull.net>
>>   */
>>  
>>  #include <linux/types.h>
>> @@ -1790,6 +1793,7 @@ static struct rpc_xprt *xs_setup_xprt(struct rpc_xprtsock_create *args, unsigned
>>   */
>>  struct rpc_xprt *xs_setup_udp(struct rpc_xprtsock_create *args)
>>  {
>> +	struct sockaddr *addr = args->dstaddr;
>>  	struct rpc_xprt *xprt;
>>  	struct sock_xprt *transport;
>>  
>> @@ -1798,15 +1802,11 @@ struct rpc_xprt *xs_setup_udp(struct rpc_xprtsock_create *args)
>>  		return xprt;
>>  	transport = container_of(xprt, struct sock_xprt, xprt);
>>  
>> -	if (ntohs(((struct sockaddr_in *)args->dstaddr)->sin_port) != 0)
>> -		xprt_set_bound(xprt);
>> -
>>  	xprt->prot = IPPROTO_UDP;
>>  	xprt->tsh_size = 0;
>>  	/* XXX: header size can vary due to auth type, IPv6, etc. */
>>  	xprt->max_payload = (1U << 16) - (MAX_HEADER << 3);
>>  
>> -	INIT_DELAYED_WORK(&transport->connect_worker, xs_udp_connect_worker4);
>>  	xprt->bind_timeout = XS_BIND_TO;
>>  	xprt->connect_timeout = XS_UDP_CONN_TO;
>>  	xprt->reestablish_timeout = XS_UDP_REEST_TO;
>> @@ -1819,7 +1819,28 @@ struct rpc_xprt *xs_setup_udp(struct rpc_xprtsock_create *args)
>>  	else
>>  		xprt_set_timeout(&xprt->timeout, 5, 5 * HZ);
>>  
>> -	xs_format_ipv4_peer_addresses(xprt);
>> +	switch (addr->sa_family) {
>> +	case AF_INET:
>> +		if (ntohs(((struct sockaddr_in *)addr)->sin_port) != 0)
> 
> Hmm.... I'm converting these to compare sin_port to htons(0). There is
> no need to byte-swap the variable every time we run this code if we can
> just have the compiler byte-swap the constant.

Not a hot path... but yes, that is true.  Up to you if you want to 
change this as described, but my feeling is that would be a little 
harder to read.  Your call, of course.

[-- Attachment #2: chuck.lever.vcf --]
[-- Type: text/x-vcard, Size: 290 bytes --]

begin:vcard
fn:Chuck Lever
n:Lever;Chuck
org:Oracle Corporation;Corporate Architecture: Linux Projects Group
adr:;;1015 Granger Avenue;Ann Arbor;MI;48104;USA
title:Principal Member of Staff
tel;work:+1 248 614 5091
x-mozilla-html:FALSE
url:http://oss.oracle.com/~cel
version:2.1
end:vcard


[-- Attachment #3: Type: text/plain, Size: 315 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/

[-- Attachment #4: Type: text/plain, Size: 140 bytes --]

_______________________________________________
NFS maillist  -  NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs

  reply	other threads:[~2007-08-13 17:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-06 15:57 [PATCH 18/20] SUNRPC: Add IPv6 address support to net/sunrpc/xprtsock.c Chuck Lever
2007-08-11 15:01 ` Trond Myklebust
2007-08-13 13:57   ` Chuck Lever [this message]
2007-08-13 17:48     ` Peter Staubach
2007-08-13 17:53       ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46C06350.6080709@oracle.com \
    --to=chuck.lever@oracle.com \
    --cc=nfs@lists.sourceforge.net \
    --cc=trond.myklebust@fys.uio.no \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox