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

mm/iob: add support of shared iob #7890

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

anchao
Copy link
Contributor

@anchao anchao commented Dec 15, 2022

Summary

  1. mm/iob: revert "modify iob to support header padding and alignment features"

we don't need to implement l2 isolation through io_head, iob offload will use io_offset

-------------------------------------------------------------
Layout of different NICs implementation:

        iob_data (aligned by CONFIG_IOB_ALIGNMENT)
            |
            |                 io_offset(CONFIG_NET_LL_GUARDSIZE)
            |                                |
            -------------------------------------------------
 Ethernet   |       Reserved    | ETH_HDRLEN |    io_len    |
            ---------------------------------|---------------
 8021Q      |   Reserved  | ETH_8021Q_HDRLEN |    io_len    |
            ---------------------------------|---------------
 ipforward  |            Reserved            |    io_len    |
            -------------------------------------------------

--------------------------------------------------------------------
  1. mm/iob: decoupling iob_s and io_data
  2. mm/iob: add support of shared iob

add reference count to each iob entry to support shared iob, multiple iob
entries could share the io_data to avoid unnecessary iob_alloc and memory copies

                 ---------  ---------
Shared entries   | iob_s |  | iob_s |
                 ---------  ---------
                    \           /
         (io_parent) \         / (io_parent)
                      \       /
                       --------------------------------------------------
Origin entry           | iob_s |  io_data (shared with shadow entries)  |
                       --------------------------------------------------
                     io_refs(3)

  1. net/devif/iobsend: add support of iob shared to avoid unnecessary iob copying

Iperf passthrough on NuttX simulator:
enable CONFIG_NET_TCP_WRITE_BUFFERS,

----------------------------------------
|  Protocol      | Client |            |
|--------------------------------------|
|  TCP           |   230  |  Mbits/sec |
|  TCP(Shared)   |   300  |  Mbits/sec |
----------------------------------------
  1. net/tcp: update only if packet and device length are different

Impact

N/A

Testing

iperf test

…atures"

we don't need to implement l2 isolation through io_head, iob offload will use io_offset

-------------------------------------------------------------
Layout of different NICs implementation:

        iob_data (aligned by CONFIG_IOB_ALIGNMENT)
            |
            |                 io_offset(CONFIG_NET_LL_GUARDSIZE)
            |                                |
            -------------------------------------------------
 Ethernet   |       Reserved    | ETH_HDRLEN |    io_len    |
            ---------------------------------|---------------
 8021Q      |   Reserved  | ETH_8021Q_HDRLEN |    io_len    |
            ---------------------------------|---------------
 ipforward  |            Reserved            |    io_len    |
            -------------------------------------------------

--------------------------------------------------------------------

Signed-off-by: chao an <[email protected]>
@anchao anchao force-pushed the 22121501 branch 2 times, most recently from 4f74d44 to 8b5a508 Compare December 15, 2022 15:38
@anchao anchao requested a review from davids5 December 17, 2022 08:59
add reference count to each iob entry to support shared iob, multiple iob
entries could share the io_data to avoid unnecessary iob_alloc and memory copies

                 ---------  ---------
Shared entries   | iob_s |  | iob_s |
                 ---------  ---------
                    \           /
         (io_parent) \         / (io_parent)
                      \       /
                       --------------------------------------------------
Origin entry           | iob_s |  io_data (shared with shadow entries)  |
                       --------------------------------------------------
                     io_refs(3)

Signed-off-by: chao an <[email protected]>
… copying

Iperf passthrough on NuttX simulator:
enable CONFIG_NET_TCP_WRITE_BUFFERS,

----------------------------------------
|  Protocol      | Client |            |
|--------------------------------------|
|  TCP           |   230  |  Mbits/sec |
|  TCP(Shared)   |   300  |  Mbits/sec |
----------------------------------------

Signed-off-by: chao an <[email protected]>
@xiaoxiang781216 xiaoxiang781216 marked this pull request as draft January 18, 2023 09:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants