I was failed to get non-zero value for the ServerSocket and according to 
clarification from the network experts:
" NAPI IDs is not marked on listening sockets. A listening socket can accept 
multiple connections coming on different queues. So even if we do it, it can 
keep changing and we don't see a use case for it. Once a connection is 
accepted, accepted or the child socket will return a valid NAPI id."

So seems the listener sockets will have this as zero.

 Thanks, Vladimir

-----Original Message-----
From: Alan Bateman <alan.bate...@oracle.com> 
Sent: Tuesday, May 5, 2020 12:24 PM
To: Ivanov, Vladimir A <vladimir.a.iva...@intel.com>; OpenJDK Network Dev list 
<net-dev@openjdk.java.net>
Subject: Re: RFR 15 8243099: SO_INCOMING_NAPI_ID support

On 05/05/2020 19:04, Ivanov, Vladimir A wrote:
> Thanks for your review.
> yes, the SocketException looks better here than the IOE. The updated 
> webrev available as 
> http://cr.openjdk.java.net/~sviswanathan/Vladimir/8243099/webrev.08/
>
> Also 'positive' was added to Javadoc to describe napi id.
Thanks. the javadoc looks good. I think Chris is looking at the API docs too. 
Next step is the CSR, I assume Sandhya will do that for you.

One question that goes back to one of my original questions is whether this 
socket option is supported for listener sockets (ServerSocketChannel and 
ServerSocket). I just checked it locally and SO_INCOMING_NAPI_ID is always 
reported as 0. I get a positive value for connected sockets as expected.


>
> Could you describe the testing scenario that should be covered?
> Now this test have:
>   - simple check (zero for non-initialized and exception for 'set' option for 
> the ServerSocket/Socket/DatagramSocket).
>   - server/client testing for the ServerSocket/Socket;
>   - send/receive testing for the DatagramSocket.
>
> The simple check may be easily extended to channels. The server/client 
> testing require special classes that increase the testing size and reduce 
> maintainability.
I think the tests can be simple, no need for server/client in different 
threads. When SO_INCOMING_NAPI_ID is supported then all you need to do is check 
it is 0 before any packets are received and then a constant positive value 
thereafter.  It's important that tests don't use a hardcoded port and also 
important that tests clean up (don't leave any sockets open).

-Alan

Reply via email to