net/mlx5: adjust shared register according to mask