[illumos-Developer] webrev for 1107

Gordon Ross gordon.w.ross at gmail.com
Mon Jun 13 14:21:01 PDT 2011


On Mon, Jun 13, 2011 at 4:45 PM, Vitaliy Gusev
<gusev.vitaliy at nexenta.com> wrote:
>>>
>>> No, do_one doesn't call do_poll_cots_action. I as mentioned early,
>>> call stack is:
>>>
>>>   poll_for_action
>>>        do_poll_cots_action
>>>             cots_listen_event
>>
>> Heh, your're right, I confused poll_for_actions with add_to_poll_list,
>> which is called by do_one.
>> But your point point opens several questions. First of all I need to
>> explain why we need OK_TPI_TYPE
>> instead of checking of nc_semantics on  NC_TPI_CLTS only.
>
>
> I think it creates kernel thread on each connect for COTS - so we can do it
> only on connect, whereas for udp it can be started at once.
>
>
>>
>> Both nfsd and lockd calls do_one function and pass svc callback to it.
>> In case of lockd svc callback
>> is nlmsvc function which calls LM_SVC nfs syscall that opens in its
>> turn makes kernel to register
>> kRPC server handles for given protocols and devices. By some reason
>
> ...
>
>> In case of nfsd do_one function calls nfssvc callback for CLTS only.
>> nfssvc calls NFS_SVC nfssys
>> that in its turn creates kRPC server handle. According to the code,
>> nfs_tbind.c will create only CLTS
>> kRPC server handles for nfsd. Is it right?
>
>
>
> 1. For udp it will be called at once from do_one()
>
> 2. For tcp it delays until incoming connection arrives. For nfsd see to
>
>
> *** src/cmd/fs.d/nfs/nfsd/nfsd.c:
>         int (*Mysvc)(int , struct netbuf, struct netconfig *) = nfssvc;
>
> *** src/cmd/fs.d/nfs/lib/nfs_tbind.c:
> cots_listen_event[1425]        ret = (*Mysvc)(new_fd, addrmask, nconf);

Right, so for connection-oriented transports:
nfs_tbind.c: do_one() calls
   add_to_poll_list() with the listening endpoint.

When that listening endpoint gets a poll event,
(typically a connection indication) it will call:
  do_poll_cots_action(),
    cots_listen_event(),
which will accept the connection and then
start RPC services on it (Mysvc, etc).

So the original check is correct:
  nc->nc_semantics == NC_TPI_CLTS
(A comment would help :)

Gordon



More information about the Developer mailing list