With a P5+ device with firmware that reports max_aggs_supported == 0, it is possible to make LRO settable by attaching and detaching an XDP program even though the device does not support TPA. Fix this by testing BNXT_SUPPORTS_TPA before restoring the feature bit.
Unified · Split
| @@ -5026,7 +5026,8 @@ void bnxt_set_rx_skb_mode(struct bnxt *bp, bool page_mode) · 5025 unmodified lines | ||
| 5026 | 5026 | bnxt_get_max_rings(bp, &rx, &tx, true); |
| 5027 | 5027 | if (rx > 1) { |
| 5028 | 5028 | bp->flags &= ~BNXT_FLAG_NO_AGG_RINGS; |
| 5029 | − bp->dev->hw_features |= NETIF_F_LRO; | |
| 5029 | + if (BNXT_SUPPORTS_TPA(bp)) | |
| 5030 | + bp->dev->hw_features |= NETIF_F_LRO; | |
| 5030 | 5031 | } |
| 5031 | 5032 | } |
| 5032 | 5033 | |