[ovs-dev] [PATCH 4/5] dpif-linux: Implement the API functions to allow multiple handler threads read upcall.
Alex Wang
alexw at nicira.com
Thu Mar 6 17:42:56 UTC 2014
Hey Han,
Yes, you are right. I'll take your suggestion,
Thanks,
Alex Wang,
On Thu, Mar 6, 2014 at 5:44 AM, Han Zhou <zhouhan at gmail.com> wrote:
> Hi Alex,
>
> On Thu, 2014-02-27 at 11:44 -0800, Alex Wang wrote:
>
> > static int
> > -dpif_linux_recv_set__(struct dpif *dpif_, bool enable)
> > +dpif_linux_recv_set__(struct dpif *dpif_, bool enable, uint32_t
> n_handlers)
> > {
> > struct dpif_linux *dpif = dpif_linux_cast(dpif_);
> >
> > - if ((dpif->epoll_fd >= 0) == enable) {
> > + if ((dpif->epolls != NULL) == enable) {
> > + if (enable && dpif->n_handlers != n_handlers) {
> > + dpif_linux_refresh_channels(dpif_, n_handlers);
>
> This makes dpif_linux_handlers_set() never return error, even if
> something wrong in dpif_linux_refresh_channels(). This trap could be
> avoided by removing n_handlers from recv_set(), and let handlers_set()
> do the n_handlers update.
>
> > + }
> > return 0;
> > } else if (!enable) {
> > - destroy_channels(dpif);
> > + destroy_all_channels(dpif);
> > return 0;
> > } else {
> > - return dpif_linux_refresh_channels(dpif_);
> > + return dpif_linux_refresh_channels(dpif_, n_handlers);
> > }
> > }
> >
>
> Best regards,
> Han
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-dev/attachments/20140306/14b5f3d4/attachment-0005.html>
More information about the dev
mailing list