All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Jason Wang <jasowang@redhat.com>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Cc: "xdp-newbies@vger.kernel.org" <xdp-newbies@vger.kernel.org>
Subject: Re: error loading xdp program on virtio nic
Date: Thu, 21 Nov 2019 08:49:57 -0700	[thread overview]
Message-ID: <df4ae5e7-3f79-fd28-ea2e-43612ff61e6f@gmail.com> (raw)
In-Reply-To: <4686849f-f3b8-dd1d-0fe4-3c176a37b67a@redhat.com>

On 11/21/19 12:02 AM, Jason Wang wrote:
> By specifying queues property like:
> 
> <devices>
> 
>   <interface type='network'>
>     <source network='default'/>
>     <target dev='vnet1'/>
>     <model type='virtio'/>
>     <driver name='vhost' txmode='iothread' ioeventfd='on'
> event_idx='off' queues='5' rx_queue_size='256' tx_queue_size='256'>

I can not check this because the 3.0 version of libvirt does not support
tx_queue_size. It is multiqueue (queues=5 in the example) setting that
needs to be set to 2*Nvcpus for XDP, correct?

>       <host csum='off' gso='off' tso4='off' tso6='off' ecn='off'
> ufo='off' mrg_rxbuf='off'/>
>       <guest csum='off' tso4='off' tso6='off' ecn='off' ufo='off'/>
>     </driver>
>     </interface>
> </devices>
> 
> 

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?

  reply	other threads:[~2019-11-21 15:50 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-20 17:52 error loading xdp program on virtio nic David Ahern
2019-11-21  3:26 ` Jason Wang
2019-11-21  3:35   ` David Ahern
2019-11-21  3:54     ` Jason Wang
2019-11-21  4:05       ` David Ahern
2019-11-21  6:26         ` Jesper Dangaard Brouer
2019-11-21  7:02           ` Jason Wang
2019-11-21 15:49             ` David Ahern [this message]
2019-11-22  6:09               ` Jason Wang
2019-11-22 15:43                 ` David Ahern
2019-11-22 16:50                   ` Jakub Kicinski
2019-11-22 16:57                   ` Jesper Dangaard Brouer
2019-11-22 17:42                     ` David Ahern
2019-11-23 13:27                       ` Toke Høiland-Jørgensen
2019-11-23 13:27                         ` Toke Høiland-Jørgensen
2019-11-25  2:42                     ` Jason Wang
2019-11-25  2:48                   ` Jason Wang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=df4ae5e7-3f79-fd28-ea2e-43612ff61e6f@gmail.com \
    --to=dsahern@gmail.com \
    --cc=brouer@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=xdp-newbies@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.