Re: Is It Possible to RX/Process/TX packets concurrently with AF_XDP?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Vincent,

Thank you very much for sharing!

I haven't tried DPDK/mTCP yet, but I will give it a shot once I could.

Also, sharing a link of slide about DPDK + AF_XDP: https://www.dpdk.org/wp-content/uploads/sites/35/2019/07/14-AF_XDP-dpdk-summit-china-2019.pdf 

Thanks
Rio

On 12/14/22, 12:40 PM, "Vincent Li" <vincent.mc.li@xxxxxxxxx> wrote:

    On Wed, Dec 7, 2022 at 2:54 PM Zhaoxi Zhu <zzhu@xxxxxxxxxxxxx> wrote:
    >
    > Hi All,
    >
    > Thank you very much for reading this email. My name is Rio.
    >
    > I recently started looking into the XDP technology, especially AF_XDP, and I really love it. I started studying and modifying this AF_XDP example(https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fxdp-project%2Fxdp-tutorial%2Fblob%2Fmaster%2Fadvanced03-AF_XDP%2Faf_xdp_user.c&amp;data=05%7C01%7Czzhu%40futurewei.com%7Cfa282c876ce04fed8e7b08dade1376e8%7C0fee8ff2a3b240189c753a1d5591fedc%7C1%7C0%7C638066472454897432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=zxR%2F3FpxxlOfe1pWRnNVOUxIX6HX8ZUE%2FTH4UNBnyEY%3D&amp;reserved=0) to meet my need, and it has been working fine.
    >
    > However, one thing I notice is that this user space application is single threaded. I wonder if it is feasible to multi-threading to the RX/packet processing/TX parts of the program, in order to utilize other cores and possibly make my application faster?
    >
    >
    > One challenge I face now is, as I tried different places to add multi-threading, the program does not work properly. Symptoms such as `assert(xsk->umem_frame_free < NUM_FRAMES);` failed; ICMP ping packets doesn’t arrive destination until seconds later and TCP connection generated by `iperf` cannot be established occurs as I tried different places to add multi-threading to my code.
    >
    > So, my question is, does AF_XDP applications support multi-threading during RX/packet processing/TX? If so, what is a proper way to modify the AF_XDP example code to let it run properly?
    >

    I used to use mTCP with DPDK https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmtcp-stack%2Fmtcp&amp;data=05%7C01%7Czzhu%40futurewei.com%7Cfa282c876ce04fed8e7b08dade1376e8%7C0fee8ff2a3b240189c753a1d5591fedc%7C1%7C0%7C638066472454897432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ktkYSL4UKvhBuRbJwgNsotned02i2lCzbGUszGCPOZc%3D&amp;reserved=0, then
    I thought why not mTCP on top of AF_XDP and I found this
    https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fmcabranches%2Fmtcp&amp;data=05%7C01%7Czzhu%40futurewei.com%7Cfa282c876ce04fed8e7b08dade1376e8%7C0fee8ff2a3b240189c753a1d5591fedc%7C1%7C0%7C638066472454897432%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;sdata=ulIhcvH5cQetmFcJpq86kcYl6IRr8Ch%2FTlz9b2dfX8g%3D&amp;reserved=0, it is multi-thread and a learning
    example, maybe we can exchange notes since I am learning AF_XDP too :)

    > Thank you again for reading this email. I look forward to hearing from you.
    >
    > Best,
    > Rio Zhu
    >
    >





[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux