On 11/25/25 8:25 AM, Michael S. Tsirkin wrote:
> On Wed, Nov 19, 2025 at 01:15:18PM -0600, Daniel Jurgens wrote:
>> +static int virtnet_ethtool_flow_insert(struct virtnet_ff *ff,
>> +                                   struct ethtool_rx_flow_spec *fs,
>> +                                   u16 curr_queue_pairs)

>> +    err = build_and_insert(ff, eth_rule);
>> +    if (err)
>> +            goto err_xa;
> 
> 
> btw kind of inelegant that we change fs->location if build_and_insert fails.
> restore it?
> 

It's not needed based on the current implementation of ethtool, it won't
use the location field if the return is an error. Parav suggested I add
it during our internal review. Leave the input unchanged if we fail.

>> +    return err;
>> +
>> +err_xa:
>> +    xa_erase(&ff->ethtool.rules, eth_rule->flow_spec.location);
>> +
>> +err_rule:
>> +    fs->location = RX_CLS_LOC_ANY;
>> +    kfree(eth_rule);
>> +
>> +    return err;
>> +}
> 


Reply via email to