Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net/mlx5: fix unintentional sign extension on shift of dest_attr->vpo…
…rt.vhca_id Shifting dest_attr->vport.vhca_id << 16 results in a promotion from an unsigned 16 bit integer to a 32 bit signed integer, this is then sign extended to a 64 bit unsigned long on 64 bitarchitectures. If vhca_id is greater than 0x7fff then this leads to a sign extended result where all the upper 32 bits of idx are set to 1. Fix this by casting vhca_id to the same type as idx before performing the shift. Fixes: 8e2e08a ("net/mlx5: fs, add support for dest vport HWS action") Signed-off-by: Colin Ian King <[email protected]> Reviewed-by: Simon Horman <[email protected]> Acked-by: Moshe Shemesh <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
- Loading branch information