netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Jurgens <danielj@nvidia.com>
To: Jason Wang <jasowang@redhat.com>
Cc: Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, mst@redhat.com,
	virtualization@lists.linux.dev, parav@nvidia.com,
	shshitrit@nvidia.com, yohadt@nvidia.com,
	xuanzhuo@linux.alibaba.com, eperezma@redhat.com,
	shameerali.kolothum.thodi@huawei.com, jgg@ziepe.ca,
	kevin.tian@intel.com, kuba@kernel.org, andrew+netdev@lunn.ch,
	edumazet@google.com
Subject: Re: [PATCH net-next v9 05/12] virtio_net: Query and set flow filter caps
Date: Tue, 11 Nov 2025 23:15:55 -0600	[thread overview]
Message-ID: <ada8b5c4-2a9e-45d9-a9e1-28fa50afce8d@nvidia.com> (raw)
In-Reply-To: <CACGkMEtMP2XfXFmuhoAkMrcgJD8JiRTc-tuq1i7xxxzA43A4mg@mail.gmail.com>

On 11/11/25 10:18 PM, Jason Wang wrote:
> On Wed, Nov 12, 2025 at 11:02 AM Dan Jurgens <danielj@nvidia.com> wrote:
>>
>> On 11/11/25 7:00 PM, Jason Wang wrote:
>>> On Tue, Nov 11, 2025 at 6:42 PM Paolo Abeni <pabeni@redhat.com> wrote:
>>>>
>>>> On 11/7/25 5:15 AM, Daniel Jurgens wrote:
>>>>> @@ -7121,6 +7301,15 @@ static int virtnet_probe(struct virtio_device *vdev)
>>>>>       }
>>>>>       vi->guest_offloads_capable = vi->guest_offloads;
>>>>>
>>>>> +     /* Initialize flow filters. Not supported is an acceptable and common
>>>>> +      * return code
>>>>> +      */
>>>>> +     err = virtnet_ff_init(&vi->ff, vi->vdev);
>>>>> +     if (err && err != -EOPNOTSUPP) {
>>>>> +             rtnl_unlock();
>>>>> +             goto free_unregister_netdev;
>>>>
>>>> I'm sorry for not noticing the following earlier, but it looks like that
>>>> the code could error out on ENOMEM even if the feature is not really
>>>> supported,  when `cap_id_list` allocation fails, which in turn looks a
>>>> bit bad, as the allocated chunk is not that small (32K if I read
>>>> correctly).
>>>>
>>>> @Jason, @Micheal: WDYT?
>>>
>>> I agree. I think virtnet_ff_init() should be only called when the
>>> feature is negotiated.
>>>
>>> Thanks
>>>
>>
>> Are you suggesting we wait to call init until get/set_rxnfc is called? I
>> don't like that idea. Probe is the right time to do feature discovery.
> 
> Nope I meant it might be better:
> 
> 1) embed virtio_admin_cmd_query_cap_id_result in virtnet_info to avoid
> dynamic allocation
> 
> Or
> 
> 2) at least check if there's an adminq before trying to call virtnet_ff_init()?

I could do a check like this:

        if (!vdev->config->admin_cmd_exec)
                return -EOPNOTSUPP;

Or would you prefer it added to the virtio_admin_command api?

bool virtio_admin_supported(struct virtio_device *vdev);

> 
> Thanks
> 
>>
>>
>>>>
>>>> /P
>>>>
>>>
>>
> 


  reply	other threads:[~2025-11-12  5:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07  4:15 [PATCH net-next v9 00/12] virtio_net: Add ethtool flow rules support Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 01/12] virtio_pci: Remove supported_cap size build assert Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 02/12] virtio: Add config_op for admin commands Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 03/12] virtio: Expose generic device capability operations Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 04/12] virtio: Expose object create and destroy API Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 05/12] virtio_net: Query and set flow filter caps Daniel Jurgens
2025-11-11 10:42   ` Paolo Abeni
2025-11-11 10:48     ` Paolo Abeni
2025-11-11 13:41       ` Dan Jurgens
2025-11-12  1:00     ` Jason Wang
2025-11-12  3:01       ` Dan Jurgens
2025-11-12  4:18         ` Jason Wang
2025-11-12  5:15           ` Dan Jurgens [this message]
2025-11-12  7:18             ` Jason Wang
2025-11-07  4:15 ` [PATCH net-next v9 06/12] virtio_net: Create a FF group for ethtool steering Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 07/12] virtio_net: Implement layer 2 ethtool flow rules Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 08/12] virtio_net: Use existing classifier if possible Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 09/12] virtio_net: Implement IPv4 ethtool flow rules Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 10/12] virtio_net: Add support for IPv6 ethtool steering Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 11/12] virtio_net: Add support for TCP and UDP ethtool rules Daniel Jurgens
2025-11-07  4:15 ` [PATCH net-next v9 12/12] virtio_net: Add get ethtool flow rules ops Daniel Jurgens

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=ada8b5c4-2a9e-45d9-a9e1-28fa50afce8d@nvidia.com \
    --to=danielj@nvidia.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=edumazet@google.com \
    --cc=eperezma@redhat.com \
    --cc=jasowang@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kevin.tian@intel.com \
    --cc=kuba@kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=parav@nvidia.com \
    --cc=shameerali.kolothum.thodi@huawei.com \
    --cc=shshitrit@nvidia.com \
    --cc=virtualization@lists.linux.dev \
    --cc=xuanzhuo@linux.alibaba.com \
    --cc=yohadt@nvidia.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).