virtchnl: make proto and filter action count unsigned
authorJan Glaza <jan.glaza@intel.com>
Tue, 4 Mar 2025 11:08:31 +0000 (12:08 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 18 Mar 2025 16:38:16 +0000 (09:38 -0700)
commitdb5e8ea155fc1d89c87cb81f0e4a681a77b9b03f
tree28b4918c0ebcdeefc9792c8cb1e1105f58fbd72c
parent7fd71f317288d5150d353ce9d65b1e2abf99a8e2
virtchnl: make proto and filter action count unsigned

The count field in virtchnl_proto_hdrs and virtchnl_filter_action_set
should never be negative while still being valid. Changing it from
int to u32 ensures proper handling of values in virtchnl messages in
driverrs and prevents unintended behavior.
In its current signed form, a negative count does not trigger
an error in ice driver but instead results in it being treated as 0.
This can lead to unexpected outcomes when processing messages.
By using u32, any invalid values will correctly trigger -EINVAL,
making error detection more robust.

Fixes: 1f7ea1cd6a374 ("ice: Enable FDIR Configure for AVF")
Reviewed-by: Jedrzej Jagielski <jedrzej.jagielski@intel.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Jan Glaza <jan.glaza@intel.com>
Signed-off-by: Martyna Szapar-Mudlaw <martyna.szapar-mudlaw@linux.intel.com>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
include/linux/avf/virtchnl.h