Skip to content

So Slow with AF_XDP code ? #425

@samueljaydan

Description

@samueljaydan

When I get the codes and use them directly, I run the code with the following iptables rules. Then the pages open very slowly. For example, the speedtest page opens, but it starts calculating after 1 minute or so. When I close the code, there is no problem with direct internet output. What could be the reasons for this?

iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o enp2s0 -j ​​SNAT --to-source 10.10.1.254

4: enp3s0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 xdp qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 10:02:02:44:4e:9e brd ff:ff:ff:ff:ff:ff
    prog/xdp id 150 name xdp_sock_prog tag 85660fbfaf1d42c0 jited 
4: enp3s0: <BROADCAST,MULTICAST,PROMISC,UP,LOWER_UP> mtu 1500 xdp/id:150 qdisc mq state UP group default qlen 1000
    link/ether 10:02:02:44:4e:9e brd ff:ff:ff:ff:ff:ff
    inet 192.168.11.254/24 brd 192.168.11.255 scope global enp3s0
       valid_lft forever preferred_lft forever
    inet6 fe80::1202:2ff:fe44:4e9e/64 scope link 
       valid_lft forever preferred_lft forever

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions