Skip to content

Commit 7aece85

Browse files
committed
virtchnl: make proto and filter action count unsigned
jira LE-4694 Rebuild_History Non-Buildable kernel-6.12.0-55.43.1.el10_0 commit-author Jan Glaza <jan.glaza@intel.com> commit db5e8ea 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: 1f7ea1c ("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> (cherry picked from commit db5e8ea) Signed-off-by: Jonathan Maple <jmaple@ciq.com>
1 parent 932d999 commit 7aece85

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/linux/avf/virtchnl.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,7 @@ struct virtchnl_proto_hdrs {
13481348
* 2 - from the second inner layer
13491349
* ....
13501350
**/
1351-
int count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */
1351+
u32 count; /* the proto layers must < VIRTCHNL_MAX_NUM_PROTO_HDRS */
13521352
union {
13531353
struct virtchnl_proto_hdr
13541354
proto_hdr[VIRTCHNL_MAX_NUM_PROTO_HDRS];
@@ -1400,7 +1400,7 @@ VIRTCHNL_CHECK_STRUCT_LEN(36, virtchnl_filter_action);
14001400

14011401
struct virtchnl_filter_action_set {
14021402
/* action number must be less then VIRTCHNL_MAX_NUM_ACTIONS */
1403-
int count;
1403+
u32 count;
14041404
struct virtchnl_filter_action actions[VIRTCHNL_MAX_NUM_ACTIONS];
14051405
};
14061406

0 commit comments

Comments
 (0)