On Mon, Jun 17, 2024 at 1:00 PM Jason Wang <[email protected]> wrote:
>
> On Fri, Jun 14, 2024 at 2:39 PM Xuan Zhuo <[email protected]> wrote:
> >
> > If the xsk is enabling, the xsk tx will share the send queue.
> > But the xsk requires that the send queue use the premapped mode.
> > So the send queue must support premapped mode when it is bound to
> > af-xdp.
> >
> > * virtnet_sq_set_premapped(sq, true) is used to enable premapped mode.
> >
> > In this mode, the driver will record the dma info when skb or xdp
> > frame is sent.
> >
> > Currently, the SQ premapped mode is operational only with af-xdp. In
> > this mode, af-xdp, the kernel stack, and xdp tx/redirect will share
> > the same SQ. Af-xdp independently manages its DMA. The kernel stack
> > and xdp tx/redirect utilize this DMA metadata to manage the DMA
> > info.
> >
Note that there's indeed a mode when we have exclusive XDP TX queue:
/* XDP requires extra queues for XDP_TX */
if (curr_qp + xdp_qp > vi->max_queue_pairs) {
netdev_warn_once(dev, "XDP request %i queues but max
is %i. XDP_TX and XDP_REDIRECT will operate in a slower locked tx
mode.\n",
curr_qp + xdp_qp, vi->max_queue_pairs);
xdp_qp = 0;
}
So we need to mention how the code works in this patch.
Thanks