From: Greg Banks <gnb@sgi.com>
To: Tom Tucker <tom@opengridcomputing.com>
Cc: neilb@suse.de, bfields@fieldses.org, nfs@lists.sourceforge.net
Subject: Re: [RFC,PATCH 0/7] svc: Incremental svc patchset cleanup
Date: Wed, 10 Oct 2007 12:24:08 +1000 [thread overview]
Message-ID: <20071010022408.GA20690@sgi.com> (raw)
In-Reply-To: <20071009153539.18846.33780.stgit@dell3.ogc.int>
G'day,
Compendium reply.
On Tue, Oct 09, 2007 at 10:35:39AM -0500, Tom Tucker wrote:
> This patchset is a series of independent, incremental patches against
> the previously posted svc transport switch patchset. I believe each
> of these patches can be taken independently. They are presented as a
> series soley because they reflect what I believe to be the collective
> consensus of the svc transport switch review.
>
> The main, non-trivial changes are as follows:
>
> - Transport class data is no longer copied to each transport instance.
>
> - A svc_xprt_find service has been added to allow a service to query
> for transport instances based on class name, address family and port.
>
> Subject: [RFC,PATCH 1/7] svc: Don't copy xprt_class data into svc_xprt instance
ok
> Subject: [RFC,PATCH 2/7] svc: Rename xpo_release to xpo_release_rqst
ok
> Subject: [RFC,PATCH 3/7] svc: Move setting of XPT_LISTENER bit to svc_tcp_init
ok
> Subject: [RFC,PATCH 4/7] svc: Add a sockaddr length argument to the xpo_create function.
ok
> Subject: [RFC,PATCH 5/7] svc: Remove extraneous debug svc_send printk
ok
> Subject: [RFC,PATCH 6/7] svc: Add svc API that queries for a transport instance
> @@ -242,11 +230,11 @@ static int make_socks(struct svc_serv *s
> int err = 0;
>
> if (proto == IPPROTO_UDP || nlm_udpport)
> - if (!find_xprt(serv, "udp"))
> + if (!svc_find_xprt(serv, "udp", 0, 0))
> err = svc_create_xprt(serv, "udp", nlm_udpport,
> SVC_SOCK_DEFAULTS);
> if (err >= 0 && (proto == IPPROTO_TCP || nlm_tcpport))
> - if (!find_xprt(serv, "tcp"))
> + if (!svc_find_xprt(serv, "tcp", 0, 0))
> err = svc_create_xprt(serv, "tcp", nlm_tcpport,
> SVC_SOCK_DEFAULTS);
You could use AF_UNSPEC as the "wildcard" value for address family.
> +struct svc_xprt *svc_find_xprt(struct svc_serv *serv, char *xcl_name,
> + int af, int port)
> +{
> + struct svc_xprt *xprt = NULL;
> + list_for_each_entry(xprt, &serv->sv_permsocks, xpt_list) {
Why have address family and port? Do you need them?
Also, if this is a generic, exported API, it should be taking
serv->sv_lock to protect traversal of the sv_permsocks list.
> + * Specifying 0 for the address family or port is a wildcard and will
> + * match any transport with the firt transport with the same class
> + * name active for the service.
> [...]
> + struct sockaddr_in *sin;
> + if (strcmp(xprt->xpt_class->xcl_name, xcl_name))
> + continue;
> + sin = (struct sockaddr_in *)&xprt->xpt_local;
> + if (af && sin->sin_family != af)
> + continue;
> +
> + if (port && (sin->sin_port != port))
> + continue;
So what are the intended semantics of svc_find_xprt(,,0,2049) ?
When called like that, it will reach into xprt->xpt_local assuming
it's a sockaddr_in and match the passed port number against whatever
it finds at bytes 2-3.
Perhaps this function could be pruned back to only do what it needs
to do right now, which is match on transport name?
> Subject: [RFC,PATCH 7/7] svc: Place type on same line for new API
ok
Greg.
--
Greg Banks, R&D Software Engineer, SGI Australian Software Group.
Apparently, I'm Bedevere. Which MPHG character are you?
I don't speak for SGI.
-------------------------------------------------------------------------
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/
_______________________________________________
NFS maillist - NFS@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs
next prev parent reply other threads:[~2007-10-10 2:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-09 15:35 [RFC,PATCH 0/7] svc: Incremental svc patchset cleanup Tom Tucker
2007-10-09 15:37 ` [RFC, PATCH 1/7] svc: Don't copy xprt_class data into svc_xprt instance Tom Tucker
2007-10-09 15:37 ` [RFC,PATCH 2/7] svc: Rename xpo_release to xpo_release_rqst Tom Tucker
2007-10-09 15:37 ` [RFC, PATCH 3/7] svc: Move setting of XPT_LISTENER bit to svc_tcp_init Tom Tucker
2007-10-09 15:37 ` [RFC, PATCH 4/7] svc: Add a sockaddr length argument to the xpo_create function Tom Tucker
2007-10-09 15:37 ` [RFC, PATCH 5/7] svc: Remove extraneous debug svc_send printk Tom Tucker
2007-10-09 15:37 ` [RFC, PATCH 6/7] svc: Add svc API that queries for a transport instance Tom Tucker
2007-10-09 15:37 ` [RFC,PATCH 7/7] svc: Place type on same line for new API Tom Tucker
2007-10-09 16:14 ` Aaron Wiebe
2007-10-09 16:13 ` [RFC,PATCH 0/7] svc: Incremental svc patchset cleanup Tom Tucker
2007-10-10 2:24 ` Greg Banks [this message]
2007-10-10 2:39 ` Tom Tucker
2007-10-10 4:25 ` Greg Banks
2007-10-10 3:32 ` Tom Tucker
2007-10-10 4:26 ` Greg Banks
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=20071010022408.GA20690@sgi.com \
--to=gnb@sgi.com \
--cc=bfields@fieldses.org \
--cc=neilb@suse.de \
--cc=nfs@lists.sourceforge.net \
--cc=tom@opengridcomputing.com \
/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