From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-f174.google.com ([209.85.160.174]:44647 "EHLO mail-qt1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726279AbfKUPuD (ORCPT ); Thu, 21 Nov 2019 10:50:03 -0500 Received: by mail-qt1-f174.google.com with SMTP id o11so4141656qtr.11 for ; Thu, 21 Nov 2019 07:50:02 -0800 (PST) Subject: Re: error loading xdp program on virtio nic References: <89f56317-5955-e692-fcf0-ee876aae068b@redhat.com> <3dc7b9d8-bcb2-1a90-630e-681cbf0f1ace@gmail.com> <18659bd0-432e-f317-fa8a-b5670a91c5b9@redhat.com> <20191121072625.3573368f@carbon> <4686849f-f3b8-dd1d-0fe4-3c176a37b67a@redhat.com> From: David Ahern Message-ID: Date: Thu, 21 Nov 2019 08:49:57 -0700 MIME-Version: 1.0 In-Reply-To: <4686849f-f3b8-dd1d-0fe4-3c176a37b67a@redhat.com> Content-Language: en-US Sender: xdp-newbies-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable To: Jason Wang , Jesper Dangaard Brouer Cc: "xdp-newbies@vger.kernel.org" On 11/21/19 12:02 AM, Jason Wang wrote: > By specifying queues property like: >=20 > >=20 > =C2=A0 > =C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0 event_idx=3D'off' queues=3D'5' rx_queue_size=3D'256' tx_queue_size=3D'256= '> I can not check this because the 3.0 version of libvirt does not support tx_queue_size. It is multiqueue (queues=3D5 in the example) setting that needs to be set to 2*Nvcpus for XDP, correct? > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ufo=3D'off' mrg_rxbuf=3D'off'/> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0 > =C2=A0=C2=A0=C2=A0 > >=20 >=20 The virtio_net driver suggests the queues are needed for XDP_TX: /* XDP requires extra queues for XDP_TX */ if (curr_qp + xdp_qp > vi->max_queue_pairs) { NL_SET_ERR_MSG_MOD(extack, "Too few free TX rings available"); netdev_warn(dev, "request %i queues but max is %i\n", curr_qp + xdp_qp, vi->max_queue_pairs); return -ENOMEM; } Doubling the number of queues for each tap device adds overhead to the hypervisor if you only want to allow XDP_DROP or XDP_DIRECT. Am I understanding that correctly?