Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue: 1792164 Socket error queue support #900

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Commits on Jun 4, 2020

  1. issue: 1792164 Use NOTIFY_ON_EVENTS in all places

    NOTIFY_ON_EVENTS should be used in all place to provide
    single way for passing any epoll events.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 4, 2020
    Configuration menu
    Copy the full SHA
    cf5aae3 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2020

  1. issue: 1792164 Introduce socket error queue

    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    e81bdb1 View commit details
    Browse the repository at this point in the history
  2. issue: 1792164 Change handle_cmsg() prototype

    Added flags argument that comes from original recv() call.
    It is needed to return information from error queue that
    should be done if MSG_ERRQUEUE is passed.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    a458344 View commit details
    Browse the repository at this point in the history
  3. issue: 1792164 Add MSG_ERRQUEUE handler

    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    3b233a4 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    28b8b23 View commit details
    Browse the repository at this point in the history
  5. issue: 1792164 Define zero copy constants

    zero copy was introduced at linux kernel 4.14 so
    prevoius versions do not have related options.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    815376c View commit details
    Browse the repository at this point in the history
  6. issue: 1792164 Add SO_ZEROCOPY processing

    Passing the MSG_ZEROCOPY flag is the most obvious step to enable
    copy avoidance, but not the only one.
    The kernel is permissive when applications pass undefined flags
    to the send system call. By default it simply ignores these.
    To avoid enabling copy avoidance mode for legacy processes that
    accidentally already pass this flag, a process must first
    signal intent by setting a socket option as SO_ZEROCOPY.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    74de061 View commit details
    Browse the repository at this point in the history
  7. issue: 1792164 Add PBUF_ZEROCOPY type of allocated pbuf

    Extend pbuf allocation functions with new parameter as pbuf_type
    to by pass requested type of memory to socket.
    Socket layer needs this information to manage different types
    of mem_buf_desc_t elements.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    3457d7d View commit details
    Browse the repository at this point in the history
  8. issue: 1792164 Introduce flags to process zero copy send

    There flags are added:
    VMA_TX_PACKET_ZEROCOPY - to use on sockinfo/dst_entry layers
    TCP_WRITE_ZEROCOPY - to use inside lwip tcp_write
    TF_SEG_OPTS_ZEROCOPY - to mark tcp segment with zero copy attribute
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Jun 15, 2020
    Configuration menu
    Copy the full SHA
    7aa343d View commit details
    Browse the repository at this point in the history

Commits on Oct 7, 2020

  1. issue: 1792164 Add MSG_ZEROCOPY processing

    These changes make workable MSG_ZEROCOPY send flow
    including notification mechanizm.
    It is needed to notify the process when it is safe to reuse a
    previously passed buffer. It queues completion notifications
    on the socket error queue.
    
    But copy avoidance internally is not done. So all data
    is copied in internal buffers as without MSG_ZEROCOPY.
    
    Full zcopy support will be implemented later.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    969ade6 View commit details
    Browse the repository at this point in the history
  2. issue: 1792164 Force tx completion for zerocopy buffers

    ZCOPY packets should notify application as soon as possible to
    confirm one that user buffers are free to reuse. So force completion
    signal for such work requests.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    94ffe80 View commit details
    Browse the repository at this point in the history
  3. issue: 1792164 Track last memory descriptor with identical zcopy counter

    TCP write can create several memory descriptors for single write
    call with identical zcopy id. Notification should be done just
    in case last one is free.
    This change does not garantee correctness completelly when during
    the same write() call memory descriptor set current zcopy id
    after previous memory descriptor get tx completion and ack.
    
    zcopy operation should allocate memory buffer to track
    unique counter correctly.
    So tcp_write() should avoid adding portion of data to existing
    pbuf.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    c239eff View commit details
    Browse the repository at this point in the history
  4. issue: 1792164 Do TX polling from internal thread

    To effectively process TX completions VMA should
    polling TX from internal thread too otherwise
    tx memory descriptor can not be freed on time as far
    as there user application should call any write() operations
    to force it.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    b22e4e9 View commit details
    Browse the repository at this point in the history
  5. issue: 1792164 Extend VMA_INTERNAL_THREAD_ARM_CQ variable

    Flexible tunning is added to control RX and TX polling.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    306d312 View commit details
    Browse the repository at this point in the history
  6. issue: 1792164 Support MSG_ERRQUEUE in sockinfo::rx()

    rx() processing should allow return information from error queue
    and income data in single call.
    Depending on user application it means that rx() logic should
    return:
    1. only income data
    2. only error queue data
    3. income and error queue data
    Error processing logic is done accordingly.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    50996ba View commit details
    Browse the repository at this point in the history
  7. issue: 1792164 Support checking POLLERR events by poll()

    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    f808091 View commit details
    Browse the repository at this point in the history
  8. issue: 1792164 Improve LSO send flow

    LSO operation can not be done when payload data less
    than mss.
    This change allows to use LSO in right way.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    fc9acbe View commit details
    Browse the repository at this point in the history
  9. issue: 1792164 Fix race access to error queue

    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    1392cb6 View commit details
    Browse the repository at this point in the history

Commits on Dec 30, 2020

  1. issue: 1792164 Remove epoll event when it is consumed

    Zcopy notification mechanism (error queue) adds an event EPOLLERR to
    respective epfd_info object and it is never removed. This leads to the
    issue that epoll_wait() returns EPOLLERR event endlessly and doesn't
    enter polling loops.
    
    Fix this by removing EPOLLERR event when socket becomes not "errorable".
    The fix avoids fake EPOLLERR events and allows epoll_wait_helper() to
    perform polling.
    pasis authored and igor-ivanov committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    b0b5b52 View commit details
    Browse the repository at this point in the history
  2. issue: 1792164 Handle duplicate zcopy notifications

    In retransmit scenario it is possible to get duplicate ids in the zcopy
    callback. In this case, ee_data is rewritten with a value which may be
    lower than previous value. This leads to missed notifications.
    
    As workaround, don't overwrite ee_data with lower value.
    pasis authored and igor-ivanov committed Dec 30, 2020
    Configuration menu
    Copy the full SHA
    d2db645 View commit details
    Browse the repository at this point in the history

Commits on Feb 20, 2021

  1. issue: 2439102 Fix issue with processing control msg in recvmsg()

    Control message should be handled just in case an user
    passes a buffer for it.
    Error queue request must be processed first before data.
    
    Signed-off-by: Igor Ivanov <[email protected]>
    igor-ivanov committed Feb 20, 2021
    Configuration menu
    Copy the full SHA
    07a71ec View commit details
    Browse the repository at this point in the history