On Tue, 2024-06-18 at 15:56 +0800, Xuan Zhuo wrote: > Support AF-XDP for merge mode. > > Signed-off-by: Xuan Zhuo <xuanzhuo@xxxxxxxxxxxxxxxxx> > --- > drivers/net/virtio_net.c | 139 +++++++++++++++++++++++++++++++++++++++ > 1 file changed, 139 insertions(+) > > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c > index 06608d696e2e..cfa106aa8039 100644 > --- a/drivers/net/virtio_net.c > +++ b/drivers/net/virtio_net.c > @@ -504,6 +504,10 @@ static int virtnet_xdp_handler(struct bpf_prog *xdp_prog, struct xdp_buff *xdp, > struct net_device *dev, > unsigned int *xdp_xmit, > struct virtnet_rq_stats *stats); > +static struct sk_buff *virtnet_skb_append_frag(struct sk_buff *head_skb, > + struct sk_buff *curr_skb, > + struct page *page, void *buf, > + int len, int truesize); > > static bool is_xdp_frame(void *ptr) > { > @@ -1128,6 +1132,139 @@ static struct sk_buff *virtnet_receive_xsk_small(struct net_device *dev, struct > } > } > > +static void xsk_drop_follow_bufs(struct net_device *dev, > + struct receive_queue *rq, > + u32 num_buf, > + struct virtnet_rq_stats *stats) > +{ > + struct xdp_buff *xdp; > + u32 len; > + > + while (num_buf-- > 1) { Why do you skip the last buffer? I thought it should be dropped, too?!? Thanks! Paolo