OSDN Git Service

veth: Avoid drop packets when xdp_redirect performs
authorHeng Qi <henqqi@linux.alibaba.com>
Mon, 31 Oct 2022 06:19:22 +0000 (14:19 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 2 Nov 2022 12:07:10 +0000 (12:07 +0000)
commit2e0de6366ac16ab4d0abb2aaddbc8a1eba216d11
tree92cc32bc0ed673f414d73aee38fc911e969bac1f
parent7e8cdc97148c6ba66671e88ad9f7d434f4df3438
veth: Avoid drop packets when xdp_redirect performs

In the current processing logic, when xdp_redirect occurs, it transmits
the xdp frame based on napi.

If napi of the peer veth is not ready, the veth will drop the packets.
This doesn't meet our expectations.

In this context, we enable napi of the peer veth automatically when the
veth loads the xdp. Then if the veth unloads the xdp, we need to
correctly judge whether to disable napi of the peer veth, because the peer
veth may have loaded xdp, or even the user has enabled GRO.

Signed-off-by: Heng Qi <henqqi@linux.alibaba.com>
Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/veth.c