[lvc-project] [PATCH v2] cxgb4: add forgotten u64 ivlan cast before shift

Nikolay Kuratov kniv at yandex-team.ru
Wed Aug 21 15:09:16 MSK 2024


> Without casting to u64, the value would be smaller and the shift might
> not behave as expected?

Yes, FT_VLAN_VLD_F is 1U << 16. As Jakub already pointed out,
vlan_shift can be as large as 21 (in t4_filter_field_shift()
FT_FCOE_W + FT_PORT_W + FT_VNIC_ID_W)

I have no evidence that we can get 1 << (16 + 21) here in practice,
so I argued that such kind of expression is written elsewhere with cast.



More information about the lvc-project mailing list