[ovs-dev] [PATCH v2 3/4] Add file descriptor persistence where possible

0-day Robot robot at bytheb.org
Fri Feb 14 19:06:22 UTC 2020


Bleep bloop.  Greetings Anton Ivanov, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Line has trailing whitespace
#71 FILE: include/openvswitch/poll-loop.h:67:
#endif 

WARNING: Line has trailing whitespace
#92 FILE: include/openvswitch/poll-loop.h:93:
 * containing the events passed by the OS in .revents. 

WARNING: Line has trailing whitespace
#95 FILE: include/openvswitch/poll-loop.h:96:
 * Limitations - MUST BE registered from the same thread as the one where 

WARNING: Line is 86 characters long (recommended limit is 79)
#99 FILE: include/openvswitch/poll-loop.h:100:
void poll_fd_register_at(int fd, int events, struct pollfd **hint, const char *where);

WARNING: Line is 100 characters long (recommended limit is 79)
#100 FILE: include/openvswitch/poll-loop.h:101:
#define poll_fd_register(fd, events, hint) poll_fd_register_at(fd, events, hint, OVS_SOURCE_LOCATOR)

WARNING: Line is 96 characters long (recommended limit is 79)
#115 FILE: include/openvswitch/poll-loop.h:116:
#define private_poll_fd_wait(fd, events) private_poll_fd_wait_at(fd, events, OVS_SOURCE_LOCATOR)

WARNING: Line is 93 characters long (recommended limit is 79)
#242 FILE: lib/poll-loop.c:55:
    bool private;               /* Can we assume that it is only in this thread poll loop? */

WARNING: Line is 86 characters long (recommended limit is 79)
#268 FILE: lib/poll-loop.c:79:
/* Look up the node with same fd or wevent - should be accessed under &loop->mutex. */

WARNING: Line is 83 characters long (recommended limit is 79)
#285 FILE: lib/poll-loop.c:99:
/* Registers 'fd' as waiting for the specified 'events' (which should be OVS_POLLIN

WARNING: Line is 88 characters long (recommended limit is 79)
#286 FILE: lib/poll-loop.c:100:
 * or OVS_POLLOUT or OVS_POLLIN | OVS_POLLOUT).  The following call to poll_block() will

WARNING: Line is 90 characters long (recommended limit is 79)
#294 FILE: lib/poll-loop.c:103:
 * The event registration is PERSISTENT. This is intended for OSes which have a persistent

WARNING: Line is 110 characters long (recommended limit is 79)
#309 FILE: lib/poll-loop.c:114:
poll_fd_subscribe_at(int fd, HANDLE wevent, int events, struct pollfd **hint, const char *where, bool private)

WARNING: Line is 97 characters long (recommended limit is 79)
#345 FILE: lib/poll-loop.c:137:
        /* If there is an existing event mask we do not need to inc - this will be waited upon */

WARNING: Line is 90 characters long (recommended limit is 79)
#346 FILE: lib/poll-loop.c:138:
        node->pollfd.events |= (events & 0x0000FFFF); /* or without epoll specific bits */

WARNING: Line is 82 characters long (recommended limit is 79)
#349 FILE: lib/poll-loop.c:141:
        /* modify existing epoll entry if there is an epoll specific ask or if the

WARNING: Line is 80 characters long (recommended limit is 79)
#353 FILE: lib/poll-loop.c:145:
            event.events = node->pollfd.events | events | EPOLLHUP | EPOLLRDHUP;

WARNING: Line is 93 characters long (recommended limit is 79)
#364 FILE: lib/poll-loop.c:156:
            /* node marked for reaping, OS has reused the fd number, valid is set to false */

WARNING: Line is 103 characters long (recommended limit is 79)
#376 FILE: lib/poll-loop.c:168:
        event.events = node->pollfd.events | EPOLLHUP | EPOLLRDHUP; /* we always listen for fd close */

WARNING: Line is 82 characters long (recommended limit is 79)
#388 FILE: lib/poll-loop.c:180:
poll_fd_register_at(int fd, int events, struct pollfd **hint, const char *where) {

WARNING: Line is 89 characters long (recommended limit is 79)
#392 FILE: lib/poll-loop.c:184:
/* Deregisters a fd. Note - this looks like a memory leak (deallocating only private fds)

WARNING: Line is 89 characters long (recommended limit is 79)
#394 FILE: lib/poll-loop.c:186:
 * In order to be compatible with existing calling conventions while using fd persistence

WARNING: Line is 86 characters long (recommended limit is 79)
#395 FILE: lib/poll-loop.c:187:
 * where supported we have to keep "legacy" fds around for the duration of the life of

WARNING: Line is 93 characters long (recommended limit is 79)
#397 FILE: lib/poll-loop.c:189:
 * The reason for this is that for some of them the close() is in a thread different from the

WARNING: Line is 93 characters long (recommended limit is 79)
#399 FILE: lib/poll-loop.c:191:
 * Thus, the only thing we can do in this case is mark them "invalid". Once the OS reuses the

WARNING: Line is 87 characters long (recommended limit is 79)
#419 FILE: lib/poll-loop.c:211:
            VLOG(VLL_WARN, "Trying to deregister a non-private %d from %s", fd, where);

WARNING: Line is 98 characters long (recommended limit is 79)
#476 FILE: lib/poll-loop.c:363:
        /* epoll does not have NVAL - it uses RDHUP and HUP which we cannot actually get to here*/

WARNING: Line is 100 characters long (recommended limit is 79)
#532 FILE: lib/poll-loop.c:437:
        (struct epoll_event *) &loop->epoll_events, MAX_EPOLL_EVENTS, loop->timeout_when, &elapsed);

WARNING: Line is 84 characters long (recommended limit is 79)
#554 FILE: lib/poll-loop.c:459:
                 * ensured that anything which refers to IO event hints will not run

WARNING: Line is 84 characters long (recommended limit is 79)
#560 FILE: lib/poll-loop.c:465:
                node->pollfd.revents |= (loop->epoll_events[i].events & 0x0000FFFF);

WARNING: Line is 101 characters long (recommended limit is 79)
#564 FILE: lib/poll-loop.c:469:
                node->pollfd.events = OVS_POLLIN; /* reset back to defaults - write needs one shot */

WARNING: Line is 82 characters long (recommended limit is 79)
#567 FILE: lib/poll-loop.c:472:
                epoll_ctl(loop->epoll_fd, EPOLL_CTL_MOD, node->pollfd.fd, &event);

WARNING: Line is 105 characters long (recommended limit is 79)
#634 FILE: lib/poll-loop.c:520:
                    VLOG_FATAL("poll: persistence state corrupted, no hash entry for %d", pollfds[i].fd);

WARNING: Line has trailing whitespace
#643 FILE: lib/poll-loop.c:529:
                /* update "requested" events. 

WARNING: Line is 96 characters long (recommended limit is 79)
#644 FILE: lib/poll-loop.c:530:
                 * Note - "private" fds always want POLLIN - that emulates EPOLL, /dev/poll, etc

WARNING: Line is 92 characters long (recommended limit is 79)
#645 FILE: lib/poll-loop.c:531:
                 * behaviour which they should be using in real life instead of using poll()

WARNING: Line is 81 characters long (recommended limit is 79)
#648 FILE: lib/poll-loop.c:534:
                    node->pollfd.events &= ~(pollfds[i].revents & (~OVS_POLLIN));

WARNING: Line is 89 characters long (recommended limit is 79)
#652 FILE: lib/poll-loop.c:538:
                /* update "occured" events for use by streams and handlers. In case there

WARNING: Line is 87 characters long (recommended limit is 79)
#653 FILE: lib/poll-loop.c:539:
                 * is an existing (but not consumed yet) event, we OR the events in the

WARNING: Line is 89 characters long (recommended limit is 79)
#654 FILE: lib/poll-loop.c:540:
                 * stored record with the new ones - it is the job of the stream to clear

ERROR: Inappropriate bracing around statement
#665 FILE: lib/poll-loop.c:549:
    if (wevents)

WARNING: Line is 93 characters long (recommended limit is 79)
#742 FILE: lib/stream-fd.c:119:
        /* poll-loop is providing us with hints for IO. If we got a HUP/NVAL we skip straight

WARNING: Line is 89 characters long (recommended limit is 79)
#743 FILE: lib/stream-fd.c:120:
         * to the read which should return 0 if the HUP is a real one, if not we clear it

WARNING: Line is 83 characters long (recommended limit is 79)
WARNING: Line lacks whitespace around operator
#746 FILE: lib/stream-fd.c:123:
        if ((!(s->hint->revents & (OVS_POLLHUP|OVS_POLLNVAL))) && (!s->rx_ready)) {

WARNING: Line lacks whitespace around operator
#755 FILE: lib/stream-fd.c:132:
            s->hint->revents &= ~(OVS_POLLHUP|OVS_POLLNVAL);

WARNING: Line is 89 characters long (recommended limit is 79)
#791 FILE: lib/stream-fd.c:177:
        /* Linux will sometimes return ENOBUFS on sockets instead of EAGAIN. Usually seen

WARNING: Line has trailing whitespace
#792 FILE: lib/stream-fd.c:178:
         *  on unix domain sockets 

WARNING: Line is 93 characters long (recommended limit is 79)
#884 FILE: lib/stream-ssl.c:705:
        /* poll-loop is providing us with hints for IO. If we got a HUP/NVAL we skip straight

WARNING: Line is 89 characters long (recommended limit is 79)
#885 FILE: lib/stream-ssl.c:706:
         * to the read which should return 0 if the HUP is a real one, if not we clear it

WARNING: Line is 102 characters long (recommended limit is 79)
WARNING: Line lacks whitespace around operator
#888 FILE: lib/stream-ssl.c:709:
        if ((!(sslv->hint->revents & (OVS_POLLHUP|OVS_POLLNVAL))) && (sslv->rx_want == SSL_READING)) {

WARNING: Line has trailing whitespace
#892 FILE: lib/stream-ssl.c:713:
                /* POLLIN event from poll loop, mark us as ready 

WARNING: Line lacks whitespace around operator
#898 FILE: lib/stream-ssl.c:719:
            sslv->hint->revents &= ~(OVS_POLLHUP|OVS_POLLNVAL);

WARNING: Line has trailing whitespace
#917 FILE: lib/stream-ssl.c:763:
                /* POLLIN event from poll loop, mark us as ready 

Lines checked: 1114, Warnings: 53, Errors: 1


Please check this out.  If you feel there has been an error, please email aconole at redhat.com

Thanks,
0-day Robot


More information about the dev mailing list