diff options
| author | Jan Sokolowski <[email protected]> | 2023-05-11 15:53:19 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-05-12 08:27:44 +0000 |
| commit | 9113302bb43cf7a6d5a414d49b29478e57451c86 (patch) | |
| tree | 11ed3b4883dc23cfbf9caaa4392fe3b9057f55c7 /drivers/net/ethernet/intel/ice/ice_dcb_lib.c | |
| parent | MAINTAINERS: exclude wireless drivers from netdev (diff) | |
| download | kernel-9113302bb43cf7a6d5a414d49b29478e57451c86.tar.gz kernel-9113302bb43cf7a6d5a414d49b29478e57451c86.zip | |
ice: Fix undersized tx_flags variable
As not all ICE_TX_FLAGS_* fit in current 16-bit limited
tx_flags field that was introduced in the Fixes commit,
VLAN-related information would be discarded completely.
As such, creating a vlan and trying to run ping through
would result in no traffic passing.
Fix that by refactoring tx_flags variable into flags only and
a separate variable that holds VLAN ID. As there is some space left,
type variable can fit between those two. Pahole reports no size
change to ice_tx_buf struct.
Fixes: aa1d3faf71a6 ("ice: Robustify cleaning/completing XDP Tx buffers")
Signed-off-by: Jan Sokolowski <[email protected]>
Reviewed-by: Alexander Lobakin <[email protected]>
Signed-off-by: Tony Nguyen <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_dcb_lib.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ice/ice_dcb_lib.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c index c6d4926f0fcf..850db8e0e6b0 100644 --- a/drivers/net/ethernet/intel/ice/ice_dcb_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_dcb_lib.c @@ -932,10 +932,9 @@ ice_tx_prepare_vlan_flags_dcb(struct ice_tx_ring *tx_ring, if ((first->tx_flags & ICE_TX_FLAGS_HW_VLAN || first->tx_flags & ICE_TX_FLAGS_HW_OUTER_SINGLE_VLAN) || skb->priority != TC_PRIO_CONTROL) { - first->tx_flags &= ~ICE_TX_FLAGS_VLAN_PR_M; + first->vid &= ~VLAN_PRIO_MASK; /* Mask the lower 3 bits to set the 802.1p priority */ - first->tx_flags |= (skb->priority & 0x7) << - ICE_TX_FLAGS_VLAN_PR_S; + first->vid |= (skb->priority << VLAN_PRIO_SHIFT) & VLAN_PRIO_MASK; /* if this is not already set it means a VLAN 0 + priority needs * to be offloaded */ |
