Loading
ipvlan: support use xdp native mode
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IAOZOH ---------------------------------------------- Currently, the ipvlan doesn't support the xdp native mode. We want to add the xdp native mode to the ipvlan in a simple way. Because the working mode of ipvlan is special, it doesn't have the concept of queue. Therefore, the packet data received by the ipvlan is sent to the same xsk, and the function is processed from the soft interrupt of the real dev. Because xdp_do_redirect/xdp_do_flush are all lock-free mode, if xdp_do_redirect and xdp_do_flush are used on the ipvlan, different packet receiving queues(from different cpus) write data to the same xsk, the concurrency problem directly causes the kernel to crash. To fix this problem, we need to change the current packet receiving mode of the ipvlan, or extend the xdp redirection and flush to provide locked version. However, in fact, do_xdp_generic is already a locked version, so using do_xdp_generic directly meets our requirements, compared with running on xdp generic mode. Advance do_xdp_generic to the NIC driver layer to reduce the invoking of a software interrupt and slightly improve the performance. Each time an ipvlan is entered, a single SKB is processed. In fact, multiple SKB of do_xdp_flush in the ipvlane cannot be refreshed at the same time. Signed-off-by:bitcoffee <liuxin350@huawei.com>