[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5b43d53d-5ab1-43da-b327-74ca29c29fad@engleder-embedded.com>
Date: Tue, 21 Jan 2025 21:13:48 +0100
From: Gerhard Engleder <gerhard@...leder-embedded.com>
To: Joe Damato <jdamato@...tly.com>, netdev@...r.kernel.org
Cc: jasowang@...hat.com, leiyang@...hat.com, xuanzhuo@...ux.alibaba.com,
mkarsten@...terloo.ca, "Michael S. Tsirkin" <mst@...hat.com>,
Eugenio PĂ©rez <eperezma@...hat.com>,
Andrew Lunn <andrew+netdev@...n.ch>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
"open list:VIRTIO CORE AND NET DRIVERS" <virtualization@...ts.linux.dev>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [RFC net-next v3 3/4] virtio_net: Map NAPIs to queues
On 21.01.25 20:10, Joe Damato wrote:
> Use netif_queue_set_napi to map NAPIs to queue IDs so that the mapping
> can be accessed by user apps.
>
> $ ethtool -i ens4 | grep driver
> driver: virtio_net
>
> $ sudo ethtool -L ens4 combined 4
>
> $ ./tools/net/ynl/pyynl/cli.py \
> --spec Documentation/netlink/specs/netdev.yaml \
> --dump queue-get --json='{"ifindex": 2}'
> [{'id': 0, 'ifindex': 2, 'napi-id': 8289, 'type': 'rx'},
> {'id': 1, 'ifindex': 2, 'napi-id': 8290, 'type': 'rx'},
> {'id': 2, 'ifindex': 2, 'napi-id': 8291, 'type': 'rx'},
> {'id': 3, 'ifindex': 2, 'napi-id': 8292, 'type': 'rx'},
> {'id': 0, 'ifindex': 2, 'type': 'tx'},
> {'id': 1, 'ifindex': 2, 'type': 'tx'},
> {'id': 2, 'ifindex': 2, 'type': 'tx'},
> {'id': 3, 'ifindex': 2, 'type': 'tx'}]
>
> Note that virtio_net has TX-only NAPIs which do not have NAPI IDs, so
> the lack of 'napi-id' in the above output is expected.
>
> Signed-off-by: Joe Damato <jdamato@...tly.com>
> ---
> rfcv3:
> - Eliminated XDP checks; NAPIs will always be mapped to RX queues, as
> Gerhard Engleder suggested.
>
> v2:
> - Eliminate RTNL code paths using the API Jakub introduced in patch 1
> of this v2.
> - Added virtnet_napi_disable to reduce code duplication as
> suggested by Jason Wang.
>
> drivers/net/virtio_net.c | 23 +++++++++++++++++++----
> 1 file changed, 19 insertions(+), 4 deletions(-)
Looks good to me. I hope I didn't get you on the wrong track!
Reviewed-by: Gerhard Engleder <gerhard@...leder-embedded.com>
Powered by blists - more mailing lists