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

net: Use k_fifo instead of k_work in RX and TX processing #34703

Merged

Commits on May 7, 2021

  1. net: 6locan: Convert to use k_fifo instead of k_work

    Following commits will remove k_work from net_pkt, so convert
    6locan L2 to use k_fifo between application and TX thread, and
    driver and RX error handler.
    
    Signed-off-by: Jukka Rissanen <[email protected]>
    jukkar committed May 7, 2021
    Configuration menu
    Copy the full SHA
    dc7d0b8 View commit details
    Browse the repository at this point in the history
  2. net: ppp: Convert to use k_fifo instead of k_work

    Following commits will remove k_work from net_pkt, so convert
    PPP L2 to use k_fifo when sending PPP data.
    
    Signed-off-by: Jukka Rissanen <[email protected]>
    jukkar committed May 7, 2021
    Configuration menu
    Copy the full SHA
    a6ef845 View commit details
    Browse the repository at this point in the history
  3. net: Use k_fifo instead of k_work in RX and TX processing

    The k_work handler cannot manipulate the used k_work. This means
    that it is not easy to cleanup the net_pkt because it contains
    k_work in it. Because of this, use k_fifo instead between
    RX thread and network driver, and between application and TX
    thread.
    
    A echo-server/client run with IPv4 and UDP gave following
    results:
    
    Using k_work
    ------------
    TX traffic class statistics:
    TC  Priority	Sent pkts	bytes	time
    [0] BK (1)	21922		5543071	103 us	[0->41->26->34=101 us]
    [1] BE (0)	0		0	-
    RX traffic class statistics:
    TC  Priority	Recv pkts	bytes	time
    [0] BK (0)	0		0	-
    [1] BE (0)	21925		6039151	97 us	[0->21->16->37->20=94 us]
    
    Using k_fifo
    ------------
    TX traffic class statistics:
    TC  Priority	Sent pkts	bytes	time
    [0] BK (1)	15079		3811118	94 us	[0->36->23->32=91 us]
    [1] BE (0)	0		0	-
    RX traffic class statistics:
    TC  Priority	Recv pkts	bytes	time
    [0] BK (1)	0		0	-
    [1] BE (0)	15073		4150947	79 us	[0->17->12->32->14=75 us]
    
    So using k_fifo gives about 10% better performance with same workload.
    
    Fixes zephyrproject-rtos#34690
    
    Signed-off-by: Jukka Rissanen <[email protected]>
    jukkar committed May 7, 2021
    Configuration menu
    Copy the full SHA
    2f435fc View commit details
    Browse the repository at this point in the history