On Mon, Feb 10, 2014 at 1:14 PM, Ben Pfaff <b...@nicira.com> wrote:
> On Mon, Feb 10, 2014 at 11:16:22AM -0800, Gurucharan Shetty wrote:
>> This commit creates events and through poll_fd_wait_event()
>> associates them with socket file descriptors to get woken up
>> from poll_block().
>>
>> Some other changes:
>>
>> * Windows does not have sys/fcntl.h but has a fcntl.h
>> On Linux, there is fctnl.h too.
>>
>> * include <openssl/applink.c> to handle different C-Runtime linking
>> of OVS and openssl libraries as suggested at
>> https://www.openssl.org/support/faq.html#PROG2
>
> The last sentence in that FAQ entry is: "An explicit reminder is due
> that in this situation [mixing compiler options] it is as important to
> add CRYPTO_malloc_init prior first call to OpenSSL."  We don't call
> CRYPTO_malloc_init().  Should we?
I did not see any negative effects without that call (or with it). Since the FAQ
explicitly asks for it, I will add it.

>
>> The above include will not be needed if we compile Open vSwitch with
>> /MD compiler option.
>
> Do we need to avoid the #include, with /MD?
I haven't been able to test it as the pthread library I am using for
testing does not like the /MD option.
The goal is to eventually get OVS compiled with the /MD option (that
is the standard way). If during that
I face problems, I will correct the mentioned include here.


>
>> * WSAEventSelect() function that associates 'fd' with events, does not
>> understand POLLIN, POLLOUT etc. Instead the macros it understands are 
>> FD_READ,
>> FD_WRITE, FD_ACCEPT, FD_CONNECT, FD_CLOSE etc. So we need to make that
>> transition.
>
> Won't we need that kind of translation for every call to
> poll_fd_wait_event() in the whole program?  If so then should we do
> the translation inside poll_fd_wait_event() itself, so that we don't
> have to modify code all over?
>
I wasn't sure if there was a use case where the user wanted more
control over the FD_* options.
But, I think you are right. I will do the translation inside
poll_block(). If we need more control, we can take it out.

> I see that one of the changes here is changing a setsockopt() call to
> cater to Windows defining the data arg as "char *" instead of "void
> *".  We have a fair number of setsockopt() calls in the tree, and so
> it might be better to just add something like this (untested) to
> socket-util.h:
>
>     #ifdef _WIN32
>     /* Windows defines the 'optval' argument as char * instead of void *. */
>     #define setsockopt(sock, level, optname, optval, optlen) \
>         rpl_setsockopt(sock, level, optname, optval, optlen)
>     static inline int rpl_setsockopt(int sock, int level, int optname,
>                                      const void *optval, socklen_t optlen)
>     {
>         return (setsockopt)(sock, level, optname, optval, optlen);
>     }
>     #endif
Thanks for the snippet. I will use it.
>
> Thanks,
>
> Ben.
_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to