[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5df616a8-5f0a-4349-9cfd-3edc5c152e2f@nvidia.com>
Date: Wed, 19 Nov 2025 10:24:33 -0600
From: Dan Jurgens <danielj@...dia.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: netdev@...r.kernel.org, jasowang@...hat.com, pabeni@...hat.com,
virtualization@...ts.linux.dev, parav@...dia.com, shshitrit@...dia.com,
yohadt@...dia.com, xuanzhuo@...ux.alibaba.com, eperezma@...hat.com,
jgg@...pe.ca, kevin.tian@...el.com, kuba@...nel.org, andrew+netdev@...n.ch,
edumazet@...gle.com
Subject: Re: [PATCH net-next v11 12/12] virtio_net: Add get ethtool flow rules
ops
On 11/18/25 12:49 PM, Michael S. Tsirkin wrote:
> On Tue, Nov 18, 2025 at 08:39:02AM -0600, Daniel Jurgens wrote:
>> +static int
>> +virtnet_ethtool_get_all_flows(struct virtnet_ff *ff,
>> + struct ethtool_rxnfc *info, u32 *rule_locs)
>> +{
>> + struct virtnet_ethtool_rule *eth_rule;
>> + unsigned long i = 0;
>> + int idx = 0;
>> +
>> + if (!ff->ff_supported)
>> + return -EOPNOTSUPP;
>> +
>> + xa_for_each(&ff->ethtool.rules, i, eth_rule)
>> + rule_locs[idx++] = i;
>> +
>> + info->data = le32_to_cpu(ff->ff_caps->rules_limit);
>> +
>> + return 0;
>> +}
>
> So I see
>
>
> * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
> * user buffer for @rule_locs on entry. On return, @data is the size
> * of the rule table, @rule_cnt is the number of defined rules, and
> * @rule_locs contains the locations of the defined rules. Drivers
> * must use the second parameter to get_rxnfc() instead of @rule_locs.
> *
>
>
> Should this set @rule_cnt?
>
Some drivers do, and others don't. I'll take the most conservative
approach and use it a limit, then set it at the end.
Also left rc uninitialized at the start of virtnet_get_rxnfc per the
comment in a separate email.
Powered by blists - more mailing lists