diff options
author | Jakub Kicinski <kuba@kernel.org> | 2020-12-16 10:51:09 -0800 |
---|---|---|
committer | Jakub Kicinski <kuba@kernel.org> | 2020-12-16 10:51:10 -0800 |
commit | ec58c75a85563026db4927276039a88091f79647 (patch) | |
tree | 371bc1fdaaeb6fe6b187afc334ac954221551a38 | |
parent | 57030a0b620f735bf557696e5ceb9f32c2b3bb8f (diff) | |
parent | 64050b5b8706d304ba647591b06e1eddc55e8bd9 (diff) | |
download | linux-stable-ec58c75a85563026db4927276039a88091f79647.tar.gz linux-stable-ec58c75a85563026db4927276039a88091f79647.tar.bz2 linux-stable-ec58c75a85563026db4927276039a88091f79647.zip |
Merge branch 'i40e-ice-af_xdp-zc-fixes'
Björn Töpel says:
====================
i40e/ice AF_XDP ZC fixes
This series address two crashes in the AF_XDP zero-copy mode for ice
and i40e. More details in each individual the commit message.
====================
Link: https://lore.kernel.org/r/20201211145712.72957-1-bjorn.topel@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r-- | drivers/net/ethernet/intel/i40e/i40e_xsk.c | 5 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_xsk.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_xsk.c b/drivers/net/ethernet/intel/i40e/i40e_xsk.c index bfa84bfb0488..47eb9c584a12 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_xsk.c +++ b/drivers/net/ethernet/intel/i40e/i40e_xsk.c @@ -220,8 +220,11 @@ bool i40e_alloc_rx_buffers_zc(struct i40e_ring *rx_ring, u16 count) } while (count); no_buffers: - if (rx_ring->next_to_use != ntu) + if (rx_ring->next_to_use != ntu) { + /* clear the status bits for the next_to_use descriptor */ + rx_desc->wb.qword1.status_error_len = 0; i40e_release_rx_desc(rx_ring, ntu); + } return ok; } diff --git a/drivers/net/ethernet/intel/ice/ice_xsk.c b/drivers/net/ethernet/intel/ice/ice_xsk.c index 39757b4cf8f4..1782146db644 100644 --- a/drivers/net/ethernet/intel/ice/ice_xsk.c +++ b/drivers/net/ethernet/intel/ice/ice_xsk.c @@ -446,8 +446,11 @@ bool ice_alloc_rx_bufs_zc(struct ice_ring *rx_ring, u16 count) } } while (--count); - if (rx_ring->next_to_use != ntu) + if (rx_ring->next_to_use != ntu) { + /* clear the status bits for the next_to_use descriptor */ + rx_desc->wb.status_error0 = 0; ice_release_rx_desc(rx_ring, ntu); + } return ret; } |