* [PATCH net] i40e: fix crash when Rx descriptor count is changed
@ 2020-06-12 11:47 Björn Töpel
2020-06-18 19:46 ` [Intel-wired-lan] " Bowers, AndrewX
0 siblings, 1 reply; 2+ messages in thread
From: Björn Töpel @ 2020-06-12 11:47 UTC (permalink / raw)
To: intel-wired-lan; +Cc: Björn Töpel, magnus.karlsson, netdev, bpf
From: Björn Töpel <bjorn.topel@intel.com>
When the AF_XDP buffer allocator was introduced, the Rx SW ring
"rx_bi" allocation was moved from i40e_setup_rx_descriptors()
function, and was instead done in the i40e_configure_rx_ring()
function.
This broke the ethtool set_ringparam() hook for changing the Rx
descriptor count, which was relying on i40e_setup_rx_descriptors() to
handle the alloction.
Fix this by adding an explicit i40e_alloc_rx_bi() call to
i40e_set_ringparam().
Fixes: be1222b585fd ("i40e: Separate kernel allocated rx_bi rings from AF_XDP rings")
Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
---
drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
index aa8026b1eb81..67806b7b2f49 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ethtool.c
@@ -2070,6 +2070,9 @@ static int i40e_set_ringparam(struct net_device *netdev,
*/
rx_rings[i].tail = hw->hw_addr + I40E_PRTGEN_STATUS;
err = i40e_setup_rx_descriptors(&rx_rings[i]);
+ if (err)
+ goto rx_unwind;
+ err = i40e_alloc_rx_bi(&rx_rings[i]);
if (err)
goto rx_unwind;
base-commit: 18dbd4cd9b8c957025cf90a3c50102b31bde14f7
--
2.25.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* RE: [Intel-wired-lan] [PATCH net] i40e: fix crash when Rx descriptor count is changed
2020-06-12 11:47 [PATCH net] i40e: fix crash when Rx descriptor count is changed Björn Töpel
@ 2020-06-18 19:46 ` Bowers, AndrewX
0 siblings, 0 replies; 2+ messages in thread
From: Bowers, AndrewX @ 2020-06-18 19:46 UTC (permalink / raw)
To: intel-wired-lan; +Cc: netdev, bpf
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Björn Töpel
> Sent: Friday, June 12, 2020 4:48 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; bpf@vger.kernel.org; Topel, Bjorn
> <bjorn.topel@intel.com>; Karlsson, Magnus <magnus.karlsson@intel.com>
> Subject: [Intel-wired-lan] [PATCH net] i40e: fix crash when Rx descriptor
> count is changed
>
> From: Björn Töpel <bjorn.topel@intel.com>
>
> When the AF_XDP buffer allocator was introduced, the Rx SW ring "rx_bi"
> allocation was moved from i40e_setup_rx_descriptors() function, and was
> instead done in the i40e_configure_rx_ring() function.
>
> This broke the ethtool set_ringparam() hook for changing the Rx descriptor
> count, which was relying on i40e_setup_rx_descriptors() to handle the
> alloction.
>
> Fix this by adding an explicit i40e_alloc_rx_bi() call to i40e_set_ringparam().
>
> Fixes: be1222b585fd ("i40e: Separate kernel allocated rx_bi rings from
> AF_XDP rings")
> Signed-off-by: Björn Töpel <bjorn.topel@intel.com>
> ---
> drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 3 +++
> 1 file changed, 3 insertions(+)
Tested-by: Andrew Bowers <andrewx.bowers@intel.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-18 19:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-12 11:47 [PATCH net] i40e: fix crash when Rx descriptor count is changed Björn Töpel
2020-06-18 19:46 ` [Intel-wired-lan] " Bowers, AndrewX
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).