AF_XDP: No packets for socket with queue-id 0 even though every packet is redirect

前端 未结 1 1946
时光说笑
时光说笑 2021-01-28 18:43

I am based on this tutorial: https://github.com/xdp-project/xdp-tutorial/tree/master/advanced03-AF_XDP

I create a socket with Queue-ID 0 in userspace. In my

1条回答
  •  生来不讨喜
    2021-01-28 19:09

    So this was discussed on IRC (#xdp, Freenode) and the xdp-newbies mailing list. Reporting here for the record.

    The answer is that you did nothing wrong: With AF_XDP, a socket receives the packets from one hardware queue. You could have several sockets receiving packets from one queue, but you cannot have, as of this writing, one socket receiving on more than one queue. This is by design.

    In your case, the Queue-ID: 0 that you associate to your socket indicates that it will receives packet from queue 0. This is why you don't see all packets received by the NIC before routing all flows to queue 0.

    Reference for the ML discussion: link. Credits to Björn and Toke.

    0 讨论(0)
提交回复
热议问题