[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a65349eb-9194-4a2d-aced-ccfdfeca1ccf@nvidia.com>
Date: Sat, 27 Sep 2025 00:02:08 -0500
From: Dan Jurgens <danielj@...dia.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
Cc: netdev@...r.kernel.org, jasowang@...hat.com, alex.williamson@...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, shameerali.kolothum.thodi@...wei.com, jgg@...pe.ca,
kevin.tian@...el.com, kuba@...nel.org, andrew+netdev@...n.ch,
edumazet@...gle.com
Subject: Re: [PATCH net-next v3 06/11] virtio_net: Implement layer 2 ethtool
flow rules
On 9/25/25 4:10 PM, Michael S. Tsirkin wrote:
> On Tue, Sep 23, 2025 at 09:19:15AM -0500, Daniel Jurgens wrote:
>> Filtering a flow requires a classifier to match the packets, and a rule
>> to filter on the matches.
>> + ff_rule->group_id = cpu_to_le32(VIRTNET_FF_ETHTOOL_GROUP_PRIORITY);
>> + ff_rule->classifier_id = cpu_to_le32(classifier_id);
>> + ff_rule->key_length = (u8)key_size;
>
> Do we know that key size is <256?
We set key size based on sizeof headers even if all 5 available were in
the key it would still be less than 256.
>
>
>> +err_ff_rule:
>> + kfree(ff_rule);
>> +err_eth_rule:
>> + xa_erase(&ff->ethtool.rules, eth_rule->flow_spec.location);
>> + kfree(eth_rule);
>
> This is a weird way to handle errors. You never added or allocated eth_rule,
> which are you erasing and freeing here?
>
>
Yes, it was left behind during some refactoring. Thanks.
>> + c = kzalloc(classifier_size +
>> + sizeof(struct virtnet_classifier) -
>> + sizeof(struct virtio_net_resource_obj_ff_classifier),
>
> do we know all this math does not overflow?
>
Yes, classifier size is based on size_ofs
Powered by blists - more mailing lists